Ch07 (Denial of Service Attacks)
Ch07 (Denial of Service Attacks)
Denial-of-service
Denial of service (DoS) an action that prevents or impairs the authorized use of
networks, systems, or applications by exhausting resources such as central
processing units (CPU), memory, bandwidth, and disk space
Attacks (overload or invalid request services that consume significant resources)
network bandwidth
system resources (SYN Spoofing)
application resources
Have been an issue for some time (25% of respondents to an FBI survey)
2
This chapter explores denial of service attacks, their definition, the various
forms they take, and defenses against them. Denial of service is a form of attack
on the availability of some service. In the context of computer and communications
security, the focus is generally on network services that are attacked over their
network connection. From this definition you can see that there are several
categories of resources that could be attacked:
• network bandwidth - relates to the capacity of the network links connecting a
server to the wider Internet
• system resources - typically aims to overload or crash its network handling
software
• application resources - aim to overload the capabilities of a server and limit
its ability to respond to requests from other users
Denial of Service attacks have been a problem for many years. The 2006 CSI/FBI
Computer Crime and Security Survey states that 25% of respondents experienced some
form of denial of service attack in the previous 12 months. This value has varied
between 25% and 40% over the previous 8 years of surveys.
SYN spoofing
Common DoS attack
Attacks the ability of a server to respond to future connection requests by
overflowing the TCP tables used to manage them
Legitimate users are denied access to the server
Hence an attack on system resources, specifically the network handling code in the
operating system
7
Along with the basic flooding attack, the other common classic denial of service
attack is the SYN spoofing attack. This attacks the ability of a network server to
respond to TCP connection requests by overflowing the tables used to manage such
connections. This means future connection requests from legitimate users fail,
denying them access to the server. It is thus an attack on system resources,
specifically the network handling code in the operating system.
HTTP-based attacks
Attempts to monopolize by sending HTTP requests that never complete
Eventually consumes Web server’s connection capacity
Utilizes legitimate HTTP traffic
Spidering: Bots starting from a given HTTP link and following all links on the
provided Web site in a recursive way
Existing intrusion detection and prevention solutions that rely on signatures to
detect attacks will generally not recognize Slowloris
Reflection attacks
Attacker sends packets to a known service on the intermediary with a spoofed source
address of the actual target system
When intermediary responds, the response is sent to the target
“Reflects” the attack off the intermediary (reflector)
Goal is to generate enough volumes of packets to flood the link to the target
system without alerting the intermediary
The basic defense against these attacks is blocking spoofed-source packets
16
Reflection and amplification attacks use network systems functioning normally. The
attacker sends a network packet with a spoofed source address to a service running
on some network server, which responds to this packet, sending it to the spoofed
source address that belongs to the actual attack target. If the attacker sends a
number of requests to a number of servers, all with the same spoofed source
address, the resulting flood of responses can overwhelm the target’s network link.
The fact that normal server systems are being used as intermediaries, and that
their handling of the packets is entirely conventional, means these attacks can be
easier to deploy, and harder to trace back to the actual attacker. Ideally the
attacker would like to use a service that created a larger response packet than the
original request. This allows the attacker to convert a lower volume stream of
packets from the originating system into a higher volume of packets from the
intermediary directed at the target. Common UDP services are often used for this
purpose. Another variant of reflection attack uses TCP SYN packets, and exploits
the normal 3-way handshake used to establish a TCP connection. Fundamental to the
success of reflection attacks is the ability to create source spoofed packets. If
filters are in place which block source spoofed packets, then these attacks are
simply not possible.
Reflection attacks
Reflection attacks
Further variation creates a self-contained loop between intermediary and target
(attacker spoofs using port 7 requiring echoes)
18
A further variation of the reflector attack establishes a self-contained loop
between the intermediary and the target system. Originally the UDP echo service was
used for this, if running on both systems. The attacker would send a large UDP
packet to the echo service on the intermediary, using a spoofed source address and
port for the echo service on the target system. The intermediary would respond with
a packet to the echo service on the target. When the target received this, it would
reply in turn to the intermediary. This process would continue with the packet
being echoed back and forth between these systems, until a packet was discarded or
otherwise failed to arrive at its destination. If the attacker kept generating a
low volume of the original source spoofed packets, this attack could be sustained
for long periods, flooding the link between the intermediary and the target. The
echo and chargen services, and other similar diagnostic network services can be
used to create such reflection loops. Figure 8.5 illustrates this attack. Whilst
very effective if possible, this type of attack is fairly easy to filter for, since
the combinations of service ports used should never occur in normal network
operation.
Amplification attacks
Can take advantage of broadcast address of some network
20
Amplification attacks are a variant of reflector attacks and also involve sending a
packet with a spoofed source address for the target system to intermediaries. They
differ in generating multiple response packets for each original packet sent. This
can
be achieved by directing the original request to the broadcast address for some
network.
As a result, all hosts on that network can potentially respond to the request,
generating a flood of responses as shown in Figure 7.7 . It is only necessary to
use
a service handled by large numbers of hosts on the intermediate network. A ping
flood using ICMP echo request packets was a common choice, since this service
is a fundamental component of TCP/IP implementations and was often allowed
into networks. The well-known smurf DoS program used this mechanism and was
widely popular for some time. Another possibility is to use a suitable UDP service,
such as the echo service. The fraggle program implemented this variant. Note that
TCP services cannot be used in this type of attack; because they are connection
oriented, they cannot be directed at a broadcast address. Broadcasts are inherently
connectionless.
The best additional defense against this form of attack is to not allow directed
broadcasts to be routed into a network from outside. Indeed, this is another
longstanding
security recommendation, unfortunately about as widely implemented as
that for blocking spoofed source addresses. If these forms of filtering are in
place,
these attacks cannot succeed. Another defense is to limit network services like
echo
and ping from being accessed from outside an organization. This restricts which
services could be used in these attacks, at a cost in ease of analyzing some
legitimate
network problems.
Attackers scan the Internet looking for well-connected networks that do allow
directed broadcasts and that implement suitable services attackers can reflect off.
These lists are traded and used to implement such attacks.
Attack prevention
Rate controls in upstream distribution nets
On specific packets types e.g. some ICMP, some UDP, TCP/SYN
Impose limits
Use modified TCP connection handling
Server sends SYN cookies when table full (reconstruct table data from the cookie
from legit clients)
Sr selective or random drop when table full
23
A critical component of many denial of service attacks, is the use of spoofed
source addresses. One of the fundamental, and longest standing, recommendations for
defense against these attacks is to limit the ability of systems to send packets
with spoofed source addresses, cf. RFC 2827. This filtering needs to be done as
close to the source as possible, by routers or gateways knowing the valid address
ranges of incoming packets. Typically this is the ISP providing the network
connection for an organization or home user. Regrettably, despite this being a
well-known recommendation, many ISPs still do not perform this type of filtering.
Any defenses against flooding attacks need to be located back in the Internet
cloud, not at a target organization’s boundary router, since this is usually
located after the resource being attacked. The filters must be applied to traffic
before it leaves the ISP’s network, or even at the point of entry to their network.
Some attacks using particular packet types, such as ICMP floods, or UDP floods to
diagnostic services, can be throttled by imposing limits on the rate at which these
packets will be accepted.
It is possible to specifically defend against the SYN spoofing attack by using a
modified version of the TCP connection handling code. Instead of saving the
connection details on the server, critical information about the requested
connection is cryptographically encoded in a “cookie” that is sent as the server’s
initial sequence number. Typically this technique is only used when the table
overflows. Alternatively, the system’s TCP/IP network code can be modified to
“selective drop” or “random drop” an entry for an incomplete connection from the
TCP connections table when it overflows, allowing a new connection attempt to
proceed.
Attack prevention
Block IP directed broadcasts
Block suspicious services and combinations
Manage application attacks with a form of graphical puzzle (captcha) to distinguish
legitimate human requests
Use mirrored and replicated servers when high-performance and reliability is
required
24
The best defense against broadcast amplification attacks is to block the use of IP
directed broadcasts. This can be done either by the ISP, or by any organization
whose systems could potentially be used as an intermediary. As we noted earlier in
this chapter, this along with anti-spoofing filters are long standing security
recommendations that all organization’s ought to implement. More generally,
limiting or blocking traffic to suspicious services, or combinations of source and
destination ports, can restrict the types of reflection attacks that can be used
against an organization.
Defending against attacks on application resources generally requires modification
to the applications targeted, such as web servers. Defenses may involve attempts to
identify legitimate, generally human initiated, interactions from automated DoS
attacks. These often take the form of a “graphical puzzle”, which is easy for most
humans to solve, but difficult to automate.
Beyond these direct defenses against denial of service attack mechanisms, overall
good system security practices should be maintained. The aim is to ensure that your
systems are not compromised and used as zombie systems. Suitable configuration and
monitoring of high performance, well-connected servers, is also needed to help
ensure they don’t contribute to the problem as potential intermediary servers.
If an organization is dependent on network services, they should consider mirroring
and replicated these servers over multiple sites with multiple network connections.
This is good general practice for high performance servers, providing greater
levels of reliability and fault tolerance in general, not just as a response to
these types of attack.
Responding to attacks
Identify type of attack
Capture and analyze packets
Design filters to block attack traffic upstream
Or identify and correct system/application bug
Have ISP trace packet flow back to source
May be difficult and time consuming
Necessary if planning legal action
Implement contingency plan
Switch to alternate backup servers
Commission new servers at a new site with new addresses
Update incident response plan
25
When a denial of service attack is detected, the first step is to identify the type
of attack and hence the best approach to defend against it. Typically this involves
capturing packets flowing into the organization, and analyzing them looking for
common attack packet types. This may be done by organizational personnel or ISP,
depending on relevant expertise. From this analysis the type of attack is
identified, and suitable filters designed to block the flow of attack packets.
These have to be installed by the ISP on their routers. If the attack targets a bug
on a system or application, rather than high traffic volumes, then this must be
identified, and steps taken to correct it to prevent future attacks.
The organization may also wish to ask their ISP to trace the flow of packets back
in an attempt to identify their source. However if spoofed sources addresses are
used, this can be difficult and time-consuming. Whether this is attempted may well
depend on whether the organization intends to report the attack to the relevant law
enforcement agencies. In such a case, additional evidence must be collected and
actions documented to support any subsequent legal action.
In the case of an extended, concerted, attack, it may not be possible to
successfully filter enough of the attack packets to restore network connectivity.
In such cases the organization needs a contingency strategy to switch to alternate
backup servers, or to rapidly commission new servers at a new site with new
addresses, in order to restore service. Without forward planning to achieve this,
the consequence of such an attack will be extended loss of network connectivity.
Following the immediate response, the organization’s incident response policy may
specify further steps that are taken to respond to contingencies like this.
Responding to attacks
Good incidence response plan
Details on how to contact technical personal for ISP
Needed to impose traffic filtering upstream
Details of how to respond to the attack
Implement anti-spoofing, directed broadcast, and rate limiting filters
Ideally have network monitors and IDS to detect and notify abnormal traffic
patterns
26
In order to successfully respond to a denial of service attack, a good incident
response plan is needed, including details of how to contact technical personal
for your Internet Service Provider(s). Denial of service attacks, particularly
flooding attacks, can only be filtered upstream of your network connection. The
plan should also contain details of how to respond to the attack. The division of
responsibilities between organizational personnel and the ISP will depend on the
resources available, and technical capabilities of the organization.
Within an organization you should have implemented the standard anti-spoofing,
directed broadcast, and rate limiting filters we discuss earlier in this chapter.
Ideally, you should also have some form of automated network monitoring and
intrusion detection system (IDS) running, so personnel will be notified should
abnormal traffic be detected.
Summary
Introduced denial of service (DoS) attacks
Classic flooding and SYN spoofing attacks
ICMP, UDP, TCP SYN floods
Distributed denial of service (DDoS) attacks
Reflection and amplification attacks
Defenses against DoS attacks
Responding to DoS attacks
27
Chapter 8 summary.