ARP Poisoning
Table of Contents
ARP Poisoning
Description
ARP Poisoning (or ARP Spoofing) is a type of Man-in-the-Middle (MitM) attack that exploits the stateless and trust-based nature of the ARP protocol, which is used to resolve IP addresses to MAC addresses on a local network segment.
How it Works
- ARP Request: When one device (A) on a network needs to send data to another device (B), it broadcasts an ARP request asking, "Who has IP address B?"
- Legitimate Reply: Device B replies, "I do, and my MAC address is \(M_B\)." Device A then caches this IP-to-MAC mapping.
- Poisoning: The attacker (X) sends unsolicited, false ARP replies to both Device A and the target Device B.
- To Device A, the attacker sends a reply saying, "I am Device B, and my MAC address is \(M_X\) (the attacker's MAC)."
- To Device B, the attacker sends a reply saying, "I am the router (gateway), and my MAC address is \(M_X\)."
- Traffic Interception: Both devices update their ARP caches with the attacker's MAC address. Consequently, all traffic intended for the router from A, and all traffic intended for A from B (or vice versa), is routed through the attacker's machine.
- Packet Forwarding: The attacker can then sniff, modify, or log the data before forwarding it to the original intended destination, thereby remaining undetected while eavesdropping.
Examples
- Man-in-the-Middle (MitM) Attack: The primary use. After poisoning the ARP cache of a victim and a gateway, the attacker sits in between, transparently intercepting all traffic, including credentials and sensitive data.
- Session Hijacking: By intercepting traffic, an attacker can steal session cookies or tokens and use them to hijack an active user session.
- Denial of Service (DoS): An attacker can poison the ARP cache of many machines on the network, associating a non-existent MAC address with a critical server's IP. This effectively stops all traffic from reaching the server, causing a localized DoS.
Command (Tool) Example:
# A common tool used for ARP Spoofing and MitM attacks in penetration testing # -i eth0: specifies the network interface # -t 192.168.1.100: specifies the target IP (victim) # -r 192.168.1.1: specifies the router/gateway IP ettercap -Tq -i eth0 -M arp:remote /192.168.1.100/ /192.168.1.1/