DDoS attacks can take your website offline in minutes. This guide covers every attack type, proven mitigation strategies, and how to test your defenses before attackers do.
Anay Pandya
1,623 words
Anay Pandya
Founder of ZeriFlow · 10 years fullstack engineering · About the author
Key Takeaways
DDoS protection is no longer optional — volumetric floods, protocol exploits, and application-layer attacks hit sites of every size, every day. Whether you run a SaaS dashboard, an e-commerce store, or a corporate blog, understanding how DDoS attacks work is the first step toward making your infrastructure resilient.
<div class="zf-stat-callout" style="background:#0d1117;border:1px solid rgba(16,185,129,0.25);border-left:3px solid #10b981;border-radius:4px;padding:16px 20px;margin:24px 0"> <p style="margin:0 0 4px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.15em;color:#10b981;font-family:monospace">ZeriFlow Data — 12,400+ sites analyzed</p> <p style="margin:0;font-size:13px;color:#e2e8f0;line-height:1.6;font-family:monospace">In ZeriFlow's dataset of 12,400+ scanned sites, the average security score is 52/100 — with 68% failing at least one critical check in categories including TLS configuration, security headers, DNS authentication, and cookie handling.</p> </div>
Keep reading
Is your site actually secure?
Run a free check — 60 seconds
Is your site exposed? Run a free ZeriFlow scan →
A Distributed Denial of Service (DDoS) attack overwhelms your server, network, or application with illegitimate traffic until legitimate users can no longer reach it. The "distributed" part means attackers use thousands — sometimes millions — of compromised machines (a botnet) to generate that traffic, making simple IP blocking useless.
Modern DDoS attacks are often multi-vector: they combine two or three attack types simultaneously to exhaust different resource pools at once. Understanding the distinct layers helps you build layered defenses.
Volumetric attacks aim to saturate your bandwidth. Common examples include:
monlist command.These attacks are measured in gigabits per second (Gbps). The 2018 GitHub attack peaked at 1.35 Tbps — no on-premise hardware survives that unaided.
Mitigation: A scrubbing CDN (Cloudflare, AWS Shield, Akamai) absorbs volumetric traffic at the network edge before it reaches your origin.
Protocol attacks exploit weaknesses in Layer 3 and Layer 4 of the OSI model — they consume server resources or intermediate infrastructure (firewalls, load balancers) rather than raw bandwidth.
Mitigation: SYN cookies, connection rate limiting at the firewall, and disabling IP-directed broadcasts neutralize most protocol attacks.
Layer 7 attacks target your web application directly. They mimic legitimate HTTP/HTTPS requests, making them the hardest to filter automatically.
Mitigation: Rate limiting per IP, CAPTCHA challenges on suspicious traffic patterns, and a Web Application Firewall (WAF) with behavioral rules.
Services like Cloudflare, Fastly, and AWS CloudFront route traffic through a global anycast network. Volumetric attacks are absorbed at the edge — your origin IP remains hidden and your bandwidth costs don't spike. Even the free tier of Cloudflare provides basic DDoS mitigation that stops the vast majority of commodity attacks.
Action item: Enable "I'm Under Attack" mode in Cloudflare during an active attack. It adds a 5-second JavaScript challenge that filters most bot traffic.
Rate limiting caps the number of requests a single IP or user agent can make in a given time window. At the application layer this is your first defense against HTTP floods and credential stuffing attacks that piggyback on DDoS traffic.
Configure rate limiting at multiple levels:
- CDN/edge — Cloudflare Rate Limiting, AWS WAF rate-based rules.
- Load balancer — NGINX limit_req_zone, HAProxy stick-table.
- Application — middleware rate limiters (express-rate-limit, Rack::Attack, Django Ratelimit).
A WAF inspects Layer 7 traffic and blocks requests matching malicious patterns — oversized headers, suspicious user agents, known attack signatures. Many cloud WAFs (AWS WAF, Cloudflare WAF, Imperva) include managed rule sets updated daily.
For Layer 7 DDoS specifically, configure rules that:
- Block requests with no User-Agent header.
- Challenge IPs generating more than N requests per second to the same endpoint.
- Drop requests with malformed Content-Type or oversized body payloads.
Several security headers directly reduce the application-layer DDoS surface:
| Header | DDoS-relevant effect |
|---|---|
X-Content-Type-Options: nosniff | Prevents MIME confusion that could amplify malformed request processing |
Content-Security-Policy | Restricts which domains can load resources, reducing third-party amplification |
Strict-Transport-Security | Forces HTTPS, eliminating SSL stripping attacks that force expensive TLS renegotiation |
X-Frame-Options | Stops clickjacking that can be used to force browsers to make requests to your server |
ZeriFlow's free scan checks all of these headers in one pass, flagging missing or misconfigured directives that expand your attack surface.
Beyond tools, your architecture matters:
You don't need to wait for an attack to discover weak points. Legitimate load and stress testing tools can simulate traffic patterns:
Always test in a staging environment first, get written permission from your hosting provider, and never test production during peak hours.
What to measure: - Time to first response degradation (when does latency climb above 200ms?). - Requests-per-second threshold before HTTP 503 errors appear. - Recovery time after traffic subsides.
Before assuming you're protected, verify each layer:
A: Yes. Most DDoS attacks are opportunistic — botnets scan the internet constantly, and small sites are often targeted precisely because they lack protections. Extortion-based attacks ("pay us or stay offline") increasingly target SMBs, not just enterprises.
A: It provides meaningful protection against volumetric and protocol attacks. The free plan includes Cloudflare's anycast network and basic DDoS mitigation. However, advanced Layer 7 rules, custom rate limiting, and the WAF require a paid plan.
A: Short bursts of 15–30 minutes are most common — attackers probe defenses, then move on if mitigation kicks in. Sustained attacks lasting days do occur against high-value targets, but they're expensive to maintain and become less common as defenses scale.
A: A DoS (Denial of Service) originates from a single machine. A DDoS uses a distributed botnet of many machines. DoS attacks are trivially blocked by a single IP ban; DDoS attacks are not, which is why CDN-based mitigation is necessary.
A: Directly, headers don't stop volumetric floods. But they significantly reduce the application-layer attack surface — for example, a strict CSP prevents injected scripts from turning your visitors' browsers into unwilling DDoS participants against other targets (a technique used in some browser-based botnets).
DDoS protection requires defense in depth: a CDN to absorb volumetric traffic, rate limiting and a WAF to filter Layer 7 attacks, and hardened HTTP headers to minimize the application surface attackers can exploit. No single tool is sufficient.
The good news is that most effective mitigations are either free (Cloudflare free tier, open-source rate limiters) or inexpensive — and auditing your headers takes less than a minute.
<!-- zf-internal-links -->
Related resources
Website Vulnerability Scanner
Run a broader website security audit across headers, TLS, DNS, cookies, SEO, and disclosure checks.
Security Headers Checker
Check CSP, HSTS, X-Frame-Options, and other response headers.
SSL Checker
Review TLS certificate, HTTPS, and transport security signals.
DMARC Checker
Validate email authentication records for domain spoofing protection.
CSP Checker
Review Content-Security-Policy coverage and common gaps.
June 24, 2026
Best Security Tools for AI Startups
Monitor your security score
Schedule recurring scans and catch regressions after deployments.