Unwanted Traffic Denial of Service Attacks Original slides

  • Slides: 48
Download presentation
Unwanted Traffic: Denial of Service Attacks Original slides by Dan Boneh and John Mitchell

Unwanted Traffic: Denial of Service Attacks Original slides by Dan Boneh and John Mitchell 1

What is network Do. S? Goal: take out a large site with little computing

What is network Do. S? Goal: take out a large site with little computing work How: Amplification n Small number of packets big effect Two types of amplification attacks: n Do. S bug: w Design flaw allowing one machine to disrupt a service n Do. S flood: w Command bot-net to generate flood of requests 2

Do. S can happen at any layer This lecture: n n n Sample Dos

Do. S can happen at any layer This lecture: n n n Sample Dos at different layers (by order): w Link w TCP/UDP w Application Generic Do. S solutions Network Do. S solutions Sad truth: n Current Internet not designed to handle DDo. S attacks 3

Warm up: 802. 11 b Radio jamming attacks: Protocol Do. S bugs: n n

Warm up: 802. 11 b Radio jamming attacks: Protocol Do. S bugs: n n Do. S bugs trivial, not our focus. [Bellardo, Savage, ’ 03] NAV (Network Allocation Vector): w 15 -bit field. Max value: 32767 w Any node can reserve channel for NAV seconds w No one else should transmit during NAV period w … but not followed by most 802. 11 b cards De-authentication bug: w Any node can send deauth packet to AP w Deauth packet unauthenticated w … attacker can repeatedly deauth anyone 4

Smurf amplification Do. S attack 1 ICMP Echo Req Src: Dos Target Dest: brdct

Smurf amplification Do. S attack 1 ICMP Echo Req Src: Dos Target Dest: brdct addr Do. S Source 3 ICMP Echo Reply Dest: Dos Target gateway Do. S Target Send ping request to broadcast addr (ICMP Echo Req) Lots of responses: n Every host on target network generates a ping reply (ICMP Echo Reply) to victim Prevention: reject external packets to broadcast address 5

Modern day example DNS Amplification attack: ( 50 amplification ) DNS Query Src. IP:

Modern day example DNS Amplification attack: ( 50 amplification ) DNS Query Src. IP: Dos Target (60 bytes) Do. S Source (Mar ’ 13) EDNS Reponse (3000 bytes) DNS Server Do. S Target 2006: 0. 58 M open resolvers on Internet (Kaminsky-Shiffman) 2014: 28 M open resolvers (openresolverproject. org) ⇒ 3/2013: DDo. S attack generating 309 Gbps for 28 mins. 6

Feb. 2014: 400 Gbps via NTP amplification (4500 NTP servers) 7

Feb. 2014: 400 Gbps via NTP amplification (4500 NTP servers) 7

Review: IP Header format 0 Connectionless n Unreliable n Best effort 31 Version Header

Review: IP Header format 0 Connectionless n Unreliable n Best effort 31 Version Header Length Type of Service Total Length Identification Flags Fragment Time to. Offset Live Protocol Header Checksum Source Address of Originating Host Destination Address of Target Host Options Padding IP Data 8

Review: TCP Header format TCP: n Session based n Congestion control n In order

Review: TCP Header format TCP: n Session based n Congestion control n In order delivery 0 31 Source Port Dest port SEQ Number ACK Number U A P P S F R C S S Y I G K H R N N Other stuff 9

Review: TCP Handshake C S SN rand. C SYN: ANC 0 C SYN/ACK: SNS

Review: TCP Handshake C S SN rand. C SYN: ANC 0 C SYN/ACK: SNS rand. S ANS SNC ACK: SN SNC AN SNS Listening Store SNC , SNS Wait Established 10

TCP SYN Flood I: low rate C S (Do. S bug) Single machine: SYNC

TCP SYN Flood I: low rate C S (Do. S bug) Single machine: SYNC 2 • SYN Packets with random source IP addresses SYNC 3 • Fills up backlog queue on server SYNC 1 SYNC 4 SYNC 5 • No further connections possible 11

SYN Floods (phrack 48, no 13, 1996) OS Linux 1. 2. x Free. BSD

SYN Floods (phrack 48, no 13, 1996) OS Linux 1. 2. x Free. BSD 2. 1. 5 Win. NT 4. 0 Backlog timeout: Backlog queue size 10 128 6 3 minutes Attacker need only send 128 SYN packets every 3 minutes. Low rate SYN flood 12

A classic SYN flood example MS Blaster worm n (2003) Infected machines at noon

A classic SYN flood example MS Blaster worm n (2003) Infected machines at noon on Aug 16 th: w SYN flood on port 80 to windowsupdate. com w 50 SYN packets every second. n each packet is 40 bytes. w Spoofed source IP: a. b. X. Y where X, Y random. MS solution: n n new name: windowsupdate. microsoft. com Win update file delivered by Akamai 13

Low rate SYN flood defenses Non-solution: n Increase backlog queue size or decrease timeout

Low rate SYN flood defenses Non-solution: n Increase backlog queue size or decrease timeout Correct solution (when under attack) : n Syncookies: remove state from server n Small performance overhead 14

Syncookies [Bernstein, Schenk] Idea: use secret key and data in packet to gen. server

Syncookies [Bernstein, Schenk] Idea: use secret key and data in packet to gen. server SN Server responds to Client with SYN-ACK cookie: n T = 5 -bit counter incremented every 64 secs. n L = MACkey (SAddr, SPort, DAddr, DPort, SNC, T) [24 bits] w key: picked at random during boot n n SNS = (T. mss. L) ( |L| = 24 bits ) Server does not save state (other TCP options are lost) Honest client responds with ACK ( AN=SNS , SN=SNC+1 ) n Server allocates space for socket only if valid SNS 15

SYN floods: backscatter [MVS’ 01] SYN with forged source IP SYN/ACK to random host

SYN floods: backscatter [MVS’ 01] SYN with forged source IP SYN/ACK to random host 16

Backscatter measurement [MVS’ 01] Listen to unused IP addresss space (darknet) /8 network monitor

Backscatter measurement [MVS’ 01] Listen to unused IP addresss space (darknet) /8 network monitor 0 232 Lonely SYN/ACK packet likely to be result of SYN attack 2001: 2013: n 400 SYN attacks/week 773 SYN attacks/24 hours (arbor networks ATLAS) Larger experiments: (monitor many ISP darknets) w Arbor networks 17

Estonia attack (ATLAS ‘ 07) Attack types detected: n 115 ICMP floods, 4 TCP

Estonia attack (ATLAS ‘ 07) Attack types detected: n 115 ICMP floods, 4 TCP SYN floods Bandwidth: n 12 attacks: 70 -95 Mbps for over 10 hours All attack traffic was coming from outside Estonia n Estonia’s solution: w Estonian ISPs blocked all foreign traffic until attacks stopped => Do. S attack had little impact inside Estonia 18

SYN Floods II: Massive flood (e. g Bet. Cris. com ‘ 03) Command bot

SYN Floods II: Massive flood (e. g Bet. Cris. com ‘ 03) Command bot army to flood specific target: (DDo. S) n n 20, 000 bots can generate 2 Gb/sec of SYNs (2003) At web site: w Saturates network uplink or network router w Random source IP attack SYNs look the same as real SYNs n What to do ? ? ? 19

Prolexic / Cloud. Flare Idea: only forward established TCP connections to site Lots-of-SYNs Lots-of-SYN/ACKs

Prolexic / Cloud. Flare Idea: only forward established TCP connections to site Lots-of-SYNs Lots-of-SYN/ACKs Prolexic Proxy Few ACKs Forward to site Web site 20

Other junk packets Attack Packet Victim Response Rate: attk/day TCP SYN to open port

Other junk packets Attack Packet Victim Response Rate: attk/day TCP SYN to open port TCP SYN/ACK TCP SYN to closed port TCP RST TCP ACK or TCP DATA TCP RST No response TCP NULL TCP RST ICMP ECHO Request ICMP ECHO Response 50 UDP to closed port ICMP Port unreachable 387 [ATLAS 2013] 773 Proxy must keep floods of these away from web site 21

Stronger attacks: TCP con flood Command bot army to: n n n Complete TCP

Stronger attacks: TCP con flood Command bot army to: n n n Complete TCP connection to web site Send short HTTP HEAD request Repeat Will bypass SYN flood protection proxy … but: n Attacker can no longer use random source IPs. w Reveals location of bot zombies n Proxy can now block or rate-limit bots. 22

A real-world example: Git. Hub popular server Javascript-based DDo. S: honest end user github.

A real-world example: Git. Hub popular server Javascript-based DDo. S: honest end user github. com (3/2015) inject image. Flood. js function imgflood() { var TARGET = 'victim-website. com/index. php? ’ var rand = Math. floor(Math. random() * 1000) var pic = new Image() pic. src = 'http: //'+TARGET+rand+'=val' } set. Interval(imgflood, 10) Would HTTPS prevent this DDo. S? 23

Do. S via route hijacking You. Tube is 208. 65. 152. 0/22 (includes 210

Do. S via route hijacking You. Tube is 208. 65. 152. 0/22 (includes 210 IP addr) youtube. com is 208. 65. 153. 238, … Feb. 2008: n Pakistan telecom advertised a BGP path for 208. 65. 153. 0/24 (includes 28 IP addr) n Routing decisions use most specific prefix n The entire Internet now thinks 208. 65. 153. 238 is in Pakistan Outage resolved within two hours … but demonstrates huge Do. S vuln. with no solution! 26

Do. S at higher layers SSL/TLS handshake [SD’ 03] Client Hello Server Hello (pub-key)

Do. S at higher layers SSL/TLS handshake [SD’ 03] Client Hello Server Hello (pub-key) RSA Encrypt Web Server Client key exchange RSA Decrypt RSA-encrypt speed 10 RSA-decrypt speed Single machine can bring down ten web servers n Similar problem with application Do. S: n Send HTTP request for some large PDF file Easy work for client, hard work for server. 27

Do. S Mitigation 28

Do. S Mitigation 28

1. Client puzzles Idea: slow down attacker Moderately hard problem: n Given challenge C

1. Client puzzles Idea: slow down attacker Moderately hard problem: n Given challenge C find X such that LSBn ( SHA-1( C || X ) ) = 0 n n Assumption: takes expected 2 n time to solve For n=16 takes about 0. 3 sec on 1 Gh. Z machine Main point: checking puzzle solution is easy. During Do. S attack: n Everyone must submit puzzle solution with requests n When no attack: do not require puzzle solution 29

Examples TCP connection floods (RSA ‘ 99) n Example challenge: C = TCP server-seq-num

Examples TCP connection floods (RSA ‘ 99) n Example challenge: C = TCP server-seq-num n First data packet must contain puzzle solution w Otherwise TCP connection is closed SSL handshake Do. S: (SD’ 03) n Challenge C based on TLS session ID n Server: check puzzle solution before RSA decrypt. Same for application layer Do. S and payment Do. S. 30

Benefits and limitations Hardness of challenge: n Decided based on Do. S attack volume.

Benefits and limitations Hardness of challenge: n Decided based on Do. S attack volume. Limitations: n n Requires changes to both clients and servers Hurts low power legitimate clients during attack: w Clients on cell phones and tablets cannot connect 31

Memory-bound functions CPU power ratio: n high end server / low end cell phone

Memory-bound functions CPU power ratio: n high end server / low end cell phone = 8000 Impossible to scale to hard puzzles Interesting observation: n Main memory access time ratio: w high end server / low end cell phone = 2 Better puzzles: n Solution requires many main memory accesses w Dwork-Goldberg-Naor, Crypto ‘ 03 w Abadi-Burrows-Manasse-Wobber, ACM To. IT ‘ 05 32

2. CAPTCHAs Idea: verify that connection is from a human Applies to application layer

2. CAPTCHAs Idea: verify that connection is from a human Applies to application layer DDo. S [Killbots ’ 05] n During attack: generate CAPTCHAs and process request only if valid solution n Present one CAPTCHA per source IP address. 33

3. Source identification Goal: identify packet source Ultimate goal: block attack at the source

3. Source identification Goal: identify packet source Ultimate goal: block attack at the source 34

1. Ingress filtering Big problem: (RFC 2827, 3704) DDo. S with spoofed source IPs

1. Ingress filtering Big problem: (RFC 2827, 3704) DDo. S with spoofed source IPs ISP Internet Ingress filtering policy: ISP only forwards packets with legitimate source IP (see also SAVE protocol https: //lasr. cs. ucla. edu/save_to_infocom. pdf) 35

Implementation problems ALL ISPs must do this. Requires global trust. n If 10% of

Implementation problems ALL ISPs must do this. Requires global trust. n If 10% of ISPs do not implement no defense n No incentive for deployment 2014: n 25% of Auto. Systems are fully spoofable (spoofer. cmand. org) n 13% of announced IP address space is spoofable Recall: 309 Gbps attack used only 3 networks (3/2013)

2. Traceback [Savage et al. ’ 00] Goal: n Given set of attack packets

2. Traceback [Savage et al. ’ 00] Goal: n Given set of attack packets n Determine path to source How: change routers to record info in packets Assumptions: n Most routers remain uncompromised n Attacker sends many packets n Route from attacker to victim remains relatively stable 37

Simple method Write path into network packet n Each router adds its own IP

Simple method Write path into network packet n Each router adds its own IP address to packet n Victim reads path from packet Problem: n Requires space in packet w Path can be long w No extra fields in current IP format n Changes to packet format too much to expect 38

Better idea DDo. S involves many packets on same path A 1 Store one

Better idea DDo. S involves many packets on same path A 1 Store one link in each packet n n Each router probabilistically stores own address Fixed space regardless of path length A 2 R 6 A 3 R 7 A 4 A 5 R 8 R 9 R 10 R 12 V 39

Edge Sampling Data fields written to packet: n Edge: start and end IP addresses

Edge Sampling Data fields written to packet: n Edge: start and end IP addresses n Distance: number of hops since edge stored Marking procedure for router R if coin turns up heads (with probability p) then write R into start address write 0 into distance field else if distance == 0 write R into end field increment distance field 40

Edge Sampling: picture Packet received n R receives packet from source or another router

Edge Sampling: picture Packet received n R receives packet from source or another router 1 n Packet contains space for start, end, distance packet R 1 s e d R 2 R 3 41

Edge Sampling: picture Begin writing edge n R chooses to write start of edge

Edge Sampling: picture Begin writing edge n R chooses to write start of edge 1 n Sets distance to 0 packet R 1 0 R 2 R 3 42

Edge Sampling Finish writing edge n R chooses not to overwrite edge 2 n

Edge Sampling Finish writing edge n R chooses not to overwrite edge 2 n Distance is 0 w Write end of edge, increment distance to 1 packet R 1 R 2 R 3 43

Edge Sampling Increment distance n R chooses not to overwrite edge 3 n Distance

Edge Sampling Increment distance n R chooses not to overwrite edge 3 n Distance >0 w Increment distance to 2 packet R 1 R 2 2 R 3 44

Path reconstruction Extract information from attack packets Build graph rooted at victim n Each

Path reconstruction Extract information from attack packets Build graph rooted at victim n Each (start, end, distance) tuple provides an edge # packets needed to reconstruct path ln(d) E(X) < p(1 -p)d-1 where p is marking probability, d is length of path 45

More traceback proposals Advanced and Authenticated Marking Schemes for IP Traceback n Song, Perrig.

More traceback proposals Advanced and Authenticated Marking Schemes for IP Traceback n Song, Perrig. IEEE Infocomm ’ 01 n Reduces noisy data and time to reconstruct paths An algebraic approach to IP traceback n Stubblefield, Dean, Franklin. NDSS ’ 02 Hash-Based IP Traceback n Snoeren, Partridge, Sanchez, Jones, Tchakountio, Kent, Strayer. SIGCOMM ‘ 01 47

Problem: Reflector attacks [Paxson ’ 01] Reflector: n A network component that responds to

Problem: Reflector attacks [Paxson ’ 01] Reflector: n A network component that responds to packets n Response sent to victim (spoofed source IP) Examples: n n n DNS Resolvers: UDP 53 with victim. com source w At victim: DNS response Web servers: TCP SYN 80 with victim. com source w At victim: TCP SYN ACK packet Gnutella servers 48

Do. S Attack Single Master Many bots to generate flood Zillions of reflectors to

Do. S Attack Single Master Many bots to generate flood Zillions of reflectors to hide bots n Kills traceback and pushback methods 49

Take home message: Denial of Service attacks are real. Must be considered at design

Take home message: Denial of Service attacks are real. Must be considered at design time. Sad truth: n Internet is ill-equipped to handle DDo. S attacks n Commercial solutions: Cloud. Flare, Prolexic Many good proposals for core redesign. 50

THE END 51

THE END 51