When raw cracking speed matters, Hashcat is usually the first tool security professionals reach for. Marketed and widely recognized as the world’s fastest password recovery tool, Hashcat leverages GPU acceleration to test billions of password candidates per second against a huge range of hash algorithms — from simple MD5 to complex WPA2 handshakes and encrypted document formats. It’s a default fixture in Kali Linux’s password-attacks category and a core skill for any serious penetration tester or forensic analyst.
This article covers Hashcat comprehensively: its architecture, installation, attack modes, real command examples with output, workflow integration, optimization tips, and common troubleshooting steps.
What Is Hashcat?
Hashcat is an open-source password cracking tool that supports over 300 hash algorithms and multiple attack modes. Unlike CPU-focused tools, Hashcat is built from the ground up to exploit GPU parallelism (via OpenCL/CUDA), making it dramatically faster for algorithms that are computationally simple per-guess (like MD5 or NTLM) and still highly effective, though comparatively slower, against intentionally slow algorithms (like bcrypt).
Architecture and Internal Working
- Hash mode system: Every supported algorithm has a numeric mode (
-m), such as0for MD5,1000for NTLM,22000for WPA-PBKDF2-PMKID+EAPOL. Specifying the correct mode is mandatory for accurate cracking. - Attack modes (
-a):- 0 — Straight (dictionary): Tests each word in a wordlist directly.
- 1 — Combination: Combines two wordlists together.
- 3 — Brute-force/mask: Uses a defined character mask (e.g.,
?u?l?l?l?d?d) to generate candidates systematically. - 6/7 — Hybrid: Combines a wordlist with a mask (wordlist+mask or mask+wordlist).
- Rule engine: Similar to John the Ripper, Hashcat supports rule files to mutate wordlist entries (capitalization, appended digits, leetspeak, etc.) for broader effective coverage.
- GPU kernel execution: Hashcat compiles optimized OpenCL/CUDA kernels per hash mode, dispatching massive parallel candidate testing across all available GPU cores.
- Session and restore system: Hashcat tracks progress so long-running brute-force or mask attacks can be paused and resumed without losing progress.
Installation
Hashcat is preinstalled on Kali Linux. To install/update manually:
sudo apt update
sudo apt install hashcat -y
Verify installation and GPU detection:
hashcat -I
This lists detected OpenCL/CUDA devices (GPUs/CPUs) Hashcat can use.
Basic Syntax
hashcat -m <mode> -a <attack_mode> <hash_file> <wordlist_or_mask>
Common flags:
-m: hash mode number-a: attack mode (0=dictionary, 3=brute-force/mask, etc.)-o: output file for cracked results-r: rule file to apply--show: display already-cracked hashes from potfile--force: bypass certain hardware warnings (use cautiously)
Practical Command Examples
1. Dictionary attack against MD5 hashes
hashcat -m 0 -a 0 md5_hashes.txt /usr/share/wordlists/rockyou.txt
Sample output:
hashcat (v6.2.6) starting...
5f4dcc3b5aa765d61d8327deb882cf99:password
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 0 (MD5)
2. Cracking NTLM hashes dumped from Windows
hashcat -m 1000 -a 0 ntlm_hashes.txt rockyou.txt
3. Dictionary attack with rule-based mutation
hashcat -m 0 -a 0 md5_hashes.txt rockyou.txt -r /usr/share/hashcat/rules/best64.rule
4. Brute-force with a character mask
hashcat -m 0 -a 3 md5_hashes.txt ?u?l?l?l?l?d?d
This mask tests one uppercase letter, four lowercase letters, and two digits (e.g., Apple12).
5. Cracking a WPA2 handshake (converted with hcxpcapngtool)
hcxpcapngtool -o hash.hc22000 capture.pcapng
hashcat -m 22000 -a 0 hash.hc22000 rockyou.txt
6. Cracking a bcrypt hash (slow algorithm, small wordlist recommended)
hashcat -m 3200 -a 0 bcrypt_hashes.txt targeted_wordlist.txt
7. Viewing already-cracked results
hashcat -m 0 --show md5_hashes.txt
8. Combining two wordlists (combination attack)
hashcat -m 0 -a 1 md5_hashes.txt wordlist1.txt wordlist2.txt
9. Benchmarking your hardware
hashcat -b
Real-World Use Cases (Authorized Lab Environments Only)
- Enterprise password audits: Testing whether Active Directory NTLM hashes (extracted with authorization via tools like secretsdump.py) hold up against common wordlists and rule sets.
- WPA2/WPA3 Wi-Fi security assessments: Auditing an organization’s own wireless network for weak pre-shared keys, using a captured handshake and Hashcat’s WPA modes.
- Encrypted document/archive recovery: Recovering passwords for legitimately owned ZIP, RAR, PDF, or Office documents where the password has been lost.
- Red team engagements: Cracking hashes obtained from an authorized post-exploitation phase to demonstrate credential-related risk to a client.
Workflow Integration
- hashID → Hashcat: Identify the hash type first, then use the suggested
-mmode directly. - secretsdump.py/Mimikatz → Hashcat: A common enterprise workflow — dump NTLM hashes during an authorized assessment, then crack with mode
1000. - hcxdumptool/hcxpcapngtool → Hashcat: Standard wireless auditing pipeline for capturing and converting WPA handshakes into a crackable format.
- CeWL/Cupp → Hashcat: Build custom, organization-specific wordlists to significantly improve dictionary attack success rates over generic lists alone.
Performance Optimization
- Use
hashcat -bto benchmark your GPU(s) and understand realistic throughput for different hash modes before starting a large job. - Apply rule files (
-r) before jumping to full brute-force/mask attacks — rules often catch realistic passwords far faster. - For slow algorithms (bcrypt, Argon2, scrypt), prioritize small, targeted wordlists over large generic ones, since throughput will be orders of magnitude lower than for fast hashes like MD5/NTLM.
- Keep GPU drivers and OpenCL/CUDA runtimes up to date for maximum performance and stability.
Troubleshooting
| Issue | Cause | Fix |
|---|---|---|
| “No devices found” | Missing or outdated GPU drivers | Install correct proprietary GPU drivers and OpenCL/CUDA runtime |
| Extremely slow cracking on a “known fast” hash | CPU fallback instead of GPU | Verify -I shows GPU devices and Hashcat is using them, not defaulting to CPU |
| Session won’t resume | Session name mismatch or corrupted restore file | Use consistent --session names; check for .restore file in working directory |
| Hash rejected/”exhausted” quickly with no cracks | Wrong -m mode specified | Reconfirm hash format with hashID before rerunning |
Best Practices and Common Mistakes
- Always confirm hash mode (
-m) with a tool like hashID before running — a wrong mode wastes GPU time with zero results. - Don’t jump straight to brute-force masks for long/complex passwords; start with dictionary + rules for efficiency.
- Only crack hashes and handshakes captured from systems/networks you own or are explicitly authorized to test.
- Use
--showto review results across sessions instead of re-cracking hashes already solved (they’re stored in the potfile).
FAQ
Is Hashcat faster than John the Ripper? For GPU-accelerated hash types, generally yes, often by a large margin. John remains strong for its rule engine flexibility and broader out-of-the-box CPU-based format support in Jumbo builds.
Can Hashcat crack any password? No — success depends on whether the plaintext exists within the tested wordlist/rule/mask space. Long, random, high-entropy passwords remain infeasible to crack in practical time even with GPU acceleration.
Does Hashcat support cracking Wi-Fi passwords? Yes, via WPA-PBKDF2/PMKID modes (e.g., mode 22000), provided a valid handshake or PMKID capture is available and the auditor has authorization to test the network.
What GPU is best for Hashcat? Modern NVIDIA GPUs with high CUDA core counts and VRAM generally perform best, though AMD GPUs with OpenCL support are also viable.
Summary
Hashcat’s combination of GPU acceleration, broad hash-mode support, and flexible attack strategies (dictionary, rules, masks, hybrid) make it the default choice whenever raw cracking speed and coverage matter. From enterprise NTLM audits to Wi-Fi security assessments and encrypted file recovery, Hashcat’s role in a penetration tester’s toolkit is hard to overstate — provided it’s always used against systems and data you’re explicitly authorized to test.
References
- Official Hashcat site: https://hashcat.net/hashcat/
- Hashcat GitHub repository: https://github.com/hashcat/hashcat
- Hashcat wiki (attack modes, hash modes reference): https://hashcat.net/wiki/
- Kali Linux tool listing: https://www.kali.org/tools/hashcat/
