WarFi Labs

hashcat

GPU password cracking ยท MIT

The GPU-accelerated cracker: the fastest way to test hashes at scale, with a deep attack-mode system of wordlists, rules, and masks.

Authorized use only. Run these only on systems you own or have explicit written permission to test. Full notice at the foot of the page.

01The speed champion

hashcat cracks hashes on the GPU, and the difference from CPU cracking is not incremental, it is orders of magnitude: a modern card does billions of fast-hash guesses per second. That speed changes what is possible, so hashcat is where serious offline cracking happens, including the wifi handshakes and PMKIDs from the wireless guides. The cost is that you must speak its language precisely: the hash type is a number (-m), the attack is a number (-a), and getting either wrong wastes the whole run.

↑ contents

02Install and benchmark

Install hashcat and the GPU drivers it needs (it will tell you if it cannot see a device). A benchmark both confirms the GPU is working and shows the speed per hash type, which is useful for estimating how long a job will take.

$ sudo emerge app-crypt/hashcat # Gentoo

$ sudo apt install hashcat # Debian / Ubuntu / Kali

$ sudo dnf install hashcat # Fedora / RHEL

03-m, the hash type

Every hash type has a mode number. 0 is raw MD5, 1000 is NTLM, 1800 is sha512crypt, 22000 is WPA (the wifi format from the hcxtools guide), 3200 is bcrypt. --help lists them all, or search it. Identify the hash first; the wrong mode simply will not match.

$ hashcat --help | grep -i ntlm

$ hashcat --identify hashes.txt

The following hash-modes match the structure of your input hash: # | Name | Category ======+=============================+====================== 1000 | NTLM | Operating System 3000 | LM | Operating System

04-a, the attack mode

The attack mode decides how hashcat generates guesses. The three you will use: 0 straight (a wordlist, optionally with rules), 3 mask (brute force over a defined pattern), and 6/7 (wordlist plus mask combinations). Straight with good rules does most of the work; masks handle the structured passwords a wordlist cannot.

↑ contents

05Wordlist with rules

The highest-yield attack: a wordlist run through a rule file that mutates each word. hashcat ships excellent rule sets; best64 is the fast, famous starting point, and larger ones trade time for coverage. This is where most passwords fall.

$ hashcat -m 1000 hashes.txt rockyou.txt

$ hashcat -m 1000 hashes.txt rockyou.txt -r /usr/share/hashcat/rules/best64.rule

Session..........: hashcat Status...........: Cracked Hash.Mode........: 1000 (NTLM) Speed.#1.........: 12843.4 MH/s 8846f7eaee8fb117ad06bdd830b7586c:Password123 Recovered........: 1/1 (100.00%) Digests

06Mask attacks for structured passwords

When you know or suspect the shape of a password, a mask brute-forces just that shape, which is vastly smaller than all possibilities. The character sets are ?l lower, ?u upper, ?d digit, ?s symbol, ?a all. A capital, five letters, and two digits is ?u?l?l?l?l?l?d?d, a tiny space that cracks in seconds.

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

$ hashcat -m 1000 hashes.txt -a 3 '?d?d?d?d?d?d?d?d'

Session..........: hashcat Status...........: Cracked Hash.Mode........: 1000 (NTLM) Guess.Mask.......: ?u?l?l?l?l?l?d?d [8] Speed.#1.........: 12345.6 MH/s (6.21ms) Recovered........: 1/1 (100.00%) Digests b4a9e2d1c0f3...:Abcdef12

» Masks are how you crack passwords that follow a pattern (a name and a year, a phone number) that no wordlist contains but that humans pick constantly.

07Cracking the wifi handshake

This closes the loop from the wireless guides. The 22000 file from hcxpcapngtool is cracked with mode 22000, and everything above applies: wordlists, rules, masks. A WPA handshake is just another hash to hashcat, only slower per guess than NTLM, so lean on a good wordlist and rules.

$ hashcat -m 22000 capture.22000 rockyou.txt -r best64.rule

$ hashcat -m 22000 capture.22000 -a 3 '?d?d?d?d?d?d?d?d'

Session..........: hashcat Status...........: Cracked Hash.Mode........: 22000 (WPA-PBKDF2-PMKID+EAPOL) Hash.Target......: capture.22000 Speed.#1.........: 412.3 kH/s Recovered........: 1/1 (100.00%) Digests AA:BB:CC:11:22:33:66778899aabb:HomeLab:password123

08Sessions, status, and resuming

Long jobs need management. Name a session so you can pause and resume it, press s for status and p to pause mid-run, and use --show to list what has already cracked from the pot. hashcat checkpoints automatically, so a stopped job picks up where it left off.

$ hashcat -m 22000 capture.22000 rockyou.txt --session wifi1

$ hashcat --session wifi1 --restore

$ hashcat -m 22000 capture.22000 --show

[s]tatus [p]ause [b]ypass [c]heckpoint [f]inish [q]uit => Session..........: wifi1 Status...........: Paused Restore.Point....: 884736/14344385 (6.17%) # after --restore it continues from the checkpoint; --show prints the result: AA:BB:CC:11:22:33:66778899aabb:HomeLab:password123

↑ contents

09What hashcat proves about your passwords

hashcat is the most honest test of password and storage strength you can run. Crack your own dumped hashes and the results are unarguable: anything that falls to a wordlist and rules in minutes is a password your users must change, and anything that falls because the hash was fast and unsalted is a storage decision you must change.

» Store passwords with a slow, salted, memory-hard algorithm (argon2, bcrypt, scrypt); hashcat's billions-per-second rate collapses to thousands against these, which is the whole point.

» Length beats complexity: a long passphrase defeats masks and rules because the search space explodes with each character; ?a to the power of twelve is out of reach, Password1 is not.

» Ban known-breached passwords at the point they are set; if it is in rockyou, hashcat finds it instantly, so never let it be chosen.

» For wifi, this is the same lesson as the aircrack-ng guide: a long random WPA passphrase is the only thing that makes the captured handshake uncrackable.

» The defender's summary of this whole credentials group: assume the hash will be captured and the guesses will be fast, then make the password long enough and the storage slow enough that speed does not matter.

Crack only hashes you are authorized to possess, from your own systems or an authorized engagement.

↑ contents

Authorized use only

The tools and techniques in these guides are for defending, testing, and understanding systems you own or have explicit written permission to assess. Unauthorized access to computers, networks, accounts, or data is a criminal offense in nearly every jurisdiction, and the penalties are real.

A few of the laws that apply, by way of example:

Wherever you are, the rule is the same: get authorization in writing, stay within the agreed scope, and never touch a system that is not yours to test. If you are unsure whether something is permitted, treat it as not permitted until you have clear authorization.

This is general information, not legal advice.