Networking guides, explanations and reader checklists on whilenetworking.com

Wireshark Debug: Capture and Analyze ARP Spoofing Attacks to Secure Your Internal VLANs

ARP spoofing, also known as ARP poisoning or ARP cache poisoning, remains one of the most persistent threats in enterprise networking. It occurs when an…

ARP spoofing, also known as ARP poisoning or ARP cache poisoning, remains one of the most persistent threats in enterprise networking. It occurs when an attacker sends falsified Address Resolution Protocol (ARP) messages over a local area network (LAN). These messages link the attacker’s MAC address with the IP address of a legitimate device, such as a gateway or another workstation. Once poisoned, traffic intended for the victim is redirected to the attacker, enabling man-in-the-middle (MitM) attacks, data interception, or denial of service. For IT students and junior engineers, mastering the detection of this attack using Wireshark is a critical skill for securing internal VLANs.

This guide provides a concrete, safe laboratory scenario designed for Packet Tracer or GNS3 environments. We will simulate an ARP spoofing attack, capture the malicious traffic, analyze the packet details in Wireshark, and implement mitigation strategies. This process reinforces understanding of subnetting, VLAN segmentation, DHCP operation, and DNS resolution within a compromised network context.

Understanding the Attack Vector and Lab Prerequisites

Before initiating any simulation, it is essential to understand the mechanics of ARP. The Address Resolution Protocol maps IP addresses to MAC addresses within a broadcast domain. In a standard environment, an ARP request asks, “Who has IP 192.168.10.5?” and the owner replies with their MAC address. An attacker disrupts this by claiming ownership of that IP address while sending their own MAC address.

To successfully simulate and analyze this scenario, you will need:
* Simulation Environment: Cisco Packet Tracer (recommended for beginners) or GNS3/EVE-NG for advanced routing simulations.
* Software Tools: Wireshark installed on your host machine to analyze exported PCAP files, or the built-in packet analyzer in Packet Tracer if running a virtualized environment.
* Network Topology: A setup involving at least three devices: an Attacker (Host A), a Victim (Host B), and a Gateway/Router acting as the default gateway for the VLAN.
* IP Scheme: Ensure your network uses static IP addressing or DHCP scopes that allow you to observe ARP traffic clearly. Avoid NAT configurations that obscure layer 2 details.

Step-by-Step Attack Simulation in Packet Tracer

We will construct a simple VLAN topology. Assume we have a single VLAN (VLAN 10) with the subnet 192.168.10.0/24. The Gateway is at 192.168.10.1, the Victim is at 192.168.10.50, and the Attacker is at 192.168.10.100.

Configuring the Attacker

In Packet Tracer, open the command prompt for the attacker PC (Host A). You can use a Python script or simulate the manual flooding of ARP replies to poison the cache. For educational purposes, we will simulate the behavior by manually sending gratuitous ARP packets.

# Conceptual Python script logic often used in labs
import subprocess
import time

def send_gratuitous_arp(interface_ip, target_ip, attacker_mac):
    # This command constructs a raw packet to claim the IP
    # In a real lab, tools like 'arpspoof' or 'bettercap' are used.
    # For Packet Tracer simulation, we manually configure the ARP table 
    # to reflect the attack state for analysis purposes.
    print(f"Poisoning {target_ip} with MAC {attacker_mac}")

# Illustrative command output in a simulated CLI:
# Attacker@HostA:~$ arp -s 192.168.10.1 <Attacker_MAC>
# Output: Added entry: 192.168.10.1 is at XX:XX:XX:XX (static)

Note: In a real-world Linux environment, an attacker might run arpspoof -i eth0 -t 192.168.10.50 192.168.10.1 to redirect traffic from the victim to the attacker. Ensure you are in a safe lab environment with no real sensitive data connected.

Capturing the Traffic

Start Wireshark on the Attacker machine (or use the “Network Analysis” feature in Packet Tracer). Set the filter to arp to isolate Address Resolution Protocol traffic. Begin the capture before executing the spoofing logic.

  1. Execute the command to poison the ARP cache of the Gateway or the Victim.
  2. Observe the Wireshark interface. You should see a flood of ARP Reply packets (opcode 2) where the sender’s MAC address does not match the hardware address associated with that IP in your local table initially, but rather claims the Gateway’s IP.

Analyzing the Malicious Packets in Wireshark

Once the attack is active, stop the capture and examine the packet details. This is where the forensic analysis occurs.

Identifying Gratuitous ARP

Filter for arp.op == 2 to see replies. Look specifically at the “Info” column in the Wireshark display filter bar. You will likely see entries like “Who has ? Tell “.

Expand the ARP protocol section in the packet details pane:
* Sender MAC Address: This should be the Attacker’s MAC address (e.g., AA:BB:CC:DD:EE:FF).
* Sender IP Address: This will claim to be the Gateway (192.168.10.1).
* Target MAC Address: Often ff:ff:ff:ff:ff:ff (broadcast) or the specific Victim’s MAC if directed.

Expected Illustrative Output:

Frame 35: [140 bytes] on eth0
    Internet Protocol Version 4, Src: 192.168.10.100, Dst: 192.168.10.50
    Address Resolution (ARP), opcode: Reply
        Sender hardware address: aa-bb-cc-dd-ee-ff (Attacker)
        Sender IP address: 192.168.10.1 (Gateway IP - FAKE)
        Target hardware address: 00-00-00-00-00-00
        Target IP address: 192.168.10.1

This discrepancy confirms the spoofing. The Attacker is claiming to be the Gateway. If the Victim accepts this, all traffic destined for 192.168.10.1 will now go to the Attacker’s MAC address.

Mitigation Strategies and VLAN Security Hardening

Detecting the attack is only half the battle; securing your internal VLANs requires proactive configuration. Relying solely on DHCP snooping and Dynamic ARP Inspection (DAI) is standard practice, but understanding the failure points is crucial for troubleshooting.

Implementing DHCP Snooping

DHCP Snooping acts as a firewall for DHCP messages. It classifies ports as trusted or untrusted. Only “trusted” ports can receive DHCP server offers. Untrusted ports cannot send DHCP server replies, preventing rogue servers (often deployed alongside spoofers) from handing out bad IPs.

Configuration Example (Cisco IOS):

ip dhcp snooping
ip dhcp snooping vlan 10
interface GigabitEthernet0/1
 description Uplink to legitimate DHCP Server
 ip dhcp snooping trust
interface GigabitEthernet0/2
 description Port connected to Workstations/VLAN 10
 no ip dhcp snooping

Enabling Dynamic ARP Inspection (DAI)

DAI uses the DHCP snooping binding database to validate ARP packets. If a host receives an ARP reply that claims an IP it does not own according to the DHCP lease table, the packet is dropped.

ip arp inspection vlan 10
ip arp inspection trust GigabitEthernet0/1
interface GigabitEthernet0/2
 ip arp inspection limit rate 10
 ip arp inspection validate src-mac dst-ip

Verifying Policy Terms and Authority

When deploying these features, always verify the specific capabilities of your switch firmware. Cisco IOS versions differ in their DAI implementation details. Consult the official Cisco Feature Navigator or your vendor’s release notes for version-specific limitations regarding VLAN support limits or performance impact on high-throughput interfaces. Never assume a feature is enabled globally without checking the running configuration (show run | include arp).

Common Mistakes and Troubleshooting Pitfalls

Even in controlled labs, errors occur that can mask an active attack or prevent mitigation from working.

  1. Ignoring MAC Address Table Aging: If you manually add a static ARP entry to bypass DAI, ensure you are aware of the aging time. Static entries do not age out, which is good for stability but bad if used to hide an attacker. Always use dynamic entries for learning purposes.
  2. Filtering Too Aggressively: Applying ip arp inspection limit rate too strictly can cause legitimate high-traffic devices (like printers or servers) to be flagged as attackers. Use the limit rate command cautiously, setting thresholds appropriate for your environment’s baseline traffic.
  3. Lack of VLAN Segmentation: If an attacker gains access to a management VLAN, they may attempt ARP spoofing there too. Ensure your management VLAN is physically or logically separated from user data VLANs.

Student Practice Task and Industry Application

Student Task:
1. Build a three-node topology in Packet Tracer (Gateway, Victim, Attacker).
2. Configure DHCP on the Gateway so it assigns IPs automatically.
3. Enable DHCP Snooping and DAI on the switch interface connecting to the Victim.
4. Attempt to spoof the ARP cache of the Gateway using a script or manual configuration in the Attacker node.
5. Use Wireshark to confirm that the spoofed packets are being dropped by the network infrastructure (if enabled) or successfully poison the cache (if disabled). Document the packet counts and MAC mismatches in a report.

Industry Application:
In a production environment, this analysis forms the basis of an Incident Response plan. Network engineers monitor NetFlow and port mirroring data to detect sudden spikes in ARP traffic. When combined with endpoint detection and response (EDR) tools that alert on unusual network behavior, ARP spoofing can be neutralized before significant data exfiltration occurs. Regularly auditing switch configurations for disabled DAI features should be part of a quarterly security audit checklist.

Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.