Denial of Service (DoS/DDoS) Attacks: Mechanisms & Mitigation Stack

A Denial of Service (DoS) attack is a malicious attempt to disrupt the normal availability of a targeted server, service, or network by overwhelming the target with a flood of illegitimate internet traffic. When hundreds of thousands of compromised IoT devices, servers, and computers around the globe are marshaled into a botnet to launch coordinated floods, it becomes a Distributed Denial of Service (DDoS) attack.

The Three Categories of DDoS Attacks

DDoS Category Measured In Attack Mechanisms Defensive Countermeasures
1. Volumetric Floods Gigabits / Terabits per second (Gbps / Tbps) DNS Amplification, NTP Reflection, UDP floods, ICMP floods. Consumes all physical pipe bandwidth. BGP Anycast routing, Cloud Scrubbing Centers (Cloudflare, AWS Shield), upstream ISP blackholing.
2. Protocol Attacks Packets per second (Mpps) TCP SYN floods, Ping of Death, Smurf attacks. Exhausts state tables in firewalls and load balancers. TCP SYN Cookies, connection rate limiting, tuning kernel TCP backlog queues.
3. Application Layer (Layer 7) Requests per second (RPS) HTTP floods, Slowloris, complex GraphQL queries, search query database exhaustion. Web Application Firewalls (WAF), CAPTCHA verification, aggressive client timeouts, Redis rate limits.

Deep Dive: UDP Amplification / Reflection Attacks

In a reflection attack, the adversary does not send traffic directly to the victim. Instead, they exploit misconfigured, open third-party UDP servers (such as public DNS resolvers or NTP servers):

  1. Attacker sends a small 60-byte DNS query to thousands of open resolvers.
  2. Crucially, the attacker spoofs the source IP address, replacing it with the victim's public IP address.
  3. The open resolver responds with a massive 3,000-byte DNS response containing full DNSSEC records.
  4. The massive payload is delivered to the unsuspecting victim, achieving an amplification factor of 50x to 100x!

Low-and-Slow Application Attacks: Slowloris

Unlike volumetric bandwidth floods that scream loudly across monitoring tools, Slowloris is a stealthy Layer 7 attack requiring almost zero bandwidth. Slowloris sends incomplete HTTP GET requests to a web server (e.g. Apache):

GET / HTTP/1.1

Host: target.com

User-Agent: Mozilla/5.0

X-a: b

... (sends another header line every 15 seconds to keep connection alive, never sending final \r\n\r\n)

Traditional thread-per-connection web servers hold the worker thread open waiting for the request to complete. With just a few hundred connections from a single laptop, Slowloris exhausts Apache's MaxRequestWorkers pool, crashing the entire web server!

Defeating Slowloris with Nginx Reverse Proxy

Event-driven asynchronous servers (like Nginx) handle tens of thousands of idle connections effortlessly without dedicating threads. Placing Nginx or HAProxy in front of Apache completely neutralizes Slowloris attacks:

# Nginx Slowloris mitigation timeouts
client_body_timeout 10s;
client_header_timeout 10s;
keepalive_timeout 15s;
send_timeout 10s;

Frequently Asked Questions (FAQ) - Student & Interview Review

Q1. What is BGP Anycast and how does it stop massive Terabit DDoS attacks?

Anycast announces the exact same IP address from hundreds of data centers globally. When a massive distributed botnet attacks that IP, the traffic is automatically partitioned and routed to the nearest regional scrubbing center, dissipating the flood across global infrastructure.

Q2. What is BGP Blackhole Routing?

Blackholing is an emergency defense where an ISP drops all traffic destined for an attacked IP address at the carrier level. While it takes the victim's service offline, it stops the flood from overwhelming the upstream ISP network and protecting neighboring customers.

Explore Related Cybersecurity Tutorials & Next Steps

Broaden your defensive and offensive security knowledge across our curriculum:

Stateful Firewalls & Rate Limiting

Enabling SYN cookies and connection limits to survive volumetric floods.

API Rate Limiting & Throttling

Mitigating Layer 7 application DDoS and HTTP flood attacks.

TCP/IP Protocol Weaknesses

How the TCP three-way handshake is abused in SYN flood denial of service.

Real-World Cyber Attack Scenarios

Dissecting multi-vector amplification attacks and cloud scrubbing defenses.

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Reddit

You may also like this!