Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 37 ยท Security Analysis

Detecting ARP Spoofing and Other LAN Anomalies

Learn how ARP works, how spoofing and duplicate-IP conflicts appear in Wireshark, and how defenders detect them with filters, expert info and simple scripts.

On a local network, devices find each other with the Address Resolution Protocol (ARP): "who has 192.168.1.1? tell 192.168.1.20". ARP has no authentication. Any host can claim any address, which is why ARP-based attacks and plain misconfigurations are both common on LANs, and why the capture shows them so clearly.

This lesson teaches detection and defense. You will read ARP in Wireshark, learn what spoofing looks like, and write a detector that runs on sample data. Do not perform spoofing on networks you do not own; it disrupts users and is illegal without authorization.

ARP in a capture

An ARP request is a broadcast; the reply is unicast.

TEXT
 1  0.000  aa:aa:aa:00:00:20  ff:ff:ff:ff:ff:ff  ARP  Who has 192.168.1.1? Tell 192.168.1.20
 2  0.001  bb:bb:bb:00:00:01  aa:aa:aa:00:00:20  ARP  192.168.1.1 is at bb:bb:bb:00:00:01

Useful filters:

TEXT
arp                               # all ARP
arp.opcode == 1                   # requests
arp.opcode == 2                   # replies
arp.duplicate-address-detected    # Wireshark noticed two MACs for one IP
arp.isgratuitous                  # gratuitous ARP (a host announces itself)

Wireshark's Expert Information may show "Duplicate IP address configured" when two MAC addresses claim the same IP. It also reports "ARP packet storm" if a flood of requests arrives.

How ARP spoofing works (and why it shows)

A host answers with its own MAC address for someone else's IP, usually the gateway. Neighbors update their ARP caches. Traffic meant for the gateway now flows to the attacker's machine first. The attacker may forward it onwards (to stay unnoticed) and read or alter it.

flowchart LR
    V["Victim 192.168.1.20"] -->|"believes gateway is at MAC X"| M["Attacker MAC X"]
    M --> G["Real gateway 192.168.1.1"]
    classDef bad fill:#fdd,stroke:#a33
    class M bad

The victim sends gateway-bound frames to the wrong MAC.

Signs in a capture:

  • One IP, two MACs. The gateway's IP is announced by its real MAC and then by another one.
  • Unsolicited replies. Many ARP replies with no matching request, often repeated every few seconds to keep caches poisoned.
  • Gratuitous ARP floods for the gateway address.
  • Duplicate traffic. The same IP packet appears twice on the wire, once to the attacker and once forwarded on. Look for identical packets with different Ethernet destinations.
  • Users see certificate warnings when attackers try to intercept HTTPS (the certificate will not match).

Detection with code

A simple detector remembers the first MAC seen for each IP and raises an alert when it changes. Tools like arpwatch do this on real networks.

Python Detect an IP that changes MAC address

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Note the weakness: a legitimate change (a replaced router, a failover pair such as VRRP) also triggers an alert. A real system keeps an allow-list of known address and MAC pairs, and treats changes of important addresses, such as the gateway, as high priority.

Other LAN anomalies worth knowing

Symptom Filter Likely cause
Duplicate IP arp.duplicate-address-detected Two devices configured with the same static IP, or a spoofer
Broadcast storm high rate of eth.dst == ff:ff:ff:ff:ff:ff Switching loop (spanning tree failure)
Many unknown MACs Statistics, Endpoints, Ethernet MAC flooding, or a virtualization host
Spanning-tree changes stp.type == 0x80 Topology change notifications repeating means a flapping link
Rogue router advertisements icmpv6.type == 134 A device announcing itself as an IPv6 router
Unusual multicast chatter mdns, llmnr, nbns Name resolution broadcast; can be abused to capture credentials

A broadcast storm is easy to measure: use Statistics, then I/O Graph, with the filter eth.dst == ff:ff:ff:ff:ff:ff. Normal LANs carry a few broadcasts per second. Thousands per second points to a loop.

Python Detect a broadcast storm from per-second counts

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Defenses

  • Dynamic ARP Inspection on managed switches checks ARP packets against the DHCP snooping table and drops forgeries.
  • Port security limits MAC addresses per port.
  • Static ARP entries for critical hosts (small networks only).
  • Segmentation (VLANs) keeps the broadcast domain small.
  • Encryption (TLS, SSH, VPN) so that intercepted traffic is unreadable. See TLS and Cleartext Exposure.
  • Monitoring ARP continuously, with arpwatch or an IDS.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why can ARP be spoofed so easily?

    ARP trusts whatever replies arrive, which is why switch-level protections like Dynamic ARP Inspection exist.
  2. 2. Which capture sign most strongly suggests gateway spoofing?

    An IP that suddenly maps to a new MAC, especially for the gateway, is the classic indicator.
  3. 3. A legitimate cause for an IP to change MAC address is:

    Hardware swaps and failover protocols change the MAC, so detectors need allow-lists and context.
  4. 4. What does a switching loop typically produce?

    Looping frames multiply broadcasts until they saturate the network.

Summary

  • ARP maps IPs to MACs without authentication, so spoofing and mistakes both appear as one IP with several MACs.
  • Wireshark flags duplicates; scripts and tools such as arpwatch automate the comparison.
  • Broadcast storms point to loops; measure them with an I/O Graph.
  • Defend with switch features (DAI, port security), segmentation, and encryption.

Next: Malware Traffic and Beaconing