Capturing and Cracking a WPA2 Handshake with Aircrack-ng

2026-08-26

You just stood up a new AP -- a spare router for a guest network, a lab bench box, whatever -- and picked a passphrase for it. The only honest way to find out whether that passphrase is any good is to attack it the same way anyone else would. That's the whole job of aircrack-ng: not one tool but a suite, covering monitor mode setup, packet capture, and the offline crack, all built around one weakness in WPA2 -- the 4-way handshake that happens every time a client associates.

Everything below assumes you're testing a network you own or have explicit written authorization to test -- a home lab AP, a CTF range, or an engagement with signed scope. Capturing handshakes or deauthing clients on a network that isn't yours is a computer crime in most jurisdictions (CFAA in the US), full stop.

What you need

Putting the interface into monitor mode

NetworkManager and friends will fight you for the interface, so kill them first:

airmon-ng check kill

Then find the interface and switch it into monitor mode:

iwconfig
airmon-ng start wlan0

This usually renames the interface to something like wlan0mon. Confirm with iwconfig that it shows Mode:Monitor.

Surveying the airspace

airodump-ng wlan0mon

This lists every AP in range -- BSSID, channel, encryption, and the clients (STATIONs) associated with each one. Find the target AP's BSSID and channel and note them; the next command needs both.

Capturing the handshake

Lock onto the target and start writing packets to disk:

airodump-ng -c <channel> --bssid <BSSID> -w capture wlan0mon

The goal is a WPA 4-way handshake, which fires whenever a client associates with the AP. If a client is already connected, there's no need to wait for a natural reconnect -- a deauth forces one on your schedule instead of whenever someone happens to rejoin:

aireplay-ng -0 5 -a <BSSID> -c <client MAC> wlan0mon

-0 5 sends 5 deauth packets. Watch the airodump-ng window -- when it shows WPA handshake: <BSSID> in the top right corner, the capture has what it needs. Stop it with Ctrl-C.

An AP that supports PMKID will hand over enough to attack without any client interaction at all -- a known weakness in a lot of consumer router firmware, and worth knowing about since it skips the deauth step entirely. That's hcxdumptool territory rather than the airodump-ng/aireplay-ng flow above, but it's the quieter alternative when one applies.

Cracking it

Point aircrack-ng at the .cap file and a wordlist:

aircrack-ng -w /usr/share/wordlists/rockyou.txt -b <BSSID> capture-01.cap

If the passphrase is in the wordlist, this finds it. Under the hood it's just hashing candidate passwords through PBKDF2 and comparing against the handshake, so it's bottlenecked on CPU -- for anything past a quick sanity check, hashcat -m 22000 on a GPU (after converting the capture with hcxpcapngtool) does the same attack an order of magnitude faster.

Where this goes wrong in practice