Can websites track the tabs you open while logged into their website? If I am on chrome and am looking up a product on Amazon on tab A, can they tell what I search if I open a tab B while tab A is still open? Should I use a new chrome or another browser window to increase security? My thought is that they can only tell if you switch away. Right?

Amazon can confidently tell what you you're looking at on another tab if the site you are looking at is affiliated with or is Amazon themselves.

This can be achieved through cookies, browser fingerprinting, and IP address matching, probably along with some other methods.

Amazon can also tell if you leave focus of your tab to view something else - see this stackoverflow answer.

They cannot tell the contents of or what you are searching on another tab if that site is not affiliated with / sending that information to amazon voluntarily.

You can prevent amazon from being able to see what you're searching on an Amazon website or website that is actively sending information to Amazon in tab B by using a separate browser with a different fingerprint, cookies, and IP address (through a proxy or VPN).


Is DDoS a specific type of ALDoS In a very broad terminology:

I understand Application Layer Denial of Service (ALDoS) to be a 1 machine on 1 machine attack.

I understand Distributed Denial of Service DDoS (DDoS) to be a 2 or more machines on one machine attack (usually a thousand machines attack one machine).

If we go broad enough, even operating systems are computer applications.

These are my conclusions as a non IS expert who tried to read and listen to conversations. I might misunderstood anything but I just want to know if this broad distinction is enough accurate.

Distributed Denial of Service Attacks could be on the application layer (and thus also Application Layer Denial of Service Attacks) but they are usually not. Most DDoS attacks are at the network and transport layer, i.e. they saturate bandwidth or they exhaust resources of the target system like in case of SYN floods.


Is it safe to enter passwords if I use a local server? I have a website that uses https:// out "in the wild".  On my local machine I have my development site.  When I enter usernames and passwords locally unencrypted to my local server is there any security risk?

The only possible risks I can think of are things that may compromise either:

Your network - If an adversary is present in your local network, then any unencrypted traffic is trivially sniffed, including your password.
Your endpoints - If either the local server or the local client are in an adversary's control, your network traffic is at risk. But at this point you probably have bigger issues to worry about (banking, sensitive documents etc.).
Software on the local server - If you are using any 3rd party software that is malicious* you are in trouble, since it has access to the server machine. Perhaps this is a special case of (2) but I'll mention it anyway.

*Edit: I realized that some 3rd party code may send data outside your network for non-malicious purposes which will nonetheless expose your information, although no example comes to mind.


Port Scanning Host that has Rate Limiting Enabled I am trying to enumerate on of my lab machines. It seems that it has rate limiting enabled since I am getting blocked after the first few probes.

I need to scan the whole 65535 tcp ports. I tried nmap with "--defeat-rst-ratelimit" option and tried Unicornscan also but non of them works for me.

Any idea how to deal with such situation ?

The --defeat-rst-ratelimit option works around rate-limiting of the target's responses on closed ports by allowing inaccuracies in differentiating between closed and filtered ports. It does not affect packet rates or open port detection.

In addition to rate-limiting the TCP RST and ICMP Port Unreachable messages, a host with an adaptive firewall can detect a port scan and firewall the source address for a time. Nmap does not have a native way to detect and correct for this kind of behavior. Instead, you should try to avoid hitting the thresholds that trigger a firewall response. This will drastically increase your scanning time, but will improve accuracy. Here are some useful options:

-T - Setting a conservative timing template will help slow the scan to acceptable levels. -T1 would be a good place to start for an aggressive firewall. -T0 is incredibly slow.

--max-retries - Nmap may continue to try to get a response from filtered (firewalled) ports in case a packet was dropped. Setting this to 0 will prevent this behavior, but you may miss some open ports if there is any packet loss.

-sT - Using TCP Connect scanning will avoid firewalls and IDS that detect the odd SYN, SYN/ACK, RST behavior of the default TCP SYN scan.

-p and --top-ports - The fewer ports you scan, the less likely you are to set off an alert. If you are only interested in a few ports, only scan for those.

This list is vastly incomplete, and Nmap scan tuning is very complex. Your best bet is to read the documentation in order to fully understand the behavior of Nmap and your target.


Vulnerability scanner inside AWS I have three VPC's within AWS and I want to run an automated Nmap scan on all three VPC's every few weeks to make sure nothing has been opened, added, etc. What would be the best way to achieve this?

You might try a network monitoring solution like OpenNMS, Zenoss, Observium, or NeDi.

They will do more than just discover new systems and open ports.


mod_security : affordable rule sets I'm looking for practical advice on the OWASP rule set for mod_security. I've heard it has many false positives, and wondering if people have successfully applied it?

I can't afford the TrustWave and my first few interactions with Atomicorps GotRoot rules has not been positive so I'm exiting my options.

Are there any other rule set providers?

Though I've not used them myself, another ruleset is produced by Comodo. I've used a number of their products over the years and they seem OK to deal with.

In addition, you can use the free tier of Cloudflare to add security to your website. I've been using it on both my main sites since they introduced the new facilities towards the backend of last year and it seems pretty good. My sites are faster, I get some analytics and they have blocked a number of potential attacks. Their are paid tiers that give you more control as well. You could use both if you wanted to.


Is the macOS Universal Clipboard secure? Since the introduction of Universal Clipboard on Apple's operating systems, I've found myself increasingly relying on it to paste passwords and authentication codes from my MacBook to my iPhone and vice-versa. I use a password manager, and on my work laptop, which is connected to my iCloud but doesn't have the same password manager installed, I often find myself copying the password on the iPhone and pasting it on the MacBook. In the case of two-factor authentication codes, the need is even bigger becasue I only have Google Authenticator on my iPhone.

Is it secure to do paste passwords using the Universal Clipboard (via Bluetooth, essentially) between an iPhone and a Mac or vice-versa?

The specific encryption algorithm used by the Universal Clipboard feature has not been disclosed but I believe that all Bluetooth connections are encrypted (on some level) by default1. Read this answer to learn a little more about possible attack vectors: Is Bluetooth 4.0 traffic encrypted by default/design?. I don't know the exact implementation details of Universal Clipboard are but what I can say is that Universal Clipboard data is not uploaded to iCloud, it stays local to your devices2. That means that Apple can't see what you are copying and pasting.

See also this answer to the same question when it was asked previously: Universal clipboard iOS10 and macOS. How secure?

Footnotes:

1: Is Bluetooth 4.0 traffic encrypted by default/design?

2: http://arstechnica.com/apple/2016/09/macos-10-12-sierra-the-ars-technica-review/4/#h3


How am I identifiable when connecting to a site and is it possible to be anonymous? When I visit a website, they get information about me such as IP address, country etc.

What are other ways/other information with that they can identify me/my connection?
How can I change/mask this information?

I know that proxy helps, but does it really works and they cant see my IP address?

First of all, they don't get your country. Although they can make a connection between an IP-Adress and a location through Geo-IP databases.
These are fairly accurate with most of the IPv4 Addresses.

Other things to track you are for example cookies and other information sent by your client. Panopticklick lists them in a nice readable form. ( https://panopticlick.eff.org )
Remember, apart from the things your client transmits they only see your IP-Adress and your request.

Yes a Proxy hides your IP from the final destination, but the proxy can still make the connection between the requests and your IP. And for most ISP the IP-Adress is not really uniquely as the assign them dynamically or even NAT all your requests.
So your IP is not really the problem if you want to protect against tracking from a website.

But the bigger problem is that your client still send's a lot of data, which can still uniquely identify you. The TOR Project tackles this problem by distributing a Browser-Bundle which is configured not to send these informations or delete them after restart because some websites need these informations to work properly.
So every Tor Browser looks the same and can't be distinguished after a browser restart.
Two of the main things to do is deactivate cookies and javascript as they are responsible for most of the additional data sent to the server. But the Tor-Browser Bundle is a good example how to configure a browser to be as least identifiable as possible.


Security and Veracrypt I have a few questions about Security and Veracrypt and hope you can clarify it for me.

I don't want the VeraCrypt hidden volume I created to be damaged. If I mount the hidden volume and transfer files there'd no damage, and if I enable the option 'Protect hidden volume against damage caused by writing to outer volume ' In the Mount Options dialog window, and write to the outer volume, there is no damage to the hidden volume, is that correct?
if someone has access to a Veracrypt encrypted flash drive, they wouldn't be able to mount or write information to it, and BadUSB, flashing malware into the firmware wouldn't be possible?
The only possibility would be to physically open up the flash drive and insert something into it? How likely is that to happen by someone who isn't the government and how much it would cost?
I assume that it would be different for a PC with an encrypted hard drive as they would be able to flash malware into the firmware if the BIOS isn't password protected, but what if the BIOS is password protected but you can still use the multi device boot option and boot a Linux operating system from a flash drive? (I know that PC does that). Does that mean that they could flash something into the firmware? How do I test if it's possible on that PC?
If four isn't possible, the only possibility would be again to open up the PC and insert something into the hardware, is that correct? How likely is that to happen by someone who isn't the government and how much would it cost?
Is there really no way to check if they inserted something into the firmware or to check if they inserted something into the hardware? How do you keep your information safe if your PC or flash drive could be compromised with no way to check if it has been compromised, aside from getting a new machine?

Please answer as much of it as you can, it's alright if you don't know all of the answers. Thanks

That's quite a lot of questions! Honestly though, I think your biggest issue is that you have not defined a threat model. You need to understand your adversary, their capabilities, the value of your assets, etc. It's far more likely that someone will simply plug in a hardware keylogger than it is that they will physically open your computer and replace your BIOS. Attackers will always choose the simpler attacks over the more sophisticated ones, and your adversaries are no exception.

Encryption cannot protect against an attacker who has unrestricted physical access to the device doing the encryption. This is not a limitation of encryption itself, but a limitation with how it can be used. VeraCrypt and similar encryption utilities can only provide data-at-rest security which means that, when the system is powered off and all an attacker has is the raw encrypted data, they will not be able to decrypt it without the key. Make sure your system is attended and physically secure.

  I don't want the VeraCrypt hidden volume I created to be damaged. If I mount the hidden volume and transfer files there'd no damage, and if I enable the option 'Protect hidden volume against damage caused by writing to outer volume ' In the Mount Options dialog window, and write to the outer volume, there is no damage to the hidden volume, is that correct?

That is correct. If you enable "protect hidden volume", then you can write to the outer volume safely. If you are forced to give up your key under duress, you would only provide the outer volume key and not both, which would cause any writes to corrupt the hidden volume. This is unavoidable.

  if someone has access to a Veracrypt encrypted flash drive, they wouldn't be able to mount or write information to it, and BadUSB, flashing malware into the firmware wouldn't be possible?

Encryption does not block writing, but it does mean that the data that is written will appear as gibberish when you decrypt it. As for flashing firmware, encryption does not prevent that. Firmware is kept separately on the flash drive and is not and cannot be encrypted by VeraCrypt.

  The only possibility would be to physically open up the flash drive and insert something into it? How likely is that to happen by someone who isn't the government and how much it would cost?

It would be far easier to modify the firmware, but if the drive does correctly disable writing to firmware, then it would be possible to physically modify the firmware chip. No one can tell you the likelihood of this happening, but the cost would be extremely low. Note that modifying the flash drive alone is incapable of circumventing encryption.

  I assume that it would be different for a PC with an encrypted hard drive as they would be able to flash malware into the firmware if the BIOS isn't password protected, but what if the BIOS is password protected but you can still use the multi device boot option and boot a Linux operating system from a flash drive? (I know that PC does that). Does that mean that they could flash something into the firmware? How do I test if it's possible on that PC?

The BIOS password does not protect against firmware modification. See this answer.

  If four isn't possible, the only possibility would be again to open up the PC and insert something into the hardware, is that correct? How likely is that to happen by someone who isn't the government and how much would it cost?

It would be easier to modify a PC because it is larger and has more components. It would be very cheap, but again, no one can tell you how likely that scenario is for your particular threat model.

  Is there really no way to check if they inserted something into the firmware or to check if they inserted something into the hardware? How do you keep your information safe if your PC or flash drive could be compromised with no way to check if it has been compromised, aside from getting a new machine?

It is possible to verify firmware, but it can be complicated to set up. I explained how this can be done on an answer to another question. At the bottom of the answer are a list of further resources.


Is howsecureismypassword.net safe to use? Is it safe to enter my real passwords to test them?

I mean, are the entered passwords being recorded/transmitted to someone else?

It's very difficult to know for sure.

It appears that this website uses a client-side script to check the password, without sending anything to the server. As such it seems it's safe to use.

However, knowing that requires a certain amount of technical knowledge. At least, it requires to know how to check what a script is doing using Firebug or developer tools.

Here there doesn't seem to be any network activity, but:

A later version of this service could change its script without you noticing.
There could be awkward conditions that cause it to send a password, it could be a bug or a "feature" whereby it would record a league table of the hardest passwords it has found (that would be a stupid idea from an honest site, of course).
This website doesn't use HTTPS, so a MITM attacker could potentially replace this script to make it send the data somewhere (perhaps less likely, but possible in principle).

In general, it's a bad idea to use this sort of service precisely because it's very difficult to know what it's doing in the general case (especially for non technical users).


Is a VM safe to run a simple virus on? I just made a very simple batch virus that runs itself and runs on startup. I want to test it because I want to send it to a YouTuber who films himself running these viruses on a Virtual Machine.

The question is, how can I make the Virtual Machine safe for running this without going to my actual computer? Also, since a VM uses RAM from the host PC, how to make it so that the RAM is un-affected by this virus?

(The Virus Runs itself 5 times and also copies itself to the users Documents Folder, Desktop, and other places creating a lot of lag.)

I have absolutely no intention of spreading the virus to the public.

The default settings for most VMs will be sufficient for keeping everything isolated, that's what they're designed for.

The specific settings might be a little different depending on what software your're using, but here's a few things you can check in your VM's settings to keep your computer safe:

Disable file sharing, shared clipboard, and Drag'n Drop
Set a cap for memory and processor usage, and virtual hard drive size
Make sure your network settings are set to disconnected or NAT
Make sure all your serial and USB ports are disabled/ not shared
Check that printers and other wireless devices associated with your PC aren't shared


"Optimal" Web Server SSL Cipher Suite Configuration Over the last couple of years there have been a number of changes in what would be considered an optimal SSL cipher suite configuration (e.g. the BEAST and CRIME attacks, the weaknesses in RC4)

My question is, what would currently be considered an optimal set of SSL cipher suites to have enabled with the following goals.

Provide the most secure connection possible, including where possible Perfect Forward Security and avoiding known weaknesses.
Provide compatibility with a wide range of commonly deployed clients including mobile devices (e.g. Android, iOS, Windows Phone) and desktop OS (including Windows XP/IE6)

The most secure setup doesn't depend only on ciphers, but also on the tls-version used. For openssl, tls 1.1/1.2 is preferred. BEAST and CRIME are attacks on the client and are usually mitigated client-side, but there are server-side mitigations too:

CRIME: just disable ssl-compression; that's it
BEAST/Lucky13: just use TLS 1.1, no SSLv3 and no RC4, see Is BEAST Still a Threat? (Ivan Ristic)
BREACH: works only, if some conditions are met, see breachattack.com; easy and always-working mitigation would be to disbale http-compression (gzip)

For a perfect setup: SSL always impacts performance on a high level, RC4 and other fast cipher-suites might still be ok for static content, esp. when served from your own cdn.

A nice guide to understanding OpenSSL is OpenSSL Cookbook with detailed explanations also on PFS, cipher-suites, tls-version etc. pp. there are 2 blogposts that explains PFS and practical setup:

SSL Labs: Deploying Forward Secrecy
Configuring Apache, Nginx, and OpenSSL for Forward Secrecy

cipher-suites-suggestions to enable PFS also on older clients:

# apache
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 \
EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 \
EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"

# nginx

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 \
EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 \
EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";

For a detailed nginx/ssl-manual I'd like to direct you to this Guide to Nginx + SSL + SPDY.


Maximum tries for 2FA code? I am building a website and I am implementing two factor authentication (2FA). The second factor will be a random 6 digit code like those from Authy. This site will store very confidential information.

I am considering limiting the amount of tries a user gets to fill in their 2FA code before locking them out. This to prevent brute forcing. But what amount of tries is reasonable? Or should there be a temporary lockout, since 2FA codes rotate and the attacker will not gain anything from it?

Many people falsely assuming that because the code rotates often, it is safe from brute force. This is not the case. If we assume 100 attempts per second and a code that is valid for 30 seconds, an attacker has 100*30 = 3000 guesses before the code rotates, this has a 3000 / 10^6 = 0.3% chance of success. This may seem low but this is only for 30 seconds, an attacker can try again for subsequent codes. For a 50% chance of success, they need only try for ln(50%) / ln(99.7%) = 230.7 30 second periods, or about 2 hours.

If you're not sure why rotating codes doesn't solve this, try thinking of it this way: an attacker can guess the range 000000 to 002999 for each code, and a code has a 3000 / 1000000 = 0.3% chance of being in that range, so after generating many codes there is a good chance that one will eventually fall in that range.

If you rate limit attempts to 1 every 5 seconds, it becomes ln(50%) / ln(99.9994%) 30 second periods, about 40 days. This still may not be good enough for a high value account, so I would definitely recommend additional measures to prevent brute force. What these measures should be though is harder to answer, as stated in the comments completely locking an account due to failed second factor attempts may allow DoS, and in general could be frustrating for users. It may be sufficient to log each attempt and warn the user to change their password if it passes a certain number of attempts per minute for the past day or so.

The Math

Let s be the chance of success for a single 30 second period
Let n be the number of 30 second periods
Let t be the total chance of success over all periods

If you have s chance of success, then you have 1 - s chance of failure. If you try multiple times, you can multiply the chance of failure for each try to get the total chance of failure, so (1 - s)^3 is the chance of failing with 3 tries, and 1 - (1 - s)^3 is the chance of succeeding in at least 1 of 3 tries. This allows us to come up with the following equation:

t = 1 - (1 - s)^n

Then we can solve for n given s and t:

(1 - s)^n = 1 - t
ln( (1 - s)^n ) = ln(1 - t)
n * ln(1 - s) = ln(1 - t)
n = ln(1 - t) / ln(1 - s)

So for t = 0.5 and s = 0.003:

n = ln(1 - 0.5) / ln(1 - 0.003)
  = ln(0.5) / ln(0.997)
  ≈ 230.7

If you want to know how long it would take an attacker to have a 99% chance of success with 6 tries per period (1 every 5 seconds), s = 6/1000000 = 0.000006 and t = 0.99, giving about 767,526 periods or 266.5 days. For a 1% chance at the same rate t = 0.01, which gives about 1675 periods or 14 hours.


How can I detect a MITM when the communication partner is in on it? I was thinking about a host computer having a hardware TPM (Trusted Platform Module), with which I can get trustworthy information about the platform (first and foremost, that I am not in a virtual machine).

Then I thought, what would happen, if I (a program of mine) was started in a VM and wanted to ask a (then virtual) TPM the same questions. Presumably I could try to get its certificate, based on the Endorsement Key, that only manufacturers like Intel can provide. A virtual TPM can't have something like this.

But: What if the vTPM works together with the hTPM, trying to make me think that I am not in a VM?

Can all the identifying information requests simply be passed through to the hTPM and the answers given into the VM to my program?

I think my question is a bit general and could become more specific, with the TPM at play, but:

How can you detect or circumvent a MITM, when he and the communication partner are on the same team?

If your communication partner is on the same team as the MitM, it's no longer a MithM.  There is no secret your partner could know that they couldn't share with the MitM.  Similarly, you have no way to prevent your partner from simply relaying the information after you exchange it.  If your partner can read it, they can pass the information to the MitM after the fact.

This is why trust is important in secure communications.  When you are talking to another system, you have to have trust in who you are talking to and how they will behave with it.  There are many different ways to attempt to establish trust, but it's fundamentally on you to decide if a communication is secure enough or not based on what trust information is available.


Can a TCP connection with a VM be "escaped from" to reach the host? Possible Duplicate:
  How secure are virtual machines really? False sense of security?

If a VM (e.g. VirtualBox) on host A opens a TCP connection to a hacker Z, are there any possible vulnerabilities in e.g. the VM's NAT that would allow Z to communicate with A itself or other devices on its network?

Can a host running a VM be compromised because of malicious access a hacker obtained on the VM?

Back story:
I was watching the show 'Person of Interest' where a protagonist used a virtual machine to hack somebody, but it was a "honeypot" (possible incorrect usage?) and instead the hacker got into all the systems on the protagonist's network.

Now I know this is fiction, and that being able to connect to a machine does not necessarily allow you to hack it, but is there a core of truth in this?

Yeah, it's definitely a possibility but only if the host of the VM is having a security vulnerability and also left configured improperly.

A good example of this, is if you run backtrack in a VM and then ping the VM's IP from your PC you can reach it.

VMs can have different types of links to a router. It can be:

Physical (Another Ethernet Card or USB Wifi)
Bridged to Host (Connect via the host)
Replicating Host Connection

Depending on the exact type, the method may change but fundamentally the VM to access the internet has to be on your LAN. Now regardless whether it's on the router directly LAN or an interval LAN between the host and the VM, it still can ping you and you can ping it in normal communication.

So unless the host has a good firewall, etc that blocks these kind of connections, it can be hacked into through the VM via this common network interface in theory. Obviously, it's not very practical in terms of amount of effort to use the VM as a pivot point to find and then exploit in the host but it can be done.

Solution:

Have a firewall to monitor inter-VM traffic, etc. Don't use the same
Internet connection on the VM, using a separate say USB Internet   Modem would keep you on different networks.

In a nut shell: VMs are mostly contained and secure on their own, but it is you who connects the host and the VM on a common network, i/o device, etc. Don't do that and you'll be practically quite safe.

A good potential option is remove all non-critical components sharing from the VM and use shell access to run the VM. Chances that a program can bypass the memory limit or so is not likely, not likely at all.

Point is, anything programmable can be hacked given enough time and effort.


SQLMap: Testing implicit parameter URL I'm pentesting a client's website but could not find a syntax to tell SQLMap that the variable it should test doesn't have an explicit name in the URL.

I've already tried the MVC method that says to use * (asterisk - did not work), but this is a little different. Instead of:

http://web.site/index/aksjdnas

it is in the form:

http://web.site/index.aspx?aksjdnas

with aksjdnas the value of the parameter, not the name of it. SQLMap keeps using it as the parameter name. Has anyone seen a solution to this problem?

Edit:

I really cannot understand why this question was put as off-topic as this is an "on-topic" question as stated in the help center - security tool and i'm not asking anyone to break anything for me.

I'm merely asking for help with syntax in a security tool. There are various other questions about this problem here on SE IS, and none of them has been closed. I've started a new question because the solution proposed there hasn't worked for me, as there are some differences in the url format.

Confirmed that it works as intended with an asterisk, using the sqlmap from Backtrack 5r2, but should behave the same with Kali. The following example doesn't work as I'm running it against a static html file, but it shows the injections occuring at the correct place.

First I saved the request to a file and added the asterisk:

root@bt:/pentest/database/sqlmap# cat trq
GET /?arg1*=test123 HTTP/1.1
Host: localhost
User-Agent: Mozilla/4.0

Next, invoke sqlmap with the -r parameter:

root@bt:/pentest/database/sqlmap# ./sqlmap.py -r trq

    sqlmap/1.0-dev-25eca9d - automatic SQL injection and database takeover tool
    http://sqlmap.org

[!] legal disclaimer: usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Authors assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting at 01:30:27

[01:30:27] [INFO] parsing HTTP request from 'trq'
custom injection mark ('*') found in '-u'. Do you want to process it? [Y/n/q] Y

[01:30:32] [INFO] testing connection to the target url
[01:30:33] [INFO] heuristics detected web page charset 'ascii'
[01:30:33] [INFO] testing if the url is stable, wait a few seconds
[01:30:34] [INFO] url is stable
[01:30:34] [INFO] testing if URI parameter '#1*' is dynamic
[01:30:34] [WARNING] URI parameter '#1*' appears to be not dynamic
[01:30:34] [WARNING] heuristic test shows that URI parameter '#1*' might not be injectable
[01:30:34] [INFO] testing for SQL injection on URI parameter '#1*'
[01:30:34] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[01:30:34] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause'
[01:30:34] [INFO] testing 'PostgreSQL AND error-based - WHERE or HAVING clause'
[01:30:34] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause'
[01:30:34] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLType)'
[01:30:34] [INFO] testing 'MySQL > 5.0.11 stacked queries'
[01:30:35] [INFO] testing 'PostgreSQL > 8.1 stacked queries'
[01:30:35] [INFO] testing 'Microsoft SQL Server/Sybase stacked queries'
[01:30:35] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'
[01:30:35] [INFO] testing 'PostgreSQL > 8.1 AND time-based blind'
[01:30:35] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind'
[01:30:35] [INFO] testing 'Oracle AND time-based blind'
[01:30:35] [INFO] testing 'MySQL UNION query (NULL) - 1 to 10 columns'
[01:30:35] [INFO] testing 'Generic UNION query (NULL) - 1 to 10 columns'
[01:30:35] [WARNING] using unescaped version of the test because of zero knowledge of the back-end DBMS. You can try to explicitly set it using the --dbms option
[01:30:35] [WARNING] URI parameter '#1*' is not injectable
[01:30:35] [CRITICAL] all parameters appear to be not injectable. Try to increase --level/--risk values to perform more tests. Also, you can try to rerun by providing either a valid --string or a valid --regexp, refer to the user's manual for details

[*] shutting down at 01:30:35

Ok, looks like it tried some injections, lets confirm by looking at the web server log:

root@bt:/pentest/database/sqlmap# tail /var/log/apache2/access.log
127.0.0.1 - - [24/Feb/2015:01:30:35 -0500] "GET /?arg1%'%20UNION%20ALL%20SELECT%20NULL--%20=test123 HTTP/1.1" 200 302 "-" "Mozilla/4.0"
127.0.0.1 - - [24/Feb/2015:01:30:35 -0500] "GET /?arg1%'%20UNION%20ALL%20SELECT%20NULL,%20NULL--%20=test123 HTTP/1.1" 200 302 "-" "Mozilla/4.0"
127.0.0.1 - - [24/Feb/2015:01:30:35 -0500] "GET /?arg1%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL--%20=test123 HTTP/1.1" 200 302 "-" "Mozilla/4.0"
127.0.0.1 - - [24/Feb/2015:01:30:35 -0500] "GET /?arg1%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL,%20NULL--%20=test123 HTTP/1.1" 200 302 "-" "Mozilla/4.0"
127.0.0.1 - - [24/Feb/2015:01:30:35 -0500] "GET /?arg1%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL,%20NULL,%20NULL--%20=test123 HTTP/1.1" 200 302 "-" "Mozilla/4.0"
127.0.0.1 - - [24/Feb/2015:01:30:35 -0500] "GET /?arg1%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL--%20=test123 HTTP/1.1" 200 302 "-" "Mozilla/4.0"
127.0.0.1 - - [24/Feb/2015:01:30:35 -0500] "GET /?arg1%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL--%20=test123 HTTP/1.1" 200 302 "-" "Mozilla/4.0"
127.0.0.1 - - [24/Feb/2015:01:30:35 -0500] "GET /?arg1%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL--%20=test123 HTTP/1.1" 200 302 "-" "Mozilla/4.0"
127.0.0.1 - - [24/Feb/2015:01:30:35 -0500] "GET /?arg1%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL--%20=test123 HTTP/1.1" 200 302 "-" "Mozilla/4.0"
127.0.0.1 - - [24/Feb/2015:01:30:35 -0500] "GET /?arg1%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL,%20NULL--%20=test123 HTTP/1.1" 200 302 "-" "Mozilla/4.0"

Log file confirms that the injection was placed where the asterisk was and not assigned to the parameter value.

Edit, addressing the specific example given:
./sqlmap.py -u 'http://localhost/test.php?argv2*'
Also injects correctly in the log:

root@bt:/pentest/database/sqlmap# tail /var/log/apache2/access.log
127.0.0.1 - - [24/Feb/2015:01:40:57 -0500] "GET /test.php?argv2%'%20UNION%20ALL%20SELECT%20NULL--%20 HTTP/1.1" 200 40 "-" "sqlmap/1.0-dev-25eca9d (http://sqlmap.org)"
127.0.0.1 - - [24/Feb/2015:01:40:57 -0500] "GET /test.php?argv2%'%20UNION%20ALL%20SELECT%20NULL,%20NULL--%20 HTTP/1.1" 200 40 "-" "sqlmap/1.0-dev-25eca9d (http://sqlmap.org)"
127.0.0.1 - - [24/Feb/2015:01:40:57 -0500] "GET /test.php?argv2%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL--%20 HTTP/1.1" 200 40 "-" "sqlmap/1.0-dev-25eca9d (http://sqlmap.org)"
127.0.0.1 - - [24/Feb/2015:01:40:57 -0500] "GET /test.php?argv2%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL,%20NULL--%20 HTTP/1.1" 200 40 "-" "sqlmap/1.0-dev-25eca9d (http://sqlmap.org)"
127.0.0.1 - - [24/Feb/2015:01:40:57 -0500] "GET /test.php?argv2%'%20UNION%20ALL%20SELECT%20NULL,%20NULL,%20NULL,%20NULL,%20NULL--%20 HTTP/1.1" 200 40 "-" "sqlmap/1.0-dev-25eca9d (http://sqlmap.org)"


Difference between Web App Pentesting and Web App Security Audit I'm having a hard time drawing the line between Web App pentesting vs a Web App Security Audit.

For instance, OWASP Testing Guide could be used for both of those cases.

Let's say the pentester and the auditor are working inside the enterprise: they therefore have access to the same resources ie architectures, documentation, etc.

I understand that for a pentester, exploiting a vulnerability is the ultimate goal. But, it looks like the process of discovering the vulnerability for both the pentester and the auditor is the same.

Consequently, the auditor job may look like a vulnerability assessment.

I was debating whether to answer since it may be a matter of opinion to an extent...

Some clients like some names other clients like others. The purpose can be the same and the result as well. So... it varies.

I've done penetration tests against web applications and black/grey box style audits (with and without access to the developer team for questions, etc) and the methodology and the output are the same.

In either case you test the application following a certain methodology to determine whether it is vulnerable to attack, which attacks, to what consequence and how to mitigate these issues. The result is usually a report with a technical risk assessment of a list of vulnerabilities detected including recommendations for mitigation, together with a discussion of the results of some sort.


What security settings are likely used in Obama's Blackberry? It's widely publicised that Obama has a blackberry, but it isn't clear to me what security settings are employed by the NSA or what private businesses can learn from his configuration?

What is known, or what can you infer about a secure Blackberry deployment of such a critical nature?

From what I've seen, he simply isn't allowed to use it for official purposes.  He has to use a secure device instead.

http://www.intomobile.com/2009/01/21/obama-cant-give-up-his-blackberry-keeping-it-for-personal-use/


PCI DSS Storage Definition - BizTalk Consideration I am having trouble locating a clear PCI DSS definition for "Storage" and wether or not Microsoft BizTalk could be considered within that definition. Could an overloaded BizTalk server or failed orcestration constitute storage even if only momentary?

I doubt you will find a specific definition of storage from the PCI DSS since there are just so many different ways of perceiving when data is "stored". A quick poll of 3 other QSAs around me could not reach consensus immediately if BizTalk only stores information if overloaded or even when it is operating normally. Cache files etc can all play a role even if you don't normally see or expect it.

One thing we all do agree on is that it ultimately does not matter in your scenario based on the information you provided. PCI DSS applies to all systems if it processes, transmits or stores cardholder data. Clearly BizTalk is used to Process and Transmit information at the very least. If the system has the potential to store information when overloaded, it needs to be considered and all applicable controls put in place to safeguard card holder information.


Use appstore using trusted certificate I connected my iPad to my laptop's localproxy. I also installed a trusted digital certificate in my iPad. I am now able to use all HTTPS networks through my iPad except appstore. If I disable proxy, I am able to access appstore. But when I enable proxy, I am able to browse all https sites (facebook,gmail) but not appstore. It says "Cannot connect to appstore". Please help me!

I don't know anything about the internals of the App Store, but I suspect this is a result of Certificate Pinning implemented by the App store.

This essentially means that their certificate validation won't just accept any old CA signed certificate, it'll only accept specific certificates or certificates signed by specific CA's.

This seems to be supported by the mitmproxy documentation:

  Some traffic is is protected using certificate pinning and mitmproxy's interception leads to errors. For example, Windows Update or the Apple App Store fail to work if mitmproxy is active.

It looks like there's other ways to intercept App Store traffic, but it's not as simple as proxying traffic via a MITM. It looks like it requires a jail-broken device to physically disable certificate validation: https://nabla-c0d3.github.io/blog/2013/08/20/intercepting-the-app-stores-traffic-on-ios/

Generally certificate pinning is considered good practice when the client knows it'll only be connecting to specific services and therefore can validate certificates more strictly. Unfortunately certificate pinning is far rarer in mobile Apps than it should be, especially considering users can't typically verify certificate information manually in an App like they can in a browser.


Scan multicast IP range on specific port using nmap I'd like to scan a multicast IP range on a specific port using nmap.

When I try to simply do a nmap -p 10000 239.35.0.0/16, it just responds with an error stating Strange error from connect (47):Address family not supported by protocol family

Is it even possible to scan multicast using nmap, or what am I doing wrong?

PS: For those wondering: "Why the hell does he want to scan an entire /16 ?":

I'm trying to list all active IPTV servers on the network of ISP (Deutsche Telekom) to see which ones are accessible using VLC.

Thanks

Tobias

If you asking if nMap can scan networks based on a mask then,  yes it can do so.

The details have been given here:
http://nmap.org/book/man-target-specification.html

As for the error you are getting. Some quick web searches and previous programming in Python indicates a driver error, which may be resulting from a glitch wherein nMap can resolve the hosts IP for an undermined reason.

If getting the job done is priority try an alternative approach.

Use a mask converter or maths to get the range of IPs to scan.
http://jodies.de/ipcalc?host=239.35.0.0&mask1=16&mask2=
Then, issue this command in nmap. nmap 239.35.0.0-239.35.255.254

Note: Neither StackExchange or I promote unauthorized illegal port scan of networks. This answer is merely to inform you about the capabilities of nMap.


How does malware use the Tor network How does malware use the Tor network to keep hidden services safe from takedowns

Tor can provide anonymity both to clients as well as to servers. A server using Tor for anonymity is called a hidden service. The protocol allows a client to connect to a server knowing only an identifier and never needing to know the IP. A high-level overview of this is that the server and client mutually agree on a relay designated the Rendezvous Point, which is chosen at random. The server and client then build a three-hop path and rendezvous at this aptly-named relay. They are then free to exchange data with neither side needing to know the other's IP. This can be done for any purpose, including anonymizing a C2.

See the Tor documentation for more information on exactly how this is achieved.


Is it a security risk to give read/write permissions to /Library/WebServer/Documents to my main account? The default setting is that the apache2 root-directory Documents is owned by root and I have to enter a password each time I change it.  This is why I want to give full permissions to my user account in the file information:

However, I'm not sure whether that might be a security risk since the default settings are so restrictive.

Yes it can be a security risk and can be considered as a security breach if your main account gets compromised or if you do something wrong by mistake - it differs from case to case depending on how important your project is and what you are dealing with. But if I were you, I would never use 777 permission or even something similar that anyone can easily make changes to my WebServer Directories. In other words, even if I own two Unix Users, one my X user and the other the root user, I won't give permission to X only because I'm looking for ease. On MacOS, like on Linux or any other Unix-Like OS, you can use ACLs - Access Control Lists -, you can set Attributes, or you can configure Apache in a way to have different root directories for different virtual hosts if you are going to deal with hundreds of users being in need of changing their own odds and sods inside the apache directories, but never underestimate DACs. Permissions that you mentioned are considered as DACs (Discretionary Access Control), 3 bits for the owner, 3 for groups, and 3 for others - also called staff. Anyway, I recommend you read about ACLs, I guess they will do what you need, default ACLs are used for granting/setting access control list on a specific directory to allow specific users and groups to have access right. For a quick insight on ACLs, you can use chmod with +a option to set or -a option to remove ACL. You can also you ls -le to display set ACLs. For instance:

chmod -R +a "group:_www allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" yourDirectoryORFile

ACLs are a better option - than changing permissions - that you can benefit form.

By the way, you should notice that that it is right that MacOS is safe and secure, but services including Apache, SSH, SAMBA, etc. are not secured since they are using and configured by the default state.

File and Directory permissions are one of the very basics and first permissions you will face with in Unix-Like Operating Systems. To secure your system, you really need to pay a close attention to every detail of the system depending on your purpose. Giving a full permission seems like you are deliberately providing security breaches in your system.

When it comes to Apache Server - or NGINX - you should first make sure about your directory safety. For instance in Linux, it's recommended not to disable SELinux (used for managin Mandatory Access Control, Role-Based Access Control - RBAC - and etc.), so in that case, after setting right permissions for directory and files, you can set roles and types in a deeper level of security. If it wasn't needed, everyone would use 777 - Read-Write-Execute for all Users, Groups, and Staff, so be sure there is reason why it isn't 777 by default.

And the next thing you should beware of, is your Firewall configuration and rules. MacOS is using PF since it's built on top of a FreeBSD microkernel (PF stands for Packet Filter - and IPFW stands for IPFireWall). You can use man pfctl to read its manual page and understand how you can deal with it.


Encryption app stroring the password The encryption app that we are using seems to generate the same output for the same input. That is bad right? I'm not smart enough to understand the scheme being used though.

The  header of each encrypted file has a string called "hexIdentifier" which is apparently how the app stores the password (hash?) for the encrypted files generated by the app. If we use the same password for different files, then the same HexIdentifier string is used. Does that mean that the password is stored in the file in a trivial fashion that would be easy to re

App is here: http://www.koingosw.com/products/dataguardian.php

Blowfish... I feel younger. This is an algorithm from more than 15 years ago, which is not bad in itself, but the author of Blowfish itself (Bruce Schneier) proposed an enhanced version called Twofish, back in 1998, for the AES competition. That the product claims to be "the ultimate database solution" but neglects the last 15 years of science and technology, including the AES, is not a good sign.

If using the same password for distinct files yields the same "identifier", but a different password produces a different identifier, then this "identifier" can be used to attack the password with cost sharing -- in other words, a rainbow table. An attacker could go through the expense of building the table once, because he could then apply it to every instance of a file coming from that product. This is not a bad sign, this is a worse sign.

None of this means that the password could be trivially extracted from the files (none of this excludes this possibility either), but it is sufficient to recommend not using this product.


Preventive Measure for detecting Session Fixation attacks From my understanding if i am not wrong in session fixation attacks. The attacker login into the server as a legitimate user and creates a valid session. He then the tricks the compromised user to use his session which has already been fixed. My Question is how to detect session fixation attacks one possible solution I have in my mind

Bind session identifier with source IP as this is possible with WAF like Modsecurity

The Problem with this approach it may have high false positive as client may be using a proxy server or client may be assigned a dynamic IP address that may change during session.

That's not how a session fixation attack works. The attacker must first trick the user into visiting the website using a predetermined session. For example, I could trick you into clicking a shortened link http://example.com/index.php?PHPSSIDE=BLAHBLAHBLAH. If you login to example.com now, your session will be identified by BLAHBLAHBLAH. I'd then simply use the same identifier and login to your session. Other methods include an untrusted sub-domain assigning a session cookie for another sub-domain.

If you trust your sub-domains, just configuring your web server not to use session identifiers (eg. PHPSSID) in GET or POST is enough. Pairing the session to an IP address, refreshing the identifier, and session expiry, are all also good extra layers of protection against session hijacking.

When implementing a security feature, always think about the majority of your users. Those 90+% whose IP won't change a gazillion time throughout the session, those who won't have their sessions constantly hijacked. For the other 10%, it's alright to show them a re authentication form (entering the password again) when something specious happens.


Why is 'avast! Web/Mail Shield Root' listed as CA for google.com? I just noticed something weird in my browser: the certificate for www.google.com has been issued by avast! Web/Mail Shield Root. Should I be worried? I am using avast! Antivirus so it's probably a built-in feature, but I don't know why this is happening and what the benefits/risks are.

The whole goal of HTTPS is to prevent eavesdropping so that anyone monitoring your web traffic can't see what you're sending. As useful as it is, HTTPS presents a bit of a problem to antivirus software because when you visit sites over an encrypted connection, your antivirus software cannot see what sites you're visiting or what files you're downloading, at least until the download finishes. This presents a risk because if you download a virus, the antivirus software won't know about it until the download is finished and the virus is already saved to your hard drive, allowing criminals to bypass the "live defense" features of AV by simply hosting the malware on an HTTPS site.

The solution that many antivirus programs use is to install its own SSL certificate as a root certificate so that it can essentially man-in-the-middle all HTTPS traffic to scan for malware. I'm guessing this is what avast! is doing.

Whether this behavior presents additional security issues is debatable but I don't think it's something you need to be deeply concerned about - after all, your own antivirus software is doing the man-in-the-middling, not a malicious party. If it worries, you, you can disable this behavior - go to Settings>Active Protection>Web Shield>click on "customize" and tick the box next to "Disable HTTPS scanning." If you do this, avast! won't be able to proactively block malware on HTTPS sites.


card.io & PCI DSS v3.0 I've researched for quite some time now, but I cannot find an answer to this question:

If I touch card holder data in any way, I need PCI DSS v3.0 SAQ A-EP certification, which is quite complex to get. Thus the high popularity of hosted payment pages: When using these, I only need PCI DSS v3.0 SAQ A (without EP). For a quick reference, see http://blog.spreedly.com/2014/12/18/pci-dss-v3-0-for-online-merchants/

The popular libary card.io makes it easy for the user to put in their credit card numbers, but I will always "touch" the data if I use this library, before forwarding it to some secure web service for tokenization.

Now, my understanding is that because of this, every application that uses card.io has to be certified PCI DSS 3 SAQ A-EP from 1st January, 2015, so does this mean that many applications out there may not be certified any more if they haven't upgraded to ...-EP? Or am I missing important information here?

If I touch card holder data in any way, I need PCI DSS v3.0 SAQ A-EP
  certification

No, that's not true.  If you touch card holder data, you need to SAQ B, C, or D.  The SAQ A (and A-EP) is only for merchants who "do not touch, process or store cardholder data" as per your Spreedly link.

  The popular libary card.io makes it easy for the user to put in their
  credit card numbers, but I will always "touch" the data if I use this
  library

Correct.  Use of card.io appears to make you ineligible for SAQ A or A-EP.

I say "appear" because card.io's site says "card.io does not store or transmit credit card numbers."  But that's kind of a crock - they take a picture and turn it into PAN data for your application.  Which your application must store or transmit, otherwise there was no point to scanning it in.  If you scanned a card with card.io and immediately deleted the data from memory without reading it, you'd probably still run afoul of 'processing' PAN data and be subject to the DSS.

So it's a little misleading to say they "do not store or transmit credit card numbers" without saying "but if you use us, you will be doing so, period."

  Now, my understanding is that because of this, every application that
  uses card.io has to be certified PCI DSS 3 SAQ A-EP from 1st January,
  2015

No, every merchant that uses card.io will need to be certified SAQ C or D, just as it would have had to in the past under DSS 2.0.

The only possible exception would be if you wrote and distributed a payment application that used card.io and submitted the PAN data directly to your processor over an approved A-EP hosted iFrame.  Great! You can do the SAQ A-EP!  But you'd probably have to get PA-DSS certification for  your application to make that work.  I don't think that's a good trade.

  so does this mean that many applications out there may not be certified any more if they haven't upgraded to ...-EP?

Applications don't certify under the SAQs, merchants do. Any merchant that was using card.io in the past would not have qualified for SAQ A in the past, and they won't qualify for A or A-EP now.

The real shift that A-EP represents is for merchants who, under DSS 2.0, qualified for SAQ A with non-iFrame solutions (Javascript or transparent-redirect).  SAQ A-EP draws an arbitrary and illogical line and says iFrame is more secure than those two. Merchants using Javascript or transparent-redirect will end up in a larger SAQ A-EP (139 questions) while those using iFrame can remain in SAQ A (14 questions).  That said, the line that has been drawn is so illogical that I expect to see continued redefinition moving forward.


For what do I hash user passwords with PDKDF2 when the user data is stored in the same database? I'm hashing the passwors of my users with PDKDF2 right now. A user can gain access to his account with his password. When the user is logged in he can edit his personal information and do other stuff in his account. All this will get safed to the same database. So if an attacker gets access to the database he will get all the information he would like to know without knowing the password. So why should I use PDKDF2, scrypt or bcrypt to hash the passwords?

An attacker might not have to gain access to your database to obtain the passwords of your users.

By design, data stored in a database are segregated by tables. Information like usernames and passwords should be in a different table from the user details like name and such. This is basic database schema design.

If an attacker compromises your application using techniques like SQL injections, they might be able to access only the table containing the passwords.

Even assuming the attacker manages to gain access to your entire database, there are other factors to consider. User information is not the only important thing in your application. If the attacker changes the information in the database directly, his actions would most likely be logged. This makes it relatively easy to find and fix any unwanted modifications.

However, if the attacker logs into a user account through the login page of your application, it would be difficult to differentiate what is intended and unintended access. He could cause a lot of potential damage.

In addition, many users use the same username/password combinations across multiple sites. If an attacker compromises the account information on your site, he could potentially access all the other online accounts of the user. This is bad.

Always hash your passwords.


functioning ( behavioural based ) of an antivirus I know how signatures are used to detect malware samples of already known malware and techniques to apply to use.

1.What are some of the different behavioral techniques used by antivirus/anti-malware ?

If would want to use some behavioral techniques then how to use? like in the signature base we could directly take a file and on the basis of that scan files/process/etc.

There are common ways malware works - currently quite a few are using powershell for example to call out download the payload and execute. This is normally trigger from say Word.exe calling cmd.exe has then called powershell.exe with arguments.

So detecting if a process for cmd.exe has been created by word is an indicator of potential malware activity and has a child process of powershell.exe.

Now there are quite a few common attacks that have indicators such as these listed by mitre:
https://attack.mitre.org/wiki/ATT%26CK_Matrix

Given known attack types you can detect this behaviour and respond. If you start grouping the different types of chained attacks you would expect you can determine if to a certain degree if something is malacious.
A good example of a tool that monitors for malicious behaviour is sysmon

Sysmon can be configured to only look for certain types of behavior and writes to the windows event log.

Obviously if a new attack category with new indicators this becomes a problem.
So now you also begin to determine what is normal behaviour on a system using some ai techniques so if something out of the normal occurs it can be flagged and other indicators looked at.


How to rate a CVSS Score if OS/compiler vulnerablity mitigations are highly likely but not guaranteed? Let's consider the following code in a hypothetical C library.
uint8_t size;
uint8_t buf[128];
read(untrusted_fd, &size, 1);
read(untrusted_fd, buf, size);

In the early 2000s, it would be a serious buffer overflow vulnerability that enables arbitrary code execution, a CVSS score would be high (definitely C:P/I:P/A:P). On the other hand, in 2020, modern kernels and compilers typically employ vulnerability mitigations such as NX, ASLR, or SSP. If an attacker only has limited access, and if an additional vulnerability (such as an infoleak) does not exist, such an exploitation can be nearly impossible in practice. If it's a product shipped in binary form, it may only receive a low CVSS score, such as C:N/I:N/A:P (i.e. vendor: nothing to see here, it's just a simple DOS attack).
But what if it's only a library in source-form? Sure, on nearly all modern systems, there are at least several mitigations in place that makes an exploitation difficult, but the caveat is: the library itself has no control over its execution environment, it's very unlikely, but still possible, that it would be deployed on systems with no mitigations. How should we correctly rate the CVSS score of a vulnerability in this situation?

The CIA scores are indications of the impact of a succesful exploitation. The CVSS is meant to rate the severity of the vulnerability, not the risk. So that it's hard to exploit is not sufficiently incorporated in the CVSS, and certainly not in the CIA scores.
So I think this vulnerability has CIA set to P at least. You can set access complexity (AC) to high (H) to indicate that it's hard to exploit.


Retrieve a deleted trojan by Kaspersky for analysis (on windows 7)? After installation of Kaspersky on a windows machine, several trojan viruses where discovered and deleted.
Now, I'm looking for a way to retreive those trojans deleted by kasperky. (to export them to a VM for further analysis)

If Kaspersky has given you logs of what it deleted you may be able to undelete the files. The company formerly known as diskeeper has an undelete program which should allow you to find it.

Be sure to temporarily disable Kaspersky or designate a directory that it should ignore to put the files into. Once the files are undeleted you'll need to password zip them up otherwise any time you try to move them around antivirus will want to purge them again.

All that said, unless you are an expert in reverse engineering/assembly hacking this doesn't seem like a safe thing to do.


How can I avoid my password being harvested by key loggers from internet cafes? During traveling, especially in poor countries, sometimes you are going to need to use the internet at an internet cafe and you really can't be sure whether anyone has installed anything to listen to your keystrokes.

I've been told this method, although I'm not sure if this works, but if you're at an internet cafe, one way to fool any key loggers is to avoid typing your password in one go. Instead type part of your password, then insert some random letters, then use your mouse to highlight over the random letters, and then overwrite them. This supposedly fools the key loggers into thinking your password has those random letters in it.

So just wondering, does this actually work? Are there any other better methods I could use?

if you do not trust the medium: do not enter sensitive information. typing in your password in some obscure way is just that: security through obscurity, which never works.

other than that: you might be able to achieve some level of security in such open places if the password you entered changes for the next login, see one-time-passwords. (note: '2-factor-authentification is a hybrid scheme where you know already one half of the password (which keeps constant / static) and then you get the other half by sms or any other means; that 2nd half is a one-time-password)


VPN profile working in Iphone I am using a VPN on my iphone https://itunes.apple.com/us/app/hotspot-vpn-free-secure-fast-internet/id1121846465?mt=8

Their privacy policy states that they can get data but doesn't says that will install a cert on my mobile

My assumption for VPN is

My Mobile ---> VPN ---> ANY WEBSITE I want to access

now in case of non https site, vpn server will be able to view all traffic, however incase of https site, vpn server can view traffic only if they install a custom certificate on my computer

My question is

Is my assumption for vpn working is correct ?
How do i know in iPhone if the vpn client has installed cert or not ? safari dont even let you see the certificate ?
any help in this regard will be appreciated
thanks

Your base assumption is correct, your VPN provider is very literally a MitM and can use that position to conduct all the questionable snooping and tampering an attacker can normally do. As you said, if you are making a connection over HTTP the VPN provider could easily sniff all of your traffic and data and based on their privacy policy, most likely are.

With that said, according to the following article: https://www.thesslstore.com/blog/trust-manually-installed-root-certificates-in-ios/ from iOS 10.3 and onwards, a user has to manually accept/allow a new root certificate to be installed. Therefore, it is impossible for this VPN app to install a root certificate on the device without the users permission. Which means even if they try to do it without telling you, all of your visited webpages over HTTPS will be flagged by your browser as dangerous. Alternatively if you never accept a root certificate and your browser is not warning you about HTTPS traffic's bad certificates, then you appear to be home free!

Hope it helps!


How can I be sure if a webview in a desktop app shows the real web page? When installing Postman (on Mac), you can log on using your Google account. For this, the logon view from Google is shown in a window (A kind of Webview I assume).

How can I be sure this is the real thing and the developers did not just build an own webpage that looks exactly the same? Since there is no browser bar or anything like that, I can't verify the URL.

Now I was only sure of it after typing my username and password, when Google sent me an email notifying me of the new login.

PS: This is certainly not an attack at Postman, it is just what triggered my question.

You just can´t.

You could monitor internet traffic and be sure it is loading the google page, but still not be sure if it is showing the one they loaded. And also it could be the real page and still it is keylogging what you type.

So:

1) Only type this kind of info on apps you trust;

2) Apps should probably do not require you to trust them, by letting you open the login window in any broswer you want. It is possible to do it, but probably less usable (and most users don´t care about security as much as they care about usability). Personally I would prefer apps offer that to me at least as an option, if not the default mode.


Is there a reason to change OTP code on every resend attempt? This question is about OTP codes that are used in flows like

Email verification
SMS 2fa

Usually, when you send an OTP, you want to give the user an option to resend the OTP.

Assuming the following protections are in place:

Limit the number of attempts to enter the right code (defend against brute force)
Limit the number of attempts to resend the code in a certain time window (defend against spamming the recipient)
Code has short expiration

Is there a reason to generate new OTP code on each resend attempt?
If so, is it really needed to revoke the previous codes once a resend has been made?

I have seen services, Facebook for example, who send you the same code in the resend attempts.
In terms of usability, it's better to send the same code so that if the first code did arrive late the user will not be confused about which code they should enter. But I am not sure if there are any practical security implications of that.

Limit the number of attempts to resend the code

This is the problem that needs solving. It is not a good idea to limit resend attempts. If someone needs to request a resend, how do you decide how many is ok? If there is a delay in receiving the OTPs, how does the user figure out which one is the most recent? There is a big UX issue here.

Because it's not a good idea to limit resends, you need to let the code survive a little while else you expose the user to a permanent DoS attack where someone just automates OTP requests which invalidate all codes sent previously, no matter how recently.

So to limit resends, you create a UX problem that is solved by simply letting OTPs live a little while. Once the OTP is used successfully, you invalidate it.

So, no, there is no security reason to change the OTP with every request. There are no risks in letting it live a little while, either.


Is it possible for a name server provider to hijack MX records? Let’s say:

We buy a domain from http://cheap-unsecure-domains.example.
Then in our control panel at cp.cheap-unsecure-domains.example we configure it to use the Cloudflare service.
We set some MX record at Cloudflare and point them to Google, for example.

In theory it should be possible for cheap-unsecure-domains to hijack our MX records answering them by itself instead of referring to Cloudflare. Is this correct?
If yes, is there any type of protection against this kind of attacks? Except using something like GPG.

I'm considering possible attacks on the receiving side.

Yes, your registrar can hijack not only your MX records, but your entire DNS.

Not only that - but they can then proceed to intercept mail sent to your domain, get a valid CA-signed SSL certificate for your domain, and host a site for your domain using the trusted SSL certificate.  And DNSSEC won't prevent any of this.

One of the primary functions of your registrar is to register the nameservers for your domain.  For example, if you do a whois lookup for stackexchange.com, you'll see that the registrar for stackexchange.com is eNom, LLC., and that the nameservers for stackexchange.com are hosted by Google Cloud and Amazon AWS.  So, the DNS for stackexchange.com is handled by Google Cloud and Amazon AWS.

In the example that you gave in your question, cheap-unsecure-domains is the registrar for yourdomain.example.  With cheap-unsecure-domains, you specified Cloudflare's nameservers as nameservers for yourdomain.example.  So, DNS for yourdomain.example is handled by Cloudflare's nameservers. Then, in Cloudflare's control panel, you setup your DNS records for yourdomain.example, including your A records, MX records, etc.

So if cheap-unsecure-domains wanted to intercept your mail - they wouldn't need to hack into your account at Cloudflare to change your DNS records.  They would simply change the nameservers for yourdomain.example to their own, then create MX records for yourdomain.example in their nameservers to point to their own mail servers.  Then, they would start receiving mail sent to your domain.

Interestingly, they could start receiving mail for yourdomain.example securely using SMTP STARTTLS, without even getting an SSL certificate for yourdomain.example.  They could just use their own certificate.  See https://blog.filippo.io/the-sad-state-of-smtp-encryption/.

Now, things get more insidious.  They can start receiving mail for hostmaster@yourdomain.example (or admin@yourdomain.example, or any of the other designated approved email addresses used for SSL domain validation).  Then, they can request a SSL certificate for yourdomain.example from a trusted CA, and when the CA sends the verification link to hostmaster@yourdomain.example, they'll receive it, and the CA will issue the certificate.  Now, they can setup an A record for www.yourdomain.example, and run a site with a valid certificate for www.yourdomain.example.

At this point, you might be wondering - can't this type of attack be prevented using DNSSEC?  The answer is no.  DNSSEC records are stored in the DNS for the domain.  When the registrar changes the nameservers for yourdomain.example to their own, the DNSSEC records that you created for yourdomain.example are gone, along with all of the other DNS records that you created.  See https://moxie.org/blog/ssl-and-the-future-of-authenticity/ for more info.


Encrypting the /boot partition in a Linux system can protect from an Evil Maid Attack? If the boot partition is encrypted (and the passphrase to unlock the device must be entered in GRUB before the boot sequence starts) is the system considerable safe from an Evil Maid Attack?

"Evil maid attack" is a catch-all term for any kind of physical manipulation to a device in the absence of the user.

Encrypting the hard drive would protect you against two of such attacks:

Physically cloning the hard drive
Starting the device and taking a look at the data on the device

It will not protect you from an attacker installing any other form of surveillance devices, like physical network sniffers, physical keyloggers etc.

And then there is also this form of an evil maid attack:

Attacker starts the device from a boot medium they brought.
Attacker installs a new bootloader which shows a decryption password prompt just like the default one.
Attacker shuts the device down and leaves.
When you enter your password, the bootloader asks for your password, which you will enter because it looks just like it always does. It will then decrypt the hard drive and boot the operating system normally, just like usual. But while it does that, it installs a malware payload on the now unencrypted hard drive and/or sends the password it just sniffed to the attacker.

This attack will work as long as you use a pure software solution, because it will always require an unencrypted bootloader on your hard drive in order to decrypt it. The only solution would be if the hard drive encryption could be implemented on the UEFI level. But I haven't heard of anything like that yet.

Always remember the 3rd Immutable Law of Security:

  If a bad guy has unrestricted physical access to your computer, it's not your computer anymore.


HPKP and Elliptic Curve certificates There is quite some information on the web on how to extract the base 64 encoding of the SHA-256 fingerprint (which is needed for the Public Key Pinning header) for RSA certificates (e.g. by Mozilla).

However, I'm not sure how to get the same information for an ECC certificate. Replacing rsa by ec seems a decent idea, however openssl ec -in my-key-file.key -outform der -pubout does not only print the actual content of the key, but also

read EC key
writing EC key

beforehand. I guess this boilerplate output is included in the stuff that's SHA-256-hashed, thus invalidating the whole procedure. Is there any way to circumvent this?

There's extra status output but it goes to the StdErr stream. So it goes to console (i.e. screen display) and does NOT go down into the pipe. Regular output is part of the "StdOut" stream. That stream goes into the pipe. This is valid for *nix and Windows, too.

Here's an example.

Generate a key:

C:\>openssl ecparam -name secp256k1 -genkey -noout -out secp256k1-key.pem

If you redirect nothing then both streams end up on the screen:

C:\>openssl ec -in secp256k1-key.pem -noout -text
read EC key
Private-Key: (256 bit)
priv:
    00:d6:09:84:21:77:32:86:bb:5d:c9:da:30:ce:dc:
    98:28:f1:f2:f2:2e:2a:9a:91:28:c3:88:b2:bb:80:
    51:24:39
pub:
    04:e3:4b:2c:96:44:08:18:9f:37:bb:b5:8e:44:52:
    69:f4:4b:7f:a7:2a:61:9e:5a:39:1a:07:7a:d6:27:
    e8:8f:83:36:fa:a6:72:e9:f5:7c:41:53:0c:b6:16:
    ab:24:7a:0d:82:2c:b9:cc:2d:2b:08:38:83:e2:ac:
    4e:d7:9a:09:91
ASN1 OID: secp256k1

If you throw away stream "1", which is StdOut, then what you are left with is stream "2", which is just StdErr:

C:\>openssl ec -in secp256k1-key.pem -noout -text 1>NUL
read EC key

You can throw away stream "2" as well:

C:\>openssl ec -in secp256k1-key.pem -noout -text 2>NUL
Private-Key: (256 bit)
priv:
    00:d6:09:84:21:77:32:86:bb:5d:c9:da:30:ce:dc:
    98:28:f1:f2:f2:2e:2a:9a:91:28:c3:88:b2:bb:80:
    51:24:39
pub:
    04:e3:4b:2c:96:44:08:18:9f:37:bb:b5:8e:44:52:
    69:f4:4b:7f:a7:2a:61:9e:5a:39:1a:07:7a:d6:27:
    e8:8f:83:36:fa:a6:72:e9:f5:7c:41:53:0c:b6:16:
    ab:24:7a:0d:82:2c:b9:cc:2d:2b:08:38:83:e2:ac:
    4e:d7:9a:09:91
ASN1 OID: secp256k1

As for the "Why?": I don't know. I think that's just one of the many quirks of the OpenSSL command line utilities.


Is it possible to use TLS 1.3 without ESNI? I've read that the Great Firewall now blocks TLS 1.3 connections with ESNI.
Is TLS 1.3 usable without ESNI, or does the user have to downgrade to TLS 1.2?

The default way to use TLS 1.3 is without ESNI. It just uses SNI, like TLS 1.2 before it.
You can even use it without SNI at all, and either the server will close the connection, or give you a certificate that doesn't cover the domain you want which will cause the client to close the connection (unless you override the cert verification logic) or it will give you a cert that covers the domain you want and everything will work great, all depending on the configuration of the web server or TLS terminator.


Do USB flash drives delete a sector before writing to it? I know that SSDs can't write to a non-empty sector, so must delete it first (and even support TRIM which resets them automatically after deletion). HDDs on the other, write to sectors before reseting them, leaving file slack of the previous data which could be analysed.

How about USB flash drives?

All NAND flash needs to erase the block before writing it. But concerning security, you have to understand that you never know which block is written.
SSD and also USB flash drives have internal controllers and remap the actual flash cells. Each flash cell only has a limited amount of writes before it fails. With the typical use of a USB flash drive or ssd (you have some static files and then you have a part of the drive where you constantly write/delete/change the content) specific parts of the flash would fail very soon, destroying your drive.

Because of this, wear levelling is used.

This means if you write to sector X on the drive, the controller might write this to the flash cell 1234. You then want to delete the data there and write random bits to sector X. But the controller decides, that flash cell 1234 is more used than average and decides to write the data to flash cell 543 instead.

The original data is still in flash cell 1234! You can't read it using the controller, because it is marked as empty. But if someone disassembles your USB flash drive and reads the content of the flash cells, the data will be there.

Because there are more flash cells than the advertised storage to allow for some to fail, there is no simple way to prevent this. Even if you fill your whole flash drive with random data, there are still flash cells not written to. The way new SSD disks prevent data leakage is that they have a hardware encryption always enabled. Every bit written is encrypted with a key stored in the controller. If you send a "secure erase" command to the ssd, it simply deletes the key for the encryption and all the data turns into garbage.

So never store any secret data unencrypted on flash memory!


What are attackers trying to achieve when doing attacks on local programs such as buffer overflows? In attacks on programs, such as stack buffer overflows, what is the objective of the attacker? I’m having trouble learning the technical details of the attack (such as overwriting the function’s return address) because it’s not clear what such attacks are intended to achieve. For example, in SQL injection, it’s usually done to get confidential information or make the server run code. It seems like the prerequisite for a buffer overflow attack is for the attacker to already have the ability to run code on the machine, so what more do they want?

Is it usually a program on a remote computer that is being attacked in these situations? By the way I'm more familiar with C++ than C.

An aspect which hasn't been mentioned yet very clearly: suppose you have a multi-user system (as all modern PC OSes like Windows, Linux, Unix and so on are), and suppose you are a normal (non-privileged) user who can run "normal" application programs. Now you want to do something malicious to your PC (like installing a keylogger to get all passwords which the other users of the PC are typing, or reading other users' emails). But you can't do that because you are just a normal user, do not have administrative rights, can't install software and can't view other users' data.

So your goal is to become a user with administrative rights (administrator in Windows, root in Linux / Unix, etc.). Besides tricking the administrator into giving you his password, another way to achieve that is to attack a vulnerable program which already is running with administrative rights. If you could make such a program run your code (for example, by abusing a buffer overflow), then this code would run with administrative privileges as well, and -bang- you could do anything what you like with the machine.

This is called privilege escalation. Please note that (due to technical reasons which can't be explained here in detail) practically every system has lots of (server) processes with root privileges running in the background, so this is a real scenario (actually, I am estimating that most of the attacks against local programs are done for privilege escalation).

So the key factor is: when you (a normal user) run a program, this program runs with your own privileges and access restrictions, but when you can make a program which is already running with administrative privileges run your own code by abusing buffer overflows and similar techniques, your code runs with administrative privileges as well.

Please note that this explanation is heavily simplified (for example, in Linux / Unix there are SUID programs and so on), but hopefully expresses the underlying idea.

One last thing: privilege escalation is often the goal whether or not the attack is done locally or remotely. Often enough, attacks work in two steps:

First, the attacker gets a naive user's password (for example, because it is too weak, is the birthday of his wife or the name of his dog)  and then uses these credentials to get onto the respective machine remotely.
Then, as the second step, being that user, the attacker scans the respective machine for vulnerable, privileged software and, for example by abusing buffer overflows in that software, lets that software run his malicious code which in turn is executed with the same privileges as the vulnerable software, effectively making the attacker an administrator.

Of course, there are also many cases where an attacker directly abuses privileged software running on a remote system (for example, web server processes running on Linux under root). But since you have primarily asked for the sense of local attacks, we'll leave that away for now.


Accidentally opened a .htm email attachment - Help! Got an email from someone i knew (their account was hacked obvs) and had a swift.htm file attached. I clicked on it and it opened up a blank browser window. Then after reading some forums I decoded it

here's the original: https://pastebin.com/K3VNhN20
Here's it decoded using coderstoolbox.net: https://pastebin.com/DUvtFWwS

I didnt enter anyting on the web page it popped up as it was blank - however I have a tab open with my gmail - i didnt log back in manually but had to open a tab and clock on my gmail favourite which automatically logged me in.

Anything I should be worried about even though I didnt manually enter anything?

I'm using MAC OS Sierra 10.14 with chrome version  57.0.2987.133

This is not malware , this is a credential phish. If you enter your password and submit the stolen password is sent to this url

hxxp://www.kamesinvestmentint[.]com/wp/xplore/kato/mail.php

If you did not enter a password you are safe.
If the page didn't load it probably means your browser failed to render the JavaScript ... either way sounds like you are safe.

Worst case rest your password and enable 2FA/MFA


dictionary attack hashing algorithm Does the kind of algorithm used to hash passwords have any advantages or disadvantages in a dictionary attack? i.e. SHA256, MD5, etc. or is it just the dictionary that is used by the attacker matters?

As far as I can understand, the hashing algorithm does not have any effect on protection against the dictionary attack like John the ripper.

In brute force dictionary attacks the speed of the algorithm essentially defines how many passwords can be checked within a specific time. The fewer passwords can be checked the better the algorithm protects against brute force. That's why proper password hashing algorithms are deliberately slow, unlike plain MD5 or SHA256.

Additionally proper password hashes use a random salt so that it is impossible to reuse a precalculated mapping between password and hash.

For more see How to securely hash passwords?.


Does HTTPS protect you from fingerprinting by the NSA? We've established that, for all intents and purposes, HTTPS hides what page you visit on a given server from NSA backbone wiretapping, but not the domain itself. But that's only IP / domain correlation (across multiple domains), and nothing more.

As far as I understand, that's not fingerprinting.

I use the Tor Browser, with things like JavaScript and third-party cookies turned off, and add-ons like RequestPolicy and Self-Destructing Cookies installed, and in full use.

I understand this increases my risk for (advanced, or not so advanced) fingerprinting, potentially hugely.

But if fingerprinting is only information that every server you accept connections from, sees, (such as what resources you accept from them or third-party servers, your cookie interaction, whether you GET their images and scripts, and so forth), then if all these details are encrypted inside the HTTPS session, does that mean the NSA can't actually fingerprint any HTTPS browsing you conduct on the Internet - assuming the certs for those domains are not compromised or cracked in any way?

Perhaps identifiable fingerprinting information can and does exist outside the encrypted information and in other parts of the whole picture here? (even if the attacks are very advanced - I'm thinking timing attacks?)

The only thing I just thought of, was: not allowing (or only allowing very specific, and limited) third-party resources, aka cross-site requests, on the various HTTPS domains your IP visits (via RequestPolicy). Could the NSA, in collecting and analyzing all your various HTTPS traffic metadata, by the fact of you simply not having any or many of the common third-party domain sites connected to (especially when not at the same time), when they know it would be normal to have that in the stream, fingerprint you uniquely just from that?

If the answer is yes to that, would the answer to this question then be, HTTPS significantly reduces the amount of ways in which the NSA can fingerprint you (but you can mess up in a whole lot of other ways)?

You asked about https, not tor which is a different question, so I'll address the https part.

There's a lot of information sent in the clear to setup an https session.  Probably the most obviously useful would be the client sending the cipher suites supported, cipher preferences, and SSL versions the client supports.  Cipher suite support varies widely among the major browsers, and will even vary between versions of the same browser.  For this reason it'd be trivial to identify broadly which browser the user is using (ie, Chrome, Firefox), and in many cases narrow it down to a range versions of the browser.  Internet Explorer for example has only a few versions, so it's trivial to identify which version is being used.

IP addresses tend to stick around for a long time.  Say  you had 3 people using the same IP address, Alice, Bob, and Charlie.  Alice uses Internet Explorer, Bob uses Firefox, and Charlie uses Chrome, it'd be relatively simple to distinguish which user is visiting a secure website if you'd identified the IP address.

In addition, the client sends date and time information as well.  That could also be very useful in fingerprinting a client.

All in all, I'd say it's very possible that at least some fingerprinting can be accomplished over SSL with only passive listening.


Personally identifiable information in query parameter for Tomcat REST service I have a REST API running in a Tomcat container that has an endpoint that takes a customer email address as a query parameter. It's something like this:

/customers?email=foo@bar.com

Customer email addresses are an asset we want to protect, so we need to ensure they aren't logged any where, and cannot be intercepted. The API only works over HTTPS and requires strong authentication.

When it comes to logging, in the application code, email addresses are not logged. However, all URLs the service get logged out in the Tomcat localhost_access_log, which include the query parameters. A plan is to use a different Tomcat access log valve that didn't log out query parameters in URLs. Would that be sufficient to ensure the email addresses don't get logged out. Is there anywhere else that typically logs out URLs that needs to be taken care of?

As pointed out by Jonah B, it is usually impossible to keep all the "request line" components clean.

There is a much safer technique : do not use the PII in the request, but instead use a mapped value for it.

So instead of /customers?email=foo@bar.com you would, for example, have /customers?email=a4kl3delmze, where a4kl3delmze is randomly generated by the server upon creation.
Using a value like the hash of the email could work as well.

The point being : the parameter value is mapped to the email in the database, so you can still execute your biz-logic but you don't transfer the email string value with your requests


Is this password generator safe? 128-bit entropy is required

http://nxtra.org/nxt-client/js/passphrasegenerator.js

With all new browsers (Chrome, Firefox, IE 11) it uses  crypto.getRandomValues which should be safe, but with IE 10 (and older) it uses random mouse input from the user combined with Math.random

$("html").on("mousemove", function(e) {
            var seed = [e.pageX, e.pageY, +new Date];
            PassPhraseGenerator.push(seed);

How safe is that second part?

In on itself it should be fairly secure as a concept, but generally speaking one should not rely on JavaScript for any kind of security. It's trivially easy to do injections and interceptions on any JavaScript code and doing complex math in JavaScript can easily trigger 'stop script' or any other browser script sanity checks so developers tend to either lower the security as much as possible or to downright break any convention just so their 'secure page' can work - which in turn leads to all kinds of problems.

But putting that aside, there are two potential problems I see with this particular implementation:

1. The word list is way too small - it picks randomly 12 words out of pool with only 1626 words which makes mere ~7.42x10^29 possible combinations assuming that the random is truly random. That's fairly lower than 128 bits of entropy (~3.4x10^38) - in fact almost half a billion times lower, so even with the assumption of true randomness or using the browser's crypto facilities you're getting at best 99 bits of entropy. Either increase the word list to ~8400 words or pick 17 words instead of 12 if you're aiming at 128 bit.
(Disregard this part, it applies only to unique pass generation.)

2. Relying on the user to generate sufficiently safe seed can easily break any security. Users are by definition lazy, and having them to move their mouse can end up in repetitive left-right movement over a small area (usually near the 'generate password' field) which can be exploited to lower the probability of picking some of the combinations at random. I'd add at least a delta check (if(Math.abs(lastX - e.pageX) < 20 || Math.abs(lastY - e.pageY)) return; ...) to force the users to move their mouse a bit more randomly. It wouldn't hurt to use some of the browser stats apart from the new Date to add to the seed as well.


Unable to downgrade https to http through sslstrip, arpspoof I've been following this guide: https://www.cybrary.it/0p3n/using-sslstrip-in-kali-linux/
and others too, ex: official Sslstrip one: https://moxie.org/software/sslstrip/
without any success.

I'm using:

5.2.0-kali2-amd64 #1 SMP Debian 5.2.9-2kali1 (2019-08-22) x86_64 GNU/Linux
sslstrip 0.9 by Moxie Marlinspike

and arpspoof.

I am running first:

echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A PREROUTING -p tcp  –destination-port 80 -j REDIRECT –to-port 8080

Then arp spoofing:

arpspoof -i <interface> -t <targetIP> -r <gatewayIP>

Then sslstrip:

sslstrip -w testfile.txt -l 8080

Then I'm going to my target machine, iPhone running Safari browser.
I'm deleting all cache and temp.
I'm browsing to non-HSTS preloaded websites (linkedin.com , zsecurity.org ).
I'm not specifying https:// , but simply the domain name (ex: linkedin.com).
They still load in https.

I tested this multiple times on another client running Windows and Internet Explorer.
Same result, I cannot have the target forced to http.

The testsfile.txt from sslstrip is empty.
I was expecting the client would open http web-pages.

What am I doing wrong?

First of all: What sslstrip does is it replaces https-links with non-https-links on hijacked non-https- websites. E.g. when the victim visits a http-only search engine via an insecure public wifi, the attacker can use sslstrip to replace https-links in the search engine- results with http-only links.

I guess that the websites you are targeting (e.g. linkedin) always redirect to https, regardless of what the victim attempted to open. And won't allow http-connections in the first place.

And last but not least, like others already mentioned in the comments, the target websites most likely set a strict-transport-security header in the first response (or even an OPTIONS response, which can be easily overlooked), which will prevent the browser from allowing http-only connections.


Are .dll files normally found in system32 but now in a user’s AppData folder always suspicious? I recently had to read over some malware reports and associated logs for a confirmed malware detection and subsequent infection of a Windows asset. The logs clearly show .dll files in a user’s AppData folder. These .dll files are named the same as .dlls normally found in system32, e.g cryptbase.dll.

I know that in this specific instance this was definitely malware and the unpacking of the rogue .dlls was part of the malware's normal process.
I asked about this in chat and was told that the only real credible explanation for this behaviour would be malware (as it was in this instance) or very bad programming practice, and even in that case it is a scenario that is rare.

My question is twofold; is there a scenario where .dll files with the same name as standard system32 .dlls be found in an user's AppData folder for any reason other than malware or poor programming?

In addition, is it fair to treat .dll files that are found in AppData and appear to be copies of .dll files in system32, as an indicator of compromise?

Since Microsoft has straightened the default permissions on the Program Files folder, many developers have turned to AppData as an alternative location for their code. The logic being that an application installed this way can be updated without requiring elevation or admin level access. (Google Chrome, for instance, does this).

This also means that, sometimes, you will find legitimate libraries that usually live in the system32 folder somewhere under the AppData path. These usually are run-time components (like the MSVCRT, GDI+ or capicom) that are maintained and updated by the application itself (usually because they require a specific version to work but sometimes because they are pushed as a user component instead of a system one and needs to be deployed without elevation).

That does not mean that you should find libraries belonging to the operating system there: there is no legitimate reason for, say, schannel.dll to be found there since the only application that maintain that library is the operating system.

So, dlls under AppData having the same name as a dll in system32 are not automatically suspicious.


several questions about linux kernel debugging - memory examination I've read this Does Linux kernel use DEP for kernel memory?

but I'm debugging linux kernel (x86_64) on Vmware using vmware stub. I've attached gdb to my linux kernel.
the kernel version is 3.x

and I changed executable memory of linux kernel in one place

(gdb) x/i $rip
=> 0xffffffff81190930 <sys_getdents>:   push   rbp
(gdb) set{long}0xffffffff81190930=0
(gdb) x/x 0xffffffff81190930
0xffffffff81190930 <sys_getdents>:      0x00000000
(gdb) x/i $rip
=> 0xffffffff81190930 <sys_getdents>:   add    BYTE PTR [rax],al

why is that? is this because I'n in virtual machine?

second question.
I know that I can list pages using this command

(gdb) info files
Symbols from "/home/a/vmlinux".
Remote serial target in gdb-specific protocol:
Debugging a target over a serial line.
        While running this, GDB does not access memory from...
Local exec file:
        `/home/a/vmlinux', file type elf64-x86-64.
warning: Cannot find section for the entry point of /home/a/vmlinux.
        Entry point: 0x1000000
        0xffffffff81000000 - 0xffffffff815f795f is .text
        0xffffffff815f7960 - 0xffffffff815f7adc is .notes
        0xffffffff815f7ae0 - 0xffffffff815fbb00 is __ex_table
        0xffffffff81600000 - 0xffffffff818427ce is .rodata
        0xffffffff818427d0 - 0xffffffff81849ed4 is __bug_table

but how to list permissions to these pages - rwx ?

I have never debugged the kernel, so I may be wrong, but I believe that what you are seeing makes complete sense.  Let's go through it:

  add    BYTE PTR [rax],al

  why is that? is this because I'n in virtual machine?

That is what I would actually expect from 0x0000.  This is easy to test:

[~]$ uname -a
Linux haps 4.7.6-1-ARCH #1 SMP PREEMPT Fri Sep 30 19:28:42 CEST 2016 x86_64 GNU/Linux
[~]$ perl -e 'print "\x00\x00\x00\x00"' > pp
[~]$ ndisasm pp
00000000  0000              add [bx+si],al
00000002  0000              add [bx+si],al

So yeah, 0x0000 is add into the first byte of RAX (i.e. al).

  but how to list permissions to these pages - rwx ?

I will argue that that does not make sense.  A common misunderstanding is thinking that the kernel runs as root, that completely untrue.  The kernel runs in kernelmode, and everything else runs in usermode (unless it is in the middle of a syscall, that is).

In the global page directory the pages used by the kernel have the DLP (Descriptor Privilege Level) set to 0, meaning kernelmode.  All userspace used pages have the DLP set to 3, meaning usermode.  When the CPU is executing a userspce process it is in usermode, therefore if it tries to access a page that has a DLP of 0 (or 1 or 2, but those are not used in Linux) then the CPU will shoot an exception (an interrupt) and tell the kernel to clean the mess.  The kernel, in turn, will simply queue a SEGFAULT in the signal queue of the process that is currently active.

In summary, any userspace process that tries to access those pages will get segfaulted.  It does not matter if the process is run with root privileges or not.  Therefore it does not really make sense to give a set of permissions to the memory pages that are used by the kernel.

Extra note

You may ask: but what about /dev/mem?  That's kernel memory that can be seen from userspace.  Well, reading and writing to /dev/mem (or /dev/kmem) provokes a syscall.  And something like copy_to_user or copy_from_user is called to pass data between DLP 3 and DLP 0 pages.


How safely allow users to run arbitrary JVM code on a server? I'm planning a service that will require allowing users to run arbitrary JVM code on a server. I'm planning to sandbox the code, but I know that the JVM has traditionally had security holes, which is why I want to explore other avenues.

There are already services such as Travis CI which allow anyone to run any code on their servers by checking it into GitHub.

How can a service like this ensure that someone isn't taking advantage of their servers to launch an attack or other malicious behavior?

There are Docker containers for Java and I think some of the newer CI services might use those.  You can put all sorts of additional restrictions on those, such as limiting memory/network/CPU/etc.  VMs can also do this of course.