[Day 8] 4. Hacking the Wi-Fi
Requirements:
-
Hardware Requirements:
- Base Machine: Kali Linux.
- Network Adapter:
- Use an external adapter or add a compatible one to your virtual machine.
- Extension Pack: Ensure the VirtualBox Extension Pack is installed.
-
VirtualBox Setup:
- Change the settings to add the USB (network adapter).
- After connecting the external network adapter, you should:
- Be able to access the internet inside the Kali machine.
- Verify the adapter with the command.
ip a
-
Promiscuous Mode and Monitor Mode:
- Promiscuous Mode: Allows Ethernet adapters to see all packets.
- Monitor Mode: Required for wireless adapters to capture packets.
Understanding the Wi-Fi Password Process:
- 4-Way Handshake:
- A critical exchange during Wi-Fi authentication.
- If these handshake packets are captured correctly, they can be cracked to reveal the password.
Tools Used:
- airmon-ng: Enables monitoring mode.
- airodump-ng: Captures Wi-Fi data packets.
- aircrack-ng: Cracks Wi-Fi passwords.
- airplay-ng: Disconnects clients from the network to force reconnections (for EAPOL packet capture).
Steps to Hack Wi-Fi:
1. Enable Monitor Mode:
- Start monitoring mode:
bash
sudo airmon-ng sudo airmon-ng start wlan0 ip a # Verify the adapter is now in monitoring mode (e.g., wlan0mon)
2. Identify the Target Wi-Fi Network:
-
Scan for Wi-Fi networks:
bashsudo airodump-ng --band bg wlan0- Note the channel number and MAC address of the Wi-Fi network you want to hack.
3. Capture 4-Way Handshake Packets:
-
Start packet capturing in a new terminal:
bashmkdir hackwifi && cd hackwifi sudo airodump-ng -c <channel-number> --bssid <mac-address> -w hack wlan0mon- Options:
- : Channel number of the target network.
-c - : MAC address of the target network.
--bssid - : Output filename (
-w hackin this example).hack
- Options:
4. Crack the Password:
-
Wordlist Preparation:
-
Use a pre-existing wordlist or create your own. Example:
bashcp /usr/share/metasploit-framework/data/wordlists/password.lst wordlist
-
-
Crack the Handshake Packets:
bashsudo aircrack-ng -w wordlist -b <mac-address> hack-01.cap- Options:
- : Path to the wordlist.
-w - : MAC address of the target Wi-Fi.
-b - : File created during handshake capture.
hack-01.cap
- The tool scans the wordlist and reveals the password within seconds if it's present in the list.
- Options:
5. Force Client Disconnection (Optional):
-
Use
to disconnect clients from the network. This forces reconnections, making it easier to capture EAPOL packets. Example:airplay-ngbashsudo airplay-ng -0 <number_of_deauth_packets> -a <bssid> wlan0mon
Extra
4-Way Handshake:
The 4-Way Handshake is a process used in Wi-Fi networks to securely connect a device to a router. Here's how it works:
- Purpose: It ensures that both the router and the device know the Wi-Fi password without directly sharing it.
- Steps:
- The router sends a random number (Nonce) to the device.
- The device uses this number and the password to create a unique response.
- The router verifies the response.
- Both sides agree on encryption keys for secure communication.
If you capture these handshake packets, you can use tools to crack the Wi-Fi password.
Read Next
[Day 8] 5. Creating your own password list
### **Creating Your Own Password List with Crunch** 1. **Setup:** ```bash mkdir hackwifi cd hackwifi mkdir mylist cd...
[Day 9] 1. File Inclusion in DVWA
### **LFI (Local File Inclusion)** - **Definition**: LFI is a web vulnerability that occurs when an attacker can include local files (present on th...