Hashcat
Hashcat is the de-facto GPU-accelerated password cracker — the offensive
counterpart to John the Ripper, trading John’s broader format
support and CPU flexibility for raw speed on modern AMD/NVIDIA hardware via OpenCL,
HIP, or CUDA. It’s the standard tool for
T1110.002 — Brute Force: Password Cracking,
and accepts output from most dump tools directly (Metasploit hashdump, impacket
secretsdump.py, Mimikatz .kirbi-derived TGS hashes).
Basic usage
hashcat -m $MODE -a $ATTACK $HASHFILE $WORDLIST-m $MODE— hash type (see table below; full list viahashcat --helpor the example_hashes wiki).-a $ATTACK— attack mode:0straight wordlist,1combinator,3mask/brute,6/7hybrid wordlist+mask. Default is0.-O— use an optimized kernel (faster, but limits candidate length — typically ≤32 chars for fast hashes, more for slow ones).-r rules/$RULE.rule— apply a mangling ruleset (e.g.best64.rule,d3ad0ne.rule,OneRuleToRuleThemAll.rule— the hashcat equivalent of John’s--rules).-w 3(or4) — workload profile; use-w 4on a dedicated cracking rig,-w 2if you’re sharing the GPU with a desktop.--show— print cracked hash:plaintext pairs from the potfile.--username— input lines containuser:hash(strip the username before cracking).
A raw hash can be passed directly in place of $HASHFILE (quote it; the shell loves
to eat $ characters). Kali’s hash-identifier and hashid help identify an
unknown blob; the hashcat example hashes page
shows a canonical sample for every mode.
Common modes
| Mode | Hash type |
|---|---|
| 0 | MD5 |
| 100 | SHA1 |
| 900 | MD4 |
| 1000 | NTLM (Windows) |
| 1400 | SHA2-256 |
| 1700 | SHA2-512 |
| 1710 | SHA2-512 with salt (sha512($pass.$salt)) — format $HASH:$SALT |
| 1800 | UNIX sha512crypt $6$ (unix-password-hash-formats) |
| 3000 | LM (LANMAN) |
| 3200 | bcrypt $2*$ |
| 5500 | NetNTLMv1 |
| 5600 | NetNTLMv2 |
| 7500 | Kerberos 5 AS-REQ Pre-Auth etype 23 |
| 13100 | Kerberos 5 TGS-REP etype 23 (RC4) — kerberoasting |
| 18200 | Kerberos 5 AS-REP etype 23 — as-rep-roasting |
| 19600 | Kerberos 5 TGS-REP etype 17 (AES128) |
| 19700 | Kerberos 5 TGS-REP etype 18 (AES256) |
| 19800 | Kerberos 5 AS-REP etype 17 |
| 19900 | Kerberos 5 AS-REP etype 18 |
A large set of “Raw Hash, Salted and/or Iterated” modes accept $HASH:$SALT —
see the example_hashes wiki for the exact per-mode layout. Output is always
HASH:PLAINTEXT tuples; the potfile (~/.hashcat/hashcat.potfile by default)
records cracked pairs so re-running the same file is cheap — use --show rather
than re-cracking.
A Token length exception almost always means the input line has the wrong shape:
an extra field, a stray colon, a missing $ marker, or a hash that got truncated
when copied out of a terminal (PowerShell’s console width truncation is the classic
culprit for long TGS hashes — use Out-File -Width 8000).
Attack modes in practice
Wordlist (mode 0)
hashcat -m 1000 ntlm.txt /usr/share/wordlists/rockyou.txt -r rules/best64.ruleThe workhorse. RockYou plus a mangling ruleset cracks the overwhelming majority of human-chosen passwords against fast hashes (NTLM, MD5).
Combinator (mode 1)
Concatenate every entry of wordlist A with every entry of wordlist B:
hashcat -m 1000 ntlm.txt -a 1 left.txt right.txtThe standalone combinator.bin from hashcat-utils pre-generates the combined list:
/usr/lib/hashcat-utils/combinator.bin $W1 $W2 > combined.txtMask / brute force (mode 3)
Masks describe a per-position character class:
| Placeholder | Class |
|---|---|
?l | lowercase |
?u | uppercase |
?d | digit |
?s | special |
?a | all printable ASCII |
?b | 0x00–0xff |
# Generate all 4-digit PINs on stdout (no hash needed)
hashcat -a 3 ?d?d?d?d --stdout
# Crack an MD5 of a 4-digit PIN
hashcat -a 3 -m 0 $MD5_HASH ?d?d?d?d
# Crack NTLM where the policy is "8 chars, first uppercase, ends with two digits"
hashcat -a 3 -m 1000 ntlm.txt ?u?l?l?l?l?l?d?dCustom classes go in --custom-charset1 (etc.) and are referenced as ?1.
Hybrid (modes 6 / 7)
Wordlist + mask (mode 6) or mask + wordlist (mode 7) — covers “password is a dictionary word plus a year/symbol suffix” better than pure rules:
hashcat -a 6 -m 1000 ntlm.txt rockyou.txt ?d?d?d?dConsuming output from other tools
-
Metasploit
hashdump/post/windows/gather/smart_hashdump— feed the file with-m 1000 --username. -
Impacket
secretsdump.py— same NTLM format, same-m 1000. -
Impacket
GetUserSPNs.py -request— emits Hashcat-format-m 13100lines directly; pipe to file and crack. -
Impacket
GetNPUsers.py -request— emits-m 18200AS-REP lines. -
Rubeus
kerberoast— same-m 13100format. -
/etc/shadow—-m 1800(sha512crypt),-m 500(md5crypt), etc. See unix-password-hash-formats for the$id$salt$hashanatomy. -
MySQL 8
mysql.user.authentication_string— the cached SHA2 (caching_sha2_password) value is a binary blob, not a crackable string. Convert it to hashcat mode 7401 (MySQL $A$ (sha256crypt)) in-database before extraction:SELECT CONCAT( '$mysql', LEFT(authentication_string, 6), '*', INSERT(HEX(SUBSTR(authentication_string, 8)), 41, 0, '*') ) FROM mysql.user WHERE user = 'target';Then crack with
hashcat -m 7401 -O hash.txt rockyou.txt. The transformation re-wraps the raw bytes into the$mysql$TYPE*SALT*HASHlayout hashcat expects; without it the blob is rejected with a token-length error. -
John’s
.pot— John and Hashcat use incompatible potfile formats; extract cracked pairs viajohn --showand re-feed the uncracked hashes.
Comparing with John the Ripper
| Hashcat | John | |
|---|---|---|
| Hardware | GPU-first (OpenCL/HIP/CUDA) | CPU-first (some GPU formats) |
| Format breadth | ~300 modes | 400+ formats (jumbo) |
| Speed on fast hashes (NTLM/MD5) | Typically 10–100× John on a decent GPU | Baseline |
| Speed on slow hashes (bcrypt/scrypt/yescrypt) | Comparable to John | Comparable to Hashcat |
| Wordlist rules | rules/*.rule files, similar syntax | Inline [List.Rules:…] in john.conf |
| Best at | High-volume fast-hash cracking (NTLM, NetNTLMv2, TGS-REP) | Long-tail formats (SSH keys, ZIP, RAR, keystore, …) |
The natural workflow is to try Hashcat first (especially for kerberoasting,
as-rep-roasting, NTLM from hashdump/mimikatz/impacket) and fall back
to john-the-ripper for formats hashcat doesn’t support.
Sources
- hashcat — advanced password recovery
- hashcat/hashcat — GitHub Repository
- Hashcat example hashes
- Brute Force: Password Cracking, Sub-technique T1110.002 — MITRE ATT&CK
Related: john-the-ripper, kerberoasting, as-rep-roasting, unix-password-hash-formats, mimikatz, impacket, msfconsole, meterpreter, hydra, h8mail.