#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.
- C2 ServerSends target and timing commands to bots
- Botnet NodesCompromised servers, routers, and IoT flood traffic
- Amplifiers or Direct PathOptional UDP reflection multiplies volume
- 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.
Inspecting arp -n for duplicate MAC addresses across different IPs and watching unsolicited replies in tcpdump exposes ARP spoofing:
$ 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 -nand forged replies intcpdumpreveal 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).