First off...I passed the CISSP exam. WOOOO. I had to get that out. GCIH and CEH by Sept. 11'

So, while studying for the technical side of things, I see that there are rainbow tables. They are pre-hashed to compare the victim's hashed password (from shadow or SAM), but there are many different hashing algorithms out there. So does there have to be a rainbow table for each and every algorithm AND I have to run the comparison through every algorithm?

In other words how am I to know which algorithm was used: MD5, SHA-1, NTLM, LANMAN?

Are the passwords from one system like Windows 7 always going to be in NTLMv2, and Unix always going to be in MD5 - or can a user modify his system and specify the algorithm to use for his system's passwords - like SHA-256?


Hum many questions in one


@M'vy has the specific answers to your questions.

In terms of a broader answer as to how it works in practice:

What we used to do was keep a range of Rainbow tables and if we had no indication as to algorithm we would just start with the most likely in a particular environment and work through them - using a script to do this makes it very easy, and if it ends up being in the last table it still takes hardly any time.


Normally you know the hash function from context. If you are trying to crack a password then this password is valuable to you, in that it would grant you access to some data or service somewhere, which you specifically target. So one has to assume that you already know the kind of system (in particular if you succeeded in grabbing a list of hashed passwords from a database, then you saw the database), and this often includes knowledge of the password hashing function. Moreover, in systems which support several types of hash function (like the /etc/shadow file on Unix systems), the kind of hash is encoded along the hash value, because, by nature, the system itself must know it.

Remember that hashed passwords are intended to be used by some software, somewhere, which exists as executable files and source code. On a general basis, software cannot be considered to be secret, and reverse engineering is quite effective at uncovering the kind of processing that is done on data.

For Windows, passwords tend to be processed with two hash functions, the old LM (LanMan), and the newer NT Hash (which is MD4). There is also a "password verifier" used in some part, which is "salted" with the user name (not a good salt, really: every "Administrator" is called "Administrator"). See this page for details. LM hash is extremely weak and was used as the demonstration testbed to show the effectiveness of rainbow tables; fortunately, it is disabled by default in newer systems (since Vista). However, the NT hash is still quite weak (not as abysmal as LM, but still) since it is very fast (a single MD4 invocation...) and unsalted (thus making it worthwhile to build precomputed tables, such as rainbow tables).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.