What is a DDoS attack ?
A denial of service (DoS) attack is any attack that prevents a legitimate user from accessing a network resource. A distributed denial of service (DDoS) attack is one that uses multiple network resources as the source of the specific attack vector. The use of multiple resources is primarily intended as a method to amplify the capabilities of a single attacker, but it can also help to conceal the identity of an attacker and complicate mitigation efforts. Most DDoS attacks leverage a “botnet”, which is a network of Internet connected computer systems centrally controlled by an attacker (Figure 1.1). Botnets can range in size from a handful of systems to tens of millions. Most botnets use compromised computer resources without the knowledge of the owner.
Within the larger scope of information security, DDoS attacks fall within the “Availability” pillar of the CIA Triad (Figure 1.2).
DDoS differs from other areas of information security exploitation that attempt to alter or gain access to data to cause harm. DDoS attacks are predicated on the notion that it is the legitimate user’s access to the data that provides value for an organization, and removing that access causes the most harm.
Explanation
A denial of service attack is any attack that results in an outage of a network resource.
This often involves large volumes of network traffic, but may also be accomplished through low volume exploitation of protocol or application weaknesses.
DDoS Impact
Damage to Reputation
By causing an outage, an attacker can negatively impact the reputation of a company.
Direct Revenue Loss
An outage to a network resource that directly generates revenue, such as E-commerce or online media, can directly impact an organization.
Lost Productivity
A DDoS attack often prevents employees from performing their normal responsibilities.
Attack Smokescreen
A DDoS attack can be used to hide other nefarious activities from information security personnel.
Attacker Motivations
Extortion
A common motivation for DDoS attacks is the extortion of money from the targeted company. In a typical DDoS extortion scheme, the attacker will anonymously contact the victim organization to request a specific amount of money to be paid to prevent a future attack. Often the attacker will prove their capabilities by performing a limited DDoS attack at a specific time. The anonymous transfer of funds is usually carried out using the Bitcoin virtual currency. A cyber-criminal gang known as DD4BC was exposed in December 2015 for operating a massive DDoS extortion ring.
Hacktivist
Within the scope of DDoS, “hacktivism” is the use of DDoS to promote a specific political agenda. An attack of this type will often be preceded by a public statement from the attacker on social media or other public forums detailing a specific grievance or manifesto. Victims of these attacks are often well established brands or companies that are likely to suffer substantial reputation damage from the associated customer impact and news coverage. The most well known example of this type of attacker is the loose hacktivist collective “Anonymous,” which has claimed responsibility for DDoS attacks targeting Bank of America, Visa, Mastercard, the Church of Scientology and many others.
State-sponsored/Cyber terrorism
A cyber terrorism campaign involves a nation or terrorist organization performing a DDoS attack. The primary goal is often the silencing of speech from certain sources, or the substantial disruption to the target’s telecommunications infrastructure and commerce. These types of DDoS attacks are generally much larger and better orchestrated due to the significant resources of the attacker. A suspected example occurred in March 2015 when a DDoS barrage originating from China targeted specific anti-China resources hosted on Github. Other examples include a three week DDoS attack in the spring of 2007 targeting the country of Estonia, which effectively disconnected the country from the Internet. The attack was linked to a political dispute with Russia.
Personal Vendetta
The historical origins of DDoS are primarily from online disputes between individuals or small groups. These types of attacks grew in popularity during the late 1990s in online chat systems. The primary purpose of these attacks is to “punish” someone for a perceived wrong, or silence their speech. These types of attacks are still prevalent today.
Business Rivalry
The purpose of these attacks is to cause financial impact or embarrassment to a business competitor. These attacks are typically long in duration, and target resources responsible for revenue generation, such as E-commerce systems. The advent of DDoS-for-hire services, where someone can purchase a DDoS attack for less than $20, has facilitated and made this type of attack more common.
Networking Refresher
OSI model
Throughout the training portal, references will be made to the Open Systems Interconnection (OSI) model. This is a conceptual model that standardizes communication functions within network connected systems. Most DDoS attacks fall within layers 3, 4 and 7 and subsequent courses will discuss these areas in detail. An understanding of the OSI model is not required for novices, but is recommended for advanced trainees.
Layer | Protocol Data Unit | Purpose | Examples |
---|---|---|---|
7 Application | Data | High-Level Application APIs | HTTP, HTTPS, DNS |
6 Presentation | Data | Data translation between a service and application | CSS, HTML, XML, JSON |
5 Session | Data | Managing communication | RPC |
4 Transport | Segment/Datagram | Transmission of data between points on a network | TCP, UDP |
3 Network | Packet | Management of a multi-node network | IPv4, IPv6, ICMP |
2 Data Link | Frame | Transmission of data between physically connected devices | PPP, L2TP |
1 Physical | Bit | Transmission of data stream over a physical medium | DSL, Ethernet |
WAN routing/connectivity
The Internet is a collection of interconnected computer networks that communicate using IPv4 or IPv6 protocols (Figure 1.3). Small networks, such as those of a home user or a small business, connect to the Internet through larger Internet Service Providers (ISPs). ISPs and other large networks connect to each other through one or more public and private peering points where network traffic can be exchanged. The connections between network devices consist of fiber optic or copper cabling with a specific maximum capacity. The interconnection of large networks is primarily managed by the BGP protocol which creates a mechanism for exchanging route (or path) information. This routing information allows an Internet connected network to advertise to the entire Internet the paths to reach that network.
Figure 1.3: WAN Connectivity
IPv4/IPv6
The Internet Protocol is the protocol that all Internet connected devices use to communicate on the Internet. All higher layer protocols (on the OSI model) are encapsulated within this lower level protocol. The header of an IP packet contains a variety of information, most importantly the source and destination address for the network devices that are communicating.
TCP
The Transmission Control Protocol (TCP) is a layer 4 protocol (on the OSI model) and is used to establish virtual circuits between two applications. A virtual circuit is a reliable, connection-based communication channel. TCP data is contained within an IP packet and is made reliable by the addition of checksums, ordering information, and an acknowledgement mechanism. Communication on a fully established TCP virtual circuit is difficult to forge. The TCP 3-way handshake is illustrated in Figure 1.4.
Figure 1.4: TCP 3-way HandshakeFigure
UDP
The User Datagram Protocol (UDP) is a layer 4 protocol (on the OSI model) and is used for connectionless transmission of data between applications. UDP contains a checksum, but does not ensure reliability or ordering of data unless it is implemented within a higher layer protocol. Due to this limitation, an attacker can often forge a UDP based communication.
UDP is a connectionless protocol that doesn’t provide a handshake mechanism. As a result, most applications built upon UDP do not have a mechanism to verify the client IP address. This capability may be added by the application protocol, but generally doesn’t exist.
ICMP
The Internet Control Message Protocol (ICMP) is contained within an IP packet but is often considered a layer 3 protocol (on the OSI model). The protocol is primarily used for intermediate network devices to communicate error messages back to a sender of data. ICMP contains a checksum, but does not ensure reliability or ordering of data. Due to this limitation, an attacker can often forge an ICMP message.
HTTP(S)
The Hypertext Transfer Protocol (HTTP) and its encrypted counterpart HTTPS are layer 7 application protocols used for communication of data on the World Wide Web. Both HTTP and HTTPS requests are sent within TCP virtual circuits, resulting in a reliable communication channel. The use of TCP makes the forging of certain client information such as source IP addresses very difficult.
DNS
The Domain Name System (DNS) protocol is a mechanism for applications to obtain IP address information for human readable network names. The DNS protocol primarily operates over UDP, but may also operate over TCP for certain large information transactions and for legacy compatibility. DNS requests that are issued using UDP can easily be forged to contain a fake source IP address. It is very difficult to forge the source IP address of a DNS request sent over a TCP virtual circuit.
BGP
The Border Gateway Protocol (BGP) is the mechanism by which networks on the Internet connect to each other (peers). Upon establishing a peering session with a network, each BGP participant exchanges routing table information containing all networks that are reachable through the peer.
Conventions
Packet Captures
The packet captures referenced throughout the training portal are in the default format commonly associated with the tcpdump utility. An example output is shown below with certain fields explained. A more complete explanation of the format can be found on the tcpdump website. An understanding of this output is not required for novices, but is recommended for advanced trainees.
Metric Graphs
The metric graphs referenced throughout the training portal are generally displayed as time series data with the chronologically most recent data points on the right-side of the X-axis.
Bandwidth Attacks
Overview
This course covers volumetric DDoS attacks, one of the most common forms of DDoS attacks. Upon completion of this course, the participant will have an understanding of how volumetric DDoS attacks work, why they are so effective and how they can be mitigated.
Definitions
Bandwidth
The volume of data on a network link. This is often measured in megabits-per-second (Mbps) or gigabits-per-second (Gbps). Bandwidth is often used as a measure of the maximum capacity of a network link.
(1 Gbps = 1,000Mbps = 1,000,000Kbps = 1,000,000,000bps)
Botnet
This is a globally distributed group of computers that have been exploited so that an attacker may use them to initiate DDoS attacks. A botnet may consist of end-user systems located on residential Internet connections, or high capacity servers on well connected networks. Botnets may even exploit seemingly innocuous devices connected to the Internet such as Internet of Things devices (smart home systems, CCTV, smart TV’s, etc.). The owner of the resource is often unaware that their resources are being used to launch DDoS attacks.
Null Route
This is a network route that goes nowhere. All matching traffic is simply discarded.
Attack Overview
A volumetric DDoS attack is any attack that attempts to overwhelm the target by saturating the available network capacity. This course is specific to volumetric attacks originating from a botnet. A subsequent course will provide details of a reflected volumetric DDoS attack.
The Internet consists of a vast number of individual networks all interconnected to each other. Large, well connected networks (ISPs) provide access to smaller networks. The connections between these networks all have a finite amount of bandwidth capacity which is often fixed due to technical or contractual limitations. Regardless of the limitation, most links cannot be trivially upgraded to a higher capacity without incurring substantial cost in both time and money. Volumetric DDoS attacks are possible due to the relatively small network capacity of a target compared to the overall capacity of all Internet connected devices.
Figure 2.1 illustrates a generalized volumetric DDoS attack. The target has a maximum link capacity of 1Gbps, and each attacking botnet node is on a common residential broadband connection capable of sending traffic at 20Mbps. Thus, a botnet of just 50 nodes is needed to overwhelm the target network (50nodes x 20Mbps = 1Gbps). Botnets of 100,000 nodes are fairly common, and large botnets with more than 10million nodes have been observed in recent years. With DDoS traffic consuming all link capacity, no legitimate traffic is able to pass through the connection.
Attack Impact
Link Saturation
The primary effect of the volumetric attack is the saturation of upstream links that connect the target network to the Internet. When more traffic is sent to a link than it can transmit, excess traffic is dropped by the upstream network device. This results in significant packet loss, causing either performance degradation or a full network outage. The extent of the packet loss depends on the amount of excess traffic but may reach nearly 100%. Impact to applications can often be observed by users with as little as 5-10% packet loss.
Increased Load on Network Devices
The increase in overall network traffic caused by a volumetric DDoS attack, frequently causes higher than normal resource utilization on network devices such as routers, switches and firewalls. If the devices are not properly sized for the level of traffic then they may reboot, hang, or otherwise degrade in performance.
Conceal Other Attack Vectors
The volumetric DDoS attack produces so much traffic that it may make it difficult to detect more subtle attacks that may be occurring simultaneously. Attackers have used volumetric attacks to overwhelm devices such as intrusion detection/prevention systems or firewalls. By rendering these devices ineffective they can increase the success rate of traditional remote vulnerability exploitation.
Increased Network Costs
Many organizations use a burstable, or tiered, pricing model for purchasing network connectivity. A volumetric DDoS attack can raise IT costs by artificially increasing link utilization. An attack lasting just eight hours once per month would be sufficient to artificially inflate network costs for customers using the common 95th percentile billing model.
Why Are Volumetric DDoS Attacks So Effective?
Finite Network Capacity
In most cases, organizations have a finite amount of network capacity that cannot be easily increased to handle the additional traffic caused by a volumetric DDoS. As an example, an organization may have a 1Gbps connection from their upstream ISP. To increase the capacity to 10Gbps would likely require a new physical link (cable), more powerful network equipment (routers/firewalls/switches), and IT implementation time. The time required by many ISPs to provision additional capacity is generally 4 to 6 weeks.
Simplicity
Any target located on the Internet can be targeted by a volumetric DDoS. The attacker requires no special knowledge of the target environment, or understanding of advanced DDoS techniques. The attacker simply needs the IP address of the target, and the ability to send traffic. For this reason, volumetric attacks are often the first type of DDoS attack attempted by an attacker.
Fundamental to Topology of the Internet
The Internet is comprised of many interconnected smaller networks. This topology means that any one network, no matter how large the organization is, is dwarfed in scale by the combined capacity of all networks connected to the Internet. Given this topology, volumetric DDoS attacks will always be possible and the scale of the attacks will primarily be dependent upon the attacker’s ability to harness vulnerable resources for constructing a botnet.
Requires Upstream Blocking
To mitigate a volumetric DDoS attack, the traffic must be blocked prior to its transmission across the saturated network link. To do this requires the participation of network providers upstream from the targeted network. For small organizations this may entail contacting upstream ISPs, or, for those using BGP routing, the creation and propagation of null routes. By forcing the mitigation to occur upstream, it can cause an organization to be dependent on vendors (like ISPs) that may be less skilled or willing to assist in DDoS mitigation.
Any Traffic Will Do
A volumetric DDoS attack can leverage any protocol, and target any endpoint even if the target is not providing a publicly accessible service. The only requirement for a volumetric DDoS attack is to route traffic to the network that the attacker is trying to impact. As an example, an attacker could send a large volume of UDP packets to an IP address and port that isn’t even in use on the target network. Since the IP address is routable, the traffic will traverse the target organization’s network links causing impact.
Spoofed Sources
Since the volumetric DDoS attack doesn’t depend on establishing a persistent connection, the source IP address is often forged. To make detection and mitigation more challenging, attackers will often set the source IP address to a completely random IP address. This renders simplistic DDoS mitigation strategies, which depend on identifying and blocking the IP addresses responsible for sending large amounts of data, ineffective.
Explanation
Volumetric DDoS attacks saturate the Internet connection of the target at the interconnect with the upstream carrier. As a result, filtering downstream is not effective as the bottleneck is located further upstream.
Mitigation Strategies
Blocking With On-Premises Devices
Attempting to block a volumetric DDoS attack using on-premises devices such as IPS/IDS and firewalls is typically ineffective. As illustrated (Figure 2.2), these devices are positioned in the network downstream from the point at which the DDoS traffic causes saturation of the link and packet loss. Discarding the traffic after the bottleneck has no effect on attack mitigation.
Blocking Upstream by the ISP
If contacted, the technical support arm of most ISPs will add simple rules to block specific traffic before it reaches the target network. This approach can be effective at mitigating simplistic attacks, but will often be unable to mitigate more complex scenarios. The limitation is related to the minimal filtering capabilities offered by most ISPs. For example, most ISPs will be happy to filter all traffic to or from a specific IP address, or using a certain protocol. But this is a very blunt tool which may not be granular enough to block DDoS traffic while at the same time allowing legitimate traffic.
Null Routing the Target IP
An organization that uses BGP may use null routes to prevent devices on the Internet from sending traffic to the target IP. The main benefit of this approach is its distributed effect, since the null route announcement is sent to all devices on the Internet that receive Internet routing table announcements. Since this mechanism results in the target IP becoming unreachable, it is only useful if the target IP is expendable and traffic can be discarded to save other resources on the same network. For this reason, null routes are typically only an effective mitigation in multi-user environments where a problematic user can be segmented off to ensure a good experience for the remaining users.
Hide Behind a Large CDN
Traditional content distribution networks (CDNs) function by locating web server caches throughout the world to deliver content to the Internet. A CDN typically works as an HTTP(S) proxy where all requests are made to the CDN server, which subsequently initiates a private connection to the organization’s server to obtain the data. With regard to volumetric attacks, using a CDN often implicitly protects a network from these types of attacks because the traffic is sent to the CDN (Figure 2.3) which often is comprised of a massive, globally distributed network.
Dedicated Mitigation Services
A dedicated DDoS mitigation service, like that provided by Incapsula, is often the most effective approach. These services are similar to the CDN approach (Figure 2.3) mentioned earlier, but with advanced capabilities specific to identifying and blocking DDoS traffic. Much like a CDN, reputable mitigation services have a massive globally distributed network of scrubbing centers capable of blocking large DDoS attacks.
Examples
UDP Flood
This volumetric DDoS attack generates a large quantity of large UDP packets. UDP is a common protocol used for communication on the Internet, and many services such as DNS, games, chat, and VOIP use this protocol. The size of the attack packets are often the same, typically set at 1500 bytes or the maximum segment size for the link. The contents of the data portion of the packets are often randomized or a simple repeated character. The source IP address(es) of the DDoS packets may be forged as a random IP address. The target of these attacks are often UDP based services like DNS, which makes mitigation more challenging as the protocol can’t simply be dropped as it is used for legitimate communication. The packet capture below is from a UDP flood with randomized source IP address, targeting the NTP port on 192.168.0.10. The timestamp and packet size can be used to estimate the attack intensity (approx. 7.5Mbps in this example)
15:10:59.049061 IP 143.223.76.113.4722 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.049273 IP 173.119.200.61.4723 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.049463 IP 148.234.201.93.4724 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.049486 IP 17.168.132.133.4725 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.049667 IP 11.91.239.117.4726 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.049856 IP 247.26.232.148.4727 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.049884 IP 166.251.44.78.4728 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.050084 IP 55.47.7.207.4729 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.050269 IP 57.218.140.70.4730 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.050455 IP 202.34.238.47.4731 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.050641 IP 157.179.60.60.4732 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.050826 IP 204.251.51.22.4733 > 192.168.0.10.123: NTPv3, unspecified, length 1400
15:10:59.051012 IP 94.115.239.70.4734 > 192.168.0.10.123: NTPv3, unspecified, length 1400
ICMP Flood
This volumetric DDoS attack generates a large quantity of large ICMP packets. ICMP is a common protocol used on the Internet for communicating miscellaneous status information between devices. The size of the attack packets are often the same, typically set at 1500 bytes or the maximum segment size for the link. The contents of the data portion of the packets are often randomized or a simple repeated character. Although any ICMP message type may be used, the ICMP ping request/response types are most common. The source IP address(es) of the DDoS packets may be forged as a random IP address. The packet capture below is from an ICMP flood with randomized source IP address, targeting 192.168.0.10. Note that the packet type is “echo reply”, yet there are no associated “echo request” packets as would normally be expected with legitimate traffic. The timestamp and packet size can be used to estimate the attack intensity (approx. 700Mbps in this example)
15:21:52.876250 IP 22.26.9.93 > 192.168.0.10: ICMP echo reply, id 61449, seq 59013, length 1408
15:21:52.876286 IP 213.82.111.254 > 192.168.0.10: ICMP echo reply, id 61449, seq 59525, length 1408
15:21:52.876299 IP 33.101.41.249 > 192.168.0.10: ICMP echo reply, id 61449, seq 59781, length 1408
15:21:52.876312 IP 158.119.39.80 > 192.168.0.10: ICMP echo reply, id 61449, seq 60037, length 1408
15:21:52.876326 IP 203.22.9.28 > 192.168.0.10: ICMP echo reply, id 61449, seq 60293, length 1408
15:21:52.876347 IP 207.166.25.255 > 192.168.0.10: ICMP echo reply, id 61449, seq 60549, length 1408
15:21:52.876360 IP 63.24.49.82 > 192.168.0.10: ICMP echo reply, id 61449, seq 60805, length 1408
15:21:52.876377 IP 38.65.17.70 > 192.168.0.10: ICMP echo reply, id 61449, seq 61061, length 1408
15:21:52.876397 IP 124.119.163.183 > 192.168.0.10: ICMP echo reply, id 61449, seq 61317, length 1408
15:21:52.876410 IP 235.22.178.49 > 192.168.0.10: ICMP echo reply, id 61449, seq 61573, length 1408
Fragmented ICMP Flood
This volumetric attack is identical to the ICMP flood, but with packets larger than the maximum segment size of the connection (usually 1500 bytes). If, for example, the data section of the packet is 10,000 bytes it will be split into 7 packet fragments. Upon reaching the target, the receiving device will reassemble the packet using extra CPU resources on the device. Other than this differentiator, the attack is identical to the more general ICMP flood. The packet capture below is a fragmented ICMP flood targeting 192.168.0.10. Note the high number of packet fragments which is atypical of legitimate ICMP traffic.
15:34:15.659680 IP 10.100.210.10 > 192.168.0.10: ICMP echo reply, id 62985, seq 45600, length 1424
15:34:15.659685 IP 10.100.210.10 > 192.168.0.10: icmp
15:34:15.659688 IP 10.100.210.10 > 192.168.0.10: icmp
15:34:15.659691 IP 10.100.210.10 > 192.168.0.10: icmp
15:34:15.659697 IP 10.100.210.10 > 192.168.0.10: icmp
15:34:15.659865 IP 10.100.210.10 > 192.168.0.10: icmp
15:34:15.659870 IP 10.100.210.10 > 192.168.0.10: icmp
15:34:15.659873 IP 10.100.210.10 > 192.168.0.10: icmp
15:34:15.659876 IP 10.100.210.10 > 192.168.0.10: icmp
15:34:15.660034 IP 10.100.210.10 > 192.168.0.10: icmp
Tsunami SYN Flood
This volumetric DDoS attack generates a large quantity of large TCP SYN packets. TCP is the most common protocol used on the Internet, and is used for connection oriented higher-level protocols like HTTP(S). The ‘SYN’ designation indicates that the synchronize flag has been set on the TCP packet, which is normally done during the setup of a new connection. The size of the attack packets are often the same, typically set at 1500 bytes or the maximum segment size for the link. The contents of the data portion of the packets are often randomized or a simple repeated character. The source IP address(es) of the DDoS packets may be forged as a random IP address. These attacks are often targeted at TCP based services like HTTP, which make mitigation more challenging as the protocol can’t simply be dropped as it is used for legitimate communication. The packet capture below is from a Tsunami SYN flood with randomized source IP address, targeting 192.168.0.10. Note that the packet has the SYN (S) flag set and that the length is 1400 bytes. This length is atypical of SYN packets which normally have no packet data. The timestamp and packet size can be used to estimate the attack intensity (approx. 230Mbps in this example)
15:42:52.311365 IP 75.39.99.97.29276 > 192.168.0.10.443: Flags [S], seq 653296982:653298382, win 512, length 1400
15:42:52.311433 IP 47.11.132.217.29281 > 192.168.0.10.443: Flags [S], seq 863791764:863793164, win 512, length 1400
15:42:52.311477 IP 175.130.183.129.29284 > 192.168.0.10.443: Flags [S], seq 83028330:83029730, win 512, length 1400
15:42:52.311544 IP 243.38.227.16.29288 > 192.168.0.10.443: Flags [S], seq 2139105808:2139107208, win 512, length 1400
15:42:52.311603 IP 105.129.100.77.29292 > 192.168.0.10.443: Flags [S], seq 1067694761:1067696161, win 512, length 1400
15:42:52.311632 IP 73.243.253.11.29294 > 192.168.0.10.443: Flags [S], seq 911930069:911931469, win 512, length 1400
15:42:52.311692 IP 96.175.11.103.29298 > 192.168.0.10.443: Flags [S], seq 379725064:379726464, win 512, length 1400
15:42:52.311739 IP 129.21.68.48.29301 > 192.168.0.10.443: Flags [S], seq 90102282:90103682, win 512, length 1400
15:42:52.311796 IP 210.181.176.241.29305 > 192.168.0.10.443: Flags [S], seq 1302395233:1302396633, win 512, length 1400
15:42:52.311855 IP 65.143.106.210.29309 > 192.168.0.10.443: Flags [S],
Protocol Attacks
Overview
This course covers DDoS attacks that exploit weaknesses in specific protocols primarily at Layer 3 and Layer 4 of the OSI model. Upon completion of this course the participant will have an understanding of how these DDoS attacks work, why they are so effective and how they might be mitigated.
Definitions
Client
In the client/server model the client is the computer system that is initiating a new connection to another system (the server).
Server
In the client/server model the server is a computer service that waits to receive a connection and request from another system (the client).
Attack Overview
Protocol attacks are a diverse collection of various attacks intended to cause disruption to an environment by exploiting a specific weakness or inefficiency in the protocol. Many of these attacks exploit weaknesses of Layer 3 and 4 protocols such as TCP, IP and UDP. Unlike volumetric attacks, the intention is not to saturate the Internet connection but instead to cause disruption with a relatively small amount of network traffic.
Most communication on the Internet uses a client/server model. In this model, a network device or system that is presenting a resource to the Internet awaits connections from clients. The client initiates a connection, and once the connection is established communication can begin. For each connection, resources are expended on both the client and the server. As an example, when a TCP connection is created between a user’s web browser and a web server, the web server will allocate various memory areas to track the communication and maintain connection state data. Additionally, most operating systems have finite limits on the size of connection tables, and other internal network state tables. Protocol attacks attempt to disrupt communication by exhausting these resources on the target system. As a general rule, the more resources a specific protocol uses the more susceptible it is to DDoS attack. Protocol DDoS attacks are possible due to the limited amount of server resources in comparison to the total client resources available on the entire Internet.
Figure 3.1 illustrates the TCP connection DDoS attack, one of the most trivial protocol attacks. The targeted system has a finite configuration limit within the operating system allowing it to support up to 20,000 TCP connections. This means that a botnet of just 20 nodes would be able to easily fill the pool of connections (20nodes x 1000 conns/node = 20,000 connections). A botnet of 100,000 nodes is fairly common, and large botnets with more than 10million nodes have been observed in recent years. With DDoS connections filling all connection slots on the target, no legitimate connections can be established.
Attack Impact
Increased Memory Usage on Network Devices
Devices that track network connection state like firewalls, IPS/IDS, or load balancers often use more memory when experiencing a protocol DDoS attack. Each new connection or data flow requires allocation of resources on these devices. If the strength of the attack is high enough, it may result in exhausting memory on these devices. Small memory leaks that might otherwise go unnoticed will be exacerbated by these attacks.
Increased Load on Network Devices
Devices that track network connection state like firewalls, IPS/IDS or load balancers may use more CPU resources. This behavior is common in TLS/SSL-related protocol attacks where the target or intermediate devices may decrypt the traffic at considerable CPU cost.
Reach Arbitrary Limits
Most operating system network stacks contain specific hardcoded limits that control the size of various buffers and tables stored in physical memory. So although the target may appear normal or idle, one of these arbitrary limits may have been exceeded, which results in the rejection of additional connections.
Why Are Protocol DDoS Attacks So Effective?
Difficult to Diagnose
Protocol DDoS attacks are often low bandwidth attacks that may easily go unnoticed. Protocol attacks that exploit hardcoded limits in network devices may go completely unnoticed as devices may appear idle. These attacks can sometimes be misdiagnosed as a simple network outage rather than an attack.
Finite Resources
With few exceptions, most organizations have a finite amount of CPU and memory on their network devices and servers. A protocol DDoS attack intended to exhaust CPU or memory on these devices takes advantage of this fact. Increasing CPU or memory capacity on servers and network devices will often require ordering more expensive hardware with substantial delivery and setup time.
The Internet Is a Massive Attack Resource
Regardless of how large an organization’s environment might be, it is dwarfed by the resources of the entire Internet. A large organization may have 10,000 servers with 160,000 CPU cores and 320TB of memory, but this same capacity could be achieved with a medium-sized botnet of just 100,000 nodes. So although most protocol attacks exhaust nearly an equal amount of resources on the attacker side, the available resource pool is much larger.
Spoofed Sources
Some protocol attacks don’t require establishing a persistent connection, thus the source IP address is often forged. To make detection and mitigation more challenging, attackers often set the source IP address to a completely random IP address. This renders simplistic DDoS mitigation strategies that depend on identifying and blocking the abusive IP addresses ineffective.
Explanation
Volumetric DDoS attacks may use any protocol. Discarding of ICMP packets may mitigate attacks that use that protocol, but should be done cautiously to prevent other network side-effects.
Explanation
Volumetric DDoS attacks may use any protocol. Discarding of ICMP packets may mitigate attacks that use that protocol, but should be done cautiously to prevent other network side-effects.
Mitigation Strategies
Blocking with On-Premises Devices
Blocking protocol DDoS attacks with on-premises devices such as IDS/IPS and firewalls may be successful due to the low bandwidth nature of these attacks. This is in contrast to volumetric DDoS attacks where the bottleneck is upstream and outside the control of the organization. Also, unlike volumetric attacks, a large portion of protocol attacks do not have spoofed source IP addresses. As a result, simple attacks can be blocked with simple firewall rules. More advanced attacks, particularly those sourced from very large botnets, will require purpose-built DDoS mitigation hardware to properly identify and automatically block the attack traffic.
Blocking Upstream by the ISP
This method of mitigation is often ineffective for protocol DDoS attacks. If contacted, the technical support arm of most ISPs will add simple rules to block specific traffic before it reaches the target network. This approach can be effective at mitigating simplistic attacks, but will often be unable to mitigate more complex scenarios. The limitation is related to the minimal filtering capabilities offered by most ISPs. For example, most ISPs will be happy to filter all traffic to or from a specific IP address, or all traffic using a certain protocol. But this is a very blunt tool and may not be granular enough to block DDoS traffic while at the same time allowing legitimate traffic. The same level of filtering is available in on-premises firewalls and routers with the added benefit of being under the control of the organization.
Traffic Analytics
Due to the low bandwidth nature of most protocol attacks, one of the greatest challenges is identifying that an attack is actually underway. Tools that analyze traffic patterns and look for anomalies based on historical data can be invaluable in making this determination.
Null Routing the Target IP
This method of mitigation is generally not recommended for protocol DDoS attacks as it blocks all traffic to the target. This option is very imprecise and will affect both legitimate and attack traffic destined for the target IP.
Hide Behind a Large CDN
Traditional content delivery networks (CDNs) function by locating web server caches throughout the world to deliver content to the Internet. A CDN typically works as an HTTP(s) proxy where all requests are made to the CDN server, which subsequently initiates a private connection to the organization’s server to obtain the data. With regard to protocol attacks, using a CDN often implicitly protects a network from these types of attacks because the traffic is sent to the CDN (Figure 3.2) which often is comprised of a massive, globally distributed network. This type of mitigation solution will only protect services supported by the CDN (generally HTTP and HTTPS).
Dedicated Mitigation Services
A dedicated DDoS mitigation service, like that provided by Incapsula, is often the most effective. These services are similar to the CDN approach (Figure 3.2) mentioned earlier but with advanced capabilities specific to identifying and blocking DDoS traffic. Much like a CDN, a reputable mitigation service has a massive globally distributed network of scrubbing centers capable of blocking large DDoS attacks.
Examples
SYN flood classic and modern
The classic SYN flood is a low bandwidth protocol DDoS attack intended to exhaust the resources on the target device. This is achieved by not completing the normal TCP 3-way handshake. The normal 3-way handshake (Figure 3.3) has the client sending an initial SYN packet to the server. The server adds the half-open connection to its internal connection state table (syn queue) and then replies with a SYN-ACK. In a normal connection, the client then responds with an ACK. At this point the connection is established and communication can occur. In the classic SYN flood, this process is interrupted (Figure 3.4). Just as in a normal connection the attacker sends an initial SYN packet. To conceal the attacker, the source IP address is often forged. Upon receiving the SYN packet, the server adds the half-open connection to its internal connection state table (syn queue) and then replies with a SYN-ACK. This SYN-ACK goes to the forged source address and is generally discarded, meaning that the server will never receive the final ACK as it would in a normal connection establishment. The server maintains the half-open connection state information for a specific timeout. If a large number of half-open connections are initiated, the connection state table (syn queue) will become full and no further connections will be permitted to the server.
In many regards the classic SYN flood has been mitigated by the use of SYN cookies, increased state table size, and other mitigation techniques. The modern SYN flood sends the same packets but is substantially different from its historical predecessor. The major difference is the number of packets-per-second sent by the attacker. In the classic SYN flood, it was trivial to fill the connection state table, as it defaulted to just 1024 entries in many network stacks. An attacker could effectively DDoS a target by sending a few hundred packets per minute. The modern SYN flood generates SYN packets measured in millions of packets-per-second (PPS). This high volume of SYN packets creates two effects. The first is that load balancers, firewalls and other devices that manage connection state will use excessive CPU and may overflow their network state tables. The second, and more damaging behavior, is that many networks are not sized appropriately for a high volume of very small SYN packets. For instance, a router advertised as handling 1Gbps of data might only be able to handle 100Mbps of very tiny SYN packets. So although the target’s network connection appears underutilized, the network hardware itself may be under extreme pressure and unable to direct traffic in a timely manner. The packet capture below is a TCP SYN flood with randomized source IP addresses, targeting the HTTPS port on 192.168.0.10. The timestamp and packet size can be used to estimate the attack intensity (approx. 60,000 PPS)
03:05:29.246728 IP 158.191.135.9.49749 > 192.168.0.10.443: Flags [S], seq 52800378, win 512, length 0
03:05:29.246742 IP 133.238.17.124.49750 > 192.168.0.10.443: Flags [S], seq 1663210950, win 512, length 0
03:05:29.246763 IP 206.126.41.118.49751 > 192.168.0.10.443: Flags [S], seq 758194152, win 512, length 0
03:05:29.246786 IP 137.77.98.4.49753 > 192.168.0.10.443: Flags [S], seq 269771553, win 512, length 0
03:05:29.246799 IP 119.86.245.230.49754 > 192.168.0.10.443: Flags [S], seq 1530171648, win 512, length 0
03:05:29.246821 IP 227.52.64.150.49755 > 192.168.0.10.443: Flags [S], seq 306851430, win 512, length 0
03:05:29.246833 IP 158.209.242.234.49756 > 192.168.0.10.443: Flags [S], seq 1332043940, win 512, length 0
03:05:29.246858 IP 135.1.224.126.49758 > 192.168.0.10.443: Flags [S], seq 899324917, win 512, length 0
03:05:29.246880 IP 2.138.29.36.49759 > 192.168.0.10.443: Flags [S], seq 1208062333, win 512, length 0
03:05:29.246893 IP 253.35.171.28.49760 > 192.168.0.10.443: Flags [S], seq 1358791898, win 512, length 0
TCP Connection Flood
The TCP connection flood is a low bandwidth protocol DDoS attack that attempts to overwhelm connection limitations of the target device. This attack is specific to connection oriented services such as those using the TCP protocol (i.e., HTTP, HTTPS, SSH, SMTP, etc). The TCP connection flood is simplistic, with the client performing the full TCP 3-way handshake to establish a full ESTABLISHED connection. By doing this an attacker may be able to completely fill all available connection table entries, thus preventing legitimate customers from connecting. Since this attack completes the 3-way handshake it is not commonly spoofed, and the source IP address is often the IP address of a system in a botnet. A typical indicator of this attack type is a high number of connections in the ESTABLISHED state in the output of netstat (Linux and Windows). Often a single source IP address may have hundreds or thousands of open connections, and typically the connections are left idle, i.e., not sending/receiving any data from whatever application is being attacked. An example might be a web server with 20,000 connections in the ESTABLISHED state, yet the log files show no actual requests being performed.
03:18:46.649026 IP 10.1.10.250.50584 > 192.168.0.10.http: S 552149290:552149290(0) win 17922 <mss 8961,sackOK,timestamp 1386647176 0,nop,wscale 7>
03:18:46.649099 IP 192.168.0.10.http > 10.1.10.250.50584: S 2492797415:2492797415(0) ack 552149291 win 5792 <mss 1460,sackOK,timestamp 2753318625 1386647176,nop,wscale 7>
03:18:46.723639 IP 10.1.10.250.50584 > 192.168.0.10.http: . ack 1 win 141 <nop,nop,timestamp 1386647195 2753318625>
03:18:46.726798 IP 10.1.10.250.50585 > 192.168.0.10.http: S 2383907015:2383907015(0) win 17922 <mss 8961,sackOK,timestamp 1386647196 0,nop,wscale 7>
03:18:46.726825 IP 192.168.0.10.http > 10.1.10.250.50585: S 2489206418:2489206418(0) ack 2383907016 win 5792 <mss 1460,sackOK,timestamp 2753318705 1386647196,nop,wscale 7>
03:18:46.798548 IP 10.1.10.250.50584 > 192.168.0.10.http: . ack 2 win 141 <nop,nop,timestamp 1386647213 2753318695>
03:18:46.799870 IP 10.1.10.250.50585 > 192.168.0.10.http: . ack 1 win 141 <nop,nop,timestamp 1386647214 2753318705>
03:18:46.802977 IP 10.1.10.250.50586 > 192.168.0.10.http: S 2942092780:2942092780(0) win 17922 <mss 8961,sackOK,timestamp 1386647215 0,nop,wscale 7>
03:18:46.802998 IP 192.168.0.10.http > 10.1.10.250.50586: S 2501835850:2501835850(0) ack 2942092781 win 5792 <mss 1460,sackOK,timestamp 2753318775 1386647215,nop,wscale 7>
03:18:46.873142 IP 10.1.10.250.50585 > 192.168.0.10.http: . ack 2 win 141 <nop,nop,timestamp 1386647232 2753318775>
03:18:46.877548 IP 10.1.10.250.50586 > 192.168.0.10.http: . ack 1 win 141 <nop,nop,timestamp 1386647233 2753318775>
03:18:46.880701 IP 10.1.10.250.50587 > 192.168.0.10.http: S 1675212591:1675212591(0) win 17922 <mss 8961,sackOK,timestamp 1386647234 0,nop,wscale 7>
03:18:46.880723 IP 192.168.0.10.http > 10.1.10.250.50587: S 2491864230:2491864230(0) ack 1675212592 win 5792 <mss 1460,sackOK,timestamp 2753318855 1386647234,nop,wscale 7>
03:18:46.952330 IP 10.1.10.250.50586 > 192.168.0.10.http: . ack 2 win 141 <nop,nop,timestamp 1386647252 2753318855>
03:18:46.952764 IP 10.1.10.250.50587 > 192.168.0.10.http: . ack 1 win 141 <nop,nop,timestamp 1386647252 2753318855>
03:18:46.956170 IP 10.1.10.250.50588 > 192.168.0.10.http: S 3263953535:3263953535(0) win 17922 <mss 8961,sackOK,timestamp 1386647253 0,nop,wscale 7>
03:18:46.956189 IP 192.168.0.10.http > 10.1.10.250.50588: S 2495715443:2495715443(0) ack 3263953536 win 5792 <mss 1460,sackOK,timestamp 2753318935 1386647253,nop,wscale 7>
03:18:47.025264 IP 10.1.10.250.50587 > 192.168.0.10.http: . ack 2 win 141 <nop,nop,timestamp 1386647270 2753318925>
03:18:47.029859 IP 10.1.10.250.50588 > 192.168.0.10.http: . ack 1 win 141 <nop,nop,timestamp 1386647271 2753318935>
tcp 0 0 10.1.10.250:38342 192.168.0.10:80 ESTABLISHED
tcp 0 0 10.1.10.250:28401 192.168.0.10:80 ESTABLISHED
tcp 0 0 10.1.10.250:51944 192.168.0.10:80 ESTABLISHED
tcp 0 0 10.1.10.250:28632 192.168.0.10:80 ESTABLISHED
tcp 0 0 10.1.10.250:58742 192.168.0.10:80 ESTABLISHED
tcp 0 0 10.1.10.250:58205 192.168.0.10:80 ESTABLISHED
tcp 0 0 10.1.10.250:13832 192.168.0.10:80 ESTABLISHED
tcp 0 0 10.1.10.250:19448 192.168.0.10:80 ESTABLISHED
tcp 0 0 10.1.10.250:42705 192.168.0.10:80 ESTABLISHED
tcp 0 0 10.1.10.250:17252 192.168.0.10:80 ESTABLISHED
SlowLoris/R.U.D.Y.
The SlowLoris and RUDY DDoS attacks are low bandwidth attacks that attempt to exhaust target connection resources by submitting requests that never complete. This keeps the connection open indefinitely, slowly exhausting the ability of the target to receive new connections from legitimate clients. Both attacks are extensions of the TCP connection attack and work by attempting to fill all available connection table entries. What differentiates the SlowLoris/RUDY attacks from a mundane TCP connection flood is that the connection isn’t idle. Instead, the connecting client slowly sends a request that will never complete. By slowly sending data to the server, the attacker is able to keep the connection open and circumvent mitigations that function by closing idle connections. The indicators for these attacks are nearly identical to that of the TCP connection flood. Below is an example of the SlowLoris HTTP GET request.
SlowLoris GET Request
Connection to target.example.com 80 port [tcp/http] succeeded!
GET / HTTP/1.1
Host: targethost.example.com:80
<pause slightly>
X-<random string>: <random string>
<pause slightly>
X-<random string>: <random string>
<pause slightly>
X-<random string>: <random string>
<pause slightly>
X-<random string>: <random string>
<pause slightly>
….
Layer 7 Attacks
This course covers DDoS attacks that exploit weaknesses in specific applications and their related protocols (layer 7 in the OSI model). Upon completion of this course the participant will have an understanding of how these DDoS attacks work, why they are so effective and how they might be mitigated.
Definitions
LAMP Stack
This is a common model of a web services stack, named for the original components (Linux, Apache, MySQL, PHP). A modern LAMP stack may have different components (i.e., NGINX instead of Apache, or PostgreSQL instead of MySQL), but the general model is the same.
Attack Overview
Application-level attacks are a diverse collection of attacks intended to cause disruption to an environment by exploiting specific weaknesses or inefficiencies in an application. The key differentiator between application-level and other attacks is that the attack traffic is “in protocol,” meaning that the traffic is legitimate from a protocol perspective. By being “in protocol,” the attacks are often difficult to distinguish from legitimate traffic.
As discussed in previous courses, the primary model for communication on the Internet is the client/server model. In this model, clients initiate connections to a server, after which data is sent and received between the participants. This communication channel is managed by layer 4 protocols such as TCP and UDP. Above this layer of communication are application layer protocols such at HTTP, DNS, SMTP and many more. It is the application level protocols that are responsible for the actual exchange of information between session participants. Figure 4.1 illustrates an example of the HTTP protocol commonly used to request and receive data on the World Wide Web (WWW) using a web browser.
Application-level attacks can take a variety of forms, but are generally more focused than volumetric or protocol attacks. Due to the “in protocol” nature of these attacks, they can also be used to cause impact at a deeper level than other attacks. Figure 4.2 summarizes the environmental impact of each attack type. Note how application-level attacks compare to the other attack types. The focused nature of application-level attacks also allows an attacker to target specific inefficient or vulnerable areas of an application such as dynamic content, searches or user login functionality.
Figure 4.3 illustrates a common HTTP request flood, one of the most trivial application-level attacks. The targeted system has a finite amount of CPU resources and as a result can process a respectable 10,000 web page loads per second. An HTTP request flood is in essence the same as a person pressing the “reload” button in their web browser repeatedly. You might expect that one person on one computer might easily be able to reload a web page once per second. Now imagine that one person could replicate that behavior 10,000 times in one second – this is effectively what happens when a botnet performs an HTTP request flood. With the attack traffic overwhelming the target, legitimate requests are discarded or delayed.
In the previous example, the application-level DDoS attack originates from a botnet. However, a botnet isn’t specifically required to perform such an attack. An example of such an attack vector is the exploitation of vulnerabilities (such as XSS) that cause all visitors to a website to unwittingly send requests to the target. This method reduces the cost to the attacker, and provides a pool of attack nodes that may be much larger and more distributed than any botnet.
Attack Impact
Increased Resource Usage on Application Servers
Application servers that are responsible for responding to a request will often experience a sudden increase in CPU or memory utilization. This is often exacerbated by an attacker targeting specific resources that typically require more CPU or memory.
Increased Resource Usage on Database Systems
Application-level attacks often extend beyond the specific reach of the attacker’s request. In a classic LAMP environment, the attacker’s request is received and then responded to by a web server. However, their request may access data and resources stored on other systems, such as a database server. This behavior can cause increased resource usage on these supporting systems. Attackers often attempt to exploit this behavior by targeting components that are difficult to scale to higher capacity, such as monolithic relational databases.
Exhaust Storage on Devices
Many applications write data to disk as part of the normal operation of the system. Examples include application log files, session data, or user uploaded content. A DDoS attack may exhaust storage resources, causing system instability and failures. Application log files can be particularly troublesome as they are often required for troubleshooting both traditional issues and DDoS incidents.
Increase Cloud Costs
An auto-scaling cloud environment may be less susceptible to application-level attacks due to the environment’s ability to automatically create new resources (e.g., bandwidth) to handle the additional requests. However, these resources aren’t free, and the DDoS attack will have a direct financial impact by increasing cloud hosting fees to process the bad requests.
Reach Arbitrary Application Limits
Many applications have default configuration values that affect the performance of the application. As an example, most web servers have a finite number of worker threads, that when exhausted will cause client requests to be delayed or fail. Likewise, a database may only allow a specific number of licensed connections. Application-level attacks are very effective at triggering poor performance by exceeding application limits. So although the environment may appear idle, client performance is significantly impacted due to a configuration limit being reached.
Why Are Application-Level DDoS Attacks So Effective?
Difficult to Diagnose
Application-level DDoS attacks are often low bandwidth attacks that may go unnoticed. Additionally, their impact may be less obvious as they penetrate deeper into the environment and affect resources that may seem unrelated. For example, high CPU usage on a web server may be a very obvious indicator of an application-level attack. However, similar high usage on a database may be misdiagnosed as a performance problem, software bug, or misconfiguration.
Mimic Real User Behavior
Identifying and mitigating an application-level attack can be challenging as the traffic may appear legitimate. A skilled attacker may construct an attack that goes to great effort to masquerade as legitimate. This may include mimicking of real user behavior in navigating a website, including realistic pauses and browser interactions. Extensive analysis of traffic patterns and anomaly detection may be required to identify these attacks.
Finite Resources
With few exceptions, most organizations have a finite amount of CPU, memory and disk I/O on their servers. An Application-level DDoS attack crafted to exhaust CPU or memory on these servers takes advantage of this limitation. Increasing these resources on servers will often require provisioning new systems, which can be costly and time consuming.
Requires Minimal Attacker Resources
A skilled attacker can create a DDoS attack by targeting inefficient areas of the environment. This generally requires significantly less attacker resources (as little as one computer) than those required to carry out volumetric or protocol attacks.
Dynamic Threat
The environments run by most organizations are dynamic, with new applications and features continually being created. Each new application or feature is an area that an attacker might leverage for a DDoS attack. The dynamic nature of applications stands in contrast with the network infrastructure, which may only see a full refresh every 3-5 years and in the meantime has to settle for small incremental improvements. So although an environment may seem safe today, each new application change opens up the possibility of a new DDoS risk. The areas of risk and the number of permutations of application-level attacks are essentially limitless.
Internet is a Massive Attack Resource
Regardless of how large an organization’s environment might be, it is dwarfed by the resources of the entire Internet. A large organization may have 10,000 servers with 160,000 CPU cores and 320TB of memory, but this same capacity could be achieved with a medium-sized botnet of just 100,000 nodes. So although most application-level attacks exhaust nearly an equal amount of resources on the attacker side, the available resource pool is much larger.
Mitigation Strategies
Blocking with On-Premises Devices
Blocking application-level DDoS attacks with on-premises devices such as IDP/IPS and firewalls may be successful due to the low bandwidth nature of these attacks. This is in contrast to volumetric DDoS attacks where the bottleneck is upstream and outside the control of the organization. Also, unlike volumetric and protocol attacks, nearly all (TCP specifically) application-level attacks do not have spoofed source IP addresses. As a result, simple attacks can be blocked with simple firewall rules. More advanced attacks, and those sourced from very large botnets, will require purpose-built DDoS mitigation hardware to properly identify and automatically block the attack traffic.
Blocking Upstream by the ISP
This method of mitigation is often ineffective for application-level DDoS attacks. If contacted, the technical support arm of most ISPs will add simple rules to block specific traffic before it reaches the target network. This approach can be effective at mitigating simplistic attacks, but will often be unable to mitigate more complex scenarios. The limitation is related to the minimal filtering capabilities offered by most ISPs. For example, most ISPs will be happy to filter all traffic to or from a specific IP address, or all traffic using a certain protocol. But this is a very blunt tool and may not be granular enough to block DDoS traffic while at the same time allowing legitimate traffic. The same level of filtering is available in on-premises firewalls and routers with the added benefit of being under the control of the organization. In addition, unless they are given decryption keys, the ISP is unable to inspect the content of traffic using encrypted protocols like HTTPS, making identification and mitigation more difficult.
Traffic Analytics
Due to the low bandwidth nature of most application-level attacks, one of the greatest challenges is identifying that an attack is actually occurring. Tools that analyze traffic patterns and look for anomalies based on historical data can be invaluable in making this determination.
Null Routing the Target IP
This method of mitigation is generally not recommended for application-level DDoS attacks as it blocks all traffic to the target. This option is very imprecise and will affect both legitimate and attack traffic destined for the target IP.
Hide Behind a Large CDN
Traditional content delivery networks (CDNs) function by locating web server caches throughout the world to deliver content to the Internet. A CDN typically works as an HTTP(s) proxy where all requests are made to the CDN server, which subsequently initiates a private connection to the organization’s server to obtain the data. With regard to application-level attacks, using a CDN may help mitigate some attacks (Figure 4.4). Specifically, requests for resources located on the CDN, such as static web objects, will be fulfilled and absorbed by the massive CDN infrastructure. However, dynamic content such as user login requests, content searches or similar non-cacheable data, will be passed by the CDN to the organization’s backend servers resulting in a DDoS attack. Moreover, this type of mitigation solution will only protect services supported by the CDN (generally HTTP and HTTPS).
Dedicated Mitigation Services
A dedicated DDoS mitigation service, like that provided by Incapsula, is often the most effective approach to solving application-level attacks. These services are similar to the CDN approach (Figure 4.4) mentioned earlier, but with advanced capabilities specific to identifying and blocking DDoS traffic. Much like a CDN, a reputable mitigation service has a massive globally distributed network of scrubbing centers capable of blocking large DDoS attacks.
Application Blocking
For smaller application-level attacks, an organization may be able to mitigate the attack by disabling the feature being targeted. For example, if the attacker is targeting a search feature on the site that is inefficient, it may be better to temporarily disable that feature in order to maintain a proper level of performance for the other components on the site.
Examples
HTTP/HTTPS request flood
HTTP and HTTPS are the application protocols responsible for sending and receiving data on the World Wide Web. These protocols use the client server model, with the client, or browser, submitting a request to a server for a specific resource. The server then responds with the requested data or an error message. Figure 4.1, above, illustrates an example of an HTTP request and response communication pattern. As with all application-level attacks, there are a massive number of permutations possible. Some examples include:
- General High Request Rate
The simplest of all application-level attacks is to send “in protocol” requests at a rate higher than the target is able to respond. In this way the attacker tries to overwhelm the target and exhaust all resources in an effort to prevent legitimate traffic from accessing the target. - Exploit Search Functionality
Many websites have functionality that allows a visitor to search for content. For example, an e-commerce website might have a product search feature, or an airline booking website may have a flight search capability. Because this data is non-cacheable on a CDN, the request is passed through to the backend servers where it is then processed. Depending on how the search functionality is implemented, this may require database queries or access to other APIs and systems all of which are likely to require substantial resources. If the search feature is critical to the business, an attacker may be able to damage the business by targeting this specific component efficiently. - Exploit User Login Functionality
Many websites have functionality that allows a visitor to login to an account. This functionality might be found in online banking portals, e-commerce sites, and online gaming networks, just to name a few. As with all dynamic content, the login functionality is non-cacheable by a CDN, and will be passed through to the backend servers for processing. The way in which login functionality is implemented varies substantially from organization to organization, but often requires a database lookup of various customer data and the use of encryption algorithms for password verification. These processes tend to use a disproportionate amount of resources as compared to “normal” requests, and can be leveraged by attackers to increase the effectiveness of their attacks. - Large Objects
HTTP and HTTPS requests are generally very small (100’s of bytes), however the responses may be very large. By targeting heavy resources on a website, an attacker may be able to exhaust outbound Internet bandwidth or raise the target’s bandwidth costs by increasing network usage. An example of this behavior might be the repeated request by an attacker for a large PDF document located on the website. - Uploading Content
Some websites give users or the public the ability to upload arbitrary content. Websites that allow uploads by the general public raise their risk of a DDoS attack. An attacker can exploit this functionality to exhaust storage space on the receiving system, or raise storage costs by uploading junk data. - Site Crawling
To mimic user behavior and obfuscate the DDoS attack, an attacker may coordinate a large botnet to “crawl” a website in a manner similar to human visitors. The attack attempts to overwhelm the computer resources of the target and thwart mitigation attempts by making the requests indistinguishable from legitimate requests. - Form Data Flooding
Any web form that accepts user provided data is susceptible to a more general type of flooding. Although an attacker might not know the details of how the form data is processed, nearly all form submissions follow the same behavior. A client provides data, which is submitted to the server, which in turn executes code to do “something” with that data. The “something” may be to put the data in a database, send an email, register a new user account, or any number of possible scenarios.
Below is a section of web server logs showing unusual behavior with respect to the target server. As web traffic patterns are unique to each organization, spotting anomalies can be challenging. Hardware platforms exist that can assist in analyzing traffic, and some DDoS mitigation vendors (including Incapsula) use this capability.
10.100.0.10 – – [06/Mar/2016:04:07:05 +0000] “GET /download/whitepaper-v1.pdf HTTP/1.1” 200 4050194
10.224.53.82 – – [06/Mar/2016:04:07:05 +0000] “GET / HTTP/1.1” 200 524
10.112.192.37 – – [06/Mar/2016:04:07:05 +0000] “GET /download/whitepaper-v1.pdf HTTP/1.1” 200 4050194
10.81.18.17 – – [06/Mar/2016:04:07:06 +0000] “GET /download/whitepaper-v1.pdf HTTP/1.1” 200 4050194
10.187.155.114 – – [06/Mar/2016:04:07:06 +0000] “GET /faq HTTP/1.1” 200 8532
10.155.79.59 – – [06/Mar/2016:04:07:06 +0000] “GET / HTTP/1.1” 200 524
10.92.174.1 – – [06/Mar/2016:04:07:07 +0000] “GET /download/whitepaper-v1.pdf HTTP/1.1” 200 4050194
10.18.186.58 – – [06/Mar/2016:04:07:07 +0000] “GET /cart/fetch HTTP/1.1” 200 1492
10.52.188.48 – – [06/Mar/2016:04:07:07 +0000] “GET /download/whitepaper-v1.pdf HTTP/1.1” 200 4050194
10.19.83.193 – – [06/Mar/2016:04:07:07 +0000] “GET /download/whitepaper-v1.pdf HTTP/1.1” 200 4050194
10.73.66.15 – – [06/Mar/2016:04:07:07 +0000] “GET /download/whitepaper-v1.pdf HTTP/1.1” 200 4050194
10.99.28.45.6 – – [06/Mar/2016:04:07:08 +0000] “GET /download/whitepaper-v1.pdf HTTP/1.1” 200 4050194
10.173.85.62 – – [06/Mar/2016:04:07:08 +0000] “GET / HTTP/1.1” 200 524
10.92.29.235 – – [06/Mar/2016:04:07:08 +0000] “GET /about HTTP/1.1” 200 4492
10.184.49.62 – – [06/Mar/2016:04:07:08 +0000] “GET /download/whitepaper-v1.pdf HTTP/1.1” 200 4050194
10.88.24.63 – – [06/Mar/2016:04:07:08 +0000] “GET /download/whitepaper-v1.pdf HTTP/1.1” 200 4050194
UDP DNS request flood
DNS is the application protocol used by computers to translate human readable names like www.example.com to an IP address. All organizations have a public DNS server to allow public users on the Internet to resolve their hostnames. This protocol uses the client-server model, with the client requesting the IP address for a specific hostname. If the DNS server is unreachable or overloaded, the client will not be able to obtain an IP address, and as a result will not be able to reach the resource. By overwhelming a DNS server, an attacker may be able to cause an outage for all hostnames for which the attacked server acts as the authoritative name server. As DNS primarily uses UDP, this application-level DDoS attack often has a forged source IP address. Below is a packet capture for a sample UDP DNS request flood. As with any application-level attack, identifying differences in traffic patterns is critical for successful mitigation. The packet capture shows that one specific DNS record is being repeatedly queried at an extremely high rate. The timestamp and packet size can be used to estimate the attack intensity (approx. 80,000 queries/second).
02:58:11.727630 IP 10.49.41.63.4292 > 192.168.0.10.domain: 28956+ A? www.example.com. (36)
02:58:11.727637 IP 10.5.52.6.4592 > 192.168.0.10.domain: 24992+ A? www.example.com. (36)
02:58:11.727640 IP 10.91.147.52.44492 > 192.168.0.10.domain: 5342+ A? www.example.com. (36)
02:58:11.727642 IP 10.148.99.228.24022 > 192.168.0.10.domain: 61639 PTR? 219.3.113.10.in-addr.arpa. (74)
02:58:11.727659 IP 10.69.98.28.29242 > 192.168.0.10.domain: 5821+ A? www.example.com. (36)
02:58:11.727662 IP 10.59.59.191.32482 > 192.168.0.10.domain: 58911+ A? www.example.com. (36)
02:58:11.727690 IP 10.253.152.29.19323 > 192.168.0.10.domain: 19425+ MX? testdomain.com. (49)
02:58:11.727695 IP 10.81.92.11.8391 > 192.168.0.10.domain: 24811+ A? www.example.com. (36)
02:58:11.727698 IP 10.92.198.59.23931 > 192.168.0.10.domain: 19425+ A? www.example.com. (36)
02:58:11.727728 IP 10.58.59.251.8244 > 192.168.0.10.domain: 2284+ A? www.example.com. (36)
02:58:11.727738 IP 10.22.199.192.38191 > 192.168.0.10.domain: 31132+ A? www.example.com. (36)
02:58:11.727762 IP 10.31.135.66.43134 > 192.168.0.10.domain: 2991+ A? www.example.com. (36)
02:58:11.727763 IP 10.31.49.19.6243 > 192.168.0.10.domain: 29146+ A? www.example.com. (36)
Leave a Comment