Hashcat
Hashcat is a fast password recovery tool that supports multiple attack modes and hash types. It’s the world’s fastest and most advanced password recovery utility.
References:
- Hash Type Codes: https://hashcat.net/wiki/doku.php?id=example_hashes
- Permutation Rules:
/usr/share/hashcat/rules - Cheat Sheet: https://pentesting.site/cheat-sheets/hashcat/
- Rule-Based Attack: https://hashcat.net/wiki/doku.php?id=rule_based_attack
Basic Usage
Attack Modes
| Mode | Description | Example |
|---|---|---|
| 0 | Straight (Dictionary) | hashcat -a 0 -m 1000 hash.txt wordlist.txt |
| 1 | Combinator | Combines words from two wordlists |
| 3 | Brute-Force/Mask | hashcat -a 3 -m 1000 hash.txt ?a?a?a?a?a?a |
| 6 | Hybrid Wordlist + Mask | Wordlist + mask pattern |
Common Hash Types & Modes
Windows Hashes
Linux Hashes
Kerberos (Active Directory)
Other Hash Types
Rule-Based Attacks
Rule-based attacks apply transformations to words in a wordlist, creating permutations and variations.
Rule Files Location
Rule Comparison Table
| Rule File | Rule Count | Use Case |
|---|---|---|
best64.rule | 64 | First Run. Instant results for easy passwords. |
d3ad0ne.rule | ~34,000 | Deep Crack. Good for standard “complex” user passwords. |
dive.rule | ~100,000+ | Paranoid. Extremely slow; last resort for dictionary attacks. |
Using Rules
Creating Custom Rules
Common rule transformations:
| Rule | Description | Example |
|---|---|---|
c | Capitalize first character, lowercase rest | password → Password |
C | Lowercase first character, uppercase rest | password → pASSWORD |
t | Toggle case of all characters | password → PASSWORD |
$! | Append ! to end | password → password! |
$1$9$9$8 | Append 1998 to end | password → password1998 |
sa@ | Replace all a with @ | password → p@ssword |
so0 | Replace all o with 0 | password → passw0rd |
ss$ | Replace all s with $ | password → pa$$word |
Example Custom Rule File:
Mask Attacks (-a 3)
Mask attacks use placeholders to define character sets and patterns for brute-force attacks.
Charset Symbols
| Symbol | Description | Charset / Definition |
|---|---|---|
?l | Lowercase | abcdefghijklmnopqrstuvwxyz |
?u | Uppercase | ABCDEFGHIJKLMNOPQRSTUVWXYZ |
?d | Digits | 0123456789 |
?h | Hex (Lower) | 0123456789abcdef |
?H | Hex (Upper) | 0123456789ABCDEF |
?s | Special | «space»!"#$%&’()*+,-./:;<=>?@[]^_{` |
?a | All | ?l?u?d?s |
?b | Binary | 0x00 - 0xff |
Custom Charsets
Mask Examples
Hash Identification
Before cracking, identify the hash type:
Common Hash Values
| Hash Value | Type | Meaning |
|---|---|---|
d41d8cd98f00b204e9800998ecf8427e | MD5 | Empty String (0 byte input) |
da39a3ee5e6b4b0d3255bfef95601890afd80709 | SHA1 | Empty String (0 byte input) |
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 | SHA256 | Empty String (0 byte input) |
Workflow Examples
Linux Password Cracking
Kerberoasting
Windows NT Hashes
Important Notes
- Hash Mode: Always specify the correct
-mmode for your hash type. Usehashidor check the hash format to determine the mode. - Wordlists: Common wordlists include
rockyou.txt,SecLists, and custom wordlists generated from OSINT. - Rules: Start with
best64.rulefor quick results, then move to more comprehensive rules if needed. - Performance: Use
-w 3or-w 4for faster cracking (uses more resources). Use-Ofor optimized kernels (may limit password length). - GPU Acceleration: Hashcat automatically uses GPU if available. Ensure proper drivers are installed.
- Resume Sessions: Hashcat saves progress automatically. Use
--restoreto resume interrupted sessions. - Output: Cracked passwords are saved to
~/.hashcat/hashcat.potfileby default.