Curious Minds

Clear answers to science and history questions

How Aircrack-ng Works: Wi-Fi Security Auditing

· 6 min read · Science

Aircrack-ng works by capturing and analyzing Wi-Fi management and data frames to test the security of a wireless network, primarily by recovering the pre-shared key (PSK) from a WPA/WPA2 handshake or by cracking WEP encryption. It is a suite of command-line tools rather than a single program, and each tool handles a specific part of the process: monitoring, capturing, injecting, and cracking.

Background: What Aircrack-ng Is and Isn't

Aircrack-ng is an open-source collection of utilities for auditing Wi-Fi network security. It is not a magic button that instantly reveals a password; it is a toolkit that requires a compatible wireless adapter, a clear understanding of 802.11 frame types, and patience. The suite runs on Linux, Windows (via a compatibility layer), and macOS, though Linux offers the most reliable driver support for the monitor mode and packet injection features the tools depend on.

The project began as a WEP cracker and grew into a broader suite. Today it includes tools such as airmon-ng (enables monitor mode), airodump-ng (captures packets), aireplay-ng (injects packets), and aircrack-ng itself (performs the actual key recovery). Understanding each piece is essential to understanding the whole.

How the Core Attack Works: Capturing the Handshake

For WPA/WPA2 networks, aircrack-ng does not break the encryption directly. Instead, it exploits the four-way handshake that occurs when a client device connects to an access point. During this handshake, the access point and the client exchange messages that allow both to derive the same pairwise transient key (PTK) without transmitting it over the air. The PTK is derived from the pre-shared key (the Wi-Fi password), the network name (SSID), and random values exchanged during the handshake.

An attacker (or auditor) can capture these handshake frames. Because the handshake contains enough information to test candidate passwords offline, aircrack-ng can take a wordlist of possible passwords and, for each one, compute the corresponding PTK and check whether it matches the captured handshake. This is a brute-force dictionary attack, not a flaw in WPA2 itself—the security depends entirely on the strength of the password.

The process typically follows these steps:

  1. Enable monitor mode: Use airmon-ng start wlan0 to put the wireless adapter into monitor mode, which allows it to capture all wireless traffic in range, not just traffic addressed to it.
  2. Discover networks: Run airodump-ng wlan0mon to list nearby access points, their channels, encryption types, and connected clients.
  3. Target a network: Note the BSSID (access point MAC address) and channel of the target, then capture traffic on that channel with airodump-ng -c [channel] --bssid [BSSID] -w capture wlan0mon.
  4. Force a handshake: Wait for a client to connect naturally, or use aireplay-ng --deauth to send deauthentication frames that briefly disconnect a client, prompting it to reconnect and produce a new handshake.
  5. Crack the handshake: Once the handshake is captured (airodump-ng indicates this), run aircrack-ng -w wordlist.txt capture.cap to test passwords from a wordlist against the captured handshake.

For WEP, the process is different: aircrack-ng exploits weaknesses in the RC4 key scheduling and initialization vectors (IVs). By capturing enough IVs (often tens of thousands), statistical attacks can recover the WEP key. Tools like aireplay-ng can accelerate IV collection through injection. WEP is now considered obsolete and easily broken, which is why modern networks use WPA2 or WPA3.

How to Choose the Right Tool for the Job

The aircrack-ng suite contains many utilities, and choosing the right one depends on the task:

  • airmon-ng: For enabling or disabling monitor mode on a wireless interface.
  • airodump-ng: For scanning and capturing packets; also used to identify clients and capture handshakes.
  • aireplay-ng: For packet injection, including deauthentication attacks and ARP request replay (useful for WEP).
  • aircrack-ng: For cracking WEP and WPA/WPA2 keys from captured files.
  • airbase-ng: For creating a soft access point, often used in rogue AP scenarios.
  • airdecloak-ng: For removing WEP cloaking from capture files.
  • airolib-ng: For managing precomputed PMK databases to speed up WPA cracking.

For a basic WPA handshake capture and crack, the essential tools are airmon-ng, airodump-ng, aireplay-ng, and aircrack-ng. For WEP, aireplay-ng's injection capabilities are more heavily used.

Common Problems and Limitations

Users frequently encounter issues that prevent aircrack-ng from working as expected:

  • Adapter compatibility: Not all wireless adapters support monitor mode or packet injection. Chipsets from Atheros and Ralink are often recommended, but support varies by driver and kernel version.
  • Driver conflicts: Network managers like NetworkManager can interfere with monitor mode. airmon-ng check kill can stop conflicting processes, but this may disconnect the system from other networks.
  • No handshake captured: If no client is active, a deauthentication attack may be needed, but some clients ignore deauth frames or reconnect too quickly. Capturing a handshake can take time.
  • Weak wordlist: The success of WPA cracking depends on the password being in the wordlist. Strong, randomly generated passwords are effectively uncrackable with dictionary attacks.
  • WPA3: Aircrack-ng does not support cracking WPA3, which uses Simultaneous Authentication of Equals (SAE) to resist offline dictionary attacks.

It is also worth noting that modern access points may use management frame protection (MFP/802.11w), which can prevent deauthentication attacks from working.

Aircrack-ng is a legitimate security auditing tool, but using it on networks you do not own or have explicit permission to test is illegal in most jurisdictions. Unauthorized access to computer networks is a criminal offense under laws such as the Computer Fraud and Abuse Act in the United States and similar legislation elsewhere. Security professionals use aircrack-ng in controlled environments, such as penetration testing engagements with written authorization, to identify weak passwords and misconfigurations. The tool itself is not illegal, but its misuse is.

Alternatives and Comparisons

Several other tools overlap with aircrack-ng's functionality. Hashcat is a general-purpose password cracker that can also attack WPA handshakes, often with GPU acceleration for faster cracking. Kismet is a wireless detector and sniffer that can capture handshakes but does not crack them. Reaver targets WPS (Wi-Fi Protected Setup) PINs, a different attack vector. Wifite is an automated wrapper that orchestrates aircrack-ng and other tools. Aircrack-ng remains popular because it is lightweight, scriptable, and included in many security-focused Linux distributions such as Kali Linux.

Frequently Asked Questions

Is aircrack-ng illegal?

The software itself is legal to download and use. However, using it to access networks without authorization is illegal in most countries. Always obtain permission before testing any network you do not own.

Can aircrack-ng crack WPA3?

No. Aircrack-ng does not support WPA3 cracking. WPA3 uses SAE, which is designed to resist offline dictionary attacks, making the handshake capture approach ineffective.

Why does aircrack-ng need a handshake?

For WPA/WPA2, the handshake contains the information needed to verify a password guess offline. Without a handshake, there is no data to test passwords against. Aircrack-ng cannot crack WPA passwords from just any captured traffic.

How long does it take to crack a WPA password?

It depends entirely on the password's complexity and the size of the wordlist. A weak password might be found in seconds; a strong, random password may never be found with dictionary attacks. There is no fixed time.

Does aircrack-ng work on Windows?

Aircrack-ng can run on Windows, but driver support for monitor mode and packet injection is limited. Most users rely on Linux for full functionality, often booting from a live USB.

What is the difference between aircrack-ng and airodump-ng?

Airodump-ng captures packets and identifies networks; aircrack-ng performs the actual key cracking. They are separate tools within the same suite, used together in a workflow.

In this article
  1. Background: What Aircrack-ng Is and Isn't
  2. How the Core Attack Works: Capturing the Handshake
  3. How to Choose the Right Tool for the Job
  4. Common Problems and Limitations
  5. Legal and Ethical Considerations
  6. Alternatives and Comparisons
  7. Frequently Asked Questions