ARP Spoofing

ARP Spoofing

ARP spoofing is like tricking your computer into sending mail to the wrong address by changing the address book. An attacker sends fake messages that make your computer think the attacker's device is actually the router, so all your internet traffic goes through them first. This lets the hacker secretly read, steal, or mess with your data before passing it along to where it was supposed to go.

Overview

ARP poisoning involves forging many ARP request and reply packets to overload a Switch

Attack Mechanism

ARP resolves IP addresses to the MAC (Hardware) address of the interface to send data. ARP packets can be forged to send data to the attacker's machine. ARP spoofing involves constructing a large number of forged ARP request and reply packets to overload a switch. When a machine sends an ARP request, it assumes that the ARP reply will come from the right machine. ARP provides no means of verifying the authenticity of the responding device. Even systems that have not made an ARP request can accept the ARP replies coming from other devices.

Attackers use this flaw in ARP to create malformed ARP replies containing spoofed IP and MAC addresses. Assuming it to be the legitimate ARP reply, the victim's computer blindly accepts the ARP entry into its ARP table. Once the ARP table is flooded with spoofed ARP replies, the switch is set in forwarding mode, and the attacker intercepts all the data that flows from the victim's machine without the victim being aware of the attack. Attackers flood a target computer's ARP cache with forged entries, which is also known as poisoning. ARP spoofing is an intermediary for performing attacks such as DoS, MITM, and session hijacking.

ARP spoofing is a method of attacking an Ethernet LAN. When a legitimate user initiates a session with another user in the same layer 2 broadcast domain, the switch broadcasts an ARP request using the recipient's IP address, while the sender waits for the recipient to respond with a MAC address. An attacker eavesdropping on this unprotected layer 2 broadcast domain can respond to the broadcast ARP request and replies to the sender by spoofing the intended recipient's IP address. The attacker runs a sniffer and turns the machine's NIC adapter to promiscuous mode.

Attack Flow Diagrams

sequenceDiagram
    participant Attacker
    participant Victim
    participant Router

    Attacker->>Victim: Send spoofed ARP reply (IP of Router -> MAC of Attacker)
    Victim->>Attacker: Updates ARP cache with incorrect MAC address for Router
    Attacker->>Router: Send spoofed ARP reply (IP of Victim -> MAC of Attacker)
    Router->>Attacker: Updates ARP cache with incorrect MAC address for Victim
    Attacker->>Victim: Man-in-the-middle: Intercepts and forwards traffic
    Attacker->>Router: Man-in-the-middle: Intercepts and forwards traffic
graph LR
    V["Victim
192.168.1.100
MAC: aa:bb:cc:dd:ee:ff"] G["Gateway/Router
192.168.1.1
MAC: 11:22:33:44:55:66"] A["Attacker
192.168.1.50
MAC: xx:xx:xx:xx:xx:xx"] V -.->|"1 ARP Request: Who has 192.168.1.1?"| G G -.->|"2 ARP Reply: I am 192.168.1.1"| V A -->|"3 Fake ARP Reply: I am 192.168.1.1"| V V -->|"4 Updates ARP cache with attacker MAC"| V V -->|"5 All traffic intended for gateway"| A A -->|"6 Forwards traffic to real gateway"| G G -->|"7 Gateway replies via attacker"| A A -->|"8 Attacker intercepts and forwards"| V classDef victim fill:#ffebee,stroke:#c62828,stroke-width:2px classDef gateway fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px classDef attacker fill:#fff3e0,stroke:#ef6c00,stroke-width:2px class V victim class G gateway class A attacker

ARP Poisoning

The result of ARP spoofing, where the ARP cache is poisoned with incorrect IP-to-MAC mappings.

Tools

Technical Background

The term ARP Spoofing, also widely known as ARP Poisoning or ARP Cache Poisoning, refers to a type of active network attack that exploits vulnerabilities in the Address Resolution Protocol (ARP) to redirect network traffic, primarily for sniffing or launching Man-in-the-Middle (MITM) attacks.

ARP poisoning is listed as a network hacking technique and a sniffing technique used by attackers to steal and manipulate sensitive data and gain control over a target network.

Address Resolution Protocol (ARP) Background

ARP is a fundamental, stateless TCP/IP protocol.

ARP Spoofing Attack Mechanism

ARP spoofing leverages the inherent trust mechanism of the ARP protocol to insert the attacker's machine into the communication path.

  1. Forging Packets: The attacker constructs and sends a large number of forged ARP request and reply packets onto the Local Area Network (LAN).
  2. Poisoning the Cache: These malformed packets contain spoofed IP and MAC addresses. The attacker floods a target computer's ARP cache with these entries (hence, "poisoning").
  3. Redirection: The attacker typically aims to associate their machine's MAC address with the IP address of a critical host, such as the default gateway or another victim.
  4. Traffic Interception: The victim's computer, assuming the forged entry is legitimate, updates its ARP table. Consequently, traffic destined for the gateway (or the other victim) is now routed through the attacker's system instead.
  5. Environment: ARP spoofing is a common method of active sniffing used against switched Ethernet networks. Once the ARP table is flooded with spoofed replies, the switch may be set in forwarding mode, allowing the attacker to sniff all network packets. To execute the attack, the attacker runs a sniffer with the Network Interface Card (NIC) set to promiscuous mode.

Goals and Threats of ARP Poisoning

ARP poisoning is used as a foundation for several serious attacks:

Attack Tools

Attackers commonly use specialized tools to automate the generation of forged ARP replies:

Countermeasures and Detection

Prevention (Countermeasures)

Detection