Computer Science 161 Fall 2016 Popa and Weaver
Network #5: Denial of Service and Firewalls (Most Slides stolen from Dave Wagner)
1
Network #5: Denial of Service and Firewalls (Most Slides stolen - - PowerPoint PPT Presentation
Computer Science 161 Fall 2016 Popa and Weaver Network #5: Denial of Service and Firewalls (Most Slides stolen from Dave Wagner) 1 Theme of This Lecture: Why Twitter & Reddit Sucked Last Week Computer Science 161 Fall 2016
Computer Science 161 Fall 2016 Popa and Weaver
1
Computer Science 161 Fall 2016 Popa and Weaver
2
Computer Science 161 Fall 2016 Popa and Weaver
network
3
Computer Science 161 Fall 2016 Popa and Weaver
4
Computer Science 161 Fall 2016 Popa and Weaver
5
Computer Science 161 Fall 2016 Popa and Weaver
6
Computer Science 161 Fall 2016 Popa and Weaver
target’s Internet connection
7
Computer Science 161 Fall 2016 Popa and Weaver
address as their source
8
Computer Science 161 Fall 2016 Popa and Weaver
(today about 75% do)
9
Computer Science 161 Fall 2016 Popa and Weaver
10
Computer Science 161 Fall 2016 Popa and Weaver
server, seemingly from the target
establish a TCP connection)
11
Computer Science 161 Fall 2016 Popa and Weaver
12
Computer Science 161 Fall 2016 Popa and Weaver
13
Client (initiator) SYN, SeqNum = x SYN + ACK, SeqNum = y, Ack = x + 1 ACK, Ack = y + 1 Server
Server creates state associated with connection here (buffers, timers, counters)
Attacker doesn’t even need to send this ack
Computer Science 161 Fall 2016 Popa and Weaver
some memory
14
Client (initiator) SYN, SeqNum = x SYN + ACK, SeqNum = y, Ack = x + 1 ACK, Ack = y + 1 Server
Server creates state associated with connection here (buffers, timers, counters)
Attacker doesn’t even need to send this ack
Computer Science 161 Fall 2016 Popa and Weaver
15
Computer Science 161 Fall 2016 Popa and Weaver
be hard to know
16
Computer Science 161 Fall 2016 Popa and Weaver
have an established connection!
come from?
3-way handshake
17
Computer Science 161 Fall 2016 Popa and Weaver
Client (initiator) SYN, SeqNum = x S+A, SeqNum = y, Ack = x + 1, <State> ACK, Ack = y + 1, <State> Server
18
Server only saves state here Do not save state here; give to client
Computer Science 161 Fall 2016 Popa and Weaver
Client (initiator) SYN, SeqNum = x S+A, SeqNum = y, Ack = x + 1, <State> ACK, Ack = y + 1, <State> Server
19
Server only saves state here Do not save state here; give to client
Problem: the world isn’t so ideal! TCP doesn’t include an easy way to add a new <State> field like this. Is there any way to get the same functionality without having to change TCP clients?
Computer Science 161 Fall 2016 Popa and Weaver
Client (initiator) SYN, SeqNum = x SYN and ACK, SeqNum = y, Ack = x + 1 ACK, Ack = y + 1 Server
y
secret
20
Server only creates state here Do not create state here
Instead, encode it here
Computer Science 161 Fall 2016 Popa and Weaver
it is returned when needed
3-way handshake in order to burden server
state
a win
21
Computer Science 161 Fall 2016 Popa and Weaver
22
Computer Science 161 Fall 2016 Popa and Weaver
23
Computer Science 161 Fall 2016 Popa and Weaver
structures
Expected time: O(1). Worst-case: O(n).
Time per lookup: O(n). Total time to do n operations: O(n^2).
24
Computer Science 161 Fall 2016 Popa and Weaver
A content delivery network
25
Computer Science 161 Fall 2016 Popa and Weaver
denial-of-service
26
Computer Science 161 Fall 2016 Popa and Weaver
27
Computer Science 161 Fall 2016 Popa and Weaver
28
Internet
Internal Network
Computer Science 161 Fall 2016 Popa and Weaver
(and we’ve vetted them). There are billions of outsiders.
29
Computer Science 161 Fall 2016 Popa and Weaver
30
In general, use Default Deny
Computer Science 161 Fall 2016 Popa and Weaver
31
Computer Science 161 Fall 2016 Popa and Weaver
(access control policy)
32
Internet
Internal Network
Computer Science 161 Fall 2016 Popa and Weaver
this connection
sees a packet, it checks whether it is part of one of those active connections. If yes, forward it; if no, check to see if rule should create a new allowed connection
33
Computer Science 161 Fall 2016 Popa and Weaver
this connection
34
Computer Science 161 Fall 2016 Popa and Weaver
(i.e., those that are initiated by internal hosts)
1.2.2.3
35
Computer Science 161 Fall 2016 Popa and Weaver
36
Computer Science 161 Fall 2016 Popa and Weaver
37
Computer Science 161 Fall 2016 Popa and Weaver
38
1
Packet #1
2
Packet #2
Computer Science 161 Fall 2016 Popa and Weaver
39
2
1
Computer Science 161 Fall 2016 Popa and Weaver
Firewall r r
seq=1, TTL=22
n
seq=1, TTL=16
X
i
seq=2, TTL=16
X
c
seq=3, TTL=16
X t t
seq=4, TTL=22
e
seq=4, TTL=16
X
Sender / Attacker Receiver
r~~~
~~~~ r~~~ ro~~ roo~ root
~~~~ r~~~? n~~~? ri~~? ni~~? ri~~? ro~~? ni~~? no~~? ric~? roc~? rio~? roo~? nic~? noc~? nio~? noo~? rice? roce? rict? roct? riot? root? rioe? rooe? nice? noce? nict? noct? niot? noot? nioe? nooe? Packet discarded in transit due to TTL hop count expiring
TTL field in IP header specifies maximum forwarding hop count Assume the Receiver is 20 hops away Assume firewall is 15 hops away
40
Computer Science 161 Fall 2016 Popa and Weaver
then makes a second TCP connection from firewall to server.
41
Computer Science 161 Fall 2016 Popa and Weaver
firewall
42
Internet Company Yahoo User VPN server Fileserver
Computer Science 161 Fall 2016 Popa and Weaver
43
Computer Science 161 Fall 2016 Popa and Weaver
44
Computer Science 161 Fall 2016 Popa and Weaver
encrypted web connection
45
Computer Science 161 Fall 2016 Popa and Weaver
46