Skip to content
Pwnversity
TOOL-HASHCATintermediate · 5 min · upd. 2026-10

hashcat & John

hashcat and John the Ripper are the reference password-cracking tools. hashcat uses the GPU (very fast); John excels on CPU and exotic formats. They’re used to audit passwords and, in pentest/CTF, to break captured hashes (see Hashing & cracking, Credential Dumping).

Both recover plaintext passwords from their hash by trying candidates (dictionary, rules, mask) and comparing. hashcat leverages the GPU and is the fastest; John (JtR) is very sharp on CPU, ships *2john utilities to extract hashes from files, and supports a wide range of formats.

  • Audit password strength in an authorized environment.
  • Break hashes captured in pentests (NTLM, Kerberos, NetNTLMv2…).
  • Recover passwords from protected files (ZIP, SSH, KeePass…) with *2john.
Ventana de terminal
sudo apt install hashcat john # Kali/Parrot
hashcat -I # list devices (GPU/CPU)
# classic wordlist
zcat /usr/share/wordlists/rockyou.txt.gz > rockyou.txt

hashcat — hashcat -m <mode> -a <attack> hashes.txt <wordlist/mask>:

Ventana de terminal
hashcat -m 0 hashes.txt rockyou.txt # MD5 + dictionary
hashcat -m 1000 ntlm.txt rockyou.txt -r rules/best64.rule # NTLM + rules
hashcat -m 22000 capture.hc22000 rockyou.txt # WPA/WPA2 (see /en/wireless/wifi-wpa/)
hashcat -m 1000 ntlm.txt -a 3 '?u?l?l?l?l?d?d' # mask (structured brute force)
hashcat hashes.txt --identify # helps detect the mode
hashcat -m 0 hashes.txt --show # show already cracked (potfile)

John — autodetects the format:

Ventana de terminal
john --wordlist=rockyou.txt hash.txt # dictionary
john --wordlist=rockyou.txt --rules hash.txt # with rules
john --format=raw-md5 hash.txt # force format
john --show hash.txt # view results

Common hashcat modes (-m):

Mode Hash
0 MD5
100 SHA1
1000 NTLM
1800 sha512crypt ($6$, Linux)
3200 bcrypt ($2*$)
5600 NetNTLMv2 (Responder)
13100 Kerberoast (TGS-REP, RC4)
18200 AS-REP roast
22000 WPA-PBKDF2-PMKID+EAPOL

Attack types (-a): 0 dictionary, 1 combinator, 3 mask (brute force), 6 hybrid dict+mask, 7 hybrid mask+dict.

Mask charsets: ?l lowercase, ?u uppercase, ?d digits, ?s symbols, ?a all.

Ventana de terminal
# hybrid: dictionary word + 3 digits at the end
hashcat -m 1000 ntlm.txt -a 6 rockyou.txt '?d?d?d'
# custom charset and mask
hashcat -m 0 h.txt -a 3 -1 '?l?d' '?1?1?1?1?1?1'

John — extract hashes from files with *2john utilities and crack:

Ventana de terminal
zip2john secret.zip > zip.hash && john --wordlist=rockyou.txt zip.hash
ssh2john id_rsa > rsa.hash && john --wordlist=rockyou.txt rsa.hash
# combine /etc/passwd + /etc/shadow to crack Linux users
unshadow passwd.txt shadow.txt > unshadow.txt
john --wordlist=rockyou.txt unshadow.txt
flowchart TD
  A[Captured hash] --> B{Identify type}
  B -->|hashcat --identify / name-that-hash| C[Pick -m]
  C --> D[Dictionary + best64 rules]
  D -->|no luck| E[Mask / hybrid]
  E -->|no luck| F[Bigger wordlists + d3ad0ne rules]
  A -->|protected file| G[*2john -> John]
  • Always start with dictionary + rules (best64.rule): the best cost/benefit ratio.
  • Save mask brute force for short passwords or known patterns.
  • hashcat stores cracked hashes in the potfile; --show retrieves them without recomputing.
  • To identify the type: hashcat --identify, name-that-hash, or hashid.
  • Cracking is offline: it generates no traffic against the target, so it isn’t detectable over the network.
  • What’s detectable is the prior stage (the dump or capture): Kerberoasting leaves mass TGS requests (Event ID 4769), and Responder/NetNTLMv2 involves anomalous LLMNR/NBT-NS traffic (see LLMNR/NBT-NS).
  • Real defense: long, unique passwords and slow algorithms (bcrypt/argon2) that make cracking unfeasible.
  • Hashes obtained within an authorized audit.
  • Hash type identified and correct -m mode.
  • First attempt with dictionary + rules.
  • Mask/hybrid only after exhausting the above.
  • Results treated as sensitive data (no exfiltration).