Password Attacks
Learn how to use Hashcat in Kali Linux as a beginner, from checking the install and selecting the right modes to running a wordlist crack and reading results.
sudo apt install hashcat
hashcat -m <hash_type> -a <attack_mode> <hash_file> [wordlist]
If you are learning how to use hashcat, follow this beginner loop: check the install with `hashcat -I`, identify the hash type, pick its `-m` mode number, choose an attack mode with `-a`, run the attack, and read the cracked password with `hashcat -m <mode> <hash_file> --show`.
Worked example: the MD5 hash of the word `password` is `5f4dcc3b5aa765d61d8327deb882cf99`. Save that hash in `password.md5`, then run `hashcat -m 0 -a 0 password.md5 /usr/share/wordlists/rockyou.txt`; it cracks because `rockyou.txt` contains `password`. Run `hashcat -m 0 password.md5 --show` to display `5f4dcc3b5aa765d61d8327deb882cf99:password`.
For triage, treat a weak fast hash as more urgent: MD5 and NTLM allow vastly more guesses per second than a deliberately slow hash such as bcrypt. Benchmark first with `hashcat -b`; a supported GPU provides Hashcat's main speed advantage, while CPU-only cracking is possible but usually much slower and less practical for large keyspaces.
When the first wordlist run comes back empty, do not jump straight to brute force. Add mutation rules with `-r rules/best64.rule` so each wordlist entry is tried with common case, digit and symbol variations, then try a focused mask with `-a 3` only for the pattern you actually expect, such as a word followed by four digits. Rules and masks are where most real cracks after the first dictionary pass come from, and they cost far less GPU time than an open-ended brute-force run.
Hashcat is the world's fastest and most advanced password recovery utility. It leverages GPU (Graphics Processing Unit) acceleration to achieve speeds impossible with CPU-only tools, making it the go-to choice for offline hash cracking.
Originally released in 2009, Hashcat supports over 300 hash types including MD5, SHA-1, SHA-256, NTLM, bcrypt, WPA/WPA2, and many more. Its five attack modes — dictionary, combinator, brute-force, hybrid, and rule-based — provide flexibility for any password auditing scenario.
Hashcat is an essential tool in penetration testing, security auditing, and red team engagements. Security professionals use it to verify password policies by cracking hashes extracted from SAM databases, Active Directory, and web applications.
| Command | Purpose |
|---|---|
hashcat -m 0 -a 0 <md5-hashes.txt> <wordlist.txt> | Run an authorized dictionary audit of MD5 hashes. |
hashcat -m 1000 -a 0 <ntlm-hashes.txt> <wordlist.txt> | Run an authorized dictionary audit of NTLM hashes. |
hashcat -m 1800 -a 0 <sha512crypt-hashes.txt> <wordlist.txt> | Audit Unix SHA-512 crypt hashes with a wordlist. |
hashcat -m 0 -a 3 <md5-hashes.txt> '?u?l?l?l?l?d?d?d' | Run a constrained MD5 mask audit. |
hashcat -m 0 -a 0 <md5-hashes.txt> <wordlist.txt> -r <rules-file.rule> | Apply a rule file to dictionary candidates. |
hashcat -m 22000 -a 0 <authorized-wifi.hc22000> <wordlist.txt> | Audit an authorized WPA PMKID/EAPOL capture offline. |
hashcat -m 0 -a 0 hashes.txt rockyou.txtMD5 dictionary attack - Cracking MD5 hashes with wordlisthashcat -m 1000 -a 0 hashes.txt wordlist.txtNTLM hash cracking - Cracking Windows password hasheshashcat -m 0 -a 3 hashes.txt ?a?a?a?a?a?aBrute force attack - When wordlist fails, try all combinationshashcat -m 2500 -a 0 capture.hccapx wordlist.txtWPA/WPA2 cracking - Cracking WiFi handshake captureshashcat --show hashes.txtShow cracked passwords - View previously cracked hasheshashcat -m 0 -a 0 hashes.txt wordlist.txt -r rules/best64.ruleDictionary with rules - More effective wordlist attackhashcat -m 22000 -a 0 capture.hc22000 wordlist.txtModern WPA cracking - Crack PMKID/EAPOL in the 22000 formathashcat -m 1800 -a 0 shadow.txt rockyou.txtLinux shadow - Crack sha512crypt hashes from /etc/shadowhashcat -m 13100 -a 0 kerb.txt wordlist.txtKerberoast - Crack TGS-REP (Kerberos) service ticket hasheshashcat -m 1000 -a 6 hashes.txt wordlist.txt ?d?d?d?dHybrid attack - Append a 4-digit mask to each wordlist wordhashcat -m 0 -a 0 hashes.txt wordlist.txt -O -w 3Optimized/fast - Enable optimized kernels and high workloadhashcat -bBenchmark - Measure GPU cracking speed for every hash modehashcat -m 0 hashes.txt wordlist.txt --potfile-path=custom.potCustom potfile - Store cracked results in a specific potfilehashcat -m 0 -a 0 hashes.txt wordlist.txt --session=job1Named session - Enable resume with --restore for long jobshashcat --restore --session=job1Resume - Continue a previously interrupted named sessionVerify organizational password policies by cracking hashes from SAM databases and Active Directory.
Crack WiFi handshake captures to test wireless network security.
Solve cryptography and password cracking challenges in capture-the-flag competitions.
Recover compromised passwords during forensic investigations after data breaches.
Validate that password complexity requirements are actually effective against modern attacks.
Test authorized NTLM, NetNTLMv2, and Kerberos hash exports to identify weak domain passwords and prioritize resets.
Test an authorized mode 22000 PMKID or EAPOL capture against targeted wordlists, rules, and masks.
Hashcat itself is a legitimate password-recovery and security-auditing tool. It is legal to use on hashes from systems, accounts, or files that you own or have explicit written authorization to test — for example during a sanctioned penetration test or when recovering your own forgotten password. Cracking hashes you do not own or lack permission to test is illegal in most jurisdictions.
A dictionary attack (`-a 0`) tries every word from a wordlist such as `rockyou.txt`, which is fast and effective against human-chosen passwords. A brute-force / mask attack (`-a 3`) generates every possible combination for a defined pattern, e.g. `hashcat -a 3 -m 0 hashes.txt ?a?a?a?a?a?a` for six mixed characters. Dictionary attacks are usually tried first because they are far quicker.
It depends entirely on the hash algorithm, the password's length and complexity, and your GPU. Fast hashes like MD5 or NTLM can be tested at billions of guesses per second, while slow hashes like bcrypt are deliberately thousands of times slower. Run `hashcat -b -m <mode>` to benchmark your hardware and estimate feasibility before starting.
The potfile (`hashcat.potfile`, stored under `~/.local/share/hashcat/`) records every hash Hashcat has already cracked together with its plaintext. Recovered results are read from it automatically, so re-running a job shows previous successes instantly. Use `--show` to display cracked results or `--potfile-disable` to ignore it.
Yes. Hashcat is cross-platform and provides binaries for Windows, macOS, and Linux, though Kali Linux includes it by default. Performance depends on having working OpenCL or CUDA GPU drivers; run `hashcat -I` to confirm your device is detected on any platform.
'Exhausted' means Hashcat tried every candidate in your attack — the whole wordlist or the full mask keyspace — without cracking the remaining hashes. It is not an error; it simply means that particular attack did not find the password. Try a larger wordlist, add mutation rules with `-r`, or switch to a different mask.
Password Attacks
John the Ripper is a free and open-source password security auditing and password recovery tool. It can crack various password hash types offline and is highly customizable with different attack modes and mangling rules.
Password Attacks
CeWL is a custom word list generator that spiders a target URL and creates a wordlist from the content. Great for targeted password attacks.
Password Attacks
Hydra is a parallelized login cracker that supports numerous protocols including FTP, HTTP, HTTPS, SMB, SSH, and many more. It performs rapid dictionary attacks against login pages and services to test password strength.
Password Attacks
Crunch is a wordlist generator where you can specify a standard character set or a custom one. It can generate all possible combinations.
Password Attacks
Medusa is a speedy, parallel, and modular login brute-forcer. It supports many protocols including HTTP, FTP, SSH, SMB, MySQL, and more.
Password Attacks
CUPP (Common User Passwords Profiler) creates custom wordlists based on target personal information like names, birthdays, nicknames, pets, and keywords.
Comprehensive Hashcat tutorial for Kali Linux. Learn GPU-accelerated password recovery, attack modes (-a 0, -a 3 mask attacks), rules, and hash modes cheat sheet.
Security · IntermediateLearn how password hashing works, the difference between hashing and encryption, common algorithms, and best practices for secure password storage.
Security · BeginnerMaster password hygiene, multi-factor authentication, password manager usage, and strategies to protect your accounts from credential theft.
Security · IntermediateLearn how dictionary attacks use wordlists to crack passwords, how to create effective wordlists, and strategies to defend against wordlist-based attacks.
A real run prints `Session` for the session name, `Hash.Mode` for the selected algorithm, `Hash.Target` for the loaded hash or file, and `Time.Started` for the launch time. `Speed.Dev.#1` reports the device's candidate rate, `Progress` shows tested candidates versus the keyspace, `Rejected` counts unusable candidates, `Restore.Point` marks the resume checkpoint, and `Candidates` shows the current range. The final status line reads `Status: Cracked`, and the potfile stores a line such as `5f4dcc3b5aa765d61d8327deb882cf99:password`; run `hashcat -m 0 password.md5 --show` to read it as `hash:password`.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.