Hashcat: Password Cracking with GPU, Hash, Modes and Rules

Hashcat: GPU password cracking practical guide for NTLM, MD5, SHA, bcrypt hashes. Attack modes, mask patterns, wordlist rules and real techniques from CTF and pentest.
- Posted on 2026-02-04
- Reading time: 12 min
Hashcat: Ultimate Guide to GPU Password Cracking for Penetration Testing #
Hashcat is the world's fastest password cracking engine. When you capture a hash during a pentest (perhaps with Responder ), Hashcat is the tool that transforms it into cleartext passwords using the power of your GPU.
Forget John the Ripper, which takes hours. With Hashcat and a decent GPU, you can crack millions of passwords per second. In this guide, you'll learn how to use Hashcat like a real penetration tester: from scratch to cracking complex enterprise hashes with techniques that work on real targets.
Setup Lab: From Hardware to Operational Cracking #
Hardware Requirements #
Compatible GPUs:
- NVIDIA (CUDA): GTX 1060 or better (RTX 3060+ recommended)
- AMD (OpenCL): RX 580 or better (RX 6700+ recommended)
- Apple Silicon: M1/M2/M3 (via Metal, limited performance)
Minimum RAM: 8GB (16GB recommended for large wordlists)
Storage: 50GB+ free for wordlist and rainbow tables
Installation on Kali Linux #
# Update sistema
sudo apt update && sudo apt upgrade -y
# Installa Hashcat
sudo apt install hashcat
# Verifica versione
hashcat --versionOutput:
v6.2.6GPU Driver Installation #
NVIDIA (performance criticisms):
# Verifica GPU riconosciuta
lspci | grep -i nvidia
# Installa driver NVIDIA
sudo apt install nvidia-driver nvidia-cuda-toolkit
# Reboot
sudo reboot
# Verifica CUDA funzionante
nvidia-sminvidia-smi output:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.147.05 Driver Version: 525.147.05 CUDA Version: 12.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... Off | 00000000:01:00.0 On | N/A |
| 30% 45C P8 15W / 170W | 1024MiB / 8192MiB | 0% Default |
+-------------------------------+----------------------+----------------------+AMD:
# Installa driver OpenCL
sudo apt install mesa-opencl-icd
# Verifica OpenCL
clinfo | grep "Device Name"Benchmark Test #
Before cracking, test GPU performance:
hashcat -bOutput (example RTX 3060):
Hashmode: 0 - MD5
Speed.#1.........: 8523.4 MH/s
Hashmode: 1000 - NTLM
Speed.#1.........: 15234.7 MH/s
Hashmode: 2500 - WPA-EAPOL-PBKDF2
Speed.#1.........: 12345 H/s
Hashmode: 3200 - bcrypt
Speed.#1.........: 5432 H/sSpeed legend:
- MH / s = Millions of hashes/second (MD5, NTLM - fast)
- kH/s = Thousands of hashes/second (SHA256, SHA512 - average)
- H/s = Hash/second (bcrypt, scrypt, Argon2 - intentionally slow)
With RTX 3060 you test about 15 billion NTLMs per second.
Identify Hash Type #
Before cracking, you need to know what type of hash you have. Hashcat supports over 300 algorithms.
Hash Common Penetration Testing #
| Hash Type | Hashcat Mode | Example | Common Use |
|---|---|---|---|
| MD5 | 0 | 5f4dcc3b5aa765d61d8327deb882cf99 | Legacy web apps |
| NTLM | 1000 | 8846f7eaee8fb117ad06bdd830b7586c | Windows (from Reply ) |
| NTLMv2 | 5600 | admin::N46iSNekpT:08ca45b7d7ea58ee:... | Windows challenge response |
| SHA1 | 100 | 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 | Git, legacy systems |
| SHA256 | 1400 | 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8 | Linux shadow modern |
| bcrypt | 3200 | $2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy | Secure web apps |
| WPA2 | 22000 | WPA*02*hash*BSSID*STATION*ESSID... | WiFi handshake |
Automatic Identification #
Usa hashid o hash-identifier:
# Installa hashid
pip3 install hashid
# Identifica hash
echo "5f4dcc3b5aa765d61d8327deb882cf99" | hashidOutput:
Analyzing '5f4dcc3b5aa765d61d8327deb882cf99'
[+] MD5
[+] Domain Cached Credentials - MD4(MD4(($pass)).(strtolower($username)))Or use online tools (but be careful not to upload hashes of real customers):
Attack Mode 0: Dictionary Attack #
The simplest attack: Try all the passwords in a wordlist.
Essential Wordlists #
RockYou (must-have):
# Già inclusa in Kali, compressa
sudo gunzip /usr/share/wordlists/rockyou.txt.gz
# Dimensione: 133MB, 14.3 milioni password
wc -l /usr/share/wordlists/rockyou.txt
# Output: 14344392 /usr/share/wordlists/rockyou.txtSecLists:
cd /opt
sudo git clone https://github.com/danielmiessler/SecLists.gitCrackStation:
wget https://crackstation.net/crackstation-human-only.txt.gz
gunzip crackstation-human-only.txt.gz
# 1.5GB, password più comuniCracking MD5 Hash (Base) #
Scenario: You have dumped MySQL database, passwords are MD5.
# Hash MD5 di "password123"
echo -n "password123" | md5sum
# Output: 482c811da5d5b4bc6d497ffa98491e38
# Salva hash
echo "482c811da5d5b4bc6d497ffa98491e38" > hash.txt
# Cracka con RockYou
hashcat -m 0 -a 0 hash.txt /usr/share/wordlists/rockyou.txtParameters:
-m 0= MD5 mode-a 0= Straight attack (dictionary)hash.txt= file with hashrockyou.txt= wordlist
Output during cracking:
hashcat (v6.2.6) starting...
OpenCL API (OpenCL 3.0) - Platform #1 [NVIDIA]
======================================================
* Device #1: NVIDIA GeForce RTX 3060, 8192 MB
Dictionary cache hit:
* Filename..: /usr/share/wordlists/rockyou.txt
* Passwords.: 14344392
* Bytes.....: 139921507
* Keyspace..: 14344385
482c811da5d5b4bc6d497ffa98491e38:password123
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 0 (MD5)
Time.Started.....: Wed Feb 5 14:23:45 2025
Time.Estimated...: Wed Feb 5 14:23:46 2025 (1 sec)
Speed.#1.........: 8523.4 MH/s
Recovered........: 1/1 (100.00%) Digests
Progress.........: 8523456/14344385 (59.42%)Cracked in 1 second! Password found: password123
View Cracked Passwords #
hashcat -m 0 hash.txt --showOutput:
482c811da5d5b4bc6d497ffa98491e38:password123If you work in environments without a GPU or want to analyze specific formats in CPU mode, you can use the historical alternative John the Ripper , which is discussed in detail here: 👉 https://hackita.it/articoli/john-the-ripper
Hashcat remains superior in terms of speed thanks to GPU acceleration, but knowledge of both tools is essential in a real-world penetration testing context.
Cracking NTLM Hash (Windows) #
Scenario: Captured NTLM hash with Responder.
# Hash NTLM di "Summer2024!"
echo "8846f7eaee8fb117ad06bdd830b7586c" > ntlm.txt
# Cracka con wordlist italiana
hashcat -m 1000 -a 0 ntlm.txt /opt/SecLists/Passwords/italian.txtNTLM Performance: With RTX 3060 → about 15 GH/s → tests 15 billion passwords/second.
RockYou (14.3M passwords) runs out in less than 1 second.
Cracking NTLMv2 (Challenge-Response) #
NTLMv2 hashes captured by Responder have different format:
# Esempio hash NTLMv2
echo "admin::CORP:1122334455667788:8C5D91E2F42AB3C5:010100..." > ntlmv2.txt
# Cracka (più lento di NTLM semplice)
hashcat -m 5600 -a 0 ntlmv2.txt rockyou.txtNTLMv2 Performance: RTX 3060 → approximately 500 kH/s (500.000 hashes/second)
Much slower because it includes challenge-response. RockYou takes about 30 seconds.
Attack Mode 3: Brute Force with Mask #
When wordlists fail, you use mask attacks: you generate all possible combinations based on patterns.
Default Charset #
| Charset | Symbol | Characters | Example |
|---|---|---|---|
| Lowercase | ?l | AZ | ?l?l?l?l = aaaa, aaab, … zzzz |
| Uppercase | ?u | AZ | ?u?u?u?u = AAAA, AAAB, … ZZZZ |
| Digits | ?d | 0-9 | ?d?d?d?d = 0000, 0001, … 9999 |
| Special | ?s | !@#$%… | ?s?s = !!, !@, … |
| All lowercase+num | ?l?d | a-z0-9 | combined |
| All printable | ?a | a-zA-Z0-9 + special | Everything |
Common Password Patterns #
Typical business passwords:
# Estate2024! (Stagione + Anno + !)
hashcat -m 1000 -a 3 hash.txt ?u?l?l?l?l?l?d?d?d?d!
# Admin123
hashcat -m 1000 -a 3 hash.txt ?u?l?l?l?l?d?d?d
# Welcome@2024
hashcat -m 1000 -a 3 hash.txt ?u?l?l?l?l?l?l?s?d?d?d?d
# Password1! (comune)
hashcat -m 1000 -a 3 hash.txt ?u?l?l?l?l?l?l?l?d!Automatic Increment #
Test all lengths from minimum to maximum:
# Password 6-8 caratteri lowercase+digits
hashcat -m 0 -a 3 hash.txt --increment --increment-min=6 --increment-max=8 ?l?l?l?l?l?l?l?lConcrete example - 4-digit PIN:
# Tutti i PIN da 0000 a 9999
hashcat -m 0 -a 3 hash.txt ?d?d?d?dKeyspace: 10.000 combinations Time with RTX 3060: < 1 millisecond (8.5 GH/s for MD5)
Custom Charset #
Define custom charsets:
# Solo vocali lowercase
hashcat -m 0 -a 3 hash.txt -1 aeiou ?1?1?1?1?1
# Hex characters (0-9a-f)
hashcat -m 0 -a 3 hash.txt -1 0123456789abcdef ?1?1?1?1?1?1?1?1Practical example - Software serials:
# Formato: XXXX-XXXX (X = 0-9A-F)
hashcat -m 0 -a 3 hash.txt -1 ?u?d ?1?1?1?1-?1?1?1?1Mask File for Extended Campaigns #
Create files with multiple masks:
nano masks.hcmaskContent:
?d?d?d?d
?d?d?d?d?d
?d?d?d?d?d?d
?l?l?l?l?d?d
?l?l?l?l?d?d?d
?u?l?l?l?l?d?d
?u?l?l?l?l?d?d?d
?u?l?l?l?l?d?d?d!
?u?l?l?l?l?l?d?d?d?d
?u?l?l?l?l?l?s?d?d?d?dExecution:
hashcat -m 1000 -a 3 hash.txt masks.hcmaskHashcat tries all masks in sequence.
Attack Mode 6: Hybrid Wordlist + Mask #
Combine wordlist with mask: append/prepend characters to existing passwords.
Hybrid Attack: Wordlist + Suffix #
Scenario: Corporate password = common word + year.
# Appende anno 2020-2025
hashcat -m 1000 -a 6 hash.txt rockyou.txt ?d?d?d?dWhat does he do:
- Law
passwordfrom rockyou.txt - Generate:
password2020,password2021,…,password9999 - Law
adminfrom rockyou.txt - Generate:
admin2020,admin2021, ...
Hybrid Attack: Prefix + Wordlist #
# Prepende carattere speciale + digit
hashcat -m 1000 -a 7 hash.txt ?s?d rockyou.txtGenerate:
!1password,!2password,…,!9password@1admin,@2admin, ...
Real-world example - “Mandatory special character” policy:
Many companies force: "At least one special character." Users simply do: Password123!
# Testa parole comuni + ! alla fine
hashcat -m 1000 -a 6 hash.txt common_passwords.txt !Rules: Advanced Mutation Wordlist #
Rules are the secret of pros. They transform every password in the wordlist into dozens of variations.
Default Rule Base #
Hashcat includes optimized rulesets:
ls -lh /usr/share/hashcat/rules/Output:
best64.rule # 64 regole migliori (veloce)
d3ad0ne.rule # 33k regole (medio)
dive.rule # 100k regole (lento, completo)
InsidePro-PasswordsPro.rule # 727M regole (massiccio)Apply Rules #
# RockYou + best64 rules
hashcat -m 1000 -a 0 hash.txt rockyou.txt -r /usr/share/hashcat/rules/best64.ruleWhat best64 rules do:
password→Password(capitalize)password→PASSWORD(uppercase)password→p@ssword(leetspeak)password→password123(append digits)password→drowssap(reverse)password→Password!(capitalize + !)- … 58 additional variations
Multiplier effect: RockYou has 14.3M passwords → with best64 it becomes about 915M combinations to test.
Combining Multiple Rules #
# Applica best64 + leetspeak + specifiche
hashcat -m 1000 -a 0 hash.txt rockyou.txt -r best64.rule -r leetspeak.ruleCustom Rules #
Create custom.rule:
nano custom.ruleContent:
# Append anno corrente
$2$0$2$4
# Capitalize first + append !
c$!
# Leetspeak common
sa4 se3 si1 so0
# Duplicate
d
# Reverse + append 123
r$1$2$3Syntax rules:
c= Capitalize first$X= Append character X^X= Prepend character XsXY= Substitute X with Yd= Duplicater= ReverseT0= Toggle case[/]= Rotate left/right
Apply custom rule:
hashcat -m 1000 -a 0 hash.txt wordlist.txt -r custom.ruleCracking Hash Complexes: bcrypt, SHA512crypt #
bcrypt (Very Slow by Design) #
bcrypt is designed to be slow (anti-bruteforce). It uses a cost factor (work factor).
Example bcrypt hash:
$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWyStructure:
$2a$= bcrypt algorithm10= Cost factor (2^10 = 1024 iterations)N9qo8uLOickgx2ZMRZoMye= SaltIjZAgcfl7p92ldGxad68LJZdL17lhWy= Hash
Cracking:
hashcat -m 3200 -a 0 bcrypt.txt rockyou.txtbcrypt performance (cost 10): RTX 3060 → about 5.4 kH/s (5.400 hashes/second)
Time for RockYou: 14.3M passwords / 5.4k/s = about 44 minutes
For cost factor 12 (4x slower): about 3 hours
Workaround for bcrypt:
- Use small, targeted wordlists
- Apply only essential rules
- Consider only likely passwords (no complete brute force)
SHA512crypt (Linux Shadow) #
# Hash da /etc/shadow Linux
echo '$6$rounds=5000$salt$hash...' > shadow.txt
hashcat -m 1800 -a 0 shadow.txt rockyou.txtPerformance SHA512crypt: RTX 3060 → approx. 120 kH/s
Faster than bcrypt but slower than NTLM.
Performance Optimization #
Workload Tuning #
# Performance massima (può bloccare GUI)
hashcat -m 1000 -a 0 hash.txt rockyou.txt -w 4
# Performance bilanciata (default)
hashcat -m 1000 -a 0 hash.txt rockyou.txt -w 3
# Performance bassa (sistema usabile)
hashcat -m 1000 -a 0 hash.txt rockyou.txt -w 2Workload levels:
-w 1= Low (usable PC, GPU at 20%)-w 2= Default (PC usable, GPU at 50%)-w 3= High (GUI lag, GPU at 90%)-w 4= Nightmare (system frozen, GPU at 100%)
Kernel Optimizer #
# Auto-tune kernel (consigliato)
hashcat -m 1000 -a 0 hash.txt rockyou.txt -OFlag -O Enables optimized kernels specifically for short passwords (≤32 chars). Typically increases speed by 20-40%.
Multiple GPU #
# Usa solo GPU 1 e 2
hashcat -m 1000 -a 0 hash.txt rockyou.txt -d 1,2
# Info su GPU disponibili
hashcat -Ioutput -I:
OpenCL Info:
============
Platform ID #1
Vendor : NVIDIA Corporation
Name : NVIDIA CUDA
Device ID #1
Name : NVIDIA GeForce RTX 3060
Compute capability: 8.6
Platform ID #2
Vendor : AMD
Name : AMD Accelerated Parallel Processing
Device ID #2
Name : AMD Radeon RX 6700Use both:
hashcat -m 1000 hash.txt rockyou.txt -d 1,2Performance adds up: RTX 3060 (15 GH/s) + RX 6700 (12 GH/s) = 27 GH/s total.
Sessions and Restores #
Save/Restore Session #
Hashcat can be stopped and resumed:
# Avvia con session name
hashcat -m 1000 -a 3 hash.txt ?a?a?a?a?a?a?a --session=mycrack
# Durante esecuzione, premi 'q' per quit (salva stato)
# Riprendi session
hashcat --session=mycrack --restoreAutomatic Checkpoint #
Hashcat automatically saves state every 10 seconds to:
~/.hashcat/sessions/mycrack.restoreIf your system/GPU crashes, you can pick up right where you left off.
Monitor Progress #
While running, press:
s= Status (show progress)p= Pauser= Resumeb= Bypass current word (debug)q= Quit (save and exit)
Output status (press 's'):
Session..........: hashcat
Status...........: Running
Hash.Mode........: 1000 (NTLM)
Time.Started.....: Wed Feb 5 15:30:22 2025
Time.Estimated...: Wed Feb 5 15:45:12 2025 (14 mins, 50 secs)
Guess.Base.......: File (rockyou.txt)
Speed.#1.........: 15234.7 MH/s
Recovered........: 3/10 (30.00%)
Progress.........: 5234567890/14344385000 (36.47%)
Rejected.........: 12345/5234567890 (0.00%)
Restore.Point....: 5234560000/14344385000Most Common Hashes in Penetration Testing — Top 30 Table #
This table presents the 30 most relevant hashes you'll encounter during real-world penetration testing. It's based on official documentation available at https://hashcat.net/wiki/doku.php?id=example_hashes and practical experience in enterprise engagement.
| Fashion | Algorithm/Type | Hash Example | Where it is | Safety |
|---|---|---|---|---|
| 0 | MD5 | 5f4dcc3b5aa765d61d8327deb882cf99 | Legacy web app database, phpBB, vBulletin | Weak |
| 100 | SHA1 | 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 | Git commits, legacy systems | Weak |
| 1000 | NTLM | b4b9b02e6f09a9bd760f388b67351e2b | Windows SAM, Active Directory | Weak |
| 1100 | Domain Cached Credentials (DCC) | 4dd8965d1d476fa0d84ffea16e96b7... | Windows cached credentials | Medium |
| 1400 | SHA256 | 5e884898da28047151d0e56f8dc6292... | Modern Linux /etc/shadow | Medium |
| 1700 | SHA512 | b109f3bbbc244eb82441917ed06d618... | Linux /etc/shadow enterprise | Medium |
| 1800 | sha512crypt $6$, SHA512(Unix) | $6$rounds=5000$salt$hash... | Linux/Unix shadow file | High |
| 2500 | WPA-EAPOL-PBKDF2 | hash$bssid$station$essid... | WiFi WPA/WPA2 handshake (legacy) | Medium |
| 3200 | bcrypt $2*$, Blowfish (Unix) | $2a$10$N9qo8uLOickgx2ZMRZoMy... | Modern web apps (Laravel, Django) | High |
| 5500 | NetNTLMv1 / NetNTLMv1+ESS | u4-netntlm::kNS:338d08f8e26... | Windows NTLM auth legacy | Weak |
| 5600 | NetNTLMv2 | admin::N46iSNekpT:08ca45b7d7... | Windows NTLM auth, Responder captures | Medium |
| 13100 | Kerberos 5 TGS-REP etype 23 | $krb5tgs$23$*user$realm$... | Kerberoasting attacks AD | Medium |
| 18200 | Kerberos 5 AS-REP etype 23 | $krb5asrep$23$user@domain... | AS-REP roasting attacks AD | Medium |
| 16800 | WPA-PMKID-PBKDF2 | hash*bssid*station*essid | WiFi WPA/WPA2 clientless attack | Medium |
| 22000 | WPA-PBKDF2-PMKID + EAPOL | WPA*02*hash*mac*mac*essid... | WiFi WPA/WPA2/WPA3 (new format) | Medium |
| 7500 | Kerberos 5 AS-REQ Pre-Auth | $krb5pa$23$user$realm$... | Kerberos pre-auth | Medium |
| 13400 | KeepAss 1/2 AES | $keepass$*2*60000*... | KeePass database files | High |
| 11300 | Bitcoin/Litecoin wallet.dat | $bitcoin$96$hash... | crypto wallets | High |
| 15700 | Ethereum Wallet, PBKDF2-HMAC-SHA256 | $ethereum$p*262144*... | Ethereum keystore | High |
| 1500 | desrypt, DES (Unix), Traditional DES | 48c/R8JAv757A | Legacy Unix systems | Weak |
| 3000 | LM | 299BD128C1101FD6 | Windows legacy (pre-Vista) | Weak |
| 400 | phppass, WordPress (MD5), phpBB3 (MD5) | $P$9IQRaTwmfeRo7u... | WordPress, Joomla, phpBB | Medium |
| 2611 | vBulletin <v3.8.5 | bf366348c53ddcfbd16e63edfdd1eee6:48 | vBulletin forum | Weak |
| 121 | SMF (Simple Machines Forum) > v1.1 | sha1:a94c0... | SMF forums | Weak |
| 124 | Django (SHA-1) | sha1$salt$hash | Django web framework | Medium |
| 10000 | Django (PBKDF2-SHA256) | pbkdf2_sha256$120000$salt... | Modern Django | High |
| 16100 | TACACS + | $tacacs-plus$0$hash... | Cisco TACACS+ auth | Medium |
| 8900 | scrypt | SCRYPT:1024:1:1:salt:hash | Litecoin, Tarsnap | High |
| 11600 | 7-Zip | $7z$0$19$0$salt... | 7-Zip encrypted archives | Medium |
| 9700 | MS Office ≤ 2003 $0/$1, MD5 + RC4 | $oldoffice$0$hash... | Office doc legacy | Weak |
Footnotes:
- Weak: Fast to crack with modern GPUs (MD5, SHA1, NTLM, LM)
- Medium: Requires good wordlists or specific patterns (NetNTLMv2, WPA2, phpass)
- High: Slow by design, requires weak passwords or targeted wordlists (bcrypt, scrypt, Argon2)
Advanced CTF Techniques #
Salted Hash #
Hashes with salt require specific format:
# MD5 salted: hash:salt
echo "5f4dcc3b5aa765d61d8327deb882cf99:randomsalt" > salted.txt
# Mode 10 = md5($pass.$salt)
hashcat -m 10 -a 0 salted.txt rockyou.txt
# Mode 20 = md5($salt.$pass)
hashcat -m 20 -a 0 salted.txt rockyou.txtCheck correct mode with:
hashcat --example-hashes | grep -i "md5.*salt" -A 5Combinator Attack #
Combine two wordlists:
# Crea firstname.txt
echo -e "john\nmary\ndavid" > first.txt
# Crea lastname.txt
echo -e "smith\njones\nbrown" > last.txt
# Combina
hashcat -m 0 -a 1 hash.txt first.txt last.txtGenerate:
- johnsmith, johnjones, johnbrown
- marysmith, maryjones, marybrown
- davidsmith, davidjones, davidbrown
Real use: Password = first name + last name (common in companies).
Practical Penetration Testing Scenarios #
Scenario 1: Hash from Dumpato Database #
Situation: SQL injection on web app, dumped users table.
SELECT username, password FROM users;Output:
admin, 5f4dcc3b5aa765d61d8327deb882cf99
john, 482c811da5d5b4bc6d497ffa98491e38
mary, e10adc3949ba59abbe56e057f20f883eIdentify hash:
echo "5f4dcc3b5aa765d61d8327deb882cf99" | hashid
# MD5Crack all:
# Crea file hash
cat > hashes.txt << EOF
5f4dcc3b5aa765d61d8327deb882cf99
482c811da5d5b4bc6d497ffa98491e38
e10adc3949ba59abbe56e057f20f883e
EOF
# Cracking con RockYou
hashcat -m 0 -a 0 hashes.txt rockyou.txt -o cracked.txtResult:
cat cracked.txt
5f4dcc3b5aa765d61d8327deb882cf99:password
482c811da5d5b4bc6d497ffa98491e38:password123
e10adc3949ba59abbe56e057f20f883e:123456Credential spray on web app:
admin:password
john:password123
mary:123456Scenario 2: NTLM from Responder #
Captured with Responder :
cat /opt/Responder/logs/SMB-NTLMv2-SSP-192.168.1.50.txtNTLMv2 Hash:
john.doe::CORP:1122334455667788:A4F2E8C9D1B6A3F7:01010000000000008B2...Cracking:
hashcat -m 5600 -a 0 ntlmv2.txt rockyou.txt -w 4 -OIf wordlist fails, try company mask:
# Password policy: Stagione + Anno + carattere speciale
hashcat -m 5600 -a 3 ntlmv2.txt ?u?l?l?l?l?l?d?d?d?d?sGenerate: Spring2024!, Summer2024!, Winter2024!, etc.
Scenario 3: WiFi WPA2 Handshake #
Captured handshake with aircrack-ng:
# Converti .cap in formato hashcat
hcxpcapngtool -o hash.hc22000 capture.cap
# Cracka WPA2 (mode 22000)
hashcat -m 22000 -a 0 hash.hc22000 rockyou.txtWPA2 is slow (PBKDF2): RTX 3060 → about 120 kH/s
RockYou takes about 30 minutes.
Optimization with WiFi-specific wordlist:
wget https://github.com/kennyn510/wpa2-wordlists/raw/master/Wordlists/wifi.txt
hashcat -m 22000 -a 0 hash.hc22000 wifi.txtCommon WiFi passwords: router name + year, street address, phone number.
Integration with Other Tools #
John the Ripper → Hashcat #
John uses his own format. Convert:
# Hash craccato da John
john shadow.txt --format=sha512crypt
# Mostra in formato Hashcat
john shadow.txt --showCopy hash and use with Hashcat for GPU acceleration.
Hashcat → Password Spray #
After cracking, use password spray:
# Craccati 50 NTLM hash, ottieni 30 password
hashcat -m 1000 hashes.txt rockyou.txt --show > cracked.txt
# Estrai solo password
cut -d: -f2 cracked.txt > passwords.txt
# Spray con [SMBClient](/articoli/smbclient/)
for pwd in $(cat passwords.txt); do
smbclient -L //target -U admin%$pwd
doneExport Potfile #
Hashcat maintains databases of cracked hashes:
cat ~/.hashcat/hashcat.potfileOutput:
5f4dcc3b5aa765d61d8327deb882cf99:password
8846f7eaee8fb117ad06bdd830b7586c:Summer2024!
482c811da5d5b4bc6d497ffa98491e38:password123Useful for multi-target campaigns: if the hash has already been cracked in the past, Hashcat recognizes it instantly.
Common Troubleshooting #
“No hashes loaded” - Incorrect Hash Format #
Error:
No hashes loadedCause: Hash format does not match mode.
Fix:
# Identifica hash corretto
hashcat --example-hashes | grep -i ntlm
# Verifica formato richiesto
hashcat -m 1000 --example-hashesNTLM hash must be: 32 hex characters, no spaces, no prefixes.
Correct:
8846f7eaee8fb117ad06bdd830b7586cIncorrect:
NTLM:8846f7eaee8fb117ad06bdd830b7586c # ha prefisso
8846f7ee e8fb117 ad06bdd830b7586c # ha spaziGPU Not Recognized #
Error:
No devices found/leftFix NVIDIA:
# Reinstalla driver
sudo apt purge nvidia-*
sudo apt autoremove
sudo apt install nvidia-driver-525 nvidia-cuda-toolkit
sudo reboot
# Verifica
nvidia-smiFix AMD:
# Installa ROCm
sudo apt install rocm-opencl-runtime
sudo usermod -a -G video $USER
sudo rebootKernel Timeout / Watchdog #
Error:
Watchdog: Temperature abort trigger set to 90cReason:
- GPU overheating
- Unstable overclock
- Insufficient PSU
Fix:
# Limita workload
hashcat -m 1000 hash.txt wordlist.txt -w 2
# Limita kernel runtime
hashcat -m 1000 hash.txt wordlist.txt --kernel-accel=1 --kernel-loops=64Out of Memory #
Error:
CUDA error: out of memoryFix:
# Riduci dimensione wordlist
head -n 1000000 rockyou.txt > small_rockyou.txt
# Oppure split e cracka a chunks
split -l 1000000 rockyou.txt chunk_
for file in chunk_*; do
hashcat -m 0 hash.txt $file
donePerformance Comparison Table #
Hash Speed for GPUs (Hashcat Benchmark) #
| Hash Type | RTX 3060 | RTX 4090 | RX 6700 XT | Max M1 | Defense Method |
|---|---|---|---|---|---|
| MD5 | 8.5 GH / s | 25 GH / s | 7.2 GH / s | 2.1 GH / s | Do not use |
| SHA1 | 3.2 GH / s | 9.5 GH / s | 2.8 GH / s | 1.2 GH / s | Do not use |
| SHA256 | 1.2 GH / s | 3.8 GH / s | 1.1 GH / s | 450 MH / s | Do not use |
| NTLM | 15 GH / s | 45 GH / s | 12 GH / s | 4.5 GH / s | Do not use |
| NTLMv2 | 500 kH/s | 1.5 MH / s | 420 kH/s | 180 kH/s | SMB Signing |
| bcrypt (cost 10) | 5.4 kH/s | 15 kH/s | 4.8 kH/s | 2.1 kH/s | ✓ Safe |
| WPA2 | 120 kH/s | 350 kH/s | 110 kH/s | 45 kH/s | Long password |
| scrypt | 150 H / s | 450 H / s | 130 H / s | 60 H / s | ✓ Safe |
| Argon2 | 80 H / s | 220 H / s | 70 H / s | 35 H / s | ✓✓ Very safe |
Description:
- GH/s = Giga hash/second (billions)
- MH/s = Mega hash/second (millions)
- kH/s = Kilo hash/second (thousands)
- H/s = Hash/second
Tempo Cracking RockYou (14.3M password) #
| Hash Type | RTX 3060 | RTX 4090 | Dev Recommendation |
|---|---|---|---|
| MD5 | < 1 sec | < 1 sec | ❌ Never use |
| NTLM | < 1 sec | < 1 sec | ❌ Never use |
| SHA256 | ~10 sec | ~3 sec | ❌ Never use |
| bcrypt (10) | ~ 44 min | ~ 16 min | ✓ OK (cost 12+ better) |
| bcrypt (12) | ~3 hours | ~1 hour | ✓✓ Good |
| Argon2id | ~50 hours | ~18 hours | ✓✓✓ Excellent |
Operational Checklist #
Pre-Cracking:
- Hash correctly identified (hashid)
- Mode Hashcat verified (
--example-hashes) - Working GPU (nvidia-smi / clinfo)
- Downloaded wordlists (RockYou, SecLists)
- Sufficient disk space (>50GB for large wordlists)
During Cracking:
- Session saved (
--session=name) - Optimized Workload (
-w 3o-w 4) - Kernel optimized enabled (
-O) - Monitored GPU temperature (< 85°C)
- Progress verified periodically (awards
s)
Post-Cracking:
- Passwords displayed (
--show) - Output saved (
-o cracked.txt) - Backup Potfile (
~/.hashcat/hashcat.potfile) - Passwords tested on real target
- Documented for customer reporting
Best Practices:
- Always start with wordlist before brute force
- Use rule only after wordlist base fails
- Mask attack only if you know the password pattern
- Backup sessions every day for long campaigns
- Do not share customer hashes with online services
Hashcat Technical FAQ #
How long does it take to crack a random 8-character password?
It depends on the charset:
- Lowercase only (26^8): RTX 3060 → ~5 minutes (MD5)
- Lowercase + digits (36^8): RTX 3060 → ~45 minutes (MD5)
- Mixed alphanumeric (62^8): RTX 3060 → ~15 hours (MD5)
- Full ASCII (95^8): RTX 3060 → unplayable (years)
For NTLM (faster): divide times by 2. For bcrypt: impossible to brute force completely.
Does Hashcat work without a GPU?
Yes, but extremely slow. CPU mode:
hashcat -m 1000 hash.txt rockyou.txt --forceIntel i7 CPU: ~200 MH/s MD5 vs RTX 3060 GPU: 8.500 MH/s → 42x slower.
Can I crack hashes without salt if the application uses salt?
No. If application does hash(password + salt), you must provide salt:
# Formato hash:salt
echo "5f4dcc3b5aa765d61d8327deb882cf99:randomsalt123" > hash.txt
hashcat -m 10 hash.txt wordlist.txtWithout the correct salt, hash will never match.
Is it worth buying an RTX 4090 for cracking?
It depends on the use:
- Occasional (CTF, sporadic pentests): No, RTX 3060 sufficient
- Professional (monthly pentests): Yes, ROI in time saved
- Full-time red team: Absolutely, consider multi-GPU rigs
How to crack 1000 hashes at once?
Hashcat automatically handles:
# File con 1000 hash (uno per riga)
hashcat -m 1000 1000_hashes.txt rockyou.txtIdentical performance to a single hash. Hashcat optimizes automatically.
Is the password “Tr0ub4dor&3” safe?
Against dictionary: Yes (made up word, leetspeak) Against brute force: Relatively (14 char, mixed case+special+digits) Against targeted attack: Depends
Better passphrase: correct horse battery staple (longer, safer).
Can Hashcat crack hashes without knowing the algorithm?
No. You must specify the correct mode. Use hashid for automatic identification, then manually check mode:
hashid hash.txt
hashcat --help | grep -i "algoritmo_identificato"Useful links:
Legal Disclaimer: Hashcat is a legal tool for password recovery, authorized penetration testing, and security research. Using it to crack other people's passwords without explicit written consent constitutes a criminal offense. Use only on your own hashes or in the context of a formally authorized security assessment.








