The Trust Flaw: Address Resolution Protocol (ARP) and Cache Poisoning
When an application transmits data over a Local Area Network (LAN), routing operates using 32-bit IP Addresses (Layer 3).
However, Ethernet network interface cards (NICs) and switches possess zero awareness of IP addresses. They transmit physical frames using 48-bit MAC Addresses (Layer 2).
The protocol responsible for bridging this gap is the Address Resolution Protocol (ARP).
1. How ARP Works: Broadcast and Unicast
When Host A (192.168.1.10) needs to transmit a packet to Host B (192.168.1.20):
- ARP Cache Lookup: Host
Ainspects its local kernel ARP table (arp -a). If the mapping exists, it encapsulates the packet immediately. - ARP Request (Broadcast): If unmapped, Host
Abroadcasts an ARP Request frame to Ethernet addressFF:FF:FF:FF:FF:FF: > "Who has 192.168.1.20? Tell 192.168.1.10 at MAC AA:AA:AA:AA:AA:AA." - ARP Reply (Unicast): Every host on the switch receives the broadcast, but only Host
Bmatches the requested IP. HostBunicasts a reply: > "192.168.1.20 is at BB:BB:BB:BB:BB:BB." - Caching: Host
Awrites the mapping into its kernel ARP cache with an expiration timer.
2. The Architectural Flaw: Stateless Trust
Designed in 1982 (RFC 826), ARP contains zero cryptographic authentication.
Crucially, ARP is stateless:
- An operating system will accept and overwrite an existing entry in its ARP cache upon receiving an ARP Reply, even if the host never transmitted an ARP Request!
3. ARP Cache Poisoning (Spoofing)
In an ARP Spoofing attack, an attacker on the same local subnet emits forged, unsolicited ARP replies (Gratuitous ARPs):
- To the Victim: "192.168.1.1 (Default Gateway) is at
Attacker_MAC." - To the Gateway: "192.168.1.10 (Victim) is at
Attacker_MAC."
Both devices update their internal ARP tables without verification:
- All outbound traffic from the victim to the Internet is routed to the attacker.
- The attacker forwards the traffic to the real gateway, silently capturing unencrypted credentials and session tokens (Man-in-the-Middle Attack).
Defense Mechanisms:
- Dynamic ARP Inspection (DAI): Enterprise switches validate ARP packets against a trusted DHCP snooping database.
- Static ARP Entries: Manually binding critical gateway IPs to physical MAC addresses.
Explore full network protocol architectures at Binary Dose.
