GO KALI FREE

Hashcat

Password Attacks

Advancedmedium risk

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.

Approved wordlist or mask candidates, optionally transformed by rules, are processed using the selected hash mode and any required salt/parameters, then compared with an authorized stored verifier.
Offline auditing compares candidatesConceptual offline candidate comparison, not exact GPU internals. Formats differ; a match is possible only when a candidate produces the same verifier, and recovery is not guaranteed.Original conceptual diagram. On narrow screens, scroll the figure to read the labels.

Installation

sudo apt install hashcat

Basic Syntax

hashcat -m <hash_type> -a <attack_mode> <hash_file> [wordlist]

Quick Facts

Full Name
Hashcat
License
MIT License
Author
Atom (hashcat.net)
Written In
C
Platforms
Linux, Windows, macOS
Category
Password Recovery (Offline)
Hash Types Supported
300+
Attack Modes
5 (Dictionary, Combinator, Brute-force, Hybrid, Rule-based)

Tool Overview

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.

Quick Reference Commands

Verified quick-reference commands for Hashcat
CommandPurpose
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 Help

Common Commands

hashcat -m 0 -a 0 hashes.txt rockyou.txtMD5 dictionary attack - Cracking MD5 hashes with wordlist
hashcat -m 1000 -a 0 hashes.txt wordlist.txtNTLM hash cracking - Cracking Windows password hashes
hashcat -m 0 -a 3 hashes.txt ?a?a?a?a?a?aBrute force attack - When wordlist fails, try all combinations
hashcat -m 2500 -a 0 capture.hccapx wordlist.txtWPA/WPA2 cracking - Cracking WiFi handshake captures
hashcat --show hashes.txtShow cracked passwords - View previously cracked hashes
hashcat -m 0 -a 0 hashes.txt wordlist.txt -r rules/best64.ruleDictionary with rules - More effective wordlist attack
hashcat -m 22000 -a 0 capture.hc22000 wordlist.txtModern WPA cracking - Crack PMKID/EAPOL in the 22000 format
hashcat -m 1800 -a 0 shadow.txt rockyou.txtLinux shadow - Crack sha512crypt hashes from /etc/shadow
hashcat -m 13100 -a 0 kerb.txt wordlist.txtKerberoast - Crack TGS-REP (Kerberos) service ticket hashes
hashcat -m 1000 -a 6 hashes.txt wordlist.txt ?d?d?d?dHybrid attack - Append a 4-digit mask to each wordlist word
hashcat -m 0 -a 0 hashes.txt wordlist.txt -O -w 3Optimized/fast - Enable optimized kernels and high workload
hashcat -bBenchmark - Measure GPU cracking speed for every hash mode
hashcat -m 0 hashes.txt wordlist.txt --potfile-path=custom.potCustom potfile - Store cracked results in a specific potfile
hashcat -m 0 -a 0 hashes.txt wordlist.txt --session=job1Named session - Enable resume with --restore for long jobs
hashcat --restore --session=job1Resume - Continue a previously interrupted named session

Step-by-Step Guide

  1. 1Run `hashcat -I` to verify the installation and confirm which GPU or CPU compute devices Hashcat detects.
  2. 2Identify the format with `hash-identifier`, then compare likely modes with `hashcat --example-hashes`.
  3. 3Save the target hashes in `hashes.txt`, with one hash on each line.
  4. 4Choose the matching `-m` number, such as `-m 0` for raw MD5 or `-m 1000` for NTLM.
  5. 5Run your first dictionary crack with `hashcat -m 0 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt`.
  6. 6Read recovered values with `hashcat -m 0 hashes.txt --show`; Hashcat also records them in its potfile.
  7. 7Add rule-based mutations with `hashcat -m 0 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt -r rules/best64.rule`.
  8. 8Try a focused mask attack with `hashcat -m 0 -a 3 hashes.txt '?u?l?l?l?l?d?d'`.
  9. 9Benchmark with `hashcat -b`, then use a suitable workload such as `hashcat -m 0 -a 0 -w 2 hashes.txt /usr/share/wordlists/rockyou.txt`.
  10. 10Start long jobs with `hashcat -m 0 -a 0 hashes.txt wordlist.txt --session=job1`, then resume with `hashcat --session=job1 --restore`.

Warnings

Use Cases

Password Auditing

Verify organizational password policies by cracking hashes from SAM databases and Active Directory.

WPA/WPA2 Recovery

Crack WiFi handshake captures to test wireless network security.

CTF Challenges

Solve cryptography and password cracking challenges in capture-the-flag competitions.

Incident Response

Recover compromised passwords during forensic investigations after data breaches.

Compliance Testing

Validate that password complexity requirements are actually effective against modern attacks.

Active Directory Audit

Test authorized NTLM, NetNTLMv2, and Kerberos hash exports to identify weak domain passwords and prioritize resets.

WPA2 Handshake Cracking

Test an authorized mode 22000 PMKID or EAPOL capture against targeted wordlists, rules, and masks.

Key Features

People Also Ask

Is it legal to use Hashcat?

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.

What is the difference between dictionary and brute-force attack modes in Hashcat?

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.

How long does Hashcat take to crack a password?

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.

What is a potfile in Hashcat?

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.

Does Hashcat run on Windows and macOS?

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.

What does the 'Exhausted' status mean in Hashcat?

'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.

Related Tools

John the Ripper

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.

CeWL

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.

Hydra

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.

Crunch

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.

Medusa

Password Attacks

Medusa is a speedy, parallel, and modular login brute-forcer. It supports many protocols including HTTP, FTP, SSH, SMB, MySQL, and more.

CUPP

Password Attacks

CUPP (Common User Passwords Profiler) creates custom wordlists based on target personal information like names, birthdays, nicknames, pets, and keywords.

Related Cybersecurity Guides

Security · Intermediate

Hashcat Tutorial Kali Linux: GPU-Accelerated Password Recovery & Mask Attack Guide

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 · Intermediate

Password Hashes Explained: How Passwords Are Stored Securely

Learn how password hashing works, the difference between hashing and encryption, common algorithms, and best practices for secure password storage.

Security · Beginner

Password Security Best Practices: Strong Authentication Guide

Master password hygiene, multi-factor authentication, password manager usage, and strategies to protect your accounts from credential theft.

Security · Intermediate

Dictionary Attacks: Wordlist-Based Password Cracking

Learn how dictionary attacks use wordlists to crack passwords, how to create effective wordlists, and strategies to defend against wordlist-based attacks.

Frequently Asked Questions

What is Hashcat used for?

Hashcat is used for offline password recovery and security auditing. It takes captured password hashes and attempts to find the original plaintext by testing millions of candidates per second using GPU acceleration. It supports over 300 hash types including MD5, SHA, NTLM, bcrypt, and WPA2.

What hash types does Hashcat support?

Hashcat supports over 300 hash types including MD5 (mode 0), SHA-1 (mode 100), SHA-256 (mode 1400), NTLM (mode 1000), bcrypt (mode 3200), WPA/WPA2 (mode 2500), and many more. Each hash type has a specific mode number used with the -m flag.

Do I need a GPU for Hashcat?

While Hashcat can run on CPU alone, it is designed for GPU acceleration and performs significantly better with a compatible NVIDIA or AMD GPU. Without a GPU, John the Ripper may be more practical for CPU-based cracking.

How do I identify a hash type for Hashcat?

You can identify hash types using tools like hash-identifier, or by examining the hash length and format. MD5 hashes are 32 hexadecimal characters, SHA-256 are 64 characters, and NTLM hashes are typically 32 characters extracted from Windows systems.

What are Hashcat rule-based attacks?

Rule-based attacks apply mutation rules to wordlist entries to generate password candidates. Built-in rules like best64.rule and dive.rule transform base words by adding numbers, symbols, case changes, and common substitutions. Rules are defined in .rule files.

How do I crack WPA2 handshakes with Hashcat?

Capture a WPA2 handshake using airodump-ng, convert it to .hccapx format using hcxpcapngtool, then run: hashcat -m 22000 capture.hccapx wordlist.txt. For PMKID attacks, use -m 22001 with the captured PMKID directly.

How do I optimize Hashcat performance?

Use the largest wordlist possible, enable rules for mutations, set optimal workload with -w 3 or -w 4, use --force for testing, and ensure proper GPU cooling. For multi-GPU setups, use -d to select specific devices.

Can Hashcat crack salted hashes?

Yes. For salted hashes, provide the salt using the appropriate hash mode. For example, mode 10 is MD5 with salt, mode 1200 is SHA1 with salt. The hash format is hash:salt. Some modes support multiple salts for batch cracking.

What is the difference between Hashcat and John the Ripper?

Hashcat is GPU-accelerated and offers maximum speed for large hash sets. John the Ripper runs on CPU, automatically detects hash types, and supports more formats like encrypted archives. Use Hashcat for speed; John for convenience and format coverage.

How do I check Hashcat installation and GPU support?

Run hashcat -I to display installed OpenCL devices, driver versions, and supported hash types. This verifies your GPU is detected and shows its compute capability for optimal cracking performance.

Can Hashcat crack passwords from a Windows SAM database?

Yes, first extract hashes using secretsdump.py, samdump2, or Mimikatz, then crack with hashcat -m 1000 for NTLM or -m 3000 for LM hashes. NTLM mode is the most common for modern Windows systems.

What is Hashcat's brain feature?

Hashcat Brain is a learned-password tracking system that prevents testing previously tried candidates. Enable with --brain-server and --brain-client flags to share tested-password databases across multiple cracking sessions.

How do I crack MD5 hashes with Hashcat?

Use mode 0 for raw MD5: hashcat -m 0 hashes.txt wordlist.txt. For MD5 with salt, use mode 10: hashcat -m 10 hash.txt wordlist.txt. The hash format is hash:salt for salted variants.

Can Hashcat crack Kerberos hashes?

Yes, Hashcat supports Kerberos 5 AS-REP (mode 18200) and Kerberoasting TGS (mode 13100) hashes. Extract Kerberos hashes using Impacket's GetUserSPNs.py or Rubeus for offline cracking.

How do I resume a paused Hashcat session?

Use hashcat --show -session=restore to resume the last session, or hashcat --session=SESSION_NAME to resume a specific named session. Hashcat automatically saves progress for interruption recovery.

What is a mask attack in Hashcat?

A mask attack tests candidates matching a specific pattern using placeholders: ?l (lowercase), ?u (uppercase), ?d (digits), ?s (symbols), ?a (all). For example, hashcat -a 3 hashes.txt ?u?l?l?l?l?d?d tests a pattern of ULLLLDD.

How do I use Hashcat with rules for password mutations?

Rules transform wordlist entries using built-in or custom rule files: hashcat -r best64.rule hashes.txt wordlist.txt. Rules add numbers, change case, append symbols, and apply common password patterns to base words.

Can Hashcat crack iOS backup passwords?

Yes, use mode 14700 for iTunes backup passwords: hashcat -m 14700 itunes_backup_hash.txt wordlist.txt. Extract the hash from the iOS backup using specialized tools before cracking.

How do I use Hashcat on cloud GPU instances?

Launch cloud GPU instances (AWS p3, GCP a100, Azure NC) with NVIDIA drivers installed, install Hashcat, and run your cracking session. Cloud GPUs offer massive parallelism but incur costs per hour.

How do I use Hashcat in Kali Linux?

Hashcat is preinstalled in most Kali Linux images. To install Hashcat if it is missing, run `sudo apt install hashcat`, then use `hashcat -I` to verify the available GPU or CPU backend. For a first MD5 crack, put an authorized raw MD5 hash in `hashes.txt`, run `hashcat -m 0 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt`, and read the result with `hashcat -m 0 hashes.txt --show`.

How do I use Hashcat with a wordlist?

Start a wordlist attack with `hashcat -m 0 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt`. Add Hashcat rules with `hashcat -m 0 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt -r rules/best64.rule`. To try multiple wordlists in one job, list each after the hash file, for example `hashcat -m 0 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt custom.txt`.

How do I use Hashcat rules?

Rules mutate every wordlist entry on the fly: run `hashcat -m 0 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt -r rules/best64.rule` to try each word with common case, digit and symbol variations. Hashcat ships rule files in its `rules/` directory — start with `best64.rule`, then try `dive.rule` or `OneRuleToRuleThemAll.rule` for wider coverage. You can also write your own rule file; each line is one mutation, for example `c` to capitalize the first letter or `$1` to append a 1.

How do I use Hashcat to crack WPA2?

Capture a WPA2 handshake or PMKID, convert it to Hashcat mode 22000 format with `hcxpcapngtool`, then run `hashcat -m 22000 -a 0 capture.hc22000 /usr/share/wordlists/rockyou.txt`. Mode 22000 replaced the older 2500 hccapx format. Only test captures from networks you own or are authorized to audit, and add rules or a mask once the plain wordlist is exhausted.

Can I run Hashcat without a GPU / on CPU?

Yes. Hashcat can run CPU-only when a compatible compute runtime exposes the CPU. Confirm it with `hashcat -I`, select CPU devices with `-D 1`, and check expected performance with `hashcat -D 1 -b -m 0`; it will usually be much slower than a modern GPU. The `--force` flag only bypasses warnings and does not enable CPU support. Choose John the Ripper instead when no supported backend is available or automatic format handling is more useful.

Tags

#password-attacks

Output Explanation

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`.

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.