146
◾
Ethical Hacking and Penetration Testing Guide
Attacker’s IP
—This will be the IP address of my BackTrack machine, which is 192.168.75.138.
Victim’s IP
—My
victim is a Windows XP machine, which has an IP 192.168.75.142.
Default gateway
—The default gateway is the IP address of my router, which is 192.168.75.142.
Next, we would take a note of the victim’s MAC addresses associated with each of them.
We can view the MAC addresses
in the ARP cache:
From this ARP cache, we can see that we have the MAC address
of the default gateway
(192.168.75.2) and our machine (192.168.75.138). So what we would like to do is to tell the
default gateway that the victim’s IP address is associated with our MAC address and vice versa.
Let’s try ARP spoof to do this job.
Usage
The basic syntax for arpspoof is as follows:
arpspoof –i [Interface] –t [Target Host]
In this case, our interface is “eth0,” and our targets are 192.168.75.2 (gateway) and
192.168.75.142 (victim). So our command would be as follows:
arpspoof –i eth0 –t 192.168.75.142 192.168.75.2
On taking a look at the ARP cache again, we figure out that
the gateway MAC address has
been replaced with our MAC address. So anything that the victim sends to the gateway will be
forwarded to us.
Network Sniffing
◾
147
We also need to issue the same command in a reverse manner because when we are in the
middle and we need to send ARP replies both ways.
arpspoof –I eth0 –t 192.168.75.2 192.168.75.142
If we take a look at the ARP cache of the victim’s machine now, we
will find our MAC address
associated with both IP addresses (default gateway and victim).
Dostları ilə paylaş: