☼
⌃
☰

Hashcat

Table of Contents

GPU-accelerated password recovery tool. Fastest option for raw hash cracking when a GPU is available — orders of magnitude faster than CPU-based John the Ripper for supported hash types. Prefer John the Ripper instead for file-format cracking (ZIP, PDF, SSH keys), since its conversion tools (zip2john, ssh2john) are built in and hashcat has no equivalent.

Related: Password Cracking Methodology John the Ripper Dictionary Attack Mask Attack jwttool

Attack Modes

Mode Name Use
0 Straight Dictionary attack — raw wordlist entries
1 Combination Combines two wordlists (word1+word2)
3 Brute-Force/Mask Systematic character-set iteration by pattern
6 Hybrid (wordlist+mask) Wordlist entry + appended mask (word + ?d?d?d)
7 Hybrid (mask+wordlist) Mask + wordlist entry (?d?d?d + word)
9 Association Rule-based mutation applied per-word from a dictionary

Common Hash Modes (-m)

The mode number must match the hash type exactly — wrong mode means zero cracks with no error explaining why.

Mode Hash Type
0 MD5
100 SHA1
1400 SHA256
1700 SHA512
1000 NTLM
3000 LM
1800 sha512crypt (Linux $6$)
500 md5crypt (Linux $1$)
3200 bcrypt ($2*$)
16500 JWT (HS256)
13100 Kerberos 5 TGS-REP (Kerberoasting)
18200 Kerberos 5 AS-REP (AS-REP Roasting)
SHELL
# Identify a hash's likely mode if unsure
hashcat --example-hashes | grep -B2 -i "<pattern from your hash>"
hashid '<hash>'

Core Flags

Flag Description
-m Hash mode (see table above)
-a Attack mode (0=dictionary, 3=mask, etc.)
-o Output file for cracked results
-r Rules file to apply
--show Display already-cracked hashes from potfile
--force Bypass warnings (e.g. no GPU detected, use CPU)
-w 3 Workload profile — 3 = high performance
--status Show progress during a run

Common Workflows

Dictionary Attack

SHELL
hashcat -m 0 -a 0 hash.txt /usr/share/wordlists/rockyou.txt

Dictionary + Rules

SHELL
hashcat -m 1000 -a 0 hash.txt /usr/share/wordlists/rockyou.txt \
  -r /usr/share/hashcat/rules/best64.rule

Mask Attack (Brute-Force)

SHELL
# All 4-digit PINs
hashcat -m 0 -a 3 hash.txt ?d?d?d?d

# 8 chars: 4 lowercase + 4 digits
hashcat -m 1000 -a 3 hash.txt ?l?l?l?l?d?d?d?d

NTLM Hashes (from secretsdump / Mimikatz)

SHELL
hashcat -m 1000 -a 0 ntlm_hashes.txt /usr/share/wordlists/rockyou.txt

Kerberoasting (TGS-REP)

SHELL
# Hash format from GetUserSPNs.py / Rubeus
hashcat -m 13100 -a 0 kerberoast.txt /usr/share/wordlists/rockyou.txt

AS-REP Roasting

SHELL
hashcat -m 18200 -a 0 asrep.txt /usr/share/wordlists/rockyou.txt

JWT Secret Brute Force

SHELL
# Matches jwt_tool's -C crack mode but runs on GPU
hashcat -m 16500 -a 0 jwt.txt /usr/share/wordlists/rockyou.txt

Show Cracked Results

SHELL
hashcat -a0 -m5600 hash.txt /usr/share/wordlists/seclists/Passwords/Common-Credentials/darkweb2017_top-10000.txt

Mask Character Sets

Placeholder Matches
?l Lowercase a-z
?u Uppercase A-Z
?d Digits 0-9
?s Special characters
?a All of the above

Tips

  • Results persist in ~/.hashcat/hashcat.potfile — always run --show after a session to read previously cracked hashes without re-running the attack
  • If hashcat reports no GPU detected, --force will fall back to CPU — much slower but works in VM/CTF environments without GPU passthrough
  • Use best64.rule as the default rule set before trying anything more aggressive — it catches most common mutations (capitalisation, appended digits/symbols) at low cost
  • Mode mismatches are silent failures — if a crack that should work returns nothing, double-check -m against the actual hash format before assuming the password isn't in the wordlist
  • For Kerberoasting/AS-REP hashes, strip everything before the actual hash value in the tool output (GetUserSPNs.py output includes a username:$krb5tgs$... prefix — hashcat needs just the $krb5tgs$... portion, check the mode's expected format with hashcat --example-hashes)
  • -w 3 (high performance workload) can make the system briefly unresponsive — expected behaviour, not a crash