
Hashcat is a powerful and versatile password-cracking tool widely used in security testing. It supports a vast range of hash types and leverages GPUs for fast and efficient cracking. Hashcat is a favorite among penetration testers for uncovering weak passwords and assessing password policies, helping identify vulnerabilities that could lead to unauthorized access or privilege escalation within a network. This cheat sheet provides practical Hashcat commands used by penetration testers to crack password hashes including NTLM, Kerberos, WPA/WPA2, Office documents, and encrypted archives.
Installation and Setup
From Package Managers
Kali Linux: Pre-installed. Run directly with hashcat.
sudo apt update && sudo apt install hashcatbrew install hashcatFrom Source
git clone https://github.com/hashcat/hashcat.gitcd hashcatmake./hashcat --helpUsing Docker
docker pull hashcat/hashcatdocker run -it --rm hashcat/hashcat --helpUpdating Hashcat
cd hashcat && git pull && make clean && makesudo apt update && sudo apt upgrade hashcatHashcat Basics
Hashcat Hash Modes
The following table lists some of the common hashcat hash modes. A full list can be found here.
hashcat -m 0 hashes.txt wordlist.txt #MD5 Hashhashcat -m 100 hashes.txt wordlist.txt #SHA1hashcat -m 1400 hashes.txt wordlist.txt #SHA256hashcat -m 1700 hashes.txt wordlist.txt #SHA512hashcat -m 500 hashes.txt wordlist.txt #md5crypthashcat -m 1500 hashes.txt wordlist.txt #descrypt (DES Unix)hashcat -m 1800 hashes.txt wordlist.txt #sha512crypt (Unix)hashcat -m 3200 hashes.txt wordlist.txt #bcrypthashcat -m 1000 hashes.txt wordlist.txt #NTLM Hashhashcat -m 3000 hashes.txt wordlist.txt #LM Hashhashcat -m 5500 hashes.txt wordlist.txt #NetNTLMv1hashcat -m 5600 hashes.txt wordlist.txt #NetNTLMv2hashcat -m 13100 hashes.txt wordlist.txt #Kerberos 5 TGS-REP etype 23hashcat -m 7500 hashes.txt wordlist.txt #Kerberos 5 AS-REQ Pre-Auth etype 23hashcat -m 7300 hashes.txt wordlist.txt #IPMI2 RAKP HMAC-SHA1hashcat -m 15300 hashes.txt wordlist.txt #DPAPI masterkey file v1hashcat -m 15900 hashes.txt wordlist.txt #DPAPI domain backup keyhashcat -m 2100 hashes.txt wordlist.txt #Domain Cached Credentials (DCC2)hashcat -m 2500 -a 3 handshake.hccapx wordlist.txt #WPA/WPA2 Handshake (old format)hashcat -m 22000 -a 3 handshake.22000 wordlist.txt #WPA/WPA2 PMKID/EAPOL (recommended)hashcat -m 12500 hashes.txt wordlist.txt #Kerberos 5 TGS-REP etype 17/18hashcat -m 16800 hashes.txt wordlist.txt #WPA-PMKID (no EAPOL)hashcat -m 7100 hashes.txt wordlist.txt #macOS v10.8+ (PBKDF2-SHA512)hashcat -m 11600 hashes.txt wordlist.txt #7-Ziphashcat -m 13400 hashes.txt wordlist.txt #KeePass 1.xhashcat -m 13711 hashes.txt wordlist.txt #VeraCrypt SHA256 + XTS 512 bithashcat -m 11300 hashes.txt wordlist.txt #TrueCrypt PBKDF2-SHA512 + XTShashcat -m 18300 hashes.txt wordlist.txt #BitLockerhashcat -m 19500 hashes.txt wordlist.txt #MS Office 2016Hashcat Attack Modes
The attack modes available are:
-a
0 | Straight1 | Combination3 | Brute-force6 | Hybrid Wordlist + Mask7 | Hybrid Mask + Wordlist9 | AssociationSome examples of common attack modes are shown below:
hashcat -a 0 -m 0 hashes.txt wordlist.txt #Wordlist Attackhashcat -a 3 -m 0 hashes.txt ?a?a?a?a #Mask Attackhashcat -a 6 -m 0 hashes.txt wordlist.txt ?d?d #Hybrid Wordlist + Maskhashcat -a 7 -m 0 hashes.txt ?d?d wordlist.txt #Hybrid Mask + Wordlisthashcat -a 1 -m 0 hashes.txt wordlist1.txt wordlist2.txt #Combinator AttackReal Pentesting Attack Scenarios
hashcat -m 1000 hashes.txt rockyou.txt #Crack NTLM hashes from a Windows dumphashcat -m 5600 netntlmv2.txt rockyou.txt #Crack captured NetNTLMv2 hasheshashcat -m 18200 asrep_hashes.txt rockyou.txt #Crack AS-REP roasted Kerberos hasheshashcat -m 13100 kerberoast_hashes.txt rockyou.txt #Crack Kerberoasted service ticketshashcat -m 2100 dcc_hashes.txt rockyou.txt #Crack Domain Cached Credentials (DCC2)hashcat -m 7500 wifi.hccapx rockyou.txt #Crack WPA/WPA2 handshakehashcat -m 11600 7zip.hash rockyou.txt #Crack 7zip encrypted archivehashcat -m 13600 keepass.hash rockyou.txt #Crack KeePass database passwordhashcat -m 9600 office.hash rockyou.txt #Crack MS Office document passwordhashcat -m 10500 pdf.hash rockyou.txt #Crack PDF passwordIdentifying Hash Types
hashid hashes.txt #Use hashid to identify hashhashcat -m 0 --example-hashes #View example hashes for mode 0hashcat --example-hashes | grep NTLM #Search example hashes for NTLMhashcat --example-hashes > examples.txt #Export all example hashesMore generic hash types can be found here.
Performance Tuning
Optimizing Performance
hashcat -w 3 -m 1000 hashes.txt wordlist.txt #Workload level 3 (high)hashcat -w 4 -m 1000 hashes.txt wordlist.txt #Workload level 4 (max)hashcat --opencl-device-types 1,2 #Select CPU (1) and GPU (2)hashcat --backend-info #Display backend infoBenchmarking
Benchmarking allows testing GPU or CPU performance before running long cracking jobs.
hashcat -b #Run benchmark for default hash typeshashcat --benchmark-all #Benchmark all supported hash modeshashcat --speed-only -m 1000 hashes.txt wordlist.txt #Estimate cracking speed and exithashcat --progress-only -m 1000 hashes.txt wordlist.txt #Display expected workload sizeDevice and Hardware Control
hashcat -I #Display available OpenCL deviceshashcat -D 1 -m 1000 hashes.txt wordlist.txt #Use CPU onlyhashcat -D 2 -m 1000 hashes.txt wordlist.txt #Use GPU onlyhashcat -D 1,2 -m 1000 hashes.txt wordlist.txt #Use CPU and GPUhashcat -d 1 -m 1000 hashes.txt wordlist.txt #Select specific device IDhashcat --opencl-platforms=1 -m 1000 hashes.txt wordlist.txt #Select OpenCL platformHardware Monitoring
Useful when cracking on GPUs to prevent overheating.
hashcat --hwmon-disable -m 1000 hashes.txt wordlist.txt #Disable hardware monitoringhashcat --hwmon-temp-abort=90 -m 1000 hashes.txt wordlist.txt #Abort if GPU temperature reaches 90°Chashcat --hwmon-temp-retain=80 -m 1000 hashes.txt wordlist.txt #Throttle GPU to maintain temperatureWorkload Tuning
These options are used when optimising cracking speed on specific GPUs or CPUs.
hashcat -w 1 -m 1000 hashes.txt wordlist.txt #Low workload profilehashcat -w 2 -m 1000 hashes.txt wordlist.txt #Default workload profilehashcat -w 3 -m 1000 hashes.txt wordlist.txt #High workload profilehashcat -w 4 -m 1000 hashes.txt wordlist.txt #Nightmare workload profilehashcat --kernel-accel=64 -m 1000 hashes.txt wordlist.txt #Manually tune GPU accelerationhashcat --kernel-loops=1024 -m 1000 hashes.txt wordlist.txt #Adjust kernel loop counthashcat --nvidia-spin-damp=50 -m 1000 hashes.txt wordlist.txt #Reduce GPU spin-wait loadWordlist and Rules
Using Wordlists
hashcat -m 0 -a 0 hashes.txt /usr/share/wordlists/rockyou.txthashcat -m 0 -a 0 hashes.txt custom_wordlist.txtApplying Rules
hashcat -m 0 -a 0 hashes.txt wordlist.txt -r rules/best64.rulehashcat -m 0 -a 0 hashes.txt wordlist.txt -r rules/combinator.ruleWordlist Encoding and Hex Handling
These options help when cracking hashes that use non-standard encodings or binary inputs.
hashcat --encoding-from=utf-16 --encoding-to=utf-8 -m 1000 hashes.txt wordlist.txt #Convert wordlist encodinghashcat --hex-wordlist -m 1000 hashes.txt wordlist.txt #Treat wordlist entries as hexhashcat --hex-salt -m 1000 hashes.txt wordlist.txt #Treat salt as hexhashcat --hex-charset -m 1000 -a 3 hashes.txt ?b?b?b?b #Interpret charset as hexGenerating Wordlists
hashcat --stdout -a 3 ?u?u?u?d?d > generated_wordlist.txt #Generate a wordlist consisting of combinations of 3 uppercase letters followed by 2 digitshashcat --stdout -a 3 ?l?l?l?l?d > generated_wordlist.txt #Generate a wordlist consisting of combinations of 4 lowercase letters followed by a 1 digithashcat --stdout -a 3 ?l?l?l?l?l?u > generated_wordlist.txt #Generate a wordlist consisting of combinations of 5 lowercase letters followed by 1 uppercase letterhashcat --stdout -a 3 ?d?d?s?s?s > generated_wordlist.txt #Generate a wordlist consisting of combinations of 2 digits followed by 3 special charactershashcat --stdout -a 3 ?l?l?l?u?u?d > generated_wordlist.txt #Generate a wordlist consisting of 3 lowercase letters, 2 uppercase letters, and 1 digithashcat --stdout -a 3 ?l?l?l?l?l?l?d?d > generated_wordlist.txt #Generate a wordlist consisting of 6 lowercase letters followed by 2 digitshashcat --stdout -a 3 ?l?d?l?d > generated_wordlist.txt #Generate a wordlist consisting of alternating lowercase letters and digits (e.g., `a1b2`)hashcat --stdout -a 3 ?d?d?d?l?l?l > generated_wordlist.txt #Generate a wordlist consisting of 3 digits followed by 3 lowercase lettershashcat --stdout -a 3 ?u?u?u?u?s > generated_wordlist.txt #Generate a wordlist consisting of 4 uppercase letters followed by 1 special characterMask Attacks
The character sets for mask attacks in Hashcat are:
l | abcdefghijklmnopqrstuvwxyz [a-z]u | ABCDEFGHIJKLMNOPQRSTUVWXYZ [A-Z]d | 0123456789 [0-9]h | 0123456789abcdef [0-9a-f]H | 0123456789ABCDEF [0-9A-F]s | !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~a | ?l?u?d?sb | 0x00 - 0xffCommon Masks
hashcat -a 3 -m 0 hashes.txt ?d?d?d?d #4-digit PINhashcat -a 3 -m 0 hashes.txt ?u?l?l?l?d #Upper, lower, lower, lower, digithashcat -a 3 -m 0 hashes.txt ?a?a?a?a #Any 4 printable ASCII charactershashcat -a 3 -m 0 hashes.txt ?u?u?u?u #4 uppercase lettershashcat -a 3 -m 0 hashes.txt ?l?l?l?l #4 lowercase lettershashcat -a 3 -m 0 hashes.txt ?d?d?d?d?d #5-digit PINhashcat -a 3 -m 0 hashes.txt ?u?u?u?l?l #3 uppercase and 2 lowercase lettershashcat -a 3 -m 0 hashes.txt ?l?l?l?d?d #3 lowercase letters followed by 2 digitshashcat -a 3 -m 0 hashes.txt ?l?l?l?l?d #4 lowercase letters followed by 1 digithashcat -a 3 -m 0 hashes.txt ?l?d?l?d?l #Alternating lowercase and digits (e.g., `a1b2c`)hashcat -a 3 -m 0 hashes.txt ?u?d?u?d?l #Upper, digit, upper, digit, lowerhashcat -a 3 -m 0 hashes.txt ?a?a?a?d #Any 3 printable ASCII characters followed by a digithashcat -a 3 -m 0 hashes.txt ?d?d?d?l #3 digits followed by a lowercase letterhashcat -a 3 -m 0 hashes.txt ?u?d?d?d?u #Upper, digit, digit, digit, upperhashcat -a 3 -m 0 hashes.txt ?s?s?s?s #Any 4 special charactershashcat -a 3 -m 0 hashes.txt ?l?u?d?s #Lowercase, uppercase, digit, special characterhashcat -a 3 -m 0 hashes.txt ?d?d?l?l?l #2 digits followed by 3 lowercase lettersCustom Charset Masks
hashcat -a 3 -m 0 hashes.txt -1 ?l?u ?1?1?1?1 #4 mixed-case lettershashcat -a 3 -m 0 hashes.txt -2 abc ?2?2?2?2 #4 characters from 'abc'Incremental Mask Attacks
hashcat -m 1000 -a 3 hashes.txt ?l?l?l?l?l?l --increment #Enable mask incrementhashcat -m 1000 -a 3 hashes.txt ?l?l?l?l?l?l --increment-min=4 #Minimum mask lengthhashcat -m 1000 -a 3 hashes.txt ?l?l?l?l?l?l --increment-max=8 #Maximum mask lengthHybrid Attacks
hashcat -a 6 -m 0 hashes.txt wordlist.txt ?d?d #Wordlist + 2 digitshashcat -a 7 -m 0 hashes.txt ?d?d wordlist.txt #2 digits + WordlistMarkov Attacks
Markov chains optimise brute-force attacks by prioritising likely character sequences.
hashcat -m 1000 -a 3 --markov-hcstat2=my.hcstat2 hashes.txt ?a?a?a?a?a?a #Use custom Markov statistics filehashcat -m 1000 -a 3 --markov-disable hashes.txt ?a?a?a?a?a?a #Disable Markov optimizationhashcat -m 1000 -a 3 --markov-classic hashes.txt ?a?a?a?a?a?a #Use classic Markov chainshashcat -m 1000 -a 3 --markov-threshold=100 hashes.txt ?a?a?a?a?a?a #Limit Markov candidate acceptanceHashcat Brain (Distributed Cracking)
The brain feature prevents duplicate cracking attempts across multiple cracking machines.
hashcat --brain-server #Start brain serverhashcat --brain-client --brain-host=127.0.0.1 -m 1000 hashes.txt wordlist.txt #Connect to brain serverhashcat --brain-client --brain-host=10.10.10.5 --brain-password=secret -m 1000 hashes.txt wordlist.txt #Authenticate to brain serverhashcat --brain-client --brain-host=10.10.10.5 --brain-port=13743 -m 1000 hashes.txt wordlist.txt #Specify custom brain portCommon Hash Types
hashcat -m 22000 -a 3 handshake.22000 ?a?a?a?a?a?a?a?a #WPA/WPA2 Handshake Crackinghashcat -m 1000 -a 0 ntlm_hashes.txt wordlist.txt #NTLM Hasheshashcat -m 1400 -a 0 sha256_hashes.txt wordlist.txt #SHA256 Hasheshashcat -m 0 -a 0 md5_hashes.txt wordlist.txt #MD5 Hasheshashcat -m 100 -a 0 sha1_hashes.txt wordlist.txt #SHA1 Hasheshashcat -m 3200 -a 0 bcrypt_hashes.txt wordlist.txt #bcrypt Hasheshashcat -m 1700 -a 0 sha512_hashes.txt wordlist.txt #SHA512 Hasheshashcat -m 11000 -a 0 cisco_pix_hashes.txt wordlist.txt #Cisco PIX Hasheshashcat -m 300 -a 0 mysql_hashes.txt wordlist.txt #MySQL 5.x Hasheshashcat -m 9600 -a 0 office2013_hashes.txt wordlist.txt #Office 2013 Hashes (RC4)hashcat -m 3900 -a 0 cfhashes.txt wordlist.txt #Adobe ColdFusion 10 Hasheshashcat -m 18200 -a 0 kerberos_hashes.txt wordlist.txt #Kerberos 5 AS-REQ Pre-Auth Hasheshashcat -m 1500 -a 0 des_hashes.txt wordlist.txt #DES Hasheshashcat -m 7400 -a 0 hmac_sha256_hashes.txt wordlist.txt #HMAC-SHA256 Hasheshashcat -m 2200 -a 0 pbkdf2_hmac_sha1_hashes.txt wordlist.txt #PBKDF2-HMAC-SHA1 Hasheshashcat -m 3000 -a 0 lm_hashes.txt wordlist.txt #LM Hashes (Windows Legacy)hashcat -m 400 -a 0 wordpress_hashes.txt wordlist.txt #WordPress Hashes (MD5-based)hashcat -m 13000 -a 0 radmin_hashes.txt wordlist.txt #Radmin 3.x Hasheshashcat -m 900 -a 0 openssl_md5_hashes.txt wordlist.txt #OpenSSL MD5 Hasheshashcat -m 12500 -a 0 rar3_hashes.txt wordlist.txt #Rar3 Hashes (Rar3.x Archives)hashcat -m 110 -a 0 office2007_2013_hashes.txt wordlist.txt #MS Office 2007-2013 Hasheshashcat -m 10500 -a 0 pdf_hashes.txt wordlist.txt #PDF 1.7 Hashes (Encrypted PDFs)hashcat -m 5000 -a 0 aix_hashes.txt wordlist.txt #AIX LM Hasheshashcat -m 6211 -a 0 truecrypt_hashes.txt wordlist.txt #TrueCrypt HashesWorking with Files
Splitting and Sorting
split -l 1000 large_wordlist.txt smaller_list #Split large wordlistsort wordlist.txt | uniq > sorted_wordlist.txt #Sort and remove duplicatesCleaning Hashes
cat hashes.txt | sort | uniq > clean_hashes.txt #Remove duplicate hashesUsing Potfile
Default Potfile
hashcat -m 0 -a 0 hashes.txt wordlist.txt --potfile-disable #Disable potfilehashcat --show -m 0 hashes.txt #Show cracked passwordshashcat --left -m 1000 hashes.txt #Show remaining uncracked hasheshashcat --potfile-disable -m 1000 hashes.txt wordlist.txt #Disable writing to potfileCustom Potfile
hashcat -m 0 -a 0 hashes.txt wordlist.txt --potfile-path=custom.potSession and Restore
Save a Session
hashcat -m 0 -a 0 hashes.txt wordlist.txt --session=my_sessionRestore a Session
hashcat --restore --session=my_sessionDisable Restore File Creation
hashcat --restore-disable -m 1000 hashes.txt wordlist.txtRuntime Control
hashcat --runtime=3600 -m 1000 hashes.txt wordlist.txt #Stop after one hourhashcat --runtime=86400 -m 1000 hashes.txt wordlist.txt #Run for 24 hoursOutput and Logging
hashcat -o cracked.txt --outfile-format=2 -m 1000 hashes.txt wordlist.txt #Custom output formathashcat --outfile-check-timer=30 -m 1000 hashes.txt wordlist.txt #Check outfile every 30 secondshashcat --separator=":" -m 1000 hashes.txt wordlist.txt #Change output separatorhashcat --logfile-disable -m 1000 hashes.txt wordlist.txt #Disable log file creationThe following custom output formats are available:
--outfile-format=
1 | hash[:salt]2 | plain3 | hex_plain4 | crack_pos5 | timestamp absolute6 | timestamp relativeMonitoring and Status
hashcat --status -m 1000 hashes.txt wordlist.txt #Enable runtime status displayhashcat --status-timer=30 -m 1000 hashes.txt wordlist.txt #Update status every 30 secondshashcat --machine-readable --status -m 1000 hashes.txt wordlist.txt #Machine-readable status outputhashcat --logfile-disable -m 1000 hashes.txt wordlist.txt #Disable log file creation



