Skip to main content
ARP/DNS Spoofing, MITM & Denial-of-Service
Lesson 4 of 12

ARP/DNS Spoofing, MITM & Denial-of-Service

Analyze DoS/DDoS, ARP poisoning, DNS spoofing, and Layer 2 switch attacks, then apply packet inspection and switch hardening controls to defend networks.

Intermediate 28 min Networking
Authorised environments only — The techniques described here are used only in training labs and on systems you own or have written permission to test.

Learning objectives

  • Classify volumetric, protocol, and application-layer (L7) Denial-of-Service attacks.
  • Trace how two-way ARP poisoning establishes a Man-in-the-Middle position on a local subnet.
  • Distinguish DNS cache poisoning, MAC flooding, VLAN hopping, and rogue DHCP attacks.
  • Select Layer 2 switch protections and transport encryption controls to detect and prevent network attacks.

Recommended first: IPv4/IPv6 Addressing & CIDR SubnettingTCP, UDP, Ports & ICMP Diagnostics

#Why this matters

Protocols such as ARP, DHCP, and classic UDP DNS prioritize speed over cryptographic authentication. On an unhardened LAN, an adversary can redirect traffic silently, impersonate gateways, or exhaust server availability remotely.

Building on IP routing and TCP handshakes from earlier lessons, this lesson examines DoS/DDoS, MITM, and Layer 2 switch attacks, and how defenders detect them in packet captures and block them at the switch.

#DoS and DDoS attack categories

Availability attacks prevent legitimate users from reaching a service:

  • DoS: A single source overwhelms one target; source-IP rate limits or firewall blocks often stop it.
  • DDoS: A command-and-control (C2) server directs a botnet of thousands of compromised hosts and IoT devices against one target, defeating simple IP blocks.
  • DRDoS (Reflection/Amplification): Small spoofed UDP queries sent to open DNS or Memcached servers trigger much larger replies toward the victim's IP. The 2018 GitHub Memcached attack (1.35 Tbps) was a landmark event at the time, though even larger multi-terabit attacks have occurred since.
  1. C2 ServerSends target and timing commands to bots
  2. Botnet NodesCompromised servers, routers, and IoT flood traffic
  3. Amplifiers or Direct PathOptional UDP reflection multiplies volume
  4. Target ServiceBandwidth, TCP tables, or CPU become exhausted
Category OSI focus Examples Primary impact
Volumetric Network / Link UDP Flood, ICMP Flood, DNS/Memcached amplification Saturates bandwidth
Protocol Transport / State SYN Flood, Smurf Exhausts firewall or TCP tables
Application (L7) Application HTTP Flood, Slowloris Exhausts web server workers or CPU

#Man-in-the-Middle and ARP poisoning

In a Man-in-the-Middle (MITM) attack, an adversary intercepts or alters traffic between two parties via ARP Poisoning, DNS Spoofing, SSL Stripping (downgrading HTTPS to HTTP), Evil Twin Wi-Fi APs, or BGP Hijacking.

ARP Poisoning exploits ARP's lack of authentication to overwrite IP-to-MAC entries in host and router ARP caches (distinct from a switch's CAM table, which maps MACs to ports). For two-way MITM between a victim (10.10.10.5) and gateway (10.10.10.1), the attacker sends forged ARP replies in both directions: telling the victim the attacker's MAC is the router, and telling the router the attacker's MAC is the victim.

Two-Way ARP Poisoning (MITM) on 10.10.10.0/24Two-Way ARP Poisoning (MITM) on 10.10.10.0/24AttackerVictim 10.10.10.5Router 10.10.10.1Forged ARP Reply (10.10.10.1 is aa:bb:cc:dd:ee:99)Forged ARP Reply (10.10.10.5 is aa:bb:cc:dd:ee:99)Outbound frames sent to Attacker MACForwarded frames (traffic inspected)Both ARP caches now route through the attacker MAC

Inspecting arp -n for duplicate MAC addresses across different IPs and watching unsolicited replies in tcpdump exposes ARP spoofing:

Detecting duplicate MAC entries and ARP replies in a lab
$ arp -n
Address          HWtype  HWaddress           Flags Mask  Iface
10.10.10.1       ether   aa:bb:cc:dd:ee:99   C           eth0
10.10.10.99      ether   aa:bb:cc:dd:ee:99   C           eth0
$ sudo tcpdump -n -i eth0 arp -c 2
10:22:04.112004 ARP, Reply 10.10.10.1 is-at aa:bb:cc:dd:ee:99, length 46
10:22:04.112490 ARP, Reply 10.10.10.5 is-at aa:bb:cc:dd:ee:99, length 46

#DNS spoofing and Layer 2 switch attacks

  • DNS Spoofing / Cache Poisoning: Injecting fake DNS answers so a legitimate domain resolves silently to a fraudulent site. Defend with DNSSEC plus DoH (DNS over HTTPS) or DoT (DNS over TLS).
  • MAC Flooding: Flooding random source MACs to overflow a switch's CAM (Content Addressable Memory) table, causing an unprotected switch to fall back to hub mode and broadcast traffic across ports. Defend with Port Security (limit maximum MAC addresses per port).
  • VLAN Hopping: Bypassing VLAN segmentation via double tagging or switch spoofing. Defend by changing the Native VLAN from its default and restricting trunk ports so access ports cannot form trunks.
  • Rogue DHCP Server: Running a fake DHCP server to distribute rogue IP, gateway, or DNS settings. Defend with DHCP Snooping, allowing DHCP offers only from authorized switch ports.

#Defending against network-layer and Layer 2 attacks

Pair switch hardening with encrypted transport:

  • Enable DHCP Snooping, Dynamic ARP Inspection (DAI), and Port Security together on managed access switches.
  • Change the default Native VLAN and restrict trunk ports.
  • Enforce HTTPS (TLS 1.3) with HSTS, deploy DNSSEC with DoH/DoT, and use a VPN on public Wi-Fi.
  • Mitigate DDoS using scrubbing, SYN cookies, rate limits, and reverse-proxy timeouts.

#Summary

  • DoS/DDoS attacks disrupt availability via volumetric floods, protocol exhaustion (SYN Flood), or Layer 7 attacks (HTTP Flood, Slowloris).
  • Two-way ARP poisoning overwrites victim and router ARP caches for MITM; duplicate MACs in arp -n and forged replies in tcpdump reveal it.
  • DNS cache poisoning redirects legitimate domains and requires DNSSEC, DoH, or DoT rather than Layer 2 switch controls.
  • Layer 2 hardening combines Port Security (MAC flooding), DHCP Snooping (rogue DHCP), DAI (ARP spoofing), and Native VLAN / trunk restrictions (VLAN hopping).

Knowledge check

Sign in to take the test, complete lessons and save your progress. Log in

Practice: test your knowledge