Force AV Scan of USB drive vs. File-Access Scan I have been evaluating MS Forefront Endpoint Protection 2010 vs. Kasperskey 2010.

One of the major differences in features seems to be that Kasperskey gives the option to force the full scan of a USB drive when it is inserted (Source), whereas FEP seems to rely solely on "actively protecting IO to/from that removable drive so autoruns that execute are scanned and any files that autruns call would be scanned.. also any reads/writes to that remove drive file system are scanned..." (Source)

FEP does have the option to run a full scan on the USB drive, but it cannot be a forced scan upon insertion of said device.

Do you see any weaknesses in the approach taken by FEP?

As is usually the case it all depends on your needs. There is an argument that as long as you check everything going to or from the drive you are safe, but this won't help you if your drive is then plugged into a machine that doesn't scan it at all. You may be blamed if malware then infects that machine.


What sort of steps can we take to definitively verify that a given rkhunter report is a false positive? Among other measures, we have rkhunter going on a couple of servers.

rkhunter on both servers reported a "suspicious file". Specifically:

Warning: Suspicious file types found in /dev:
     /dev/shm/R1Soft-SHM-ZocPNFWuCcEl2rrN: data

This corresponds to a regular package update to R1Soft from just before this alert appeared. However, rpm -qf indicates that this file is not owned by any package.

I am reasonably satisfied that this is a false positive, given that the timing corresponds with a package update of a piece of mainstream software, and it did so identically on two unconnected servers. The bit of doubt I have is really that a few days have gone by, and I don't see anybody else reporting the same issue.

My main question is:
What sort of steps can we take to definitively verify that this is a false positive?

If we can do that, I would happily white-list it in rkhunter.

Why are you having rkhunter scan /dev?

If rkhunter works by calculating a hash on each file in a directory then comparing recent hash results against a database of original hashes, AND /dev is your device directory (so a non-normal filesystem), then /dev/shm is a shared memory device and not a static file.

Of course a hash on /dev/shm (shared memory) could be ever changing and producing alerts since it may not be static data.  As what's stored in that shared memory device changes so will its calculated hash change.

Consider prohibiting rkhunter from scanning some of these non-normal filesystem directories in Linux (such as /dev) by adding /dev to the preclusion list.

This has very little to do with your yum update.


Is my Windows 10 machine experiencing DNS poisoning? I keep getting Chinese IP addresses when connecting to a U.S. government domain I've found that some .gov sites are being redirected to a Chinese IP. I have searched across Internet to see if this a known form of malware but I'm unable to find any info. I would like someone guiding me to isolate the infected files and report to AV if applicable.

This is a nslookup resolution from the infected computer:

C:\Users\Alex>nslookup www.whitehouse.gov
Servidor:  google-public-dns-a.google.com
Address:  8.8.8.8

Respuesta no autoritativa:
Nombre:  www.whitehouse.gov
Address:  139.129.57.70

This is a valid response from a Linux computer in the same network:

alex@nas:~$ nslookup www.whitehouse.gov
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
www.whitehouse.gov      canonical name = wildcard.whitehouse.gov.edgekey.net.
wildcard.whitehouse.gov.edgekey.net     canonical name = e4036.dscb.akamaiedge.net.
Name:   e4036.dscb.akamaiedge.net
Address: 104.83.16.193

As you can see something is intervening the DNS requests and redirecting to 139.129.57.70, that is a Chinese IP. I think this computer is infected by some kind of malware made to impersonate as gov sites and leak info.

Any clue about which files may be infected?

Content Delivery Network

This is probably part of a Content Delivery Network with a lot of political issues to consider.

If you try dig www.whitehouse.gov a, underneath the answer section you'll see the following:

www.whitehouse.gov. 131 IN  CNAME   wildcard.whitehouse.gov.edgekey.net.
wildcard.whitehouse.gov.edgekey.net. 731 IN CNAME e4036.dscb.akamaiedge.net.
e4036.dscb.akamaiedge.net. 20   IN  A   23.73.28.110

See the CNAME addresses? Try host -t A www.whitehouse.gov for a better explanation:

www.whitehouse.gov is an alias for wildcard.whitehouse.gov.edgekey.net.
wildcard.whitehouse.gov.edgekey.net is an alias for e4036.dscb.akamaiedge.net.
e4036.dscb.akamaiedge.net has address 23.73.28.110

Do you notice that I'm getting a different IP address than you? Note the wildcard*edge* portion? What is that? It's an edge server which is supposed to be closest to you.

Are you using a VPN on your Linux machine, or Windows Machine? Maybe one that's in Hong Kong, Hangzhou, or somewhere else in East Asia? Maybe your router is configured to use a VPN, or go through TOR?

The IP address you received belongs to Aliyun Computing Co. Ltd, which is part of the Alibaba Cloud/CDN suite.

But wait, how did we we get an Aliyun Cloud/CDN (Alibaba) IP address from Akamai? Aren't they competitors?

Again, are you using a VPN on your Linux machine, or Windows Machine? Maybe one that's in Hong Kong, Hangzhou, or somewhere else in East Asia? Maybe your router is configured to use a VPN, or go through TOR?

Akamai does operate in China, but...

Want to make money in China? You have to follow Beijing's rules. I think we just found something embarrassing for Akamai: in order to operate in China, they were likely forced into a partnership with them.

To do business in China, almost all foreign companies were previously required to hand over control of their intellectual property to a joint Chinese partner to be allowed to operate in the country.

Let's look at the IP you gave us: whois 139.129.57.70 | grep -i 'Ali\|Hangzhou':

netname:        ALISOFT
descr:          Aliyun Computing Co., LTD
descr:          No.391 Wen'er Road, Hangzhou, Zhejiang, China, 310099
address:        NO.969 West Wen Yi Road, Yu Hang District, Hangzhou
e-mail:         jiali.jl@alibaba-inc.com
address:        No.391 Wen'er Road, Hangzhou City
e-mail:         anti-spam@list.alibaba-inc.com
e-mail:         cloud-cc-sqcloud@list.alibaba-inc.com
address:        Hangzhou, Zhejiang, China
address:        No.391 Wen'er Road, Hangzhou City
e-mail:         guowei.pangw@alibaba-inc.com

In this case, the Akamai partner is likely Alibaba/Aliyun. This allows the Chinese government, if they so desire, to serve malicious content to visitors by way of the CDN.

Every single CDN is, in my opinion, MITM as a service.

Wireshark? You might be doing it wrong.

What if you did have a DNS hijacking/MITM issue of some sort? If you want to use Wireshark, you probably cannot do a packet capture between your router and computer unless the problem exists primarily on your Windows 10 machine. You'd simply be receiving whatever your router provides you with.

If there is no problem with your Windows 10 machine, then using Wireshark on your computer will likely not provide you any meaningful information. What if your router has been compromised?

What you could do is put a switch with port mirroring capabilities between your gateway and your router, and use the port mirror to see what's going on. Or a LAN throwing star. This way, you can see what your router is sending and receiving, and compare that to what Wireshark sees.


dhclient cloud-init /var/tmp process There's a process that's running that I'm trying to investigate why its running and what its doing. The server is a Linux Ubuntu server running on AWS. Running 16.04.

The process in question is:

root 829 0.0 0.0 16116 2888 ? Ss Jun19 0:04 /var/tmp/cloud-init/cloud-init-dhcp-zaislidv/dhclient -1 -v -

When I ran lsof -p 829:

sudo lsof -p 829
COMMAND  PID USER   FD   TYPE             DEVICE SIZE/OFF    NODE NAME
dhclient 829 root  cwd    DIR              259,1     4096       2 /
dhclient 829 root  rtd    DIR              259,1     4096       2 /
dhclient 829 root  txt    REG              259,1   487248 1536424 /var/tmp/cloud-init/cloud-init-dhcp-zaislidv/dhclient (deleted)
dhclient 829 root  mem    REG              259,1    47600    1993 /lib/x86_64-linux-gnu/libnss_files-2.23.so
dhclient 829 root  mem    REG              259,1    14608    1982 /lib/x86_64-linux-gnu/libdl-2.23.so
dhclient 829 root  mem    REG              259,1  1868984    1980 /lib/x86_64-linux-gnu/libc-2.23.so
dhclient 829 root  DEL    REG              259,1             2123 /lib/x86_64-linux-gnu/libisc-export.so.160.0.0
dhclient 829 root  DEL    REG              259,1             2125 /lib/x86_64-linux-gnu/libdns-export.so.162.1.3
dhclient 829 root  mem    REG              259,1   162632    1978 /lib/x86_64-linux-gnu/ld-2.23.so
dhclient 829 root    0u   CHR                1,3      0t0       6 /dev/null
dhclient 829 root    1u   CHR                1,3      0t0       6 /dev/null
dhclient 829 root    2u   CHR                1,3      0t0       6 /dev/null
dhclient 829 root    3u  unix 0xffff880036debc00      0t0   12925 type=DGRAM
dhclient 829 root    5u  pack              12942      0t0     ALL type=SOCK_RAW
dhclient 829 root    6u  IPv4              12943      0t0     UDP *:bootpc

Out of 200 servers this is the only one running this process.

I enter the /var/tmp/cloud-init dir and its empty of course and I don't see this executable even in there.

Any insight on what it is and where it may be configured to run at?

When I run systemctl status --no-pager cloud-init-local.service --full:

systemctl status --no-pager cloud-init-local.service --full
● cloud-init-local.service - Initial cloud-init job (pre-networking)
Loaded: loaded (/lib/systemd/system/cloud-init-local.service; enabled; vendor preset: enabled)
 Active: active (exited) since Tue 2018-06-19 15:31:39 UTC; 5 months 24 days ago
 Main PID: 859 (code=exited, status=0/SUCCESS)
 Tasks: 1
 Memory: 8.6M
 CPU: 10.408s
 CGroup: /system.slice/cloud-init-local.service
       └─829 /var/tmp/cloud-init/cloud-init-dhcp-zaislidv/dhclient -1 -v -lf /var/tmp/cloud-init/cloud-init-dhcp-zaislidv/dhcp.leases -pf /var/tmp/cloud-init/cloud-init-dhcp-zaislidv/dhclient.pid ens5 -sf /bin/true

Dec 12 20:37:38 hostname dhclient[829]: bound to IP -- renewal in 1599 seconds.
Dec 12 21:04:17 hostname dhclient[829]: DHCPREQUEST of IP on ens5 to 10.80.10.1 port 67 (xid=0x36c118d4)
Dec 12 21:04:17 hostname dhclient[829]: DHCPACK of IP from IP
Dec 12 21:04:17 hostname dhclient[829]: can't create /var/tmp/cloud-init/cloud-init-dhcp-zaislidv/dhcp.leases: No such file or directory
Dec 12 21:04:17 hostname dhclient[829]: can't create /var/tmp/cloud-init/cloud-init-dhcp-zaislidv/dhcp.leases: No such file or directory
Dec 12 21:04:17 hostname dhclient[829]: bound to IP -- renewal in 1433 seconds.
Dec 12 21:28:10 hostname dhclient[829]: DHCPREQUEST of IP on ens5 to IP port 67 (xid=0x36c118d4)
Dec 12 21:28:10 hostname dhclient[829]: DHCPACK of IP from IP
Dec 12 21:28:10 hostname dhclient[829]: can't create /var/tmp/cloud-init/cloud-init-dhcp-zaislidv/dhcp.leases: No such file or directory
Dec 12 21:28:10 hostname dhclient[829]: bound to IP -- renewal in 1353 seconds.

Thanks!

lsof shows that the executable has been deleted.

Looks like https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1732964 shows a similar bug where the dhclient gets left running.

Might be worth checking:

systemctl status --no-pager cloud-init-local.service --full

And see if that reports the process?

Looks like you've hit the same bug, where a temporary copy of dhclient get's left running.
The bug report suggests they've fixed it - I'd suggest updating your server.


Authenticate user without knowing their password I'm working on a project where each each user will have a public/private RSA key-pair. Users will be able to send encrypted messages to each other using the each target user's public key so that only target users can read the message (similar to PHP's openssl_seal). Since we want the user to be able to use any device to read or send a message, the key-pair will be stored on an API server, and the private key will be encrypted with the user's password.

When a user logs in from a new device, they will use their password to decrypt the private key. The catch is that ideally, the API server should never be able to decrypt the user's private key, even to authenticate the user. Originally, I was just going to send the client the encrypted private key and let the client decrypt it. If the client can decrypt it, they must have the correct password, but this would be vulnerable to offline dictionary attacks. To prevent that, I need to authenticate the user before I give them the encrypted private key.

I could have the client send the password to the server and let the server attempt to decrypt the key using the password or even just validate the password against a hash, but then the server would temporarily have the password and be able to decrypt the user's private key. That's OK, but I'd rather figure out a way to authenticate the user without the server knowing their password.

In my case, the client will be a PHP web server or a native mobile or desktop app, not a browser, so I have access to a wide range of cryptographic methods. The only client authorized to make the call to the API server to create an account will be the PHP web server, and I'm currently planning on having it create the public/private key-pair and encrypt the private key with the user's password. It will then send that information to the API server (also running PHP) to create the account. The API server will store the encrypted private key, the public key, information about the user, and any encrypted messages, but won't be able to decrypt any of it.

I'm not trying to protect against a MITM attack here. All API calls will be over HTTPS. My goal is to build the API in such a way that even if the Chinese government could gain access to the API server, they still couldn't read any of the messages. The web server can have the private key temporarily, just not the API server.

How can I let the API server authenticate the user without being vulnerable to an offline brute-force attack and without the API server needing the user's password?

Feel free to tell me I'm doing something totally wrong and suggest something completely different.

Do it the way MEGA does it: perform all encryption decryption within your browser using JavaScript. Only allow encrypted files to be sent to the server (unless of course public keys).

You wouldn't need to send the private key at any point to the server (because everything is being done browser side). One small caveat though, if your user looses a password or an encrypted file goes corrupt, then you are basically screwed and all messages will be useless since you don't have the key anymore.

For authenticating the user you could use something like open OpenID. The user would still need to supply a password to decrypt his private key, but at no point is the password decrypted key sent to the server (everything stays within the browser).


IP Security (IPsec) vs Public Key Infrastructure (PKI) I've found the following question on the internet and don't think the answer is right.

Which of the following does IPsec use?

    A) SSL
    B) AES
    C) DES
    D) PKI

The given answer is D, PKI which is totally different technology than IPsec.

I believe the answer should be B, as IPsec is using AES as the cryptographic algorithms.

What do you think about this? Is the given answer's right or wrong?

Reference:
https://tools.ietf.org/html/rfc7321

IPsec is not directly related to public key infrastructure (PKI), i.e. the use of X.509 certificates structured in certificate authorities (CAs).

The Internet Key Exchange protocol (IKE), on the other hand, which is used to dynamically negotiate IPsec SAs may use PKI to authenticate the peers. But there are other authentication methods that are based on raw public keys or shared secrets.  There are even authentication methods for IKEv2 like EAP-TLS/TTLS/PEAP that rely on SSL/TLS, so that may even be a "correct" answer to the question the same way PKI is (i.e. the question is very ambiguous).

And the encryption algorithm used for IPsec SAs is a configurable parameter (usually negotiated via IKE) so there is no single one that IPsec (or rather ESP) uses, although, there are some recommended algorithms that implementations should provide. Encryption is even optional.


Search on hashed data We have a request to encrypt customer personal data (e-mail, address etc.) We use MySQL which does not have any TDE like MS SQL or Oracle. So along with encrypting data we need to preserve functionality for querying this data directly (not LIKE). So something like
select * from person where email='blah@blah.com'.

The idea here is to use hashing and to make sure encryption is not made redundant by poor hashing function. So if we use bcrypt which has random salt built-in it should be fine.
The problem is that with random salt we can't construct the same hash again to be able to run sql queries. If I use bcrypt('blah@blah.com')  and it will return different hash value I can't run   select * from person where hash_email=bcrypt('blah@blah.com'). I can get the same hash value only if I use the same salt (and work factor). But having application-wide salt does not seem to be a great solution. So what can be done about this?

If having one salt value per application is not smart could it be a kind of improvement if we generate, say, 1000 random salt values and store them in the database?
If we need to hash email we can do the following:

get some fast numeric hashing function and calculate, say, m=num_hash(email) mod 1000
go to salt table take salt where id=m
hash email with this salt  email_hash=bcrypt(salt,email) and store in the database

For searching we can apply the same routine, obtain email_hash and run query.
I guess num_hash(email) mod 1000 does not tell a great deal about the e-mail itself.
Having 1000 random salts is better than having just one.

Any suggestions would be welcome

Unfortunately, the protection provided by using a different salt for each e-mail is designed to prevent exactly the same kind of queries that you need. So, if you need efficient queries, you should either use the same salt for all e-mails, or not use salt at all.

Selecting a salt based on the hash of the e-mail is no more secure than using the same salt. To see that, you need to understand what kind of attack salts are designed to protect against. Suppose than an attacker has n hashes to crack, and a dictionary of m e-mails. If each e-mail is hashed with an individual salt, such attacker will need to hash each e-mail in the dictionary with each salt, requiring n·m hash calculations. However, if the same salt is used, the attacker has to hash each e-mail only once, so just m hash calculations are needed. If the salt is deterministically selected based on the e-mail, than again only m hash calculations are needed.

In general, if your applications allows fast lookups by e-mail, the attacker can run the lookup procedure on all e-mails in their dictionary. No matter how the lookup procedure is implemented, if it's fast, the attacker would be able to use it to check all their e-mails quickly. So, using salts properly (as they are used for password hashing) is incompatible with fast lookups.


Never use stored session in sqlmap I am trying to make sqlmap to avoid fetch data from stored session. How do I achieve that? I have performed sqlmap check once on a target and now that target is offline, I want sqlmap to just stop the checks if target is offline and even if target is online it should recheck it not just show the data from stored session.
python3 sqlmap.py --threads=5 -m /tmp/sql --batch --answers "already=N"

[12:39:54] [CRITICAL] unable to connect to the target URL ('Connection refused')
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: id2 (GET)
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: id2=1 AND 9749=9749

    Type: UNION query
    Title: Generic UNION query (NULL) - 2 columns
    Payload: id2=1 UNION ALL SELECT NULL,'qzvpq'||'GUyWfclrkLkxNLVAdYrBXilkXpGmcpZLkJplITTj'||'qqbbq'-- qdhG

You will want to use the fresh queries switch:
    --fresh-queries     Ignore query results stored in session file


Does Microsoft Edge (Spartan) share Cookies, Cache, Passwords, or TLS Certificates with Internet Explorer? Windows 10 was released with a new browser called Microsoft Edge.  Interestingly, Internet Explorer is also installed on the same default install.  Given that Chrome and Firefox tend to separate their cache, or even root certificate handling from other browsers, it would make sense to see how much is shared between IE and Edge based on the same criteria.

Question

Does IE and Spartan share their cookies from each other, or are they separate?
Does Microsoft Edge authenticate all subsequent Winsock connections once the first connection is made, like IE does?
Are root certificates shared between Edge and IE? Or are they separate like Firefox?
Are any passwords shared between Edge and IE? (Including Enterprise credentials, or Microsoft Accounts/Live.ID/Passport)
Are the file caches separate in independent from IE and Edge (possibly leaking privacy information with cached files)
Are IE and Edge proxy settings shared?

As I guess you know, "Spartan" was developed in parallel to Internet Explorer 11. On April 29, 2015, during the Build Conference keynote, it was announced that "Spartan" would officially be known as Microsoft Edge.

Internet Explorer was the default web browser for the earlier versions of Windows 10, but after the Windows 10 Anniversary Update on August 2, 2016, Microsoft announced that Internet Explorer would be deprecated on Windows 10 and "Microsoft Edge" was decided to be the main default web browser.

The main difference between Internet Explorer and Microsoft Edge is the engince they are using. Internet Explorer is using the legacy Trident engine, while Edge is using EdgeHTML as engine. It's basically a fork from Trident that has removed all legacy code of older versions of Internet Explorer and rewritten the majority of its source code to support web standards and interoperability with other modern browsers.

Complete history here: Wikipedia

Anyway, they are different but they are sharing some of operating system resources as you'll see on my next answers.

Answering to your questions:

Does IE and Spartan share their cookies from each other, or are they separate?

No, they are separate.

Does Microsoft Edge authenticate all subsequent Winsock connections once the first connection is made, like IE does?

Yes, it works in the same way.

Are root certificates shared between Edge and IE? Or are they separate like Firefox?

Yes, they are shared because they use the certificate store managed by operating system.

Are any passwords shared between Edge and IE? (Including Enterprise credentials, or Microsoft Accounts/Live.ID/Passport)

Yes, they are shared.

Are the file caches separate in independent from IE and Edge (possibly leaking privacy information with cached files)?

Yes, they use same cache files.

Are IE and Edge proxy settings shared?

Yes because both are using the operating system's proxy configuration.

You can configure almost all of these options (certificates, proxy settings, cache and temporary files settings) from the same place. Press Win+R, type inetcpl.cpland press Enter. Certificates are under "Content" tab. Proxy settings are under "Connections" tab, "LAN configuration", and Cache and Temp files can be managed under "General" tab pressing on "Configuration" button. I'll put you some screenshots. Sorry, they are in spanish like my system, but I put some tags in english:


How secure is manually over writting files? Say I have 100 image files, all different names, I batch rename them 1-100.jpg, I then change the extension of all the files to .txt. I then make 100 blank text files and over write the converted image files.

I then split the 100 blank txt files and split them 50/50, renaming them both the same and over writing, then split to 25/25, rename and over write, till I get just one file. Then I just delete this file.

Would this make the original img files or file names, hashes etc recoverable?

Different filesystems for different operating systems work differently. But no matter which filesystem you use, this is unlikely to overwrite the data.

One thing you need to understand about filesystems is that the friendly directory- and filenames are usually an abstraction for the human user. On the actual hardware, all the file data is one big lump of one's and zero's. In order to find a file, there is a file table which maps human-readable file paths to hard drive locations and lengths.

  I batch rename them 1-100.jpg, I then change the extension of all the files to .txt.

This will change their names in the file table, but not change any of the data.

  I then make 100 blank text files and over write the converted image files.

This will truncate the length of all the files in the file table to 0 bytes. There is no reason for the filesystem to overwrite the actual data. You will likely end up with lots of space marked as empty, but which still contains the image data until the filesystem needs the space for new files.

  I then split the 100 blank txt files and split them 50/50, renaming them both the same and over writing, then split to 25/25, rename and over write, till I get just one file. Then I just delete this file.

I am not really sure what you mean with that, but it sounds like something which would again just affect the file table entries but none of the actual data.

If you want the filesystem to actually overwrite the data and not just the filename, you usually need to replace the content of the file with new content of the same length and then save it under the same name. So the manual way to shred a file would be to open it with a text editor and replace the content with the same number of random keystrokes (you can use copy&paste if you like). This is of course very tedious, so you might want to use one of the many file shredding programs which are available for free.

Also be aware of the special intricacies of shredding files on solid-state-drives. Their wear leveling algorithms create another layer of indirection below the filesystem which the operating system is not aware of and might result in data not actually being overwritten on the hardware even when the filesystem tells the hardware to do exactly that.


SFTP vs VPN and Samba share to share files remotely I need to set up a way to share files securely and remotely with other users. I have a file server on which the user's files will be stored. Would it be more secure to have the users SFTP into the server to get/put files, or would it be better to set up a VPN, have the users connect to it, and have a Samba share available on the network for the files?

The disadvantages of using Samba over VPN are:

I've found in practice that windows file shares often get stuck up doing something in the background without giving any user feedback about what is happening. I've had to disconnect and re-create the share to continue file sharing. Although specific instances can be investigated and configuration related issues resolved to fix these problems, but the lack of clear feedback to the user during file transfers makes it frustrating to users.  On the other hand, SFTP user programs like FileZilla give clear and specific details about the file transfer and any errors encountered.
If users already have VPN connections they regularly use for work or connect to clients, they would need to disconnect form those and connect to your to transfer files.
A VPN client must be installed as it creates a virtual network interface; whereas for copying files over SFTP users could simply copy Filezilla, WinSCP or Putty files and start using them without installing them.
If you have problems with file transfers you need to look into two services/logs to understand and resolve the issues - VPN logs/config & Samba logs/config.

Considering all these reasons, I would recommend using SFTP.

Maybe a decade ago I would have recommended Samba when simple user-friendly SFTP interfaces were hard to find, but with excellent user-friendly opensource programs available now, SFTP is a better option.


How do CORS proxy websites work? While I was developing the front-end side of my web project, I got an CORS protection error. Not surprising since my front-end project was not in the same origin. After some search on how to bypass CORS protection, I have found some proxy websites.

I do not want to mention the website names but, they usually work in this format:

https://acorsproxywebsite.com/https://example.com

When I have sent this request, I was able to send GET request and receive response from any CORS-disabled website.

How can the CORS proxy websites bypass the protection and get a response from any cross sources? Why can they send requests successfully but I can not? Is it possible to implement a similar structure so that I can bypass CORS protection from my front-end?

The CORS policy is enforced by the browser, not by the server. The server just sets a couple of HTTP headers telling the browser how it wants it to behave. There is nothing that forces a proxyserver to honor those headers, and it can add, edit or remove them like it can with any other headers.

So the proxy can send the request but you can not, because as a front-end developer you are bound by the limitations the browser puts on you. There is no way around that. You will either have to set appropriate CORS-headers on your back-end, or you'll have to continue to rely on proxies.

So is CORS and the whole same origin policy useless if it can be bypassed with a simple proxy? No! Since the request is now made to acorsproxywebsite.com any cookies or other authentication information for example.com will not be included automatically in the request by the browser. That means that the proxyserver is only exposing what itself can see, and not what some other potential victim can see.


Can USB ethernet passthrough to a KVM virtual machine isolate network-related kernel vulnerabilities? I'm worried about the attack surface that the linux kernel networking stack, including nic drivers and packet filtering, offers to a remote attacker. So I'm planning to isolate as much of the networking code (drivers, packet filtering etc) in a KVM virtual machine (Basically what Qubes OS is doing, but with kvm instead of the type 1 xen hypervisor)

AFAIK, there are two ways to achieve this: Either pass through the host's ethernet device using PCI passthrough, which has the advantage that we can use the machine's IOMMU hardware to isolate DMA, or use an ethernet device attached via USB and pass through the USB device to the virtual machine. In both cases, it's then the virtual machine kernel that actually does the low-level networking. I would use PCI passthrough of the mainboard's NIC, but for several reasons that turns out not to be an option, so I'm looking at USB passthrough of an ethernet-to-usb dongle.

Am I right in assuming that with both methods (PCI & USB passthrough), I'm actually reducing the attack surface in the host kernel in regards to networking? In my mind, with that solution, the host kernel simply passes through data to the virtual machine and none of the network traffic touches any part of host kernel's networking code. Is that right?
Are there glaring problems with passing through a device via USB that renders the isolation of networking in the virtual machine useless/pointless? I'm not worried about the physical security of the machine, e.g. I don't have to defend against someone plugging in a rogue USB adapter that would convince the host's USB 3 controller to do anything it wasn't supposed to do. My main goal ist to make remote exploits more difficult.
Is the whole endeavour a lost cause? E.g. am I worried about holes in a tried-and-true part of the kernel, while adding a larger attack surface to the system by using virtualization? Am I actually decreasing the overall security of the system by using KVM?

Yes, this can reduce host kernel attack surface area. It can also be useful for isolating devices in the case that you have broken DMAR table and cannot protect from DMA attacks otherwise. This is something I have done in the past for most PCI devices. Some things to consider:

Use VFIO, not PCI passthrough

VFIO is newer, and will properly isolate devices in their IOMMU groups, whereas PCI passthrough can potentially be bypassed if there are any devices that are not passed through which are in the same IOMMU group. From the above link:

  IOMMU groups try to describe the smallest sets of devices which can be considered isolated from the perspective of the IOMMU.  [...]  Legacy KVM device assignment will allow a user to assign these devices separately, but the configuration is guaranteed to fail.  VFIO is governed by IOMMU groups and therefore prevents configurations which violate this most basic requirement of IOMMU granularity.

Beware option ROMs

There is one thing you should keep in mind, though. When you pass the PCI device directly though to a guest, the guest gets raw access to the PCI configuration space, including read/write access to the option ROM. An option ROM is a bit of firmware stored on certain devices which is executed by the BIOS during early boot. If the guest kernel is hijacked, then even if it cannot escape into the host, it will be able to write to the option ROM on the physical device, and wait until you next reboot, at which time the option ROM is called by the BIOS, subjecting you to a BIOS rootkit.

There is a way to mitigate this risk, however. Intel TXT allows you to verify option ROMs before they are called. This requires you set up tboot, which enables various TXT features at boot, properly. The official documentation is available here. This is very important, so don't ignore it!

Harden userspace components

By far, the most vulnerabilities will be present in the userspace component (QEMU, or maybe kvmtool), so securing this should be a high priority. Assuming you will be using QEMU, you should ensure it restricts its filesystem access to an empty directory with the -chroot directive. It must drop to a dedicated, unprivileged user with the -runas directive, and it must enable a seccomp sandbox with the -sandbox directive. Attack surface can further be reduced in other ways, by disabling unnecessary features (ACPI, RTC, etc.), and setting resource limits. Using a MAC such as AppArmor or SELinux is also recommended. If you will be compiling QEMU from source, you can further harden it at compile-time with the right gcc flags.

Harden both kernels

It's very important, if you want reduced attack surface, to use grsecurity for both the host and the guest. Additionally, grsecurity will provide PaX, which has components that harden userspace components like QEMU. If QEMU is used with -enable-kvm, then it is safe to use the strictest PaX settings with it. The commercial version of grsecurity is not necessary. All it is is a stable kernel which does not update as often. It is not necessary unless you are running a high-availability servers.


Importing bcrypt passwords into Active Directory I have a user database in MySQL format on my web server. The user passwords are encrypted by php with bcrypt. We want to import them into Active Directory without requiring the users to change their passwords.

I looked around the Internet and I can't find anything that would indicate this is possible. All the password import stuff I could find for AD assumes plaintext passwords.

Is there a way to import bcrypt passwords into AD and have them work?

AD only uses LM and NTLM password hashes for domain authentication.  You won't be able to import the bcrypt hashes and have them work to authenticate users to the domain.

You could modify your web app authentication process to temporarily capture the plaintext password when a user successfully logs in and create a corresponding AD user account for them with that password.  This assumes you have time to wait for the majority of your users to log in before they start using the AD.  Anyone who doesn't log in during that time wouldn't have an AD account.


Public key in SSL protocol I have gone through many of the posts including My understanding of how HTTPS works (gmail for example). Everywhere it's mentioning that before creating a https connection, the browser verifies the server's certificate and then uses the server's public key to encrypt data to the
server, and server then decrypts using its private key.

But where does this public key come from?

While generating certificates, aren't we generating private key which the server use to decrypt data?

Also, how does the server respond if it has to use the public key for encrypting the reply? How is the browser going to decrypt encrypted reply from server since there is no private key at browser side?

The SSL handshake is not encrypted. The server simply sends its public key in the plain. The client knows it can trust it, because it's signed by a totally trustworthy CA. A certificate is essentially a public key with some associated data such as a domain, signed by a CA.

The client doesn't need to be able to decrypt the PreMasterSecret (from which the session key is derived), because it chose its value and still remembers it.

Take a look at how the SSL handshake works:

  Negotiation phase:

  A client sends a ClientHello message ...
  The server responds with a ServerHello message ...
  The server sends its Certificate message (depending on the selected cipher suite, this may be omitted by the server). This contains the public key
  The server sends a ServerHelloDone message, indicating it is done with handshake negotiation.
  The client responds with a ClientKeyExchange message, which may contain a PreMasterSecret, public key, or nothing. This PreMasterSecret is encrypted using the public key of the server certificate.
  The client and server then use the random numbers and ''PreMasterSecret'' to compute a common secret, called the "master secret". All other key data for this connection is derived from this master secret (and the client- and server-generated random values)

  The client now sends a ChangeCipherSpec record, essentially telling the server, "Everything I tell you from now on will be encrypted and authenticated
  Finally, the client sends an authenticated and encrypted Finished message, containing a hash and MAC over the previous handshake messages.
  The server will attempt to decrypt the client's Finished message and verify the hash and MAC. If the decryption or verification fails, the handshake is considered to have failed and the connection should be torn down.
  Finally, the server sends a ChangeCipherSpec, telling the client, "Everything I tell you from now on will be authenticated and encrypted
  The server sends its authenticated and encrypted '''Finished''' message.
  The client performs the same decryption and verification.

(Based on wikipedia Secure Sockets Layer - Simple TLS handshake)

As you can see, the encryption is only enabled after the negotiation and thus transfer of the public key completed.


How can my country's legal/telecoms environment protect against cold-callers conning a remote-access session to the victim's computer? My local region in Australia is being targeted by a scam whereby victims are cold-called and told that their computer is sending 'errors' to caller at 'Windows' which should be fixed ASAP, and they are standing by to help out with a remote-access session to fix it.

It's not clear that there is any particular attack being carried out with the remote-access session (probably there are many companies trying the scam on).  There's the actual sting of paying for the 'service' by credit-card, likely transfers of browser-cache files, and some reports of trojans.  Let your imagination go wild.

It seems clear that one way or another, organisied crime is paying good money to harvest pwned machines.  Out comes the white pages, and the call centres get to work.

What is frustrating is that there seems to be very little recourse an alert would-be-victim can take to get back at the operators (other than wasting their time, which usually involves wasting one's own - some people have also suggested keeping a loud whistle near the phone).  The caller-id information (that's what we call it in .au) is witheld - possibly the number is just from a pool of VoIP gateway numbers anyhow.

It seems unlikley that the Australian government can successfully prosecute and shut down all overseas operators of the scam.

It would seem like other protections will have to be put in place to counter what is doubtless going to be a growing phenomneon.  Something that's crowd-sourced, statistical, and dynamic, most likely.  As an example, one might impose on telcos that if a user presses some key sequence during a call, the call legs are flagged as being a 'suspicious' call.  Maybe a recording of the conversation can be made as well, to automatically collect evidence for public prosecutions?

What measures - which I could lobby my local politician for the government to adopt - would be useful in hindering this kind of social attack?

In the US, a telephone customer can dial *57 after the call to get a "Customer Originated Trace" - which theoretically "Provides the recipient of an abusive call the ability to request an auto-trace of the last call received".  Not sure what the definition of abusive there is, or the latest reality of how well it works.


Is ARP poisoning necessary? Correct me if I'm wrong but isn't it possible to sniff WiFi traffic in the air? If so, what exactly is the point of ARP poisoning? In this scenario, the attacker would already be authenticated on the WPA2-PSK network and can therefore decrypt traffic.

You are assuming that once you are authenticated to the Access Point that you can automatically see all WiFi traffic from all nodes in the clear.

In WPA, each node is given their unique key with which to communicate with the Access Point.


What are the strengths and weaknesses of using a single 'burner' computer vs. many public access computers over a sustained period? Assuming that the user is accessing/publishing related sensitive information over this period, and also assuming that they would take additional precautions in both scenarios, such as a Tails live USB, and an on-screen keyboard to prevent keylogging where it may be a risk.

The main aim is to remain anonymous.

Thank you!

Quick answer

Buy and configure a disposable computer.
Limit device usage to a single purpose.
Follow information hygiene practices.

  Disposable vs public access computers

Firstly, the reconstruction of your data and conduct by third parties depends on whether your conduct was localised or networked.

The reconstruction of network communication involves tracing a thread through various servers with search warrants until your identity and conduct is known. The reconstruction of localised behaviour requires either physical access to the computer or knowing your location whilst you are using it in order to eavesdrop in a variety of ways.

So:

A disposable computer is only marginally better than public computers for internet activity, as most of web anonymity depends on following strict rules of compartmentalisation and online hygiene.
A disposable computer is generally better than public computers for non-HTTP network communication as public computers usually lack appropriate tools like ssh, tor, freenet and pgp.
A disposable computer is quite superior for all localised activities as you control your data and can destroy it when required.

You pay for this improved anonymity by having to buy and configure the single-purpose disposable computer.

Public computing can cost nothing and requires minimal technical expertise to use within the limits of its anonymity. However availability of public computing is wildly variable, both in time of day and location - which limits how random your access behaviour will really be.

  Regarding disposable devices

Let us consider a disposable computer as any computer that you are willing and able to physically destroy to protect sensitive information or conduct.

A distinction should be made between self-contained disposable computers and live-boot distributions requiring a host computer to execute instructions. There are also new pc-on-a-stick hybrids that combine the portability of USB with the security of isolated CPU and storage.

Mobile phones are either a dreadful or an excellent option for anonymity - depending on what type of operating system and software is installed. Typically mobile phones are dreadful as they haemorrhage information out of every conceivable transceiver; know your location and conduct intimately; explicitly aggregate your identity for various commercial reasons; and have the interface security of a wet paper bag. However, a hardened custom OS with the transceivers tightly controlled or entirely disabled can make for an excellent option under ordinary use cases.

Laptops and netbooks are less portable and typically more expensive disposable solution than a mobile phone but require far less technical expertise to establish as anonymity-orientated machine.

Live-boot USB sticks will rely on the security of the host computer and hence the level of trust in that computer. They are the cheapest and most mature of the portable anonymity solutions, but you will find many public access computers disable booting from USB or prohibit such conduct in any case - as the flow of access is both ways. You could in effect manipulate the (unencrypted) host computer.

PC-on-a-stick solutions are a less mature technology than live-boot disk-images but, depending on their operating system and feature set, are probably the best overall solution for anonymity as they work with any accessible HDMI monitor and almost completely isolated from the surrounding environment.


SSL interception with client certificate I want to intercept a ssl-encrypted tcp-stream. I have the privat key and the certificat of the server and of the client. But how can I intercept the connection.

Is there a intercepting-proxy with such a feature?

You are typically trying to perform a Man in the Middle. There are many ways to do it.

easy way is by using Wireshark - refer blownie55's answer
Web Browsers these days come with Developer Tools Which show a lot. (Press F12 in Chrome)
Packet Dump at your Gateway. - Collect Packets from Client and then decrypt them using the Private Key (pretty hard, but doable).
Port Cloning or Port mirroring at your Gateway - Your Gateway simply forwards all traffic from a particular Port(say port A) in your router/switch to another Port of your choice(say port B) - you decrypt traffic from Port B using the Private Key.
Web Proxy -You can achieve this by:

setting up a Web Proxy with the Private Keys of both the Server and
Client, so the Proxy appears to be the Server to the Client and Vice
Versa.
Then you have to Route the traffic through the Web Proxy.(like using a Host file at the Client). - If your Gateway is also the web proxy, then don't bother with this step.


Is symmetric encryption vulnerable to known plaintext attack? If Bob sends some plaintext to Alice for encryption before sending the ciphertext to Carol, can Bob deduce the key by comparing the plaintext and ciphertext assuming only Alice and Carol knows the key and it is a symmetric encryption scheme?

It sounds like you're describing a "chosen plaintext attack" where Bob can craft a series of special messages that he can use to break the encryption through differential cryptanalysis.

(You might also be thinking of the "known plaintext attack" where Bob knows the plaintext and the ciphertext but can't make special ones - e.g. if Alice is reading the plain texts then she might notice Bob is sending weird messages.)

(And as a0video points out, there are also attacks where the attacker can encrypt the same plain text with different keys.)

Some symmetric encryption algorithms are indeed vulnerable to these attacks.

On a practical note, though, if you are properly using a modern, well established symmetric algorithm, such as AES - and you should be! - then you have little to worry about. The best crypto attacks on AES still don't reduce the time needed to break them to anything remotely do-able.


Secure elasticsearch in Docker How can I secure elasticsearch for production use in Docker?

I use this docker-compose.yml:

version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.16
container_name: elasticsearch
restart: unless-stopped
environment:
- "network.host=0.0.0.0"
- "http.port=9200"
- "cluster.name=elasticsearch"
- "node.name=db-master"
- "node.master=true"
- "node.data=true"
- "bootstrap.memory_lock=true"
- "ES_JAVA_OPTS=-Xms6g -Xmx6g"
- xpack.security.enabled=false
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 12g
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- 127.0.0.1:9200:9200
networks:
- esnet
volumes:
esdata:
driver: local
networks:
esnet:

I want elasticsearch to be accessible only on localhost network (only local apps should access it), so it shouldn't be accessible from internet. I use bind to localhost - 127.0.0.1:9200:9200, but I don't know if it is enough.

Yes, It's enough, but you can harden it using XPACK, Xpack is available now in free version of ELK.
Please check the reference regarding XPACK: https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-xpack.html

You can run elasticsearch in local network only, If you want to access it later outside your network you can use NGINX Reverse Proxy

Here's the guide : https://logz.io/blog/securing-elk-nginx/

Additionally, the password in elastic is a default. So you can change password in all built-in users by using this command:

bin/elasticsearch-setup-passwords interactive

Lastly, Enable auditing features. Add the following setting to elasticsearch.yml on all nodes in your cluster:

xpack.security.audit.enabled: true

You can look a walkthrough for security in elastic website.


homomorphic encryption and DARPA Why the government (and the DARPA in particular)is spending all these millions to improve the homomorphic encryption?which useful usage could it get?

In one sentence: data can be modified and calculated without being disclosed. Quoting from the Wikipedia page: ... effectively allowing the construction of programs which may be run on encryptions of their inputs to produce an encryption of their output. Since such a program never decrypts its input, it can be run by an untrusted party without revealing its inputs and internal state.

Like with most research agencies, their possible benefits aren't fully described. The full benefits of GPS, for example, were probably not imagined at the time either.


ML approach to malicious attachments using email contents Based on my understanding of the field, it seems like there is a lot of attention paid to spam filtering based on the contents and metadata of an email, and there is considerable attention paid to detecting malicious attachments on their own, but I was wondering whether any work has been done on taking a ML approach of analyzing attachments and emails together to determine malice. It seems like you could do a lot better detecting emails with bad attachments if the contents of the attachment don't match up with the body of the email.

For instance, an email whose body claims to have an earnings report wouldn't be suspicious, and an executable file wouldn't be any more suspicious than any executable file, but an earnings report email with an executable attachment should set off red flags.

I was wondering whether products already incorporated this insight or if there were open source projects that integrated this capability.

For context, I work at a large company that already has a spam filter, and we perform automated static and dynamic analysis on attachments, my question is whether I could tie the output of the tree together with ML to provide better coverage for threats that may slip through. We already do manual content to catch these kinds of things so I was wondering if applying ML could catch novel threats. I know that EXEs aren't the main threat.

I think you are using the wrong tool for the wrong problem. Why not inspect the attachment for malicious code? What does pairing the content of both things gain you?

Also, you appear to have an underlying assumption about the disconnect between the two contents. Why do you think that the attachment content would not match the email content?

What if attachments are zipped, compressed, encrypted, or compiled and you cannot read the content? What if the attachment has no content?

So, if we do the things we currently can do correctly: validate senders, Bayesian analysis of email content, and inspection for malicious attachments, what gaps exist for your approach to provide fruit?

I do not believe projects exist to do this (and I have not heard of any) because it is simply not a fruitful area for work when there are other more fruitful avenues.


Denial Of Service attack in asynchronous communication Is Low rate DOS attack (unintended) possible through asynchronous communication? Consider this scenario:

I have a client server application were there is a WAN communication between the client and server. Client makes synchronous calls to the service and so waits for a response. Now there happens some nasty WAN issue causing the latency to spike. In this case the server might wait for the packets to arrive while the client could timeout and start a new connection. If this happens fast enough the server might get saturated with connections causing legitimate connection requests to be dropped causing DOS.

Now if the communication is asynchronous the client will not wait for the response and repeated attempts wont happen. This seems to protect from DOS?

Am I correct here? or where did I go wrong ?

You are correct. The ability to receive multiple communications will protect from that kind of DoS, or rather: will increase the "power" needed by the DoS to be harmful (this in the single-client scenario).

On the other hand, keeping more communications open at the same time will have an impact on the server (memory and resources - which are basically memory again, handled by a negligible amount of CPU). So you are trading one vulnerability to "slow DoS" with another.

For typical systems, it makes sense, since they have memory to spare and CPU to burn, Unless protocol or architecture prevents from doing it, multiple asynchronous support is desirable.

The other (more typical) possibility is that we're looking at a large series of parallel continuous communications, i.e. a large number of persistent HTTP client channels. In that case, you ask, if the latency causes N connections out of M to drop and being reinstated, it will cause M+N connections to be simultaneously open, then M+2N, then M+3N...,; if the grow rate exceeds the rate at which the server closes stuck connections, the server resources will be eventually exhausted.

There are several lines of defense against this. Usually, when a connection drops (at HTTP level), the server will be aware of the fact at the TCP level, when the client closes the channel. Unless the client endeavors to drop the connection without a by-your-leave or keeps the old socket alive and opens another (such leaks are mainly due to sloppy programming - but it happens); in that case the server will notice the fact after a suitable TCP timeout, which can be further shortened by employing the keepalive option. This may not work against sloppy clients, since the underlying socket isn't actually dead at all.

Then, the server may be able to recognize the client (e.g. using sessions, or IP address; a firewall can also do the latter), and tear down any other extant communications with the same client either explicitly or implicitly (e.g. because the client has an assigned "slot" and can only be occupied once, therefore the incoming communication replaces the first; this needs be done after successful identification and authentication of the client, since otherwise it would open the door to a different DoS).

Client session recognition may be the only practical way to deal with sloppy clients if IP address isn't an option (e.g. several legit clients behind a NAT sharing its address); apart from upgrading the client software, of course. Such a situation would be readily visible with a simple netstat on any such client.

Finally, such a scenario would require for the whole architecture to be almost at capacity; you can avoid this by monitoring performances and upgrading capacity before entering the "danger zone". The farther you stay from the red line, the more power (and demonstrable will and culpability) will a DoS require before driving the system up to there, and the more warning you will have when this happens. Briefly eating up 5% of system capacity may be accidental, consistently eating 50% that much less. Of course, such a safety margin will have its costs.


Why would Gmail ask for the last password I remember? Yesterday I tried to recover the password for a Gmail account that I have created few months ago and during the process it asked me for the last password I remember. Why would it ask for that?

I'm 100% sure that I have used only ONE password for the account so it's meaningless to ask me for the last password I used in case they were trying to verify my identity using old passwords
I assume Gmail does not store the passwords in clear text so I highly doubt it's helpful for them if I remember my password as Password123 instead of the right one password1234 as they have totally different hashes.

It looks like GMail knows the hashes of earlier passwords for users. While this is not true in your case, treating it as a special case would cost the developers time, and it would provide attackers a clue about your password habits. It is a good thing that GMail doesn't advertise that you never changed your password.


Is EFS FINRA and SEC Acceptable I'm trying to search in their manual but there is nothing explicit being mentioned as to what type and how encryption should be done.

Can I assume that if I use EFS on the entire USER directory that it will be perfectly acceptable in terms of compliance?

In most cases where regulations mandate encryption at rest it generally would apply to the system as a whole due to the fact that the regulated data will frequently be copied into logs, swap space, and other areas of the system. Likewise it would be accessed by other applications on the system for things like file integrity monitoring, backup, anti-virus scanning, etc...

For these reasons just encrypting the USER directory would not normally be acceptable. Likewise there are additional security risks to not doing full disk-encryption in the event the system (or it's backup) are compromised.


Does TLS 1.3 mitigate the BREACH vulnerability? Section 5.4 of the TLS 1.3 specification describes record padding.

One of the mitigations for BREACH is to add random padding.

Therefore, I'm wondering:

Does TLS 1.3 require random record padding? I'm also unclear on if this padding is optional or required, and if it is always random.
If TLS 1.3 random record padding is done, am I correct in thinking that it does mitigate BREACH?

Assuming both of those questions are answered affirmatively, I believe that would mean that any site that uses TLS 1.3 (and supports no earlier version of SSL/TLS) would not be vulnerable to BREACH.

This article, under BREACH sums it up pretty well.

  BREACH targets HTTP compression, not TLS compression

With that said, the random record padding can be done on a higher level of encapsulation and not on the TLS record itself. You do not want to be obscuring the length of the record but the whole response.

Here are the preventive measures mentioned in the post above,

Disable HTTP compression
Separate secrets from user input (these secrets can be taken as a CSRF token)
Randomize secrets per request
Mask secrets (effectively randomizing by XORing with a random secret per request)
Protect pages against CSRF
Hide the length (by adding random numbers of bytes to responses)
Limit the rate of requests


What are things we look to find Access Control Database? Currently Working on HP Fortify Access Control Database category.

Source:

userId = request.getParameter(Constants.USERID).trim();

Sink:

pstm1.setString(3,userId.trim());

I saw the definition provided by Fortify that is:

  Without proper access control, executing a SQL statement that contains a user-controlled primary key can allow an attacker to view
  unauthorized records.

In these application primary id is different (i.e Userid is not a primary of that table)

What kind of stuff attacker will do with these vulnerabilities?
How can attackers exploit these vulnerabilities?
How we can say that there is an actual issue not a false positive?
Any suggested remediation for these kinds of vulnerabilities?

What kind of stuff can an attacker do with this vulnerability?

I will assume that my request looks like this: GET /editPassword?userID=163495&password=myNewPassword

In this case, an attacker can simply change the userID and thus edit the password of another user. Even if it's just read access, by having the user supply the ID, it can be changed to arbitrary values, even if your application always sets it to the "correct" IDs.

  How can an attacker exploit this vulnerability?

That entirely depends on the application, and what you consider an exploit.

For example, on Stack Exchange, I can look at people's profiles, knowing just their IDs. Maybe this is what you want, maybe not.

If your only defense against anybody viewing any content in the database is just that they never try to insert a different ID, then you don't have any defense at all.

  How can we determine if it's an actual issue?

Again, depends on your application. Is it okay that users can read arbitrary records? If so, then it's fine. Otherwise you need to add some kind of authorization mechanism, to see if the request is authorized to view this information.

  Any suggested remediation for this vulnerability?

Depends on your codebase. I can't fix your code by knowing 2 lines of it.


What are the (two?) definitions of SOC? On one hand "Security Operations Centre", but SOC is seemingly used in the reporting and certification domain, where does this come from? Is there another (or more) definitions of SOC in Information Security Compliance Certification, or do these terms just reference it as a way to describe practices needed to be in place in a given IT division? The question comes from trying to determine what SOC "Level" Report I should request from a third party vendor to my organization.

There are at least two meanings of the acronym SOC, completely unrelated:

Security Operations Center
System and Organization Controls

Whenever you see "SOC <Number>", like SOC 1 or SOC 2, that means System and Organization Controls which are a complex and well defined set of audit requirements.  The different SOC levels are defined by the AICPA as a standard for audits.
In general, when performing due diligence on a third party vendor, a SOC 2 report is asked for:

A SOC 2 audit examines and reports on a service organization’s
internal controls relevant to the security, availability, processing
integrity, confidentiality and/or privacy of customer data.


Do you need to use the same number of rounds for everyone with bcrypt? I am going to be hashing user passwords on the client machine, and I would like the hash to be generated in 0.3 seconds.

Do I need to find the number of rounds myself and make every user use this number, or should the number of rounds depend on the machine?

For example, if I found that 10 rounds took 0.3 seconds on my machine, does this mean every user should use 10 rounds? Or should it be on a per-machine basis. If it's per machine, I will have to send the number of rounds to a server and store the number of rounds on the user machine to make sure this number is always used in the future. Is that ok? Or do things not to be that complex?

The tuning of the cost factor for BCrypt is mainly a problem for server side applications. If the cost factor is too high, the server can become very busy only with calculating hashes, when a number of people try to login at the same time. That's why we try to find a suitable number of rounds for this server.

If you are doing the calculation client side, every client has enough cpu power on its own to calculate even a large number of rounds, the power grows with the number of clients. Web applications should calculate the hash server side though.


When cellphone providers give "unlimited social networking", how do they identify the traffic? Some providers will give unlimited traffic for things like Facebook, Twitter, LinkedIn and even YouTube in some rare cases on smartphones. I'm wondering if there's any documented way they identify this traffic. Not for malicious purposes but from an ethical standpoint I'm curious as to how they keep the data at bay. On first glance, I would assume an IP filter and payload size checks but I wonder if anyone has any better theories or resources?

Strictly speaking, the phones are not completely restricted because of IP over Facebook. Whatever the medium, there's always someone to think about transporting raw IP packets in it, and then go ahead and actually implement it.

For the actual restriction, this can be done with IP filtering, or by enforcing an unescapable Web proxy which filters on the URL (preferably a transparent proxy rather than something in the phone software, so that jailbroken phones may not evade the restriction).


Can we trust antivirus software? There are a lot of free antivirus software and free versions of commercial anti-malwares. Can we really trust these free antivirus programs?

The same question about commercial antivirus software. Maybe they install backdoors on our computers?

Maybe commercial or free anti-malware installs backdoors

Very true. Maybe they do.

However – there are a lot of technically experienced individuals who are in a position to check, either through monitoring unexpected connections outbound, or through reviewing the code, so we can have reasonable assurance that they don't.

But think about the alternative – we know that malware does install backdoors etc., so from a risk based perspective, which would you prefer? A control that you personally haven't vetted, but that many others approve, or a lack of control which leaves you open to malware.

Pretty simple. Trust isn't required – it's just up to you to balance the risk factors for your circumstances.

If you need any guidance, large companies use perimeter and desktop anti-virus and anti-malware, as well as anti-malware on laptops and other endpoints. It isn't cheap for them, so it is very much a risk based decision to spend that money.


Is revealing login name of macOS into internet a security risk? For example, sometimes I need to post debug messages to internet like this:

No such file : /Users/xxxxx/Documents/test.sh

My question is, is forgetting replacing the login name into xxxxx a security risk?

The revealed username
would only be a real security problem if this MacOS computer is directly exposed to the Internet with remote accessible services like SSH, where the username could be used. The username alone would most likely be used for brute force attacks.

The brute force attack would not be that effective, if you have a strong password (and possibly Fail2Ban). However, people often have weaker passwords on their personal computers as they need to type it frequently.
Username information is only useful for brute force attacks if the intruder also knows the IP address of his target.

Other parts of the PATH may, however, reveal something more directly usable. Say you have e.g.  /Users/username/public_html/path/to/known/vulnerable.php that could be directly exploited without brute forcing any passwords.

Then, there's all the possible privacy issues, but as you send this information voluntarily, you are probably  already aware of those.


IT security audit : is threat modelling key to reproducible success of just following a methodology (ex : ethical hacking) To sum up the methodology of ethical hacking, what you do is :

Information gathering (gets the IP, domains, etc...)
Fingerprint the IP (what OS, what services are running, etc...)
Vulnerability assessment (are any services or vulnerable application found to be vulnerable ?)
Exploitation : verify the result of the step above

But, I came to realize during my security audit that end up either asking google questions like "what should I do to hack system A ?" or questions like "what are the tools to assess the security of system A ?"

It's like looking for a looking for a needle in a haystack.

Then I read a paper in which the audit started with threat modelling. I was just asking myself how would a hacker (either a script kiddy or an ethical hacker) should perform threat modelling in order to have results meaningful to integrate and follow the methodology (info gathering, fingerprinting, vuln assessement, etc...)

I'm starting to believe this would make the security audit more professional and its results more reproducible. What do you think ?

You are exactly right about the need for realistic threat modeling before conducting any type of security audit. If you don't understand or realize the threat actors (e.g: cybercriminal , disgruntled inside actor), it will be very difficult to know

What security controls to audit
How to interpret the results of your security audit as the severity of any vulnerabilities / findings must be put into the context of who / what is likely to defeat / bypass your security controls

  What security controls to audit

Depending on the threat actors you believe are most likely to attack the assets your are trying to protect with security controls, the criticality of each security control to be audited differs. As an example, security controls that guard against attacks from threat actors looking to attack a web application may not be as applicable (if at all) when your most likely threat are in the physical environment - e.g: tailgating of individuals through electronic doors.

  How to interpret the results of your security audit such as vulnerabilities detected

If you don't have a realistic and clear idea of who the threat actors are and the attack vectors they are most likely to use to exploit vulnerabilities detected, it is difficult to evaluate the likelihood and impact of the vulnerabilities noted. Likelihood and impact assuming exploitation are 2 key dimensions when ranking the severity of vulnerabilities, which in turn should influence how you prioritize the remediation of such vulnerabilities.


SSL certs signed by different CA Have a question on SSL certs signed by different CA. in the past, my web server cert is signed with CA1 and it was also imported into the web app firewall for SSL traffic monitoring. Now, I have changed to CA2 and would be importing this new cert into my web server. In this case during this interim, would the client have any impact if my web app firewall is still using the cert from CA1? I suppose which CA does not matter as long as the cert is trusted?

As long as they are valid certificates issued by a trusted CA and you aren't using something like HPKP, there will be no impact on the client.

In fact, it looks like the client won't even see the cert on the server itself. It will only see what the WAF is using.


Choosing a cipher and MAC for an SSH connection The cipher and mac selection according to this are in some sort of order in a config file. How do the client and server know that they are using the same ones though? Is this information exchanged in the beginning? Another question:  was SSH v1 vulnerable to MiM attacks? From what I've been reading there is no certification authority involved.

In the first messages between client and server, both send their list of supported algorithms, in order of preference. Then the algorithm that will be used is the first one on the client list that also appears somewhere in the server list. This is specified in RFC 4253, section 7.1:

  encryption_algorithms
     A name-list of acceptable symmetric encryption algorithms (also
     known as ciphers) in order of preference.  The chosen
     encryption algorithm to each direction MUST be the first
     algorithm on the client's name-list that is also on the
     server's name-list.  If there is no such algorithm, both sides
     MUST disconnect.

  (...)

  mac_algorithms
     A name-list of acceptable MAC algorithms in order of
     preference.  The chosen MAC algorithm MUST be the first
     algorithm on the client's name-list that is also on the
     server's name-list.  If there is no such algorithm, both sides
     MUST disconnect.

In other words, the protocol is such that the client's preferences take precedence over the server's preferences.

The normal SSH model (for both SSH v1 and v2) is that the client remembers the server's public key. When the client first connects to a given server, the client displays the hash of the apparent server public key to the user; the user is then supposed to check that hash with regards to some reference value provided by a trusted sysadmin (e.g. the user might phone the server's sysadmin to get the expected hash value, and compare). The client software will then remember that public key (e.g. in the .ssh/known_hosts file), and further connections will check the server key by simply comparing it with the remembered value.

This model is vulnerable to MitM only if the attacker acts during the very first connection, and if the human user is lazy and does not check the hash value as he should (in practice, 99% of human users are lazy).

This model has not changed between SSH v1 and v2. However, modern SSH v2 implementations also optionally (but not commonly) dabble in certificates, allowing the use of a CA-based model instead of the traditional model explained above. I have yet to see that kind of certificates-for-SSH really used in practice, though.


What are the pros and cons of enabling 2 factor authentication on internal user workstations of an organization? An organization has all the regular controls you can think of for network and systems protection from the 10 security domains. External login access to the organization's services is protected with 2 factor authentication. As an improvement on security posture, it is suggested that 2 factor authentication could be enabled on all user workstations. Given the fact that security controls ranging from physical security to logging access are well implemented, what are the pros and cons of implementing 2 factor authentication on all workstations of the organization?

Pros:
You could gain security by having that the physical access card, that is used to open doors in organization, must be placed on a Reading pad or inserted in a smart card reader, and kept there to keep the computer logged in.
As soon as the card is removed, computer is forcefully logged out. (shutdown /l /f /t 0)

I would advise against locking the computers instead of logging out them, both for security, but also so shared computers do not get "locked up" by careless users. Better to log the computer out, if the user want to continue working, he has to save his work prior to removing the card.

If this card is used to access basically all doors in the organization, even for the exit direction, even toilets and lets say vending Machines, coffe Machines, copy machine, printer, etc

then it will become a habit of the workers to actually Always bring the card with them when going anywhere.

This means that you dont need to logout the session after inactivity.

This means you can actually use it with a one-factor login (only card) instead to make the login extremely convient for the user. To protect against lost cards, you could have that the card needs to be presented and a PIN code needs to be entered, at the front door or lobby area, to enable the card for 12 hours.

Thus on the beginning on work day, the user has to use card+PIN to activate the card. After this, the card will work for 12 hours, in all doors and on all computers where the user is allowed to be.

Cons:The cost. It can be prohibilively expensive to buy RFID readers for computer login, or replace all RFID cards with combo Chip+RFID cards and then invest in Smart card readers.


Does prompting for security questions on new computers add any security on banking websites? When you sign into Bank of America on a computer you haven't used with them before, the site prompts you to answer one of your security questions.

How exactly does this make the site more secure?

Is the assumption that if a person somehow guessed your password, they couldn't get in on their computer because they wouldn't know your security questions? If they have your password, they've already won. It seems like all this does is make it harder for legitimate users to use the site...

Update

Based on the answer from @AJHenderson it seems that the scenario we're trying to protect the user from is a key logger. Perhaps we're counting on the key logger as having been placed after the user already marked this computer as "trusted" by entering their security question? In that particular case the hacker wouldn't have captured the user's security question answer. Wouldn't a better solution be to have the user enter a PIN via an onscreen key pad that wouldn't be so easily key logged?

The scenario that this is designed to prevent is keylogging.  It is fairly easy to get a keylogger that will report back but somewhat more complex to make a program that will actually execute an attack remotely on another computer.  Since you don't regularly enter your security question answers, if an attacker obtains your password via a key logger, they won't be able to use it on their system without knowing the answer.

It does have somewhat limited effectiveness though as if the attacker can force your system to not be recognized, they can get you to answer the security questions as well.  It is still a slight increase in difficulty for an attacker though and is not a significant or even common burden for a user.


Avast antivirus virus alarm while programming I was programming a function pointer in C on CodeBlocks. When I compiled and ran it, Avast showed an alert message and quarantined the .exe.

Is there a solution? Or do I need to disable Avast while programming?

Do not turn off your protection. In Avast, just like in most antivirus software, it's possible to add exceptions on a whitelist.

  Quick Summary

  Make sure the blocked file or webpage is not malicious by testing it at www.virustotal.com
  Add it as an exception by going to Settings » General » Exclusions
  Confirm by clicking OK

It should be safe to add the folder where you keep (just) your own software to the whitelist. However, it might be a good idea to manually test the final version before publishing to avoid false positives that may harm your reputation. You could also use the name and description of the dedection to investigate whether your software actually has malware like characteristics.


Search Engine security for searches associated with the same searcher A number of years ago AOL leaked potentially identifiable information, because all of the searches leaked were associated with the same 'user', and as such they could be put together to identify the searcher. Search engines now claim they are cautious enough to encrypt their searches, but does that include seperating searches coming from the same IP address, or do they only encrypt the IP address? If they don't seperate the searches there is still a risk, because the content of the searches can be combined to identify a searcher if ever leaked, even if the IP address is masked.

There was a documentary I saw a few months ago on Netflix that told about how Google has data on everyone's searches. They showed an example of some guy who searched for numerous ways to kill his wife. He also searched for a good place to get a sandwich in the middle of his murder searches. So the documentary visits the guy and it turns out he was a writer for a crime tv show. And his wife is very much alive.

It's probably a good idea to assume that nothing you do on the Internet is a secret unless you go to great lengths to make it that way.

(I think the documentary was titled something like "terms and conditions may apply")


How is Facebook accessing my iPhone texts in order to recommend friends? I have noticed that Facebook has been recently recommending people who have texted me. It has been able to connect their number (I believe most of these people are using iPhone) and connect their Facebook profile to mine.

How is this happening? How does Facebook access these texts and connect them to users?

Furthermore, how can I stop this? Obviously my security setting have failed somewhere.

I use an iPhone 4, Chrome and Safari on my Macbook Pro, mid-12, OS X Yosemite 10.10.4.

EDIT: Based on questions, I do not have the Facebook app and I do not have Whatsapp. On my iPhone, I have Safari, Google Chrome and DuckDuckGo, but I have never accessed Facebook via my iPhone. All people being recommended online are individuals I have contacted via iMessages. How is Facebook getting this information?

EDIT 2: I think we've established FB must be using iMessages. Probably these individuals have the FB app downloaded to their phone, and FB is accessing their iMessages and connecting us. How is FB doing this? What are the internal dynamics at play here? Facebook accesses their SMS data?

EDIT 3: In order to discuss the dynamics of how the Facebook app accesses smartphone data, I've opened up a new (but related) question here:
How does the Facebook App on iPhone access the SMS data from iMessages? What are the details?

It's entirely possible that this has no bearing on your own devices or settings. Let's talk about the way one could go about designing that feature:

Consider all connections one or two steps away. From those who have enabled syncing their contacts, consider those with a fuzzily matched name. Factored with some other heuristic scoring, you start seeing people you know in your feed based on information that didn't source from you.

From their own page: We show you people based on mutual friends, work and education information, networks you’re part of, contacts you’ve imported and many other factors. and When your friends join Facebook, they can invite their friends to join too. Their invitation emails can include suggestions of other people you may know who may have invited you in the past. This helps you find your friends on Facebook quickly so you can start sharing with them if you decide to join.

https://www.facebook.com/help/501283333222485/

Thus, there's no inherent implication that something is wrong with your security settings, particularly on an iPhone.


Can you just replace the TLS cert in a pinned application? Say there is an Android APK. You want to sniff the traffic to the private API. So you decompile it, find the cert, then replace it with fiddler's or burp's or charles proxy's, recompile it then run it, using one of the above listed proxies to sniff the traffic.

Is it really that simple? I easily found a text file titled "pubcert_prod"(along with pubcert_dev) in a top 10 worldwide app by ctrl+f'ing the decompiled apk.

It would be extremely trivial to write an automated tool that decompiles the app, searches contents for cert file extensions and/or greps for -----BEGIN PUBLIC KEY/CERTIFICATE----- and use openssl to generate a new cert and replace it which can then be used to sniff the ssl pinned traffic.

Is it really that simple?

Generally, yes.

  It would be extremely trivial to write an automated tool that decompiles the app, searches contents for cert file extensions and/or greps for -----BEGIN PUBLIC KEY/CERTIFICATE----- and use openssl to generate a new cert and replace it which can then be used to sniff the ssl pinned traffic.

So?

SSL, with or without certificate pinning, is not designed to defend against a local on-client attack. It is designed to defend against data interception by arbitrary middlemen (e.g., ISPs, the coffee shop WiFi router) from arbitrary clients.


Is ignoring a threat you cannot defend from a valid strategy? Given that you sometimes can not defend from a form of threat, is it then valid to ignore said threat? Instead of defending from the threat, just mitigate the symptom.

An example of this comes from media distribution, where DRM has been less than effective at protecting the data. Ultimately, there is nothing that stops the client from circumventing the protection because it, in fact, needs to be undefended at some point in order to view it.

While the above particular case is well known, some analogous cases might not be as well known. Given that developing a protective measure might be cost prohibitive, when does one suggest the client should:

ignore the security threat
change business model to one that sidesteps the threat

You would never ignore a threat, and perhaps that is semantics over your wording. You either accept, mitigate, or outsource the risk for the given threat.
In this case, that would be:

accept that there will be a $X loss,
mitigate fix DRM or find DRM alternate to protect the product, or
outsource using insurance or place the risk on someone else in the same way insurance does.

In your case, if 1) is not acceptable then they need to move to 2 or 3 as their alternatives.


Limit on modulus lines in OpenSSH /etc/ssh/moduli file? I understand that OpenSSH server looks in /etc/ssh/moduli and picks a modulus at random for each Diffie-Hellman group exchange.  What I am wondering is whether there is a practical limit on how many modulus lines can be in that file.

Would an absurdly large number, such as 50,000 lines, pose a problem or create some weird behavior?

Most likely 4294967295.

In the source file dh.c, the moduli file is opened with fopen, and a fgets loop is used to extract each line. The current line being processed is recorded in a variable declared as int linenum. This means it is a 32 bit signed integer, capable of representing 232 possible values. Since it is signed, this equates to -2147483648 to 2147483647 (one less because 0 is still a number and is considered positive). Since it starts at 0 and increments, the maximum value is thus 232 / 2 - 1. It will become negative if it exceeds this bound and wraps around.

There is some conversion between signed and unsigned in the source code. The int linenum holds the number of lines, while int bestcount has the number of suitable lines and is passed to arc4random_uniform, which outputs a random value between 0 and bestcount. The value it accepts and the value it returns is unsigned, but it is stored in another signed integer, which. That integer is used to specify which random line is to be used. If the number of lines exceeds what an 32 bit integer can hold, the random choice of line's upper bound will be smaller, perhaps much smaller, than the actual number of lines.

This limitation is not an issue in practice. The maximum length of a line is 4096 bytes, and 232 lines (not - 1 because the first line starts at 0) of 4096 bytes each gives a maximum file size of 16 terabytes! Good luck waiting for openssl dhparam to generate terabytes of moduli.

The whole function in the source code, as of OpenSSH 7.5p1:

DH *
choose_dh(int min, int wantbits, int max)
{
    FILE *f;
    char line[4096];
    int best, bestcount, which;
    int linenum;
    struct dhgroup dhg;

    if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL) {
        logit("WARNING: could not open %s (%s), using fixed modulus",
            _PATH_DH_MODULI, strerror(errno));
        return (dh_new_group_fallback(max));
    }

    linenum = 0;
    best = bestcount = 0;
    while (fgets(line, sizeof(line), f)) {
        linenum++;
        if (!parse_prime(linenum, line, &dhg))
            continue;
        BN_clear_free(dhg.g);
        BN_clear_free(dhg.p);

        if (dhg.size > max || dhg.size < min)
            continue;

        if ((dhg.size > wantbits && dhg.size < best) ||
            (dhg.size > best && best < wantbits)) {
            best = dhg.size;
            bestcount = 0;
        }
        if (dhg.size == best)
            bestcount++;
    }
    rewind(f);

    if (bestcount == 0) {
        fclose(f);
        logit("WARNING: no suitable primes in %s", _PATH_DH_MODULI);
        return (dh_new_group_fallback(max));
    }

    linenum = 0;
    which = arc4random_uniform(bestcount);
    while (fgets(line, sizeof(line), f)) {
        if (!parse_prime(linenum, line, &dhg))
            continue;
        if ((dhg.size > max || dhg.size < min) ||
            dhg.size != best ||
            linenum++ != which) {
            BN_clear_free(dhg.g);
            BN_clear_free(dhg.p);
            continue;
        }
        break;
    }
    fclose(f);
    if (linenum != which+1) {
        logit("WARNING: line %d disappeared in %s, giving up",
            which, _PATH_DH_MODULI);
        return (dh_new_group_fallback(max));
    }

    return (dh_new_group(dhg.g, dhg.p));
}

Note that this is all from a cursory glance at the source code. If there are other issues that may occur down the line for reasons I can't predict caused by a large file, the upper limit may be smaller. I don't see any reason to think it would be, though.


Clarification on Cipher Suite definition in Wikipedia Can someone clarify me the difference (or similarity) between data and message described under Cipher Suite in Wikipedia

  The key exchange algorithm is used to exchange a key between two
  devices. This key is used to encrypt and decrypt the messages being
  sent between two machines. The bulk encryption algorithm is used to
  encrypt the data being sent.

In this case, they mean the same. The messages are the data.

Symmetric ciphers are much faster than asymmetric ciphers. If asymmetric ciphers were faster, we'd simply use them for all the data exchange.

But they aren't, so instead we use the asymmetric ciphers to agree on a key for a symmetric cipher. The much faster symmetric cipher is then used to encrypt the actual conversation - the bulk of the communication.


Encryption and unique id Why not encrypt all confidential, sensitive and borderline data? Why not use a fingerprint ID system as the private encryption key? Why not use a fingerprint and/or other unique identifier such as retinal or lens scan to ID your terminal to a computer? Why not use this method of identification to identify ALL info extracting and/or entering devices attached to system (s) that are to be protected?

It seems that your question basically breaks down to two points: why not use biometrics as an encryption key, and why not encrypt everything, or at least a lot more.

Security of Biometrics

  Why not use a fingerprint and/or other unique identifier such as retinal or lens scan to ID your terminal to a computer?

Biometrics are not really all that secure. See for example these links:

iPhone fingerprint scanner hacked
reverse engineering iris scans
interesting video about biometrics hacks [in german + english translation]
Police can coerce fingerprint to unlock iPhone
wikipedia also has a list of concerns, including the concern of someone cutting of your finger to get your fingerprint. Is your data really worth this risk?

The main problem is that you cannot keep your biometric information secret, as you leave it all over the place. And once it is acquired by attackers, you also cannot change it.

There are of course other means to get a unique id that doesn't depend on you remembering a password (each with their own problems), such as smart cards, usb key cards, pufs, etc.

Encrypt by Default

  Why not encrypt all confidential, sensitive and borderline data?

Who decides what is borderline data and what is not? The easiest solution would be to just encrypt everything. But there are problems with encryption:

work: someone has to set this up
speed: encryption takes time
recoverability: it is a lot easier to recover unencrypted data from failing storage than to recover encrypted data from it
security concerns: if there is a backdoor in your encryption program or if your system is compromised the encryption is useless, but the other points in this list still matter

Why should someone take on these additional issues if their thread model doesn't really call for encryption? (note that I'm all for encryption, but other people will consider these points)

But it seems that there is a move to encryption by default. It seems to be enabled by OS X Yosemite and Windows 8.1, and self encrypting drives do exist.


What to do when iPhone is successfully phished My girlfriend watched "some" pages on her iPhone and facebook.you-won.com page appeared. She didn't know how to get rid of that JavaScript alert, so she clicked OK. After that she closed the page, and sent me the link with message "what is that".

I also clicked that link she sent. In Safari I found out, that it is some phishing page, so I closed it by restarting Safari on my iPhone and before the page loaded I quickly opened "panels" and left-swiped to close that page (all before the page loaded and that JavaScript alert appeared).

Because I think it's a phishing attack that is trying to steal your ID, I have 2 questions:

What can I do with HER iPhone (is restore enough to get rid of everything that could be downloaded? When she clicked OK?)
What can I do with MY iPhone? (I restored and recovered last backup from last week - this "page" appeared today, is it enough that I didn't click OK?).

I have my work "exchange" account on the iPhone, do I have to worry?
I have apps that are linked to my credit account (apps from my bank), do I have to worry?
I have credit card information saved in the App Store, do I have to worry?

She has nothing on her phone, just Facebook and some free games, so she is without problems I guess when I recover her iPhone.

Anyway none of those devices are jailbroken. Both iPhones have their original and newest iOS.

From the scenarion you describe, she rather has been a victim of a drive-by download attack that leads to installing -in most cases- adware or spyware but this attack can be even more dangerous depending on the malware that has been installed.

This attack uses the browser vulnerabilities or the browser's plugins vulnerabilities using mainly malicious obfuscated JavaScript code.

The attack can be triggered passively by a simple visit to a given webpage as it happened for example on 2011 to Amnesty International's homepage where lot of visitors got infected by simply reading articles on their homepage.

In an other scenarion, the attack needs the visitor to be active (which is the case of you describe here): the visitors sees pop-up windows that a simple click on the OK, Cancel or even Exit (X) button will trigger the attack.


Difference between information flow control, data flow integrity, and tainting The three techniques/concepts are frequently mentioned in recent academic security papers.

But what are the similarity, difference and relation between them.

Below is my very shallow understanding:

All of them involve labels, which are used to indicate the sources or types of the information.

Tainting is a simple form of information flow control. It only has 1 bit of information for each byte/word: tainted or untainted.

Could someone provide more insights into the question?

Information flow control is a broad concept, but the crux of it is that one can attempt to increase the security of a process by identifying which parts of memory it should legitimately modify, and then comparing that to which parts of memory it actually attempts to modify. This can be as broad or granular as you like: you could consider Code Access Security as a very board form of IFC, or even something as simple as file permissions and auditing. More commonly, though, IFC is applied to code at compile/link time and enforced in the generated assembly (or in the language runtime if the program is JIT-based). This can also, more broadly, be applied to cases such as information leakage, where you want to understand how a sensitive piece of information makes its way through the system.

Taint analysis is a mechanism by which some aspects of IFC can be implemented. In order to produce the whitelist of legitimate memory sections that an operation is expected to touch, the compiler assesses the code for what variables are read/written, which functions are called, and what code paths are expected to be followed (e.g. if a method is called with a static value, it can infer that certain branches must always be taken / not taken). This list can be considered to be a list of entities which are tainted by the operation. In a more broad case, taint checking can also be used as part of code analysis techniques where sources (i.e. locations where untrusted input arrive from) can be mapped against drains (i.e. locations where security-relevant operations occur), such that each source has a list of tained drains, and each drain has a list of sources from which it can potentially be tainted - this is commonly demonstrated by considering a case where URL value (source) might reach a SQL query (drain), resulting in SQL injection.

Data flow integrity is simply a term used to describe whether or not an application under IFC protection has strayed outside the expected flow. When the program runs, it is instrumented in some fashion in order to ensure that each instruction or set of instructions does not violate data flow integrity, i.e. the values which were expected to be untainted by the operation have remained so.