Hash Cracking
Recover plaintext passwords from captured or extracted password hashes using dictionary, rule-based, and brute-force attacks.
Hash cracking is essential after obtaining hashes from SAM, NTDS.dit, shadow files, or network captures.
Quick Reference
# Hashcat NTLM hash |
Common Hash Formats
# NTLM (Windows SAM/NTDS.dit) |
Hashcat
# Basic dictionary attack |
Hashcat Mask Attack
# Mask characters |
John the Ripper
# Basic dictionary attack |
Hash Identification
# hashID |
File Cracking with John
# List available tools |
Custom Wordlist Generation
# CeWL - Spider website for wordlist |
Hashcat Rules
# Common rule files (in /usr/share/hashcat/rules/) |
Filtering Wordlists
# Filter by minimum length (8 chars) |
Common Cracking Workflows
# Workflow 1: NTLM hashes from SAM/NTDS.dit |
Hash Format Examples
# NTLM (from NTDS.dit via secretsdump) |
Performance Optimization
# Check available devices |
Notes
Hash Type Identification:
Always identify hash type before cracking:
- Check hash length and format
- Consider source (Windows, Linux, network capture)
- Use hashid or hash-identifier
- Verify with example hashes
Common Hash Sources:
- NTLM: SAM database, NTDS.dit (Domain Controller)
- NTLMv2: Network authentication (Responder, Inveigh)
- Kerberos TGS: Service accounts (Kerberoasting)
- Kerberos ASREP: Accounts without pre-auth (ASREP Roasting)
- Linux: /etc/shadow file
- Web Apps: Database dumps, configuration files
Cracking Strategy:
Quick wins (5-10 minutes):
- Small wordlist (top 10k passwords)
- No rules
- Check for weak passwords
Medium effort (1-2 hours):
- Rockyou.txt with best64 rules
- Common patterns
- Most passwords crack here
Extended (overnight):
- Large wordlists
- Multiple rule sets
- Combination attacks
Brute force (days/weeks):
- Mask attacks
- Incremental mode
- Last resort
Wordlist Selection:
Start small, scale up:
- Top 100 passwords
- Top 10,000 passwords
- Rockyou.txt (14M)
- Custom wordlists (CeWL, CUPP)
- Combined wordlists
Rule-Based Attacks:
Rules multiply effectiveness:
- Rockyou.txt = 14M passwords
- Rockyou.txt + best64 = 896M candidates
- Rockyou.txt + best64 + d3ad0ne = billions
Common patterns rules handle:
- Capitalization:
password→Password - Numbers:
password→password123 - Years:
password→password2024 - Symbols:
password→password! - Leetspeak:
password→p@ssw0rd
Mask Attack Patterns:
Common corporate password patterns:
# Uppercase + lowercase + digits + special |
Hardware Considerations:
- CPU: Slow, use for simple hashes (MD5, SHA1)
- GPU: Fast, 100x-1000x faster than CPU
- Multiple GPUs: Linear scaling (2 GPUs = 2x speed)
- Cloud: AWS/Azure GPU instances for large jobs
Hash Cracking Speed:
Approximate speeds (single RTX 3080):
- MD5: 50 GH/s (billion hashes/sec)
- NTLM: 50 GH/s
- SHA1: 20 GH/s
- SHA256: 10 GH/s
- bcrypt: 50 KH/s (thousand hashes/sec)
- Kerberos TGS: 500 MH/s (million hashes/sec)
Time Estimates:
8-character password, all lowercase:
- Keyspace: 26^8 = 208 billion
- At 50 GH/s: ~4 seconds
8-character password, mixed case + digits + symbols:
- Keyspace: 95^8 = 6.6 quadrillion
- At 50 GH/s: ~37 hours
Success Rates:
Typical success rates with rockyou.txt + rules:
- NTLM hashes: 60-80%
- NTLMv2: 40-60%
- Kerberos TGS: 30-50%
- Linux SHA-512: 20-40%
Cracked Password Analysis:
After cracking, analyze patterns:
# Show cracked |
Common Password Patterns:
Based on real-world data:
Password123!- Most common corporateWelcome1!- Common defaultSummer2024!- Seasonal patternCompanyName2024!- Company-basedJanuary2024!- Month-based
Ethical Considerations:
- Only crack hashes with authorization
- Secure cracked passwords properly
- Don’t share credentials
- Document findings professionally
- Follow data handling policies
Troubleshooting:
Common issues:
- Wrong hash format: Verify with hashid
- Corrupted hash file: Check for extra spaces/newlines
- Out of memory: Use -O flag or reduce workload
- Slow performance: Check GPU drivers, use -w 3
- No results: Try different wordlists/rules
Post-Cracking Actions:
Once passwords cracked:
- Document credentials securely
- Test for password reuse
- Check privilege levels
- Attempt lateral movement
- Continue enumeration
- Report findings
Tools Comparison:
Hashcat:
- GPU-accelerated
- Fastest option
- Best for large jobs
- Requires GPU
John the Ripper:
- CPU and GPU support
- Good for file cracking
- Easier for beginners
- Slower than Hashcat
Additional Resources:
- Hashcat wiki: https://hashcat.net/wiki/
- Example hashes: https://hashcat.net/wiki/doku.php?id=example_hashes
- John formats: https://openwall.info/wiki/john/sample-hashes
- Wordlists: https://github.com/danielmiessler/SecLists