This document discusses distributed denial of service (DDoS) attacks. It begins by defining a DDoS attack as a malicious attempt to disrupt normal traffic by overwhelming a target with a flood of traffic utilizing multiple compromised systems. The document then discusses the evolution of DDoS attacks over time in terms of size and complexity. It provides examples of different types of DDoS attacks including application layer attacks like HTTP floods, protocol attacks like SYN floods, and volumetric attacks like DNS amplification attacks. Finally, it discusses common techniques for mitigating DDoS attacks such as black hole routing, rate limiting, web application firewalls, and anycast network diffusion.
4. Elements of a DDoS Attack
● Malicious attempt to disrupt
normal traffic
● Overwhelm target with flood
● Utilize multiple compromised
systems
● Motive can be political, social,
or financial
5. Cloudflare engineers have witnessed some of the largest DDoS attacks in history unfold.
Mitigating Historic Attacks
In the winter of 2016, we
mitigated the largest Layer 3
DDoS attack to date. We were
not only able to mitigate it, but
accurately measure and analyze
it as well.
Cloudflare has been fighting
historic DDoS attacks for over 5
years. Back in 2013, the 120Gbs
on Spamhaus was a “big” attack,
and we were able to keep their
website online.
DDoS attacks take all shapes
and forms. In this 400Gbps
amplification attack, an attacker
used 4,529 NTP servers to
amplify an attack from a mere
87Mbps source server.
400Gbps: Winter of Whopping
Layer 3 DDoS Attacks
Details Behind a 400Gbps NTP
Amplification Attack
The DDoS Attack That Almost
Broke the Internet
6. DDoS Attacks are evolving in size and complexity
1Tbps // IoT Botnet Layer 7 Attack
400Gbps // NTP Reflection
300Gbps // Volumetric Layer 3/4
2016
2013
2012
The Evolution of DDoS
9. Botnet Operations
● Attacker sends instructions to
botnet
● Bots send requests to target
● Target server or network overflows
capacity
● Difficult to separate good from bad
traffic
12. Application Layer Attacks
HTTP Flood Attack
This attack is similar to
pressing refresh in a web
browser over and over on
many different computers
at once – large numbers of
HTTP requests flood the
server, resulting in denial-
of-service.
13. Protocol Attacks
SYN Flood Attack
A SYN Flood Attack is
analogous to a worker in a
supply room receiving
requests from the front of
the store. The worker
receives a request, goes
and gets the package, and
waits for confirmation
before bringing the
package out front. The
worker then gets many
more package requests
without confirmation until
they can’t carry any more
packages, become
overwhelmed, and
requests start going
unanswered.
14. Volumetric Attacks
DNS Amplification Attack
A DNS Amplification attack
is like if someone were to
call a restaurant and say
“I’ll have one of everything,
please call me back and
tell me my whole order,”
where the callback phone
number they give is the
target’s number. With very
little effort, a long
response is generated.
21. UDP Flood Attack
Normal UDP Traffic
1. Server checks for
running programs
listening at a
specified port.
1. If no programs are
receiving packets,
server responds
with a ICMP (ping)
packet to inform
sender that the
destination was
unreachable.
22. UDP Flood Attack
UDP Flood Attack
As a result of the targeted
server utilizing resources
to check and then respond
to each received UDP
packet, the target’s
resources can become
quickly exhausted when a
large flood of UDP packets
are received, resulting in
denial-of-service to normal
traffic.
24. SYN Flood Attack
Normal TCP Connection
1. Client sends a SYN
packet to the server in
order to initiate the
connection.
2. Server responds with a
SYN/ACK packet, in order
to acknowledge the
communication.
3. Client returns an ACK
packet to acknowledge the
receipt of the packet from
the server. After
completing this sequence
of packet sending and
receiving, the TCP
connection is open and
able to send and receive
data.
25. SYN Flood Attack
SYN Flood Attack
1. Attacker sends high
volume of SYN packets to
the targeted server, often
with spoofed IP addresses.
2. Server responds to each
connection request and
leaves an open port ready
to receive the response.
3. While the server waits
for the final ACK packet,
attacker sends more SYN
packets. Each new SYN
packet causes the server
to maintain new open port
connection, and once all
the available ports have
been utilized the server is
unable to function
normally.
26. SYN Flood Attack
SYN Flood Mitigations
1. Increasing Backlog
queue.
2. Recycling the Oldest
Half-Open TCP connection
3. SYN cookies
4. Using a Proxy Service
28. DNS Flood Attack
DNS Flood Mitigation
DNS floods represent a
change from traditional
amplification based attack
methods. With easily
accessible high bandwidth
botnets, attackers can now
target large organizations.
Until compromised IoT
devices can be updated or
replaced, the only way to
withstand these types of
attacks is to use a very
large and highly
distributed DNS system
that can monitor, absorb,
and block the attack traffic
in realtime.
29. Cloudflare DDoS Protection
Cloudflare Network
● 10MM
Requests/second
● 10% Internet
requests everyday
● 100+ Data centers
globally
● 2.5B Monthly
unique visitors
● 6M+ websites, apps
& APIs in 150
countries
DDoS attacks make headlines every day, but how do they work, and how can you defend against them? DDoS attacks can be high volume UDP traffic floods, SYN floods, NTP amplification, or Layer 7 HTTP attacks, amongst others. Understanding how to protect yourself from DDoS is critical to doing business on the internet today. This talk will cover how these attacks work, what is being targeted by the attackers, and how you can protect against the different attack types.
What is a DDoS Attack?
From a high level, a DDoS attack is like a traffic jam clogging up the highway, preventing regular traffic from arriving at its desired destination.
A distributed denial-of-service (DDoS) attack is a malicious attempt to disrupt normal traffic of a targeted server, service or network by overwhelming the target or its surrounding infrastructure with a flood of Internet traffic. DDoS attacks achieve effectiveness by utilizing multiple compromised computer systems as sources of attack traffic. Exploited machines can include computers and other networked resources such as IoT devices.
The motive behind such attacks are often based on political, social, or religious animus, or utilized for financial gain when hackers threaten a website owner with an attack unless they pay a cryptocurrency ransom.
Cloudflare engineers have witnessed some of the largest DDoS attacks in history unfold. In the winter of 2016, we mitigated the largest Layer 3 DDoS attack to date. We were not only able to mitigate it, but accurately measure and analyze it as well. DDoS attacks take all shapes and forms. In this 400Gbps amplification attack, an attacker used 4,529 NTP servers to amplify an attack from a mere 87Mbps source server. Cloudflare has been fighting historic DDoS attacks for over 5 years. Back in 2013, the 120Gbs on Spamhaus was a “big” attack, and we were able to keep their website online.
DDoS attacks are evolving in size and complexity. 2016 saw 3 attacks over 1 Tbps; one of these was launched at Cloudflare and we successfully protected our clients. 10 days later a similarly sized attack, launched through the Mirai botnet, brought down a good part of the internet in North America.
How does a DDoS attack work?
A DDoS attack requires an attacker to gain control of a network of online machines in order to carry out an attack. Computers and other machines (such as IoT devices) are infected with malware, turning each one into a bot (or zombie). The attacker then has remote control over the group of bots, which is called a botnet.
Once a botnet has been established, the attacker is able to direct the machines by sending updated instructions to each bot via a method of remote control. When the IP address of a victim is targeted by the botnet, each bot will respond by sending requests to the target, potentially causing the targeted server or network to overflow capacity, resulting in a denial-of-service to normal traffic. Because each bot is a legitimate Internet device, separating the attack traffic from normal traffic can be difficult.
What are common types of DDoS attacks?
Different DDoS attack vectors target varying components of a network connection. In order to understand how different DDoS attacks work, it is necessary to know how a network connection is made. A network connection on the Internet is composed of many different components or “layers”. Like building a house from the ground up, each step in the model has a different purpose. The Open Systems Interconnection (OSI) model is a conceptual framework used to describe network connectivity in 7 distinct layers. This framework helps to reduce the complexity when discussing networks. Each layer provides service to the previous layer in the protocol stack.
L1 - Physical Layer - The physical medium for transferring data. Cat5E, Cat6, Fibre Optic, WiFi. Bits - Electrical pulses on the wire. Light transmission.
L2 - Datalink Layer - Defines the format of data on the network. Switching, MAC addresses.
L3 - Network Layer - Decides which physical path the data will take. NICs / Routers, combination of hardware and software. IPv4 and IPv6 addressing.
L4 - Transport Layer - Transmits data using transmission protocolss. TCP, UDP. Port numbers. Well Known Ports = 21, 22, 25, 53, 80, 443
L5 - Session Layer - Manages the sequence and flow of events that initiate and tear down network connections.
L6 - Presentation Layer - Simplest in function of any piece of the OSI model. Handles syntax processing of message data such as format conversions and encryption / decryption needed to support the Application layer above it.
L7 - Application Layer - Human-computer interaction layer, where applications can access the network services. HTTP, SMTP, DNS etc.
Attackers exploit the different layers:
Layer 3 flood - Reflection and Amplification attack.
Layer 4 - TCP SYN Flood.
Layer 7 - Slow Lloris, DNS Flood.
Application Layer Attacks - Sometimes referred to as a layer 7 DDoS attack (in reference to the 7th layer of the OSI model), the goal of these attacks is to exhaust the resources of the target. The attacks target the layer where web pages are generated on the server and delivered in response to HTTP requests. A single HTTP request is cheap to execute on the client side, and can be expensive for the target server to respond to as the server often must load multiple files and run database queries in order to create a web page. Layer 7 attacks are hard to defend against as the traffic can be difficult to flag as malicious.
HTTP Flood Attack
This attack is similar to pressing refresh in a web browser over and over on many different computers at once – large numbers of HTTP requests flood the server, resulting in denial-of-service.
This type of attack ranges from simple to complex. Simpler implementations may access one URL with the same range of attacking IP addresses, referrers and user agents. Complex versions may use a large number of attacking IP addresses, and target random urls using random referrers and user agents.
Protocol attacks, also known as a state-exhaustion attacks, cause a service disruption by consuming all the available state table capacity of web application servers or intermediate resources like firewalls and load balancers. Protocol attacks utilize weaknesses in layer 3 and layer 4 of the protocol stack to render the target inaccessible.
SYN Flood Attack
A SYN Flood Attack is analogous to a worker in a supply room receiving requests from the front of the pstore. The worker receives a request, goes and gets the package, and waits for confirmation before bringing the package out front. The worker then gets many more package requests without confirmation until they can’t carry any more packages, become overwhelmed, and requests start going unanswered.
This attack exploits the TCP handshake by sending a target a large number of TCP “Initial Connection Request” SYN packets with spoofed source IP addresses. The target machine responds to each connection request and then waits for the final step in the handshake, which never occurs, exhausting the target’s resources in the process.
Volumetric Attacks - This category of attacks attempts to create congestion by consuming all available bandwidth between the target and the larger Internet. Large amounts of data are sent to a target by using a form of amplification or another means of creating massive traffic, such as requests from a botnet.
DNS Amplification Attack
A DNS Amplification attack is like if someone were to call a restaurant and say “I’ll have one of everything, please call me back and tell me my whole order,” where the callback phone number they give is the target’s number. With very little effort, a long response is generated.
By making a request to an open DNS server with a spoofed IP address (the real IP address of the target), the target IP address then receives a response from the server. The attacker structures the request such that the DNS server responds to the target with a large amount of data. As a result, the target receives an amplification of the attacker’s initial query.
How are DDoS attacks mitigated?
Mitigating a multi-vector DDoS attack requires a variety of strategies in order to counter different trajectories. Generally speaking, the more complex the attack, the more likely the traffic will be difficult to separate from normal traffic - the goal of the attacker is to blend in as much as possible, making mitigation as inefficient as possible. Mitigation attempts that involve dropping or limiting traffic indiscriminately may throw good traffic out with the bad, and the attack may also modify and adapt to circumvent countermeasures. In order to overcome a complex attempt at disruption, a layered solution will give the greatest benefit.
Black Hole Routing
One solution available to virtually all network admins is to create a blackhole route and funnel traffic into that route. In its simplest form, when blackhole filtering is implemented without specific restriction criteria, both legitimate and malicious network traffic is routed to a null route or black hole and dropped from the network. If an Internet property is experiencing a DDoS attack, the property’s Internet service provider (ISP) may send all the site’s traffic into a blackhole as a defense.
Rate Limiting
Limiting the number of requests a server will accept over a certain time window is also a way of mitigating denial-of-service attacks. While rate limiting is useful in slowing web scrapers from stealing content and for mitigating brute force login attempts, it alone will likely be insufficient to handle a complex DDoS attack effectively. Nevertheless, rate limiting is a useful component in an effective DDoS mitigation strategy.
Web Application Firewall
A Web Application Firewall (WAF) is a tool that can assist in mitigating a layer 7 DDoS attack. By putting a WAF between the Internet and a origin server, the WAF may act as a reverse proxy, protecting the targeted server from certain types of malicious traffic. By filtering requests based on a series of rules used to identify DDoS tools, layer 7 attacks can be impeded. One key value of an effective WAF is the ability to quickly implement custom rules in response to an attack.
Anycast Network Diffusion
This mitigation approach uses an Anycast network to scatter the attack traffic across a network of distributed servers to the point where the traffic is absorbed by the network. Like channeling a rushing river down separate smaller channels, this approach spreads the impact of the distributed attack traffic to the point where it becomes manageable, diffusing any disruptive capability.
The reliability of an Anycast network to mitigate a DDoS attack is dependent on the size of the attack and the size and efficiency of the network. An important part of the DDoS mitigation implemented by Cloudflare is the use of an Anycast distributed network. Cloudflare has a 10 TBPS network, which is an order of magnitude greater than the largest DDoS attack recorded.
What is a UDP flood attack?
A UDP flood is a type of denial-of-service attack in which a large number of User Datagram Protocol (UDP) packets are sent to a targeted server with the aim of overwhelming that device’s ability to process and respond. The firewall protecting the targeted server can also become exhausted as a result of UDP flooding, resulting in a denial-of-service to legitimate traffic.
A UDP flood works primarily by exploiting the steps that a server takes when it responds to a UDP packet sent to one of it’s ports. Under normal conditions, when a server receives a UDP packet at a particular port, it goes through two steps in response:
1. The server first checks to see if any programs are running which are presently listening for requests at the specified port.
2. If no programs are receiving packets at that port, the server responds with a ICMP (ping) packet to inform the sender that the destination was unreachable.
A UDP flood can be thought of in the context of a hotel receptionist routing calls. First, the receptionist receives a phone call where the caller asks to be connected to a specific room. The receptionist then needs to look through the list of all rooms to make sure that the guest is available in the room and willing to take the call. Once the receptionist realizes that the guest is not taking any calls, they have to pick the phone back up and tell the caller that the guest will not be taking the call. If suddenly all the phone lines light up simultaneously with similar requests then they will quickly become overwhelmed.
As each new UDP packet is received by the server, it goes through steps in order to process the request, utilizing server resources in the process. When UDP packets are transmitted, each packet will include the IP address of the source device. During this type of DDoS attack, an attacker will generally not use their own real IP address, but will instead spoof the source IP address of the UDP packets, impeding the attacker’s true location from being exposed and potentially saturated with the response packets from the targeted server.
As a result of the targeted server utilizing resources to check and then respond to each received UDP packet, the target’s resources can become quickly exhausted when a large flood of UDP packets are received, resulting in denial-of-service to normal traffic.
How is a UDP flood attack mitigated?
Most operating systems limit the response rate of ICMP packets in part to disrupt DDoS attacks that require ICMP response. One drawback of this type of mitigation is that during an attack legitimate packets may also be filtered in the process. If the UDP flood has a volume high enough to saturate the state table of the targeted server’s firewall, any mitigation that occurs at the server level will be insufficient as the bottleneck will occur upstream from the targeted device.
How does Cloudflare mitigate UDP Flood attacks?
In order to mitigate UDP attack traffic before it reaches its target, Cloudflare drops all UDP traffic not related to DNS at the network edge. Because Cloudflare’s Anycast network scatters web traffic across many Data Centers, we have sufficient capacity to handle UDP flood attacks of any size.
What is a SYN flood attack?
A SYN flood (half open attack) is a type of denial-of-service (DDoS) attack which aims to make a server unavailable to legitimate traffic by consuming all available server resources. By repeatedly sending initial connection request (SYN) packets, the attacker is able to overwhelm all available ports on a targeted server machine, causing the targeted device to respond to legitimate traffic sluggishly or not at all.
SYN flood attacks work by exploiting the handshake process of a TCP connection. Under normal conditions, TCP connection exhibits three distinct processes in order to make a connection.
1. First, the client sends a SYN packet to the server in order to initiate the connection.
2. The server than responds to that initial packet with a SYN/ACK packet, in order to acknowledge the communication.
3. Finally, the client returns an ACK packet to acknowledge the receipt of the packet from the server. After completing this sequence of packet sending and receiving, the TCP connection is open and able to send and receive data.
To create denial-of-service, an attacker exploits the fact that after an initial SYN packet has been received, the server will respond back with one or more SYN/ACK packets and wait for the final step in the handshake. Here’s how it works:
1. The attacker sends a high volume of SYN packets to the targeted server, often with spoofed IP addresses.
2. The server then responds to each one of the connection requests and leaves an open port ready to receive the response.
3. While the server waits for the final ACK packet, which never arrives, the attacker continues to send more SYN packets. The arrival of each new SYN packet causes the server to temporarily maintain a new open port connection for a certain length of time, and once all the available ports have been utilized the server is unable to function normally.
In networking, when a server is leaving a connection open but the machine on the other side of the connection is not, the connection is considered half open. In this type of DDoS attack, the targeted server is continuously leaving open connections and waiting for each connection to timeout before the ports become available again. The result is that this type of attack can be considered a “half-open attack”.
A SYN flood can occur in three different ways:
Direct attack: A SYN flood where the IP address is not spoofed is known as a direct attack. In this attack, the attacker does not mask their IP address at all. As a result of the attacker using a single source device with a real IP address to create the attack, the attacker is highly vulnerable to discovery and mitigation. In order to create the half-open state on the targeted machine, the hacker prevents their machine from responding to the server’s SYN-ACK packets. This is often achieved by firewall rules that stop outgoing packets other than SYN packets or by filtering out any incoming SYN-ACK packets before they reach the malicious users machine. In practice this method is used rarely (if ever), as mitigation is fairly straightforward – just block the IP address of each malicious system. If the attacker is using a botnet such as the Mirai botnet they won’t care about masking the IP of the infected device
Spoofed Attack: A malicious user can also spoof the IP address on each SYN packet they send in order to inhibit mitigation efforts and make their identity more difficult to discover. While the packets may be spoofed, those packets can potentially be traced back to their source. It’s difficult to do this sort of detective work but it’s not impossible, especially if Internet service providers (ISPs) are willing to help.
Distributed attack (DDoS): If an attack is created using a botnet the likelihood of tracking the attack back to its source is low. For an added level of obfuscation, an attacker may have each distributed device also spoof the IP addresses from which it sends packets. If the attacker is using a botnet such as the Mirai botnet, they generally won’t care about masking the IP of the infected device.
By using a SYN flood attack, a bad actor can attempt to create denial-of-service in a target device or service with substantially less traffic than other DDoS attacks. Instead of volumetric attacks, which aim to saturate the network infrastructure surrounding the target, SYN attacks only need to be larger than the available backlog in the target’s operating system. If the attacker is able to determine the size of the backlog and how long each connection will be left open before timing out, the attacker can target the exact parameters needed to disable the system, thereby reducing the total traffic to the minimum necessary amount to create denial-of-service.
How is a SYN flood attack mitigated?
SYN flood vulnerability has been known for a long time and a number of mitigation pathways have been utilized. A few approaches include:
Increasing Backlog queue
Each operating system on a targeted device has a certain number of half-open connections that it will allow. One response to high volumes of SYN packets is to increase the maximum number of possible half-open connections the operating system will allow. In order to successfully increase the maximum backlog, the system must reserve additional memory resources to deal with all the new requests. If the system does not have enough memory to be able to handle the increased backlog queue size, system performance will be negatively impacted, but that still may be better than denial-of-service.
Recycling the Oldest Half-Open TCP connection
Another mitigation strategy involves overwriting the oldest half-open connection once the backlog has been filled. This strategy requires that the legitimate connections can be fully established in less time than the backlog can be filled with malicious SYN packets. This particular defense fails when the attack volume is increased, or if the backlog size is too small to be practical.
SYN cookies
This strategy involves the creation of a cookie by the server. In order to avoid the risk of dropping connections when the backlog has been filled, the server responds to each connection request with a SYN-ACK packet but then drops the SYN request from the backlog, removing the request from memory and leaving the port open and ready to make a new connection. If the connection is a legitimate request, and a final ACK packet is sent from the client machine back to the server, the server will then reconstruct (with some limitations) the SYN backlog queue entry. While this mitigation effort does lose some information about the TCP connection, it is better than allowing denial-of-service to occur to legitimate users as a result of an attack.
How does Cloudflare mitigate SYN Flood attacks?
Cloudflare mitigates this type of attack in part by standing between the targeted server and the SYN flood. When the initial SYN request is made, Cloudflare handles the handshake process in the cloud, withholding the connection with the targeted server until the TCP handshake is complete. This strategy takes the resource cost of maintaining the connections with the bogus SYN packets off the targeted server and places it on Cloudflare’s Anycast network.
What is a DNS Flood?
Domain Name System (DNS) servers are the “phonebooks” of the Internet; they are the path through which Internet devices are able to lookup specific web servers in order to access Internet content. A DNS flood is a type of distributed denial-of-service attack (DDoS) where an attacker floods a particular domain’s DNS servers in an attempt to disrupt DNS resolution for that domain. If a user is unable to find the phonebook, it cannot lookup the address in order to make the call for a particular resource. By disrupting DNS resolution, a DNS flood attack will compromise a website, API, or web application's ability respond to legitimate traffic. DNS flood attacks can be difficult to distinguish from normal heavy traffic because the large volume of traffic often comes from a multitude of unique locations, querying for real records on the domain, mimicking legitimate traffic.
How does a DNS flood attack work?
The function of the Domain Name System is to translate between easy to remember names (e.g. example.com) and hard to remember addresses of website servers (e.g. 192.168.0.1), so successfully attacking DNS infrastructure makes the Internet unusable for most people. DNS flood attacks constitute a relatively new type of DNS-based attack that has proliferated with the rise of high bandwidth Internet of Things (IoT) botnets like Mirai. DNS flood attacks use the high bandwidth connections of IP cameras, DVR boxes and other IoT devices to directly overwhelm the DNS servers of major providers. The volume of requests from IoT devices overwhelms the DNS provider’s services and prevents legitimate users from accessing the provider's DNS servers.
How can a DNS Flood attack be mitigated?
DNS floods represent a change from traditional amplification based attack methods. With easily accessible high bandwidth botnets, attackers can now target large organizations. Until compromised IoT devices can be updated or replaced, the only way to withstand these types of attacks is to use a very large and highly distributed DNS system that can monitor, absorb, and block the attack traffic in realtime.
10MM Requests/second
10% Internet requests everyday
100+ Data centers globally
2.5B Monthly unique visitors
6M+ websites, apps & APIs in 150 countries