
Hashcat: GPU Password Cracking
Cracking password hashes with Hashcat. Hash modes, attack modes, rules, performance flags and the hashes you meet on internal tests.
Introduction
Hashcat is a GPU password cracker. It supports more than 350 hash types and several attack modes: wordlist, mask, combinator and hybrid. On a test it is what you reach for once you have NTLM hashes, Kerberos tickets or a captured NetNTLMv2 response.
Hashcat is open-source and licensed under the MIT license. It runs on Linux, Windows, and macOS, with support for AMD, NVIDIA, and Intel GPUs through OpenCL and CUDA.
Installation
Install Hashcat
# Kali Linux (pre-installed)
hashcat --version
# Ubuntu/Debian
sudo apt install hashcat
# From source
git clone https://github.com/hashcat/hashcat.git
cd hashcat
make
sudo make installVerify GPU support
# Check available OpenCL/CUDA devices
hashcat -I
# Should show your GPU(s)
# Backend Device ID #1
# Name: NVIDIA GeForce RTX 3080Test with a simple hash
# Create test MD5 hash
printf '%s' "password123" | md5sum | cut -d' ' -f1 > test.hash
# Crack with wordlist
hashcat -m 0 test.hash /usr/share/wordlists/rockyou.txtCommon hash modes
Hashcat picks the hash type with a numeric mode (-m). These are the ones that come up most:
Password hashes
| Hash type | Mode | Category |
|---|---|---|
| MD5 | 0 | Raw Hash |
| SHA1 | 100 | Raw Hash |
| SHA2-256 | 1400 | Raw Hash |
| SHA2-512 | 1700 | Raw Hash |
| NTLM | 1000 | Operating System |
| bcrypt | 3200 | Operating System |
Windows & Active Directory
| Hash type | Mode | Use case |
|---|---|---|
| NTLM | 1000 | Windows local accounts |
| NetNTLMv1 | 5500 | Network authentication |
| NetNTLMv2 | 5600 | Network authentication |
| Domain Cached Credentials (DCC) | 1100 | Cached domain creds |
| Domain Cached Credentials 2 (DCC2) | 2100 | Cached domain creds |
Kerberos
| Hash type | Mode | Attack |
|---|---|---|
| Kerberos 5 AS-REP (etype 23) | 18200 | AS-REP Roasting |
| Kerberos 5 TGS-REP (etype 23) | 13100 | Kerberoasting |
| Kerberos 5 etype 17 TGS-REP | 19600 | TGS-REP cracking |
| Kerberos 5 etype 18 Pre-Auth | 19900 | Pre-Auth cracking |
Application hashes
| Hash type | Mode | Application |
|---|---|---|
| KeePass | 13400 | Password manager |
| 1Password cloudkeychain | 8200 | Password manager |
| LastPass | 6800 | Password manager |
| BitLocker | 22100 | Full disk encryption |
| VeraCrypt | 13711+ | Disk encryption |
Use hashcat --help | grep -i <keyword> to find a mode. The full list has more than 350 formats.
Hash identification
Identify the hash type before you crack it.
Using hash-identifier
# Interactive mode
hash-identifier
# Paste your hash when prompted
# Example: 5f4dcc3b5aa765d61d8327deb882cf99Using hashid
# More accurate than hash-identifier
hashid '$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy'
# Output:
# Analyzing '$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy'
# [+] Blowfish(OpenBSD)
# [+] Woltlab Burning Board 4.x
# [+] bcryptUsing Hashcat directly
# Let hashcat identify the hash
hashcat --identify hash.txt
# Shows all possible hash typesOnline hash analyzer
For an odd hash the local tools can't place, TunnelsUp Hash Analyzer shows likely types with examples. Don't paste client hashes into a third-party site.
Attack modes
The attack mode is set with -a.
Mode 0: straight (wordlist)
Tries each word in the list, optionally run through rules.
# Basic wordlist attack
hashcat -m 1000 -a 0 ntlm.hash /usr/share/wordlists/rockyou.txt
# With rules to mutate passwords
hashcat -m 1000 -a 0 ntlm.hash /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule
# Multiple rule files
hashcat -m 1000 -a 0 ntlm.hash wordlist.txt -r best64.rule -r toggles.ruleMode 3: brute force (mask)
Tries every combination the mask allows, one character set per position.
# 8-character lowercase
hashcat -m 0 -a 3 md5.hash ?l?l?l?l?l?l?l?l
# 6-8 characters, all types
hashcat -m 0 -a 3 md5.hash ?a?a?a?a?a?a?a?a --increment --increment-min 6 --increment-max 8
# Common pattern: capital + lowercase + digits
hashcat -m 0 -a 3 md5.hash ?u?l?l?l?l?d?d?d?dBuilt-in character sets:
?l- abcdefghijklmnopqrstuvwxyz?u- ABCDEFGHIJKLMNOPQRSTUVWXYZ?d- 0123456789?h- 0123456789abcdef (hex)?s- Special characters (!@#$%^&*)?a- All of the above
Mode 1: combinator
Joins every word in the first list with every word in the second.
# Combine two wordlists
hashcat -m 0 -a 1 hash.txt words1.txt words2.txt
# Example: "password" + "123" = "password123"Modes 6 and 7: hybrid
Appends (mode 6) or prepends (mode 7) a mask to each wordlist entry.
# Wordlist + mask (e.g., "password" + "123")
hashcat -m 0 -a 6 hash.txt wordlist.txt ?d?d?d
# Mask + wordlist (e.g., "123" + "password")
hashcat -m 0 -a 7 hash.txt ?d?d?d wordlist.txtRules
A rule turns one wordlist entry into one or more candidates: capitalise it, append a year, swap letters for digits.
Pre-built rules
# Best64 - highly effective, balanced
hashcat -m 1000 hash.txt wordlist.txt -r /usr/share/hashcat/rules/best64.rule
# Dive - more aggressive
hashcat -m 1000 hash.txt wordlist.txt -r /usr/share/hashcat/rules/dive.rule
# Leetspeak
hashcat -m 1000 hash.txt wordlist.txt -r /usr/share/hashcat/rules/leetspeak.rule
# Combine multiple rules
hashcat -m 1000 hash.txt wordlist.txt -r best64.rule -r toggles.ruleTest a rule
--stdout prints the candidates instead of cracking, so you can see what a rule does:
# Test rule transformations
echo "password" | hashcat --stdout -r custom.rule
# Example output with best64.rule:
# password
# Password
# PASSWORD
# password1
# password123
# drowssap (reversed)Write a custom rule
# Example custom.rule
cat > custom.rule << EOF
# Capitalize first letter
c
# Append year
$2 $0 $2 $3
# Append common suffix
$! $!
# Leetspeak substitution
sa@ so0 se3
EOF
# Use custom rule
hashcat -m 1000 hash.txt wordlist.txt -r custom.ruleStart with best64.rule. It is 64 rules picked for how many real passwords they crack, and it runs fast.
Practical examples
NTLM hashes
# Windows NTLM hash format
# Example: Administrator:500:aad3b435b51404eeaad3b435b51404ee:8846f7eaee8fb117ad06bdd830b7586c:::
# Extract just the NTLM hash (second part after third colon)
echo "8846f7eaee8fb117ad06bdd830b7586c" > ntlm.hash
# Crack with wordlist and rules
hashcat -m 1000 ntlm.hash /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule --force
# Optimized for NTLM (fast hash)
hashcat -m 1000 ntlm.hash /usr/share/wordlists/rockyou.txt -O -w 3Kerberoasting (TGS-REP)
# Crack Kerberos TGS-REP tickets (from impacket GetUserSPNs.py)
hashcat -m 13100 tgs.hash /usr/share/wordlists/rockyou.txt --force
# With rules for service accounts
hashcat -m 13100 tgs.hash wordlist.txt -r best64.ruleAS-REP Roasting
# Crack AS-REP responses (from impacket GetNPUsers.py)
hashcat -m 18200 asrep.hash /usr/share/wordlists/rockyou.txt --forceNetNTLMv2 from Responder
# Format: username::domain:challenge:HMAC-MD5:blob
hashcat -m 5600 netntlmv2.hash /usr/share/wordlists/rockyou.txt -r best64.rule
# High workload profile for faster cracking
hashcat -m 5600 netntlmv2.hash /usr/share/wordlists/rockyou.txt -w 3Multiple hash files
# Crack multiple hashes at once
cat hash1.txt hash2.txt hash3.txt > all_hashes.txt
hashcat -m 1000 all_hashes.txt /usr/share/wordlists/rockyou.txt
# Remove cracked hashes from file
hashcat -m 1000 all_hashes.txt /usr/share/wordlists/rockyou.txt --removePerformance
Workload profiles
# -w 1: Low (2ms, minimal impact)
# -w 2: Default (12ms, balanced)
# -w 3: High (96ms, desktop unresponsive)
# -w 4: Nightmare (480ms, headless systems)
hashcat -m 1000 hash.txt wordlist.txt -w 3Optimized kernels
# Enable optimized kernels (limits password length)
hashcat -m 1000 hash.txt wordlist.txt -O
# Combine with workload profile
hashcat -m 1000 hash.txt wordlist.txt -O -w 3Device selection
# Use specific GPU
hashcat -m 1000 hash.txt wordlist.txt -d 1
# Use multiple GPUs
hashcat -m 1000 hash.txt wordlist.txt -d 1,2,3
# Check device info
hashcat -ISessions
# Name session for resume capability
hashcat -m 1000 hash.txt wordlist.txt --session mysession
# Resume interrupted session
hashcat --session mysession --restore
# Status of running session
hashcat --session mysession --statusOther techniques
Hex-encoded output
Hashcat prints a plaintext as $HEX[...] when it contains a colon or non-printable characters:
# Hashcat output: 2e208ad146efda5bc44869025e06544a:$HEX[7261626269743a29]
# Decode hex to plaintext
echo -n '7261626269743a29' | xxd -r -p && echo
# Output: rabbit:)Show results and benchmark
# Show cracked passwords
hashcat -m 1000 hash.txt --show
# Show remaining uncracked hashes
hashcat -m 1000 hash.txt --left
# Benchmark hash mode
hashcat -b -m 1000
# Get detailed status
hashcat -m 1000 hash.txt wordlist.txt --status --status-timer=5Potfile
Hashcat writes every cracked hash to a potfile and skips hashes already in it:
# Default location: ~/.local/share/hashcat/hashcat.potfile
# (or $XDG_DATA_HOME/hashcat/; older releases used ~/.hashcat/)
# Use custom potfile
hashcat -m 1000 hash.txt wordlist.txt --potfile-path custom.pot
# Disable potfile
hashcat -m 1000 hash.txt wordlist.txt --potfile-disable
# Compare hash with potfile
hashcat -m 1000 hash.txt --showLoopback mode
Loopback feeds cracked plaintexts back in as new candidates:
# Enable loopback
hashcat -m 1000 hashes.txt wordlist.txt --loopback
# Cracked passwords become new candidates with rules appliedFlag reference
# Essential flags
-m, --hash-type # Hash type (see mode list)
-a, --attack-mode # 0=straight, 1=combination, 3=brute-force
-r, --rules-file # Apply rules from file
-w, --workload-profile # 1-4, performance level
-O, --optimized-kernel # Enable optimized kernels
-d, --backend-devices # Select GPU(s)
# Output control
-o, --outfile # Write cracked passwords to file
--show # Display cracked passwords
--left # Display uncracked hashes
--username # Parse username from hash file
# Session management
--session # Name for resumable sessions
--restore # Resume previous session
--status # Show status during cracking
# Advanced
--increment # Increment mask length
--increment-min # Start mask length
--increment-max # End mask length
--force # Ignore warnings
--remove # Remove hash after cracking
--quiet # Suppress outputScenarios
Scenario 1: SAM database
# Extract hashes from SAM
secretsdump.py -sam SAM -system SYSTEM LOCAL
# Crack NTLM hashes
hashcat -m 1000 ntlm_hashes.txt /usr/share/wordlists/rockyou.txt -r best64.rule -O -w 3
# Try brute-force for remaining hashes (8 chars max)
hashcat -m 1000 ntlm_hashes.txt -a 3 ?a?a?a?a?a?a?a?a --increment --increment-min 6Scenario 2: Kerberoasting
# Get service tickets
GetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.10 -request
# Crack TGS-REP tickets
hashcat -m 13100 tickets.txt /usr/share/wordlists/rockyou.txt -r best64.rule --force
# Service accounts often use weak passwords
hashcat -m 13100 tickets.txt common_passwords.txtScenario 3: mask built from the password policy
If you know the password policy, or the pattern most users follow (here one uppercase, six lowercase, two digits), build the mask from it:
# Create mask matching policy
hashcat -m 1000 hash.txt -a 3 ?u?l?l?l?l?l?l?d?d
# Or with hybrid approach
hashcat -m 1000 hash.txt -a 6 wordlist.txt ?d?dTroubleshooting
Out of memory
# Reduce workload profile
hashcat -m 1000 hash.txt wordlist.txt -w 2
# Use segment size limit
hashcat -m 1000 hash.txt wordlist.txt -c 32GPU not detected
# Check OpenCL/CUDA installation
hashcat -I
# Force specific backend
hashcat --backend-devices 1 -m 1000 hash.txt wordlist.txt
# Update GPU drivers
# NVIDIA: https://www.nvidia.com/drivers
# AMD: https://www.amd.com/supportHash format errors
# Some hashes need specific formatting
# Check example hashes: https://hashcat.net/wiki/doku.php?id=example_hashes
# Use --example-hashes to see format
hashcat -m 1000 --example-hashesReferences
MITRE ATT&CK Techniques
- T1110.002 - Brute Force: Password Cracking - Offline password hash cracking
- T1558.003 - Steal or Forge Kerberos Tickets: Kerberoasting - TGS-REP cracking
- T1558.004 - Steal or Forge Kerberos Tickets: AS-REP Roasting - AS-REP cracking
- T1003 - OS Credential Dumping - Password hash extraction
- T1552.001 - Unsecured Credentials: Credentials In Files - Hash file analysis
Official documentation
- Hashcat Wiki - Official documentation
- Example Hashes - Hash format reference
- Rule-based Attack - Rule syntax guide
- Mask Attack - Brute-force patterns
Community resources
- Hashcat Forums - Community support
- Hashcat Discord - Real-time help
- Hashcat GitHub - Source code and issues
Related tools
- Hashcat-Utils - Utility collection for rule and wordlist manipulation
- kwprocessor - Keyboard walk generator
Next steps
Only crack hashes you are authorized to crack. Cracked client passwords are sensitive data: store and delete them as the rules of engagement say.
Command and Control Infrastructure Setup and OPSEC
C2 infrastructure architecture guide covering redirectors, domain fronting, malleable profiles, CDN-based evasion, and operational security.
Impacket for Active Directory attacks
Reference notes for the Impacket toolkit, covering GetUserSPNs, secretsdump, psexec, ntlmrelayx, and more for AD penetration testing.