Tutorial 1.9: Distributed Denial-of-Service (DDoS) Attacks and Defenses

Table of Contents

Learning Objectives

Upon completion of this tutorial, you will be able to:

  1. Explain the architectures of distributed denial-of-service (DDoS) attacks, including agent-handler, IRC-based, and modern botnet ecosystems.
  2. Analyze the mechanics of reflection and amplification attacks, including DNS, NTP, SSDP, and Memcached amplification.
  3. Describe detection techniques such as traffic baselining, anomaly detection, and monitoring systems.
  4. Evaluate defense mechanisms including rate limiting, filtering, blackholing, sinkholing, and scrubbing services.
  5. Compare CDN-based protection and cloud-based DDoS mitigation services.
  6. Design a comprehensive DDoS defense strategy for an enterprise network.
  7. Assess the limitations and trade-offs of each defense mechanism.
  8. Investigate real-world DDoS attacks to understand attacker tactics and defensive responses.
  9. Apply quantitative metrics to evaluate the effectiveness of DDoS defenses.

Overview

In Tutorial 1.8, we examined the fundamentals of denial-of-service (DoS) attacks—deliberate attempts to disrupt the availability of systems and networks. While DoS attacks can be launched from a single source, the most devastating and common form is the Distributed Denial-of-Service (DDoS) attack, which leverages multiple compromised systems (bots) to generate overwhelming traffic. DDoS attacks are capable of saturating network links, exhausting server resources, and disrupting critical services on a global scale.

This tutorial provides a comprehensive exploration of DDoS attacks and the defenses designed to counter them. We begin by dissecting the architectures of DDoS attacks, from early agent-handler models and IRC-based coordination to modern botnet ecosystems that use P2P and HTTP-based C2. Understanding these architectures is essential for anticipating attacker capabilities and designing effective countermeasures.

We then delve into reflection and amplification attacks, which exploit third-party servers to magnify attack traffic. We will examine specific amplification vectors, including DNS (amplification factor up to 70x), NTP (up to 500x), SSDP (up to 30x), and Memcached (up to 50,000x). The combination of spoofed source IPs and amplification creates attacks that can generate terabit-scale traffic with minimal attacker resources.

Next, we explore detection techniques: establishing network baselines, deploying anomaly detection systems, and implementing comprehensive monitoring with SIEM and flow analysis. Detection is the first line of defense; early warning enables rapid mitigation.

Finally, we present a spectrum of defense mechanisms, from simple rate-limiting and IP filtering to advanced techniques like blackholing, sinkholing, traffic scrubbing, CDN-based protection, and cloud-based DDoS mitigation services. We analyze the strengths, limitations, and trade-offs of each approach, and discuss how they can be integrated into a layered defense strategy.

By the end of this tutorial, you will have a thorough understanding of DDoS attack vectors and the multi-layered defense strategies required to protect modern networks against these ever-evolving threats.


5.1 DDoS Architectures

5.1.1 Agent-Handler Architecture

The agent-handler model was an early DDoS architecture. Attackers compromise handlers (masters) that control multiple agents (bots). The attacker communicates with handlers, which then command agents to launch attacks. This hierarchy provides separation and obfuscation, making it harder to trace back to the attacker. However, the centralization of handlers creates a single point of failure for defenders.

5.1.2 IRC-based Architecture

Attackers used Internet Relay Chat (IRC) channels to coordinate botnets. Bots connected to an IRC server and joined a specific channel. The attacker issued commands via IRC, and all bots executed them simultaneously. While simple, IRC traffic is easily detectable, leading to the evolution of more sophisticated C2 methods.

5.1.3 Botnet Architecture

Modern botnets use distributed, resilient architectures. Common models include:

Botnets are often rented as a service (DDoS-for-hire), enabling even unskilled attackers to launch large-scale attacks.

5.1.4 Modern DDoS Ecosystems

The modern DDoS ecosystem includes:

The commoditization of DDoS has lowered the barrier to entry, increasing the frequency and scale of attacks.

Figure 9.1: Modern DDoS Botnet Architecture

+-----------------------------------------------------------+ | DDoS BOTNET ARCHITECTURE | | | | +--------+ +--------+ +--------+ | | | Bot | | Bot | | Bot | | | +--------+ +--------+ +--------+ | | | | | | | +------------+------------+ | | | | | v (C2 - DGA/HTTPS/P2P) | | +--------------------------------------------------+ | | | BOTNET OPERATOR (C2 Infrastructure) | | | +--------------------------------------------------+ | | ^ | | | (Command) | | +--------------------------------------------------+ | | | ATTACKER | | | +--------------------------------------------------+ | | | | Bots generate attack traffic toward target. | | Traffic may be amplified via reflection/amplification. | +-----------------------------------------------------------+

5.2 Reflection Attacks

5.2.1 Reflection Mechanisms

A reflection attack exploits third-party servers that respond to requests. The attacker spoofs the source IP address of the target and sends requests to many reflectors. The reflectors send their responses to the target, flooding it with traffic. This obfuscates the attacker's origin and amplifies the attack.

5.2.2 Source-Address Spoofing

Source-address spoofing is a critical enabler of reflection attacks. Attackers forge the source IP of their packets to match the victim's IP. Defenses include ingress filtering (BCP38) and uRPF to prevent spoofed traffic from leaving networks. However, not all networks implement these, leaving many amplifiers exploitable.

5.3 Amplification Attacks

5.3.1 DNS Amplification

DNS amplification uses open DNS resolvers. A small query (e.g., a DNS ANY query) can generate a large response (up to 4,000 bytes). Amplification factor: ~70x. Attackers spoof the victim's IP and send queries to many resolvers, flooding the victim with DNS responses. Mitigation: restrict recursion, rate-limit, and use response rate limiting (RRL).

5.3.2 NTP Amplification

NTP amplification exploits the monlist command, which returns a list of the last 600 connected hosts. A small request can generate a 500x amplification. Mitigation: disable monlist on NTP servers, upgrade to NTPv4, and filter traffic.

5.3.3 SSDP Amplification

SSDP (Simple Service Discovery Protocol) is used for UPnP devices. A query can generate responses up to 30x amplification. Mitigation: restrict SSDP to internal networks and apply rate limiting.

5.3.4 Memcached Amplification

Memcached amplification is one of the most powerful, with amplification factors up to 50,000x. A small UDP request can generate a response many orders of magnitude larger. Mitigation: expose Memcached only to internal networks, disable UDP, and apply ACLs.

Table 9.1: Amplification Attack Characteristics

Protocol Amplification Factor Typical Payload Size Mitigation
DNS ~70x ~60 bytes → ~4,000 bytes Restrict recursion, RRL
NTP ~500x ~234 bytes → ~100,000 bytes Disable monlist, upgrade
SSDP ~30x ~100 bytes → ~3,000 bytes Internal only, rate-limit
Memcached ~50,000x ~15 bytes → ~750,000 bytes Internal only, disable UDP

Figure 9.2: Amplification Attack Flow

+-----------------------------------------------------------+ | AMPLIFICATION ATTACK FLOW | | | | Attacker (spoofed victim IP) | | | | | | Small query (src=Victim) | | +-------------------------------------------+ | | | | | | v v | | +-------------+ +-------------+ +-------------+ | | | Amplifier 1 | | Amplifier 2 | | Amplifier N | | | +-------------+ +-------------+ +-------------+ | | | | | | | Large response (to Victim) | | | +-------------------+-----------------------+ | | | | | v | | +------------------+ | | | VICTIM (flooded) | | | +------------------+ | | | | Amplifiers are unwitting participants. | +-----------------------------------------------------------+

5.4 Detection

5.4.1 Traffic Baselining

Establishing a traffic baseline is essential for detecting anomalies. Baselines should capture normal traffic patterns—volumes, protocols, packet sizes, and geographic distribution. Baselines must be updated regularly to account for legitimate changes (e.g., new services, seasonal spikes).

5.4.2 Anomaly Detection

Anomaly detection identifies deviations from baseline behavior. Techniques include:

Effective anomaly detection must balance sensitivity (to detect real attacks) and specificity (to avoid false positives).

5.4.3 Monitoring Systems

Network monitoring is critical for DDoS detection. Key tools include:

Continuous monitoring enables early detection and rapid response.

5.5 Defense Mechanisms

5.5.1 Rate Limiting

Rate limiting restricts the amount of traffic from a given source IP or to a particular resource. It is effective against volumetric attacks but can be bypassed by distributed (many IPs) attacks. It must be carefully tuned to avoid blocking legitimate users.

5.5.2 Filtering

Filtering drops traffic based on attributes (IP, port, protocol, packet signatures). Ingress/egress filtering (BCP38) prevents spoofed traffic from leaving a network. Packet filtering at firewalls and routers can block known attack vectors.

5.5.3 Blackholing

Blackholing (null routing) directs all traffic to a specific IP address (or prefix) to a null interface, effectively discarding it. This is a drastic measure used to stop an attack by sacrificing the target's availability. It is often used for the attacked IP itself (remote blackholing).

5.5.4 Sinkholing

Sinkholing diverts malicious traffic (e.g., botnet C2 traffic) to a controlled server where it can be analyzed and blocked. DNS sinkholing is a common technique for disrupting botnets by redirecting domain lookups to a sinkhole.

5.5.5 Scrubbing Services

Traffic scrubbing uses specialized DDoS mitigation appliances or services that analyze incoming traffic, drop malicious packets, and forward clean traffic to the target. Scrubbing centers are often deployed near the network edge and use a combination of rate limiting, signature filtering, and behavioral analysis.

5.5.6 CDN Protection

Content Delivery Networks (CDNs) can absorb DDoS traffic by distributing content across many servers. CDNs act as a shield, caching content and handling traffic spikes. They can also scrub traffic before forwarding to the origin. Cloudflare, Akamai, and Fastly are major CDN providers with built-in DDoS protection.

5.5.7 Cloud Mitigation Services

Cloud-based DDoS mitigation services (e.g., AWS Shield, Azure DDoS Protection, Google Cloud Armor) provide scalable protection by absorbing and filtering traffic in the cloud. They use global networks and anycast routing to distribute traffic across many data centers, making it difficult for attackers to saturate any single location.

Table 9.2: Comparison of DDoS Defense Mechanisms

Defense Scope Effectiveness Trade-offs
Rate Limiting Per-IP, per-service Moderate (against single-source) False positives, limited against DDoS
Filtering Network layer High against known signatures Requires signatures, may miss new attacks
Blackholing IP prefix Complete mitigation (sacrifice IP) Makes target unreachable
Sinkholing DNS C2 traffic Disrupts botnet coordination Limited to botnet C2, not direct traffic
Scrubbing Traffic flow Very high, can handle large DDoS Cost, latency, requires specialized infrastructure
CDN Content distribution High for web traffic Not effective for non-HTTP services
Cloud Mitigation Network-wide Very high, scalable Cost, reliance on third-party

Real-World Example: In February 2020, AWS Shield mitigated a 2.3 Tbps DDoS attack targeting a customer. The attack used UDP reflection and amplification. AWS Shield's global infrastructure absorbed and scrubbed the traffic, ensuring the customer's service remained available. This incident underscores the effectiveness of cloud-based mitigation services against record-setting attacks.


Quiz: Tutorial 1.9

Test your understanding of DDoS attacks and defenses. Questions range from foundational to advanced analytical levels.

Question 1 (Foundational): Which DDoS architecture uses a hierarchical model with handlers and agents?

Answer
b) Agent-handler. Attackers use handlers to control multiple agents (bots).

Question 2 (Foundational): Which amplification attack has the highest amplification factor (up to 50,000x)?

Answer
d) Memcached. The amplification factor can reach 50,000x.

Question 3 (Intermediate): Source-address spoofing is a critical enabler for which type of attack?

Answer
c) Reflection/amplification attacks. Spoofing the victim's IP directs responses to the victim.

Question 4 (Intermediate): What is the primary purpose of traffic baselining in DDoS detection?

Answer
b) To establish a reference for normal network behavior, enabling anomaly detection.

Question 5 (Intermediate): Which defense mechanism involves diverting all traffic destined for an IP address to a null interface?

Answer
c) Blackholing. It discards traffic to the targeted IP, effectively making it unreachable.

Question 6 (Intermediate): Which defense is specifically effective against botnet C2 communication?

Answer
b) Sinkholing. By redirecting C2 domain requests, it can disrupt botnet operations.

Question 7 (Advanced): The NTP monlist command was widely exploited for amplification attacks. What is the recommended mitigation?

Answer
a) Disable monlist and upgrade to NTPv4.

Question 8 (Advanced): Which of the following is a limitation of using a CDN for DDoS protection?

Answer
b) CDNs primarily protect HTTP/S services and may not be effective for other protocols (e.g., UDP-based services).

Question 9 (Advanced): In the context of DDoS detection, anomaly detection techniques often face a trade-off between sensitivity and specificity. What is the consequence of high sensitivity?

Answer
b) More false positives. High sensitivity means more deviations are flagged, leading to many false alarms.

Question 10 (Advanced Scenario): An organization observes a sudden spike in inbound UDP traffic to port 53 (DNS) from a wide range of source IPs. The traffic volume is 50 Gbps, and the source IPs appear to be legitimate recursive resolvers. What type of attack is most likely occurring?

Answer
b) DNS amplification. The target's IP is being spoofed, and open resolvers are sending DNS responses to the victim.

Question 11 (Theoretical): Explain the concept of "reflection" in DDoS attacks and why it is effective even when the attacker has limited bandwidth.

Answer
Reflection involves sending requests to third-party servers with a spoofed source IP (the victim's IP). The servers send responses to the victim, flooding it. The attacker uses minimal bandwidth (small request packets) but generates large volumes of response traffic from many reflectors, achieving significant amplification and obfuscation of the attacker's identity.

Question 12 (Scenario): A company subscribes to a cloud-based DDoS mitigation service. During a large DDoS attack, the service detects the attack and routes traffic through its scrubbing centers. After mitigation, the company's website is accessible, but some legitimate users report captcha challenges. What trade-off is being made?

Answer
b) Security vs. usability. The scrubbing service may challenge suspicious traffic with captchas, which can inconvenience legitimate users but is necessary to filter out attack traffic.

Exercises

Apply your knowledge through these realistic scenarios.

Exercise 1 (Intermediate): DNS Amplification Mitigation
An organization's DNS servers are being used as amplifiers in a reflection attack against a third party. (a) How would you detect that your DNS servers are being abused? (b) What immediate steps would you take to stop the abuse? (c) What long-term configuration changes would you implement to prevent recurrence? (d) How would you communicate with the victim and the affected parties?

Sample Solution

(a) Detect by monitoring DNS query/response ratios; look for a high volume of queries with spoofed source IPs; monitor egress traffic for unusually large UDP packets to port 53.

(b) Immediate: Disable recursion for external queries; rate-limit responses; implement Response Rate Limiting (RRL) to drop excessive responses.

(c) Long-term: Restrict recursion to authorized internal IPs; ensure BCP38 is applied to prevent spoofed outgoing traffic; deploy anycast DNS.

(d) Communicate with the victim: Provide logs and cooperate with law enforcement; notify the ISP to block spoofed traffic.

Exercise 2 (Advanced): DDoS Defense Strategy
A large e-commerce company experiences frequent DDoS attacks. The company has a mix of web servers, APIs, and databases. Design a multi-layered DDoS defense strategy that includes: (a) network edge protection; (b) application-layer defenses; (c) cloud-based mitigation; (d) monitoring and response; (e) considerations for cost and performance.

Sample Solution

(a) Network edge: Deploy intrusion prevention systems (IPS) and firewalls with rate limiting; use a DDoS scrubbing center or cloud-based mitigation service (e.g., AWS Shield, Cloudflare).

(b) Application layer: Web Application Firewall (WAF) to filter malicious HTTP traffic; implement CAPTCHA challenges for suspicious traffic; use rate limiting per IP and per session.

(c) Cloud-based: Use a CDN to absorb and distribute web traffic; subscribe to a DDoS mitigation service that can scale to handle large volumetric attacks.

(d) Monitoring: Implement NetFlow/IPFIX monitoring; use SIEM to correlate alerts; establish baseline traffic patterns; have an incident response playbook.

(e) Cost/performance: Balance cost of protection with potential revenue loss from attacks; tune thresholds to minimize false positives; use hybrid approach (on-premises + cloud) to optimize.

Exercise 3 (Advanced): Memcached Amplification Analysis
A security analyst observes a massive UDP flood targeting the company's network, with packet sizes of up to 750 KB. The source ports are from random external IPs. (a) What attack vector is likely being used? (b) Explain how the attack works. (c) What steps would you take to mitigate it? (d) How could the company prevent its own Memcached servers from being used in such attacks?

Sample Solution

(a) Memcached amplification attack.

(b) Attacker sends small UDP requests to Memcached servers with spoofed victim IP. Memcached servers respond with large data responses (up to 750 KB), flooding the victim.

(c) Mitigation: Contact ISP to block UDP traffic to port 11211; deploy DDoS scrubbing; rate-limit UDP traffic; blackhole the target IP if necessary.

(d) Prevention: Configure Memcached to listen only on internal interfaces; disable UDP if not needed; use firewall rules to restrict access.

Exercise 4 (Advanced): Traffic Baseline Analysis
A company has established a normal traffic baseline of 500 Mbps inbound, with peaks up to 700 Mbps during sales events. During an attack, they observe 2.5 Gbps of inbound UDP traffic to port 53. (a) Is this an anomaly? (b) What additional data would you need to confirm an attack? (c) If the attack persists and the company's scrubbing service can handle 10 Gbps, what is the cost-benefit of keeping the scrubbing service active indefinitely? (d) How would you adjust the baseline after the attack?

Sample Solution

(a) Yes, the traffic is 5x the normal baseline and 3.5x the peak sales traffic, indicating a likely attack.

(b) Additional data: Source IP distribution (many IPs vs. few), packet size distribution, and whether the traffic is valid DNS queries or malformed.

(c) Cost-benefit: If the scrubbing service is per-incident or subscription-based, the cost of keeping it active must be weighed against the revenue loss from downtime. If the attack is sustained, it may be cheaper to increase capacity or use a cloud-based service.

(d) After the attack, update the baseline to reflect the new normal, considering any legitimate traffic growth. Re-tune detection thresholds to avoid false positives.

Exercise 5 (Advanced Research): DDoS-for-Hire (Booters)
Research the current landscape of DDoS-for-hire services (booters/stressers). (a) How do these services operate? (b) What are the typical costs and attack volumes? (c) What legal actions have been taken against them? (d) How can organizations defend against attacks originating from these services?

Sample Solution

(a) Booters are websites that offer DDoS attack services for a fee, often using a botnet or amplification infrastructure. They often have a subscription model with various attack types and durations.

(b) Costs range from $20 to $100 per month; attack volumes can be tens of Gbps to hundreds of Gbps.

(c) Law enforcement has taken down many booter services (e.g., vDOS, X-Booter) and arrested operators, but new ones emerge.

(d) Defense: Deploy cloud-based DDoS protection, use threat intelligence to block known booter IPs, and ensure robust mitigation strategies are in place.


Homework

These assignments require deep research, analysis, and synthesis.

Homework 1: Mirai Botnet Analysis
Research the Mirai botnet (2016). Write a 700-word report covering: (a) the architecture and propagation of Mirai; (b) the devices it targeted and why; (c) the major attacks it facilitated (including the Dyn DNS attack); (d) the impact and aftermath; (e) lessons for IoT security and DDoS defense.

Sample Answer (Abridged)

Mirai Botnet: Mirai targeted IoT devices (cameras, routers, DVRs) using default credentials. It spread rapidly and was used to launch massive DDoS attacks, including the 1.2 Tbps Dyn DNS attack. Impact: Major internet services disrupted. Lessons: IoT security is critical; default credentials must be changed; network-level filtering is essential.

Homework 2: Cloud vs. On-Premises DDoS Protection
Compare and contrast cloud-based DDoS mitigation services (e.g., AWS Shield, Cloudflare) with on-premises DDoS appliances. In your 600-word analysis, address: (a) cost structure; (b) scalability; (c) detection and mitigation capabilities; (d) latency implications; (e) integration with existing infrastructure; (f) which is more suitable for different organization sizes.

Sample Answer (Abridged)

Cloud-based: Scalable, pay-as-you-go, lower latency for global traffic, but dependency on third-party. On-premises: Full control, no external latency, but limited by hardware capacity and higher capex. Smaller organizations benefit from cloud; larger enterprises may use hybrid.

Homework 3: DDoS Response Playbook
Design a DDoS incident response playbook for a large enterprise. Cover: (a) detection and identification; (b) escalation and communication; (c) mitigation steps for different attack types (volumetric, protocol, application); (d) coordination with ISPs and third-party providers; (e) post-incident analysis and improvements.

Sample Answer (Abridged)

Detection: Monitoring tools, traffic baselines. Escalation: Contact SOC, incident commander, and executive team. Mitigation: For volumetric—activate DDoS scrubbing; for protocol—enable SYN cookies; for application—WAF rate limiting. Coordination: Contact ISP for upstream filtering. Post-incident: Conduct root-cause analysis, update defenses.

Homework 4: DNS Security Extensions (DNSSEC)
Research how DNSSEC can be exploited for amplification attacks and what mitigations exist. Write a 500-word essay that: (a) explains DNSSEC and its purpose; (b) describes how DNSSEC can amplify traffic; (c) discusses the trade-offs between security and performance; (d) recommends best practices for DNS operators.

Sample Answer (Abridged)

DNSSEC adds cryptographic signatures to DNS responses, increasing response size. This can be exploited for amplification. Operators should use Response Rate Limiting (RRL) and deploy anycast to mitigate.

Homework 5: Critical Infrastructure DDoS Analysis
Research a DDoS attack that targeted critical infrastructure (e.g., power grid, water treatment, transportation). Write a 700-word case study that covers: (a) the target and the attack methodology; (b) the impact on operations and public safety; (c) the defensive measures that were in place; (d) what failed or was insufficient; (e) recommendations for improving resilience in critical infrastructure.

Sample Answer (Abridged)

Example: In 2021, a DDoS attack targeted a water treatment facility, disrupting monitoring systems. The attack exploited a vulnerable remote access system. Defenses were insufficient. Recommendations: air-gap critical systems, implement robust remote access controls, deploy DDoS protection, and conduct regular exercises.


Summary

This tutorial provided a comprehensive examination of Distributed Denial-of-Service (DDoS) attacks and the defenses required to counter them. We began by exploring the architectures of DDoS attacks, from early agent-handler models and IRC-based coordination to modern botnet ecosystems that use P2P and HTTP-based C2. The commoditization of DDoS-as-a-Service has made these attacks accessible to a wide range of adversaries.

We then analyzed reflection and amplification attacks, which exploit third-party servers to magnify traffic. Specific vectors—DNS (70x), NTP (500x), SSDP (30x), and Memcached (50,000x)—demonstrate the devastating amplification potential. These attacks rely on source-address spoofing, which can be mitigated through ingress filtering (BCP38).

We covered detection techniques, including traffic baselining, anomaly detection (statistical, machine learning, rule-based), and monitoring systems (NetFlow, sFlow, SIEM). Effective detection enables rapid response and reduces the impact of attacks.

Finally, we examined a spectrum of defense mechanisms: rate limiting, filtering, blackholing, sinkholing, scrubbing services, CDN-based protection, and cloud-based mitigation. Each has strengths and limitations, and a layered defense strategy that combines multiple approaches is essential for protecting modern networks. Real-world examples, including the Mirai botnet and the 2.3 Tbps attack mitigated by AWS Shield, underscore the scale and sophistication of contemporary threats.

This tutorial equips you with the knowledge to design, implement, and manage DDoS defenses in enterprise environments. As we move to Tutorial 1.10: Unit 1 Security Case Studies and Integrated Analysis, we will apply the concepts from all nine tutorials to real-world security incidents, integrating threat modeling, malware analysis, and defense strategies.

COMP400 — Computer and Network Security (Revision 3) • School of Computing and Information Systems, TrustOpen University