Skip to content

Hashcat

100 commands

The world’s fastest GPU password cracker: hundreds of hash types with dictionary, rule, mask and hybrid attack modes.

  • password cracking
  • GPU
  • hashes

Install Hashcat

sudo apt install hashcat

Basic Syntax & Help2

hashcat --help

Displays the main help menu listing all valid parameters and modes.

hashcat --version

Prints the currently installed version of Hashcat to the console.

Benchmarking3

hashcat -b

Runs a benchmark against the default kernel set to test system performance.

hashcat -b -m 1000

Runs a benchmark specifically for NTLM hashing speed measurement.

hashcat -b -m 0 --force

Forces a benchmark of MD5 hashes even if warnings are present.

Hash Mode Identification1

hashcat --example-hashes

Displays a table of example hashes for every supported hash mode.

Basic Dictionary Attack4

hashcat -m 0 -a 0 hashes.txt wordlist.txt

Performs a standard dictionary attack against MD5 hashes using a single wordlist.

hashcat -m 1000 -a 0 ntlm.txt wordlist.txt

Performs a standard dictionary attack against NTLM hashes typically found in Windows environments.

hashcat -m 1800 -a 0 shadow.txt rockyou.txt

Attacks sha512crypt hashes often found in Linux /etc/shadow files.

hashcat -m 0 hashes.txt list1.txt list2.txt

Attacks MD5 hashes using multiple wordlists loaded sequentially.

Link

Rule Based Attack5

hashcat -m 0 -a 0 -r rules/best64.rule hashes.txt wordlist.txt

Applies the popular 'best64' mutation rules to the wordlist candidates.

Link
hashcat -m 0 -r rules/dive.rule hashes.txt wordlist.txt

Uses the extensive 'dive' rule set for deeper mutation coverage.

Link
hashcat -m 0 -j k$ hashes.txt wordlist.txt

Applies a single dynamic rule to append a dollar sign to every word.

Link
hashcat -m 0 -r rule1.rule -r rule2.rule hashes.txt wordlist.txt

Stacks multiple rule files to apply complex mutations in sequence.

Link
hashcat -m 0 -g 10000 hashes.txt wordlist.txt

Generates 10,000 random rules to apply to the dictionary.

Link

Mask Attack5

hashcat -m 0 -a 3 hashes.txt ?a?a?a?a

Brute forces MD5 hashes trying all combinations of 4 printable characters.

Link
hashcat -m 0 -a 3 hashes.txt ?d?d?d?d?d?d

Brute forces MD5 hashes looking specifically for 6-digit PIN codes.

Link
hashcat -m 0 -a 3 hashes.txt ?u?l?l?l?d?d?d?d

Uses a structured mask for an Uppercase, 3 Lowercase, and 4 Digits pattern.

Link
hashcat -m 0 -a 3 -i hashes.txt ?a?a?a?a?a

Enables increment mode to try lengths 1 through 5 sequentially.

Link
hashcat -m 0 -a 3 -i --increment-min=4 --increment-max=8 hashes.txt ?a?a?a?a?a?a?a?a

Brute forces all printable characters restricting length between 4 and 8.

Link

Custom Charsets3

hashcat -m 0 -a 3 -1 ?l?d hashes.txt ?1?1?1?1

Defines custom charset 1 as lowercase and digits, then uses it for a 4-char mask.

Link
hashcat -m 0 -a 3 -1 ?l?u -2 ?d?s hashes.txt ?1?1?1?2?2?2

Uses two separate custom charsets to define a specific password complexity pattern.

Link
hashcat -m 0 -a 3 --custom-charset1=?l?d hashes.txt ?1?1?1?1?1

Explicitly defines a custom charset using the long-form flag.

Link

Hybrid Attack3

hashcat -m 0 -a 6 hashes.txt wordlist.txt ?d?d?d?d

Appends a 4-digit mask to the end of every word in the wordlist.

Link
hashcat -m 0 -a 7 hashes.txt ?d?d?d?d wordlist.txt

Prepends a 4-digit mask to the beginning of every word in the wordlist.

Link
hashcat -m 0 -a 6 -j S wordlist.txt ?d?d

Uses a rule to capitalize words before appending a 2-digit mask.

Link

Combinator Attack2

hashcat -m 0 -a 1 hashes.txt left.txt right.txt

Combines words from two lists to form candidates like 'word1word2'.

Link
hashcat -m 0 -a 1 -j $- -k $! hashes.txt first.txt second.txt

Injects a hyphen between the words and an exclamation mark at the end.

Link

Session Management2

hashcat -m 0 hashes.txt list.txt --session=project1

Starts a cracking session with a specific name for easier resumption.

Link
hashcat --session=project1 --restore

Resumes a previously interrupted session named 'project1' from the restore point.

Link

Performance Tuning4

hashcat -m 0 -w 3 hashes.txt list.txt

Sets the workload profile to 'High' to prioritize cracking speed over desktop responsiveness.

Link
hashcat -m 0 -w 4 hashes.txt list.txt

Sets workload profile to 'Nightmare' for maximum GPU utilization on dedicated rigs.

Link
hashcat -m 0 -O hashes.txt list.txt

Enables optimized kernels which limits password length but increases speed.

Link
hashcat -m 0 -S hashes.txt list.txt

Enables the slow candidate generator for specific low-performance scenarios.

Link

Device Control5

hashcat -I

Displays detailed information about installed OpenCL/CUDA devices and drivers.

Link
hashcat -d 1 -m 0 hashes.txt list.txt

Forces Hashcat to use only the device with ID 1.

Link
hashcat -D 2 -m 0 hashes.txt list.txt

Forces the backend type to use GPU devices only.

Link
hashcat -m 0 --gpu-temp-abort=90 hashes.txt list.txt

Automatically aborts the attack if the GPU temperature reaches 90 degrees Celsius.

Link
hashcat -m 0 --gpu-temp-retain=80 hashes.txt list.txt

Adjusts fan speeds dynamically to try and maintain a temperature of 80 degrees.

Link

Status & Monitoring2

hashcat -m 0 --status hashes.txt list.txt

Enables the automatic status screen update during the attack.

Link
hashcat -m 0 --status-timer=30 hashes.txt list.txt

Sets the interval for the status screen update to every 30 seconds.

Link

Output Management3

hashcat -m 0 -o cracked.txt hashes.txt list.txt

Writes recovered passwords to a specific output file.

Link
hashcat -m 0 --outfile-format=2 -o cracked.txt hashes.txt list.txt

Writes output in format 'plain_password' only, omitting the hash.

Link
hashcat -m 0 --outfile-format=3 -o cracked.txt hashes.txt list.txt

Writes output in format 'hash:plain_password' including hex data.

Link

Potfile Management3

hashcat -m 0 --show hashes.txt

Reads the potfile to display only the hashes that have already been cracked.

Link
hashcat -m 0 --left hashes.txt

Reads the potfile to display only the hashes that have NOT yet been cracked.

Link
hashcat -m 0 --potfile-disable hashes.txt list.txt

Prevents Hashcat from writing recovered credentials to the potfile.

Link

Hash Parsing3

hashcat -m 0 --username hashes.txt list.txt

Ignores the username field in 'user:hash' formatted input files.

Link
hashcat -m 0 --separator=, hashes.csv list.txt

Specifies a comma as the separator for input files.

Link
hashcat -m 0 --remove hashes.txt list.txt

Removes hashes from the input file immediately as they are cracked.

Link

Advanced Hash Types13

hashcat -m 2500 capture.hccapx list.txt

Attacks WPA/WPA2 wireless keys using the legacy hccapx format.

Link
hashcat -m 22000 capture.hc22000 list.txt

Attacks WPA-PBKDF2-PMKID+EAPOL (modern WiFi) using the hc22000 format.

Link
hashcat -m 5600 ntlmv2.txt list.txt

Attacks NetNTLMv2 hashes captured via Responder or similar tools.

Link
hashcat -m 13100 krb5tgs.txt list.txt

Attacks Kerberos 5 TGS-REP etype 23 hashes (Roasting).

Link
hashcat -m 18200 asrep.txt list.txt

Attacks Kerberos 5 AS-REP etype 23 hashes.

Link
hashcat -m 3200 bcrypt.txt list.txt

Attacks Blowfish/bcrypt hashes ($2a$, $2y$, etc.).

Link
hashcat -m 15700 eth_wallet.txt list.txt

Attacks Ethereum wallet SCRYPT based password protection.

Link
hashcat -m 11300 btc_wallet.txt list.txt

Attacks Bitcoin/Litecoin wallet.dat files.

Link
hashcat -m 12500 pdf.txt list.txt

Attacks PDF 1.7 Level 3 password protection.

Link
hashcat -m 13600 winzip.txt list.txt

Attacks WinZip AES-256 encrypted archive headers.

Link
hashcat -m 6211 truecrypt.txt list.txt

Attacks TrueCrypt volumes using RIPEMD160 + AES boot mode.

Link
hashcat -m 13400 keepass.txt list.txt

Attacks KeePass 1 and KeePass 2 password manager database files.

Link
hashcat -m 16800 pmkid.txt list.txt

Attacks WPA-PMKID (PMKID-only) captures without full handshakes.

Link

Special Features6

hashcat -m 0 --hex-salt hashes.txt list.txt

Assumes the salt within the hash file is given in hexadecimal format.

Link
hashcat -m 0 --hex-charset -1 414243 hashes.txt ?1?1?1

Allows defining the custom charset using hexadecimal bytes.

Link
hashcat -m 0 --keep-guessing hashes.txt list.txt

Continues attacking a hash even after a collision is found (useful for collisions/salts).

Link
hashcat -m 0 --loopback hashes.txt --potfile-path=my.pot

Uses the passwords found in the potfile as the wordlist for a new attack.

Link
hashcat -m 0 --markov-classic hashes.txt

Enables the classic Markov-chain based candidate generator.

Link
hashcat -m 0 --markov-disable hashes.txt ?a?a?a?a

Disables the internal Markov statistics usually applied to masks.

Link

Advanced Automation4

hashcat -m 0 --self-test-disable hashes.txt list.txt

Disables the startup self-test (risky, but useful for unstable/embedded devices).

Link
hashcat --stdout -r rules/best64.rule wordlist.txt

Prints the candidates generated by rules and wordlist to stdout without cracking.

Link
hashcat --stdout -a 3 ?d?d?d?d

Generates a keyspace of candidates to stdout for piping into other tools.

Link
hashcat -m 0 -a 3 --skip=100000 --limit=50000 hashes.txt ?a?a?a?a

Skips the first 100k candidates and runs only the next 50k (distributed cracking).

Link

Distribution1

hashcat -m 0 -s 1000 -l 2000 hashes.txt list.txt

Shorthand flags for skip and limit to control workload chunks.

Link

Audit & Compliance3

hashcat -m 0 -a 3 --increment --increment-min=1 --increment-max=7 hashes.txt ?a?a?a?a?a?a?a

Audits for passwords strictly shorter than 8 characters.

Link
hashcat -m 0 -a 3 hashes.txt ?d?d?d?d?d?d?d?d?d?d

Audits for 10-digit number usage (phone numbers/IDs).

Link
hashcat -m 0 -a 0 wordlist.txt hashes.txt --show

Validates which current dictionary words match the hash list.

Link

Log Management2

hashcat -m 0 --logfile=audit_session.log hashes.txt list.txt

Redirects all session output to a specific log file for reporting.

Link
hashcat -m 0 --logfile-disable hashes.txt list.txt

Disables logging entirely for stealth or read-only filesystem operations.

Link

Rule Generation2

hashcat -m 0 --generate-rules=5000 hashes.txt list.txt

Automatically generates 5000 random rules to find new patterns.

Link
hashcat -m 0 --generate-rules-func-min=2 --generate-rules-func-max=5 hashes.txt list.txt

Constrains generated rules to have between 2 and 5 functions per rule.

Link

Output Formatting1

hashcat -m 0 --outfile-check-timer=60 hashes.txt list.txt

Checks the outfile every 60 seconds to see if it was modified externally.

Link

Input Handling1

hashcat -m 0 --encoding-from=utf16le --encoding-to=utf8 hashes.txt list.txt

Converts input wordlist from UTF-16LE to UTF-8 internal representation.

Link

Algorithm Specific6

hashcat -m 2500 --nonce-error-corrections=10 capture.hccapx list.txt

Increases WPA nonce error correction range for noisy captures.

Link
hashcat -m 500 -O hashes.txt list.txt

Attacks md5crypt (Unix) using optimized kernels.

Link
hashcat -m 7400 sha256crypt.txt list.txt

Attacks sha256crypt hashes (Round 5).

Link
hashcat -m 100 hashes.txt list.txt

Attacks standard SHA1 hashes.

Link
hashcat -m 1400 hashes.txt list.txt

Attacks standard SHA256 hashes.

Link
hashcat -m 1700 hashes.txt list.txt

Attacks standard SHA512 hashes.

Link

Workload Profiles1

hashcat -w 1 -m 0 hashes.txt list.txt

Sets workload to 'Low' to keep the computer usable during cracking.

Link

Hybrid Custom1

hashcat -a 6 -m 0 hashes.txt list.txt -1 ?d?s ?1?1

Hybrid attack appending 2 characters that are either digits or symbols.

Link

Mask Incremental1

hashcat -a 3 --increment-min 1 --increment-max 4 hashes.txt ?d?d?d?d

Brute forces numeric PINs from length 1 up to 4.

Link

Enterprise Audit2

hashcat -m 5500 netntlmv1.txt list.txt

Attacks legacy NetNTLMv1 hashes.

Link
hashcat -m 2100 mscash2.txt list.txt

Attacks Domain Cached Credentials 2 (DCC2/MSCash2).

Link

Keyspace Info1

hashcat -a 3 --keyspace ?l?l?l?l

Calculates and displays the total number of combinations for a given mask.

Link

Wordlist Management1

hashcat --stdout -r rules/best64.rule list.txt > mutated_list.txt

Creates a pre-computed wordlist by applying rules and saving the output.

Link

Clean Up1

hashcat --session=project1 --cleanup-rules

Removes temporary rule files generated during a session.

Link

Hardware Info1

hashcat --cpu-affinity=1,2 -m 0 hashes.txt list.txt

Locks Hashcat processes to specific CPU cores.

Link

Advanced Config2

hashcat --backend-ignore-cuda -m 0 hashes.txt list.txt

Forces Hashcat to ignore CUDA devices and use OpenCL only.

Link
hashcat --spin-damp=50 -m 0 hashes.txt list.txt

Adjusts the CPU spin dampening workaround for specific driver loads.

Link