30
Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Embed Size (px)

Citation preview

Page 1: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Denial of Service

Serguei A. Mokhov

SOEN321 - Fall 2004

Page 2: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Contents

• DOS overview

• Distributed DOS

• Defending against DDOS– egress filtering

• References

Page 3: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Goal of an Attacker

• Reduce of an availability of a system to legit users, so that the system is unable to provide the services it is supposed to provide.

• Deny you use of your own resources.

• Hence, the Denial of Service, or DOS.

Page 4: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

DOS Types

• Greatly vary: from program/system overloading, to disk space usage, to network load.

• Types:– Memory eaters

– Bandwidth cloggers

– System crashers

Page 5: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Simplest DOS Examples

• Causing a computer system running out of disk space so it crashes (feeding some noisy programs so their logs fill up the space, creating directories, eating up virtual memory).– A host fs DoS : UNIX : while true; do mkdir ... cd ... done

• Sending a database with deliberately slow queries.• Worms:

– Eating up machine resources.– Clogging the network with enormous number of packets.

• "Teardrop" and "Ping of death" are system crashers.

• Starting up processes in an infinite loop– Fork bomb (infinite fork() or spawning new threads)– Open browser windows in an infinite loop (JavaScript)

Page 6: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Distributed DOS

• DOS over the networks, such as the Internet.• Multiple compromised hosts, zombies, (say

infected with some Trojans or worms) from all over the world target a network or even a single IP with loads of malformed packets.

• Worm’s port scanning.• Denial of Service Attacks, with the backbone, the

multiplication strategy.

Page 7: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Some Stats• http://www.securitydocs.com/library/2576:• From a latest important report “2003: CSI/FBI [1] Computer Crime and

Security Survey”, we know the following information about the DoS/DDoS attacks in America: – 42 percent of respondents of the survey suffered the Denial of Service (DoS) attacks

(from 1999 to 2002, only 27-40 percent of respondents suffered the DoS attacks). – 111 of 398 respondents reported the financial losses caused by the DoS attacks. – The total losses by DoS attacks was over 65 million US dollars, or average losses

1.427 million dollars, it is the 4.8 times of average losses on 2002 (from 2000 to 2002, the average losses caused by the DoS attacks are only 0.108, 0.122, 0.297 million dollars respectively).

– In “WWW Site Incidents: What Types of Unauthorized Access or Misuse”, 35% are Denial of Service attacks.

– In addition, on the 2001’s version of the CSI/FBI Survey, when the DoS attacks increased by an astonishing 33 percent on network, where firewalls had been installed in 90 percent of instances.

– DoS/DDoS attacks are also easy to launch. For example, a teenager using very simple DoS tools managed to cripple the web sites of large E-Commerce companies like Yahoo and Amazon, during a series of DoS/DDoS attacks in February 2000

Page 8: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Smurf• http://www.securitydocs.com/library/2576• Smurf attacks are one of the most devastating DoS attacks.• See the Figure 1, in the Smurf (ICMP Packet Magnification) attack, the attacker

sends an ICMP echo request (ping) to a broadcast address.• The source address of the echo request is the IP address of the victim (uses the

IP address of the victim as the return address).• After receiving the echo request, all the machines in the broadcast domain send

echo replies (responses) to the victim’s IP address (see the Figure 2).• Victim will crash or freeze when receiving larger-sized packet flood from many

machines.

• Smurf attack uses bandwidth consumption to disable a victim system’s network resources.

• It accomplishes the consumption using amplification of the attackers bandwidth.

• If the amplifying network has 100 machines, the signal can be amplified 100 times, so the attacker with relatively low bandwidth (such as the 56K modem) can flood and disable a victim system with much higher bandwidth (such as the T1 connection).

Page 9: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Smurf(http://www.securitydocs.com/library/2576)

Page 10: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Fraggle

• The Fraggle (UDP Packet Magnification) attack is the cousin of Smurf attack.

• Fraggle attack uses UDP echo packets in the same fashion as the ICMP echo packets in Smurf attack.

• Fraggle usually achieves a smaller amplification factor than Smurf, and UDP echo is a less important service in most network than ICMP echo, so Fraggle is much less popular than Smurf.

Page 11: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

SYN Flood• The SYN flood attack was considered to be the most devastating DoS attack method before

the Smurf was discovered.• This method uses resource starvation to achieve the DoS attack.• See the figure next slide, during a normal TCP handshake, a client sends a SYN request to

the server; then the server responds with a ACK/SYN to the client, finally the client sends a final ACK back to the server.

• But in a SYN flood attack, the attacker sends multiple SYN requests to the victim server with spoofed source addresses for the return address.

• The spoofed addresses are nonexistent on network.• The victim server then responds with an ACK/ SYN back to the nonexistent address.• Because no address receives this ACK/SYN, the victim server just waits for the ACK from

the client.• The ACK never arrives, and the victim server eventually times out. If the attacker sends

SYN requests often enough, the victim server’s available resources for setting up a connection will be consumed waiting for these bogus ACKs.

• These resources are usually low in number, so relatively few bogus SYN requests can create a DoS event.

Page 12: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

DNS Attacks

• On earlier versions of BIND (Berkeley Internet Name Domain), attackers could effectively poison the cache on a DNS server that was using recursion to look up a zone not served by the name server.

• Once the cache was poisoned, a potential legitimate user would be directed to the attacker’s network or a nonexistent network.

• This problem has been corrected with later versions of BIND.

Page 13: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

DDOS Attacks

• DDoS attack is a large-scale, coordinated attack on the availability of Internet services and resources.

• It launches indirectly the DoS attacks through many compromised computers (they often are called “secondary victims” or “zombies”).

• The Internet services and resources under the attack are “primary victims”.• DDoS attack is generally more effective to bring down huge corporate sites

than DoS attacks.• A typical DDoS attack consists of master, slave, and victim – master being the

attacker, slave being the compromised systems and victim of course being the attacker’s target.

• The Types of DDoS Attacks• Generally, DDoS attacks are a combination of four types:

– Trinoo,– TFN,– TFN2K,– Stecheldraht.

Page 14: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Trinoo

• Trinoo is essentially a master/slave (called Masters and Daemons) programs that coordinate with each other to launch a UDP DoS flood against a victim machine.

• See the figure, in a typical scenario, the following steps take place as the Trinoo DDoS network is set up:

– Step 1 The attacker, using a compromised host, compiles a list of machines that can be compromised. Most of this process is done automatically from the compromised host, because the host stores a mount of information including how to find other hosts to compromise.

– Step 2 As soon as the list of machines that can be compromised has been compiled, scripts are run to compromise them and convert them into the Trinoo Masters or Daemons. One Master can control multiple Daemons. The Daemons are the compromised hosts that launch the actual UDP floods against the victim machine.

– Step 3 The DDoS attack is launched when the attacker issues a command on the Master hosts. The Masters instruct every Daemon to start a DoS attack against the IP address specified in the command, many DoSs comprise the DDoS attack.

Page 15: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Trinoo

Page 16: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

TFN/TFN2K• TFN (Tribal Flood Network), like Trinoo, is essentially a master/slave (called Clients and

Daemons) programs that coordinate with each other to launch a SYN flood against a victim machine, see the figure.

• The TFN Daemons, however, are capable of a larger variety of attacks, including ICMP flooding, SYN flooding, and Smurf attacks, so TFN attack is more complicated than the Trinoo attack.

• TFN2K introduces some enhancements to the original TFN tool.• TFN2K attacks are launched using spoofed IP addresses, making detecting the source of

the attacks more difficult.• TFN2K attacks are not just simple floods like those in TFN.• They also include attacks exploiting the operating system’s vulnerabilities to malformed

or invalid packets, which can cause the victim machines to crash.• The TFN2K attackers no longer need to execute commands by logging into the Client

machine, they can execute these commands remotely.• The communication between the Clients and the Daemons is no longer limited to simply

ICMP echo replies, it can take place over a larger variety of mediums, such as TCP and UDP.

• So TFN2K attacks are more dangerous and also more difficult to detect.

Page 17: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

TFN/TFN2K

Page 18: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Stacheldraht

• Stacheldraht code is very similar to the Trinoo and TFN, but Stacheldraht allows the communication between the attacker and the Masters (called Handlers, see the figure) to be encrypted; the Agents can upgrade their code automatically, can launch different types of attacks such as ICMP floods, UDP floods and SYN floods.

Page 19: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Stacheldraht

Page 20: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

SYN Flood

Page 21: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Defending against DDOS

• Nearly impossible.– Just tracing and stopping.– Tracing is often difficult as the source IP addresses are forged.– Even if you manage to trace, it doesn’t mean you’d get to the responsible

behind the attack.• Need out-of-band channels to communicate to the flooding network

admins the problem.• Shut down until the attack “wears out”, then bring the machines up

again.• Why? Because of the nature of networking.

– Servers listen on ports for connections– Authorization and access control happen after the connection have been

made.– Example: open TCP connection and don’t finish the protocol (SYN flood).– Firewalls at the target don't help---it's too late by then.

Page 22: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Network Solutions

• Solutions within the network:– Flow control– Authentication– Authorization– Egress filtering

• Otherwise:– Detection– Prosecution– Cooperation

Page 23: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Egress Filtering

• ISP should make sure that traffic originating from their networks has valid source IP address.

• Unfortunately, most care only for inbound traffic.• ISP, Universities, large companies can all do that because

they have a well-defined range of IP address and can easily check it at the firewall.

• This process is called egress filtering.• Advantages:

– Prevents spoofed traffic.– If implemented on a large scale, many DDOS tools will be

ineffective.

Page 24: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Other Methods to Detect and Trace DDOS Attacks

• Link Testing

• Controlled Flooding

• ICMP Traceback

• IP Traceback

Page 25: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Link Testing

• Start at the closest to the victim router and try to identify attack traffic.

• Once routers, participating in the traffic identified, move one router back until the source of it is found.

• Properties:– Time consuming– Requires admin expertise– Requires competent logging– Requires good relationship between organizations– Interactive

Page 26: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Controlled Flooding

• Identify the routes in a network that are congested due to an attack by selectively flooding various links and observing packet lost.

• Links under attacks have a greater probability to lose packets.

• Properties:– Requires knowledge of the full network topology.– May not be usable with networks where it cannot be tolerated, so

not to interfere with the regular network operations.– Cannot be used to trace the attack when it’s over.– May help to trace the origin of the ongoing attack.

Page 27: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

ICMP Traceback

• Sample traffic with a very low probability (e.g. 1/20000) and copy the contents of that packet into a special ICMP traceback message.– ICMP – Internet Control Message Protocol

• The packet includes info about adjacent routers along the path to the destination.

• During attack, with many thousand packets per second, there will be enough ICMP packets (taken per 20000) to trace the source.

• Properties:– Very low overhead– Under standardization by The Internet Engineering Task Force,

(IETF)

Page 28: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

IP Traceback

• Mark probabilistically IP headers with info about previous routers, so that with enough traffic, the route to the origin can be reconstructed.

• Properties:– Novel coding methodology: info encoded into 16 bits

(of fragmentation identifier).

– The scheme appears promising, except may interfere with the legit network fragmentation (non-trivial limitation).

Page 29: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

Conclusion

• The need of moral rules and conventions to structure the Internet world.

• More on DOS:– http://staff.washington.edu/dittrich/misc/ddos/

Page 30: Denial of Service Serguei A. Mokhov SOEN321 - Fall 2004

References

• The Textbook

• Dr. Probst’s Notes

• The Internet Article (the link inline)

• The rest and most of the mistakes are of my own.