How to Use Hashcat: Attack Modes and Examples (2026)

Penetration Testing
18 min read
How to Use Hashcat: Attack Modes and Examples (2026)
On this page
  1. What Hashcat Does
  2. Installing Hashcat and Checking Your GPU Actually Works
  3. Finding the Right Hash Mode
  4. How to Use Hashcat for a Dictionary Attack (the 80% Case)
  5. Rules: Turning One Wordlist Into Billions of Candidates
  6. Mask and Hybrid Attacks
  7. Cracking the Hash Types You Actually Meet
    1. Linux shadow files
    2. Windows and Active Directory
    3. Wireless captures
    4. Encrypted files
  8. The Four Errors Everyone Hits
  9. Tuning Without Cooking Your GPU
  10. Frequently Asked Questions
  11. Legal and Ethical Considerations
  12. Your Next Steps With Hashcat

Most guides on how to use Hashcat were written before version 7 shipped, and it shows. They open with a lecture on memorizing hash mode numbers, which Hashcat now figures out on its own. This tutorial covers the workflow as it actually runs in 2026: identifying the hash, picking an attack mode, layering rules and masks, and fixing the four errors that stop almost every beginner on their first run. Follow along in HackerDNA's Password Cracking course and start with the Shadow Cracker lab, where you pull hashes off a live Linux target and crack them yourself. For the wider context, see our complete penetration testing guide.

Every command below runs against Hashcat 7.1.2, the current stable release as of August 2026. If you are on 6.2.6 (still the version in some older distro repos), the attack modes and rule syntax are identical, but the hash mode auto-detection described in the next section will not be there. Upgrade before you start.

TL;DR: Hashcat is a GPU password cracker. The command shape is always the same: hashcat -m <mode> -a <attack> hashes.txt wordlist. Run a dictionary attack with hashcat -m 1000 -a 0 hashes.txt rockyou.txt, add -r rules/best66.rule to multiply candidates, and switch to -a 3 with a mask when you know the password pattern. Hashcat 7 detects the hash mode for you when you leave out -m, so the old habit of memorizing mode numbers is gone.

What Hashcat Does

Hashcat is an open-source password recovery tool that takes a cryptographic hash, generates candidate passwords, hashes each candidate with the same algorithm, and reports a match. It supports more than 400 hash types and runs on NVIDIA, AMD, Apple and Intel hardware through CUDA, HIP, Metal and OpenCL backends.

The reason Hashcat matters is parallelism. A CPU checks candidates a few dozen threads at a time; a modern GPU checks them tens of thousands at a time. Hashcat's own release notes benchmark Argon2 (mode 34000) at 1,703 hashes per second on an RTX 4090 versus 92 on a Ryzen 9 9900X, roughly an 18x gap on one of the slowest algorithms in circulation. On a fast unsalted hash like NTLM, the gap is wider still.

Version 7.0, released in August 2025, was the first major release in over two years. It added automatic hash type identification, Argon2 support, and the Assimilation Bridge for pushing work to CPUs, FPGAs and embedded Python. The full v7.0.0 release notes are worth reading once.

An opinionated take before you go further: do not start by reading the hash mode reference table. Every tutorial pushes you toward memorizing that -m 1000 means NTLM and -m 1800 means sha512crypt. You will absorb the dozen modes you actually meet through repetition, and Hashcat 7 will tell you the rest. Spend that effort on rules and masks instead, because those are where crack rates come from.

Installing Hashcat and Checking Your GPU Actually Works

On Kali, Parrot and most Debian derivatives, the package is in the repositories:

sudo apt install hashcat
hashcat --version

On macOS, Hashcat 7 uses the Metal backend, which replaced the deprecated OpenCL path Apple stopped maintaining. Install with brew install hashcat. On Windows, download the binary archive from hashcat.net, extract it, and run hashcat.exe from a terminal in that folder. There is no installer, which surprises people.

Now the step almost everyone skips. Confirm Hashcat can see your GPU:

$ hashcat -I
Backend Device ID #1 (Alias: #2)
  Type...........: GPU
  Vendor.........: NVIDIA Corporation
  Name...........: NVIDIA GeForce RTX 4070
  Processor(s)...: 46
  Memory.Total...: 12282 MB

If the only device listed is your CPU, Hashcat will still run, and it will be slow enough that you conclude the tool is broken. The usual cause is running Kali inside VirtualBox or VMware, where the guest never gets real GPU access. GPU passthrough is possible and rarely worth the afternoon it costs.

Practical setup: run Hashcat on the host operating system (Windows or bare-metal Linux) where the GPU lives, and keep Kali in the VM for everything else. Wordlists and hash files copy across a shared folder in seconds. Almost every experienced pentester works this way, and nobody mentions it in the tutorials.

Once the GPU shows up, benchmark it so you have a baseline:

hashcat -b -m 1000     # NTLM only
hashcat -b              # every mode, takes a while

Write the NTLM number down. When a future run looks sluggish, that baseline tells you within seconds whether the problem is your driver or just a slow algorithm.

Finding the Right Hash Mode

The -m flag tells Hashcat which algorithm produced your hash. Get it wrong and Hashcat either refuses to load the file or grinds through billions of candidates that could never match. In Hashcat 7, you can simply omit -m:

$ hashcat -a 0 hash.txt rockyou.txt
The following hash-mode match the structure of your input hash:
      # | Name                     | Category
  ======+==========================+===========
   1000 | NTLM                     | Operating System
   ...

When exactly one mode matches, Hashcat proceeds automatically. When several match, it lists the candidates and asks you to choose. You can also ask for the list without starting a run:

hashcat --identify hash.txt

The limit is worth quoting directly from the documentation: "Auto-detect is best effort. The correct hash-mode is NOT guaranteed." Detection works from the shape of the string alone, so algorithms with identical output formats cannot be told apart. A bare 32-character hex string could be MD5, NTLM or LM, and only context decides: NTLM comes out of Windows SAM dumps and secretsdump.py, raw MD5 out of web application databases.

These are the modes that cover the overwhelming majority of real engagements:

ModeAlgorithmWhere you find it
0MD5Legacy web app databases
100SHA1Older application storage
1000NTLMWindows SAM, NTDS.dit dumps
1800sha512crypt ($6$)Linux /etc/shadow
3200bcrypt ($2b$)Modern web applications
5600NetNTLMv2Responder captures
13100Kerberos TGS-REPKerberoasting output
18200Kerberos AS-REPAS-REP roasting output
22000WPA-PBKDF2-PMKID+EAPOLWireless captures
34000Argon2Recently built applications

One gap to know about in advance: Hashcat does not support yescrypt, the $y$ format that became the default on Debian 12 and Ubuntu 24.04. There is an open request for it, but yescrypt is memory-hard by design and a poor fit for GPUs. When you pull a shadow file off a current Debian box and see $y$, switch to John the Ripper. Our John the Ripper tutorial covers that side, and the hash cracking guide explains why some algorithms resist GPUs at all.

💻
Practice this now: Shadow Cracker - pull /etc/shadow off a live Linux target, identify the hash format, and crack it. Browser-based, no setup.

How to Use Hashcat for a Dictionary Attack (the 80% Case)

Attack mode 0 is the straight dictionary attack: try every line in a wordlist, in order. It is the first thing you run against any new hash file, and it is what cracks most passwords.

hashcat -m 1000 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt

The argument order is fixed and not intuitive: options, then the hash file, then the wordlist. Reverse the last two and Hashcat tries to load your wordlist as hashes, which produces a confusing error.

While the run is going, press s for status, p to pause, b to bypass the current attack and move to the next, and q to quit cleanly. For unattended runs, print status on a timer instead:

hashcat -m 1000 -a 0 hashes.txt rockyou.txt --status --status-timer=60

Cracked results go into the potfile at ~/.local/share/hashcat/hashcat.potfile and stay there permanently. Retrieve them any time:

$ hashcat -m 1000 hashes.txt --show
b4b9b02e6f09a9bd760f388b67351e2b:Password1
8846f7eaee8fb117ad06bdd830b7586c:password

The potfile is also the source of the single most confusing beginner experience with Hashcat. If you crack a hash, then re-run the same command, Hashcat reports "All hashes found in potfile" and exits without doing anything. That is correct behaviour, not a failure. Use --show to read the results, or --potfile-disable if you genuinely want to crack it again.

Two more flags belong in your muscle memory. --username parses user:hash files instead of choking on the colon, which matters because that is what every dumping tool produces. --session=name labels the run so you can resume it later with hashcat --restore --session=name; a full rule-based sweep often outlives your laptop battery.

hashcat -m 1000 -a 0 --username --session=q3-audit \
  -o cracked.txt hashes.txt rockyou.txt

Rules: Turning One Wordlist Into Billions of Candidates

Nobody uses password as their password anymore. They use Password1!, P@ssw0rd2026, or password123. Rules apply mutations to every wordlist entry so those variants get tested without you writing them out.

hashcat -m 1000 -a 0 -r /usr/share/hashcat/rules/best66.rule hashes.txt rockyou.txt

Note the filename. Hashcat 7 renamed best64.rule to best66.rule, and the changelog records the rename plainly. Every tutorial written before August 2025 still tells you to use best64.rule, and on a current install that file does not exist. If a command fails with a missing rule file, this is almost always why.

That command multiplies rockyou's 14 million entries by 66 mutations each, giving roughly 950 million candidates. Against NTLM on a mid-range GPU it still finishes in minutes. The rule files ship with Hashcat in /usr/share/hashcat/rules/:

  • best66.rule - 66 mutations covering the common patterns. Fast, high yield per unit of time, and where you should always start.
  • rockyou-30000.rule - 30,000 rules derived from the RockYou breach. The sensible second pass when best66 comes up short.
  • d3ad0ne.rule and dive.rule - large sets for long overnight runs, at roughly 34,000 and 98,000 rules. Both only make sense against fast hashes.
  • top10_2025.rule and stacking58.rule - new in version 7. The first is ten high-yield mutations, the second is 58 rules built to be stacked with another file.

You can stack rule files by passing -r more than once, and the mutations multiply. Two files of 100 rules each become 10,000 combinations per word. That escalates fast, so check the keyspace before committing your GPU to it:

hashcat -m 1000 -a 0 -r best66.rule -r stacking58.rule --keyspace hashes.txt rockyou.txt

Outside the bundled files, the community rule set worth having is OneRuleToRuleThemAll and its 2023 successor OneRuleToRuleThemStill, both on GitHub. They pack a very high crack rate into a single file. Drop the .rule file anywhere and point -r at the path.

Hashcat 7 also added character class operations to the rule syntax, written with a ~ prefix (~s?CY, ~@?C, ~e?C). They act on classes of characters rather than literal ones, so rules that used to need dozens of lines fit into one.

In practice, the useful trick is finding out which rules earned their keep. Run with debug output, then read the file afterwards to see which mutations produced cracks in this environment:

hashcat -m 1000 -a 0 -r best66.rule --debug-mode=1 \
  --debug-file=matched-rules.txt hashes.txt rockyou.txt

When one client's users all append the current year and one exclamation mark, that shows up in the debug file within the first hundred cracks. Build a five-line custom rule around that pattern and the remaining hashes fall much faster than any generic sweep would manage.

Mask and Hybrid Attacks

Masks describe a password's shape instead of its content. When you know a policy requires eight characters starting with a capital and ending in two digits, a mask tests exactly that space and nothing else. The placeholders:

  • ?l - lowercase a-z
  • ?u - uppercase A-Z
  • ?d - digits 0-9
  • ?s - special characters
  • ?a - all of the above
  • ?h / ?H - lowercase and uppercase hex

Attack mode 3 runs a mask:

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

That covers eight characters in the pattern described above, about 31 billion candidates, which an RTX-class card clears against NTLM in well under a minute. Change the hash to bcrypt and the same mask becomes a multi-year proposition. Algorithm speed decides what is reachable, every single time.

For unknown lengths, add --increment to work up from short to long:

hashcat -m 1000 -a 3 --increment --increment-min 6 --increment-max 8 hashes.txt ?a?a?a?a?a?a?a?a

Hashcat 7 added -ii (--increment-inverse), which grows the mask right to left instead. That helps when the fixed part of the password sits at the start, such as a company prefix followed by a variable suffix.

Custom charsets narrow the space further. Define up to four with -1 through -4:

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

Hybrid modes bolt a mask onto a wordlist. Mode 6 appends, mode 7 prepends:

hashcat -m 1000 -a 6 hashes.txt rockyou.txt ?d?d?d?d    # password2026
hashcat -m 1000 -a 7 hashes.txt ?d?d rockyou.txt        # 26password

Mode 6 with four trailing digits is the highest-value single command in this entire article. It catches the enormous population of passwords that are a dictionary word plus a year, and it runs in a fraction of the time a large rule set takes. When a dictionary run comes back empty, try that before you reach for dive.rule.

Cracking the Hash Types You Actually Meet

Linux shadow files

Modern distributions use $6$ sha512crypt (mode 1800) or $y$ yescrypt (not supported, use John). Feed the shadow lines to Hashcat directly with --username:

hashcat -m 1800 -a 0 --username shadow.txt rockyou.txt -r best66.rule

sha512crypt runs 5,000 iterations by default, which puts a consumer GPU somewhere in the hundreds of thousands of candidates per second rather than the billions you get with NTLM. Wordlists plus targeted rules are realistic here. Full brute force is not.

Windows and Active Directory

NTLM (mode 1000) is unsalted and extremely fast, which is why an entire domain's hashes typically fall in one overnight run. Extract them from an NTDS.dit dump and crack the fourth colon-separated field:

cut -d: -f4 ntds-dump.txt > ntlm.txt
hashcat -m 1000 -a 0 ntlm.txt rockyou.txt -r rockyou-30000.rule

Kerberoasting output goes in as mode 13100 and AS-REP roasting as 18200. Both are service or account tickets encrypted with a password-derived key, so cracking one gives you the account password in plaintext. Practice the Windows side in the Windows Password Cracker lab.

Wireless captures

Mode 22000 replaced the old 2500 and covers both PMKID and EAPOL handshakes in one format. Convert the capture first with hcxpcapngtool, which is a separate package:

hcxpcapngtool -o hash.22000 capture.pcapng
hashcat -m 22000 -a 0 hash.22000 rockyou.txt

WPA2 enforces a minimum of eight characters, so masks shorter than that waste your time. The WiFi Password Cracker lab walks the capture-to-crack pipeline end to end on a target you are allowed to attack.

Encrypted files

Hashcat cracks 7-Zip (11600), KeePass (13400), MS Office (9600) and PDF (25400), but it will not extract those hashes for you. That part belongs to John the Ripper's helper scripts. The normal workflow is office2john document.docx > office.hash, strip the leading username field, then hand the hash to Hashcat for the GPU work.

Last verified: August 2026 against Hashcat 7.1.2 on Kali 2026.2, with mode numbers confirmed against hashcat --help.

The Four Errors Everyone Hits

These four account for nearly every "Hashcat is broken" post on every forum. None of them mean Hashcat is broken.

  1. Token length exception. The hash does not match the structure mode -m expects. Nine times out of ten the real cause is a trailing newline, a Windows line ending, or a user: prefix you forgot to strip. Check with cat -A hash.txt and look for ^M at the end of lines. The tenth time, your -m is wrong; run --identify.
  2. No hashes loaded. Same root cause as above, or the file is empty because a redirect silently failed. If the file has content and the format is right, check whether everything in it is already cracked and sitting in the potfile.
  3. Separator unmatched. Your file is in user:hash format and you did not pass --username. Add the flag.
  4. Self-test failed. Hashcat verifies each kernel against a known hash at startup, and a failure means the GPU driver produced the wrong answer. The fix is updating or reinstalling the driver. --self-test-disable makes the message go away and leaves you cracking with a kernel that computes incorrect results, so you will find nothing and not understand why.

One silent failure deserves its own mention because there is no error message at all. The -O flag enables optimized kernels, which are considerably faster but cap candidate password length, often at 32 characters and sometimes lower depending on the mode. If the real password exceeds that cap, Hashcat finishes the run happily and reports nothing found. Use -O for speed on short candidates, drop it when you start testing passphrases.

Tuning Without Cooking Your GPU

The workload profile flag -w trades desktop responsiveness for speed. Profile 1 keeps your machine usable, 3 is the sensible default for a dedicated cracking box, and 4 used to be the maximum setting people reached for by habit.

Do not use -w 4 on Hashcat 7. The release notes are explicit that the new memory management makes it counterproductive, because it exhausts host memory while -w 3 reaches higher speeds without the overhead. This is one of the few pieces of long-standing Hashcat advice that version 7 genuinely reversed.

hashcat -m 1000 -a 0 -w 3 --hwmon-temp-abort=90 hashes.txt rockyou.txt

The temperature abort is not optional advice. Hashcat pushes a GPU harder than any game will, and long rule-based runs hold it at full load for hours. The default threshold is 90 degrees Celsius, and leaving it in place costs you nothing.

Finally, know when to stop. If rockyou plus best66 plus a hybrid digit mask has not cracked a hash, the password is probably long, random, or generated by a password manager. Three more hours of dive.rule will not change that. Note it as uncracked in the report, which is itself a finding: it means the account holder is doing something right.

Frequently Asked Questions

Is Hashcat free?

Yes. Hashcat has been open source under the MIT license since 2015 and there is no paid tier, no commercial edition, and no feature held back. The version you download from hashcat.net is the same one used in professional engagements and in the DEF CON Crack Me If You Can competition.

Do I need a GPU to use Hashcat?

No, Hashcat runs on CPU, but the difference is large enough to change what is possible. Hashcat's published Argon2 benchmark shows 1,703 hashes per second on an RTX 4090 against 92 on a Ryzen 9 9900X. For learning the command syntax, a CPU is fine. For real cracking work, any dedicated GPU from the last five years beats the fastest CPU you can buy.

Hashcat or John the Ripper: which should I learn first?

Learn Hashcat first if you have a GPU, because the speed makes practice runs finish while you are still paying attention. Add John when you hit a format Hashcat does not support, such as yescrypt shadow hashes or Mac OS X keychains, or when you need its *2john scripts to extract a hash from an encrypted file. Working pentesters keep both installed and switch based on the hash in front of them.

Can Hashcat crack WiFi passwords?

Yes, using mode 22000 against a captured PMKID or EAPOL handshake converted with hcxpcapngtool. Hashcat cannot capture the handshake itself, which requires a wireless adapter in monitor mode and a separate tool such as hcxdumptool or airodump-ng. Practice the full pipeline legally in the WiFi Password Cracker lab.

Where can I practice Hashcat legally?

Use environments built for it. HackerDNA's Password Cracking course and its labs provide targets that exist specifically for offensive practice. CTF competitions, VulnHub virtual machines, and hashes you generate yourself with mkpasswd are all safe. Never run Hashcat against hashes you do not own or have written permission to test.

Critical reminder: Only crack hashes you own or have explicit written authorization to test. Unauthorized password cracking is a criminal offense under the Computer Fraud and Abuse Act in the United States, the Computer Misuse Act in the United Kingdom, and equivalent laws almost everywhere else. In many jurisdictions, merely possessing credentials you cracked without authorization is a separate offense.

Make sure password cracking is named in your scope of work before the engagement starts. "Penetration testing authorized" is not the same as "you may exfiltrate the domain hash database and crack it," and that distinction has produced real disputes. Get it in writing.

Treat cracked credentials as the most sensitive artifact of the engagement. Keep them encrypted at rest, share them only through the channel the client agreed to, and destroy them when the report is delivered. Downloading breach dumps for "research" carries legal exposure that is not worth the convenience; stick to well-known training sets like rockyou.txt and hashes you generated yourself.

When the client asks how to defend against what you just demonstrated, the answer is algorithm choice and length. NIST SP 800-63B recommends dropping mandatory composition rules and periodic expiration in favour of longer passphrases and breached-password screening, and the OWASP Password Storage Cheat Sheet gives concrete Argon2id parameters. Both recommendations do more against Hashcat than any complexity policy ever has.

Your Next Steps With Hashcat

Knowing how to use Hashcat comes down to three decisions, repeated in order: which mode matches this hash, which attack fits what you know about the password, and when to stop. The syntax takes an afternoon. Looking at a hash file and knowing immediately whether to reach for a rule set, a mask or a hybrid attack takes a few dozen real runs.

Get those runs in the Shadow Cracker lab, where you extract hashes from a live Linux target and crack them yourself. From there, the Password Cracking course covers every attack mode against real Windows, wireless, archive and document targets in guided lessons. Start on the free tier, no credit card required.

HackerDNA Team

HackerDNA Team

Written by the HackerDNA team - cybersecurity professionals building hands-on hacking labs and educational content to help you develop real-world security skills.

Meet the Team

Ready to put this into practice?

Stop reading, start hacking. Get hands-on experience with 170+ real-world cybersecurity labs.

Start Hacking Free
19,000+ Hackers 100+ Labs & Courses Free
Start Hacking Free