Introduction to Hashing, Cracking, and Mastering Hashcat
What Is Hashing?
Hashing is a one-way cryptographic process that converts data into a fixed-length string of characters. It’s commonly used to store passwords securely in databases. Examples include MD5, SHA-256, and NTLM.
Why Crack Hashes?
Cracking hashes can help penetration testers assess password security, recover lost credentials, or analyze digital evidence in forensics. However, it must always be done with permission.
General Commands in Hashcat
Brute Force Attack
hashcat -m 1000 -a 3 hashes.txt ?a?a?a?a?a?a
This command brute forces all 6-character passwords.
Wordlist Attack
hashcat -m 1000 -a 0 hashes.txt wordlist.txt
Uses a pre-defined wordlist to test passwords.
Example: Cracking NTLM Hashes
Setup
Create a file hashes.txt with the following NTLM hashes:
8846f7eaee8fb117ad06bdd830b7586c # password123
b3d5c338a03f1d744c3c7022d5d27a1c # letmein
Create a wordlist wordlist.txt with these entries:
password123
123456
letmein
qwerty
Command
hashcat -m 1000 -a 0 hashes.txt wordlist.txt -o results.txt
Result
Hashcat cracks the hashes and outputs the results:
8846f7eaee8fb117ad06bdd830b7586c:password123
b3d5c338a03f1d744c3c7022d5d27a1c:letmein
The corresponding passwords are password123 and letmein.