The arpspoof command will spoof default_router_ip's MAC address on all victims in the subnet
arpspoof -i <NIC> <default_router_ip>
How does it fool the router about the MAC addresses of victim hosts in the subnet?
arpspoof -i <NIC> <default_router_ip>
Will tell all devices on the subnet of <NIC>
that they should resolve <default_router_ip>
to this machine instead.
Say your attacking box has eth0 IP 192.168.52.7
and the MAC address 00-14-22-01-23-45
.
Say the router has IP 192.168.52.1
and the MAC address 00-14-22-01-02-03
.
If you run arpspoof -i eth0 192.168.52.1
your system will constantly send out ARP replies stating 00-14-22-01-23-45
is the correct hardware address for 192.168.52.1
.
Therefore when our victim, 192.168.52.100
asks for the MAC address of the default gateway 192.168.52.1
, it gets 00-14-22-01-23-45
and routes all of its internet traffic to our attacking box instead.
Note that -t
is optional, and is only used if you want to target one victim at a time (192.168.52.100
in our case). If not specified, all ARP caches on the subnet are attempted to be poisoned. If -t
is specified, you can also specify -r
so that traffic in both directions is captured. This then does not require two arpspoof
commands to be issued.
Assume the router having an IP of 192.168.1.1. Our victim will have an IP of 192.168.1.9.
We will need to open two terminal windows now, as we need to tell the victim that it should send its packets to us instead of the gateway, and we need to tell the gateway to send packets to us, instead of the victim.
arpspoof -t 192.168.1.9 192.168.1.1
arpspoof -t 192.168.1.1 192.168.1.9
Now run Wireshark or tcpdump to start capturing packets.
It will continuosly send arp reply and thus update the arp cache table on both the victim and the router side.
Also its important to enable ip forwading for the packet to reach from victim to router and vice versa.
As the attacker will capture the packets on wireshark (because the destination ip of the packet won't match with attackers ip.)
Hence forward the packet to destined routerand vice versa.