Computer networks were originally designed in academic and military environments (ARPANET) where interconnected nodes fundamentally trusted one another. As a consequence, core foundational networking protocols—including IP, TCP, UDP, ARP, and DNS—were engineered without built-in encryption or cryptographic authentication. Understanding how modern adversaries exploit these protocol weaknesses across the OSI 7-layer model is essential for every network defender.
Every network communication transits through the Open Systems Interconnection (OSI) stack. Security engineers examine vulnerabilities at each specific layer:
Figure 8.1: Comprehensive OSI 7-Layer Protocol Stack, Vulnerabilities, and Defensive Hardening
The Address Resolution Protocol (ARP) translates Layer 3 IP addresses into Layer 2 physical MAC addresses. Crucially, ARP is entirely stateless and unauthenticated: any computer can send a forged ARP reply claiming ownership of an IP address!
Defenses against ARP Spoofing: Deploying Dynamic ARP Inspection (DAI) on managed enterprise switches, pairing with DHCP Snooping, or utilizing static ARP bindings.
Transmission Control Protocol (TCP) establishes reliable connection-oriented sessions via a synchronized 3-way handshake:
Client Server
| |
| -------- SYN (Seq=x) -------> | 1. Client requests connection
| |
| <---- SYN-ACK (Seq=y,Ack=x+1) | 2. Server allocates memory & responds
| |
| -------- ACK (Ack=y+1) -----> | 3. Client acknowledges; session ESTABLISHED
| |
The SYN Flood Exploit: In a classic SYN flood attack, an adversary sends millions of spoofed SYN packets with forged source IP addresses and deliberately never sends the final ACK. The victim server keeps half-open connection slots allocated in its backlog queue until memory resources are completely exhausted, crashing legitimate traffic.
Linux kernels defeat SYN floods using SYN Cookies. Instead of allocating memory state in the backlog queue upon receiving a SYN, the server encodes session state directly into the initial sequence number (ISN). Memory is only allocated when the client returns a valid ACK!
# Check if SYN Cookies are enabled on Linux (1 = Enabled)
sysctl net.ipv4.tcp_syncookies
# Permanently enable SYN Cookies
echo "net.ipv4.tcp_syncookies = 1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
Broaden your defensive and offensive security knowledge across our curriculum:
Perform active network reconnaissance to identify open ports and services.
Inspect TCP handshakes, ARP traffic, and unencrypted credentials in transit.
Block malicious network traffic with packet filtering and stateful rules.
Protecting Layer 4 transport protocols from volumetric SYN floods.