Practice Password Cracking without Going to Jail

The purpose of this article is to give a small amount of background on password hashes, how they are cracked, and how to practice password cracking without breaking any laws.

The term "password cracking" can mean a few different things. In this context, I'm referring to the concept of recovering an original password from a hashed/encrypted password.

The term "hash" refers to a one-way checksum that is computed from a piece of data.

The reason passwords are hashed is because it is ultimately safer to store a one-way checksum of a plaintext password than it is to store the password itself.

Here's an example of an LM (LanManager) password hash:

>>> smbpasswd.lmhash('andrew')

Password = "andrew"
Hash = "7733BFECC3A7D081AAD3B435B51404EE"

As a red teamer, or penetration tester, it's very common to recover password hashes. Most of the time, the next step after finding password hashes is cracking them.

If you are training to become a red teamer, or if you want benchmark a new password cracking rig without using client data, it can be hard to create realistic-looking password hashes that emulate what real corporate networks look like.

I break into large companies' networks for a living, so I've cracked a lot of passwords. Armed with this knowledge, I wrote a script that generates somewhat realistic password hashes, ready to be cracked.

$ python 10 word.lst

The script works by rolling a number and deciding on the strength of the password based on the outcome. Most passwords generated will be in the form of (dictionaryword)(two digit number), like "soccer12" or "blueberry99". However, some passwords are more complex and use capital letters. Some passwords are completely random.

You can find the source code and starter word/name files on my github at the following URL-

NOTE: This code is very poorly written, but it gets the job done. If there is any interest in this tool, I'll be happy to make improvements.

Here's a snippet of us running some hashes through John the Ripper:

$ sudo /opt/john/run/john hashes.txt
Loaded 13 password hashes with no different salts (LM DES [128/128 BS SSE2-16])  
SECRET           (GSHARP)  
SECRET           (TGRAHAM)  
12345            (LWHITLEY)  
12345            (MMATTHEWS)  
SECRET           (INOEL)  
AAAAAA           (HCABRERA)  
E                (CBROOKS:2)  
E                (DGAINES:2)  
T                (KLAWSON:2)  
ROOT             (AWEAVER)