Skip to main content

Lesson 6 of 10

DDoS Attacks & Mitigation

Distributed Denial of Service (DDoS) attacks overwhelm a target's resources to deny service to legitimate users. Modern DDoS attacks are larger and more sophisticated than ever - the GitHub 2018 attack peaked at 1.35 Tbps. Understanding attack types is essential for building resilient infrastructure.

45 minBy Priygop Editorial TeamUpdated 2026Peer Reviewed & Verified

DDoS Attack Categories

  • Volumetric attacks: Flood bandwidth with traffic. UDP flood, ICMP flood, DNS/NTP/Memcached amplification. Goal: consume all available bandwidth so legitimate traffic cannot reach the server. Amplification: small spoofed request → massive response from third-party servers reflected to victim
  • Protocol attacks: Exploit networking protocol weaknesses. SYN flood (exhaust connection tables), Smurf attack, Fragmentation attacks. Goal: exhaust server/firewall state tables
  • Application layer attacks (Layer 7): Low-volume but targeted HTTP requests that exhaust server resources. HTTP GET/POST flood, Slowloris (hold connections open slowly), RUDY (send POST data 1 byte/second). Hardest to distinguish from legitimate traffic
  • DDoS amplification explained: Attacker sends 1KB DNS request spoofed with victim's source IP → DNS resolver sends 50KB response to victim. Amplification factor: 50x. Memcached amplification: up to 51,000x - used in GitHub 2018 (1.35Tbps from ~5,700 memcached servers)

DDoS Mitigation Strategies

DDoS Mitigation Strategies
# Multi-layer DDoS defense strategy

# Layer 1: Upstream scrubbing center
# Contact ISP or use Cloudflare/AWS Shield/Akamai
# Traffic routed through scrubbing center before reaching your servers
# Removes attack traffic, passes legitimate traffic

# Layer 2: Anycast network diffusion
# Traffic distributed across global PoPs (Points of Presence)
# Attack traffic absorbed by global network instead of hitting single server
# Cloudflare: 197+ Tbps global network capacity

# Layer 3: Rate limiting at edge
# iptables SYN rate limiting:
iptables -A INPUT -p tcp --syn -m limit --limit 1/s --limit-burst 3 -j ACCEPT
iptables -A INPUT -p tcp --syn -j DROP

# Reduce amplification contribution (protect others):
# Block amplification protocols from being used as reflectors
iptables -A INPUT -p udp --dport 11211 -j DROP   # Block external memcached access
iptables -A INPUT -p udp --dport 53 ! -s 10.0.0.0/8 -j DROP  # Restrict DNS to internal

# Layer 4: Application hardening (Layer 7 attacks)
# Nginx rate limiting:
# limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;
# limit_req zone=login burst=5 nodelay;

# AWS Shield Advanced - automatic DDoS detection and mitigation
# CloudFlare Under Attack mode - JavaScript challenge before serving requests

Common Mistakes

  • Relying solely on your own infrastructure for DDoS mitigation - volumetric attacks exceed your internet connection bandwidth; upstream scrubbing is required
  • Not having a DDoS response runbook - scrambling during an active attack leads to mistakes and extended downtime. Pre-plan your escalation path (ISP contact, CDN activation, traffic blackholing)
  • Over-blocking during an attack - panicked broad blocks take down legitimate users; use targeted rate limiting and challenge pages rather than blanket IP blocks

Tip

Tip

Practice DDoS Attacks Mitigation in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.

Diagram
Loading diagram…

The foundational security model: Confidentiality (privacy), Integrity (trust), and Availability (uptime).

Practice Task

Note

Practice Task - (1) Write a working example of DDoS Attacks Mitigation from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.

Quick Quiz

Common Mistake

Warning

A common mistake with DDoS Attacks Mitigation is skipping edge case testing - empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready cybersecurity code.

Key Takeaways

  • Distributed Denial of Service (DDoS) attacks overwhelm a target's resources to deny service to legitimate users.
  • Volumetric attacks: Flood bandwidth with traffic. UDP flood, ICMP flood, DNS/NTP/Memcached amplification. Goal: consume all available bandwidth so legitimate traffic cannot reach the server. Amplification: small spoofed request → massive response from third-party servers reflected to victim
  • Protocol attacks: Exploit networking protocol weaknesses. SYN flood (exhaust connection tables), Smurf attack, Fragmentation attacks. Goal: exhaust server/firewall state tables
  • Application layer attacks (Layer 7): Low-volume but targeted HTTP requests that exhaust server resources. HTTP GET/POST flood, Slowloris (hold connections open slowly), RUDY (send POST data 1 byte/second). Hardest to distinguish from legitimate traffic

Hands-on Practice Tools for this Course

Test what you learn using these free in-browser developer utilities (no signup required).

All 40+ Tools

Topics in This Module

0/10 done