The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor...

62
COS 561 Yixin Sun TOR: The Onion Router 11/09/2017

Transcript of The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor...

Page 1: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

COS 561

Yixin Sun

TOR:The Onion Router

11/09/2017

Page 2: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Looking at an Internet communication, one can

even if the communication is encrypted

infer who is talking to whom

infer physical locations

use that to track behavior and interests

Internet communications are not anonymous

Five-tuple: (srcip, srcport, dstip, dstport, protocol)

Page 3: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Tor aims at preventing adversaries to followpackets between a sender and a receiver

client server

Page 4: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

To do that, Tor bounces traffic around a network of relays

Tor network

entry middle exitpoint point

client server

Page 5: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Tor clients start by selecting3 relays, one of each type

entry middle exitclient server

Tor network

Page 6: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Tor clients then incrementallybuild encrypted circuits through them

Tor network

entry middle exitclient server

Page 7: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Tor network

entry middle exitclient server

Page 8: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Tor network

entry middle exitclient server

Page 9: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Tor network

entry middle exitclient server

Page 10: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Anonymous communication takes placeby forwarding across consecutive tunnels

TCPconnection

Tor network

entry middle exitclient server

Page 11: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Not a single Tor entity knowsthe association (client, server)

Tor network

entry middle exitclient server

Page 12: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

knows the source, not the destination

Tor network

entry middle exitclient server

Page 13: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

knows neither the source, nor the destination

Tor network

entry middle exitclient server

Page 14: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

knows the destination, not the source

Tor network

entry middle exitclient server

Page 15: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

However, Tor is known to be vulnerable to traffic correlation analysis

15

Page 16: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Traffic entering and leaving Toris highly correlated

transmission time transmission time

highly correlated

client-to-entry connection exit-to-server connection

Tor network

Page 17: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Traffic correlation attacks require to seeclient-to-entry and exit-to-server traffic

Page 18: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

How?

Traffic correlation attacks require to seeclient-to-entry and exit-to-server traffic

Page 19: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Manipulate Tormalicious relays

Manipulate routingmalicious networks

Two ways

Page 20: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

We’ll talk about this

Manipulate Tormalicious relays

Manipulate routingmalicious networks

Two ways

Page 21: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

client

server

AS1

AS2

AS5

AS4

AS6

AS3

entry

exit

Page 22: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2

AS5

AS4

AS6

AS3

Tor connections get routed according to BGP

exit-to-serverconnection

client-to-entryconnectionclient

serverentry

exit

Page 23: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2

AS5

AS4

AS6

AS3

Traffic correlation attacks require to seeclient-to-entry and exit-to-server traffic

client-to-entryconnectionclient

serverentry

exitexit-to-server

connection

Page 24: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2 AS4

AS6

AS3

AS5

can performtraffic correlationclient

serverentry

exit

Page 25: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Natural BGP convergencepolicy changes, failures, etc.

Asymmetric routingpath from A to B != from B to A

Active BGP manipulationIP prefix hijack, interception (MITM)…

User anonymity decreases over timedue to BGP dynamics

Page 26: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

#1. Asymmetric routing increasesthe numbers of AS-level adversaries

Page 27: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2

AS5

AS4

AS6

AS3

So far, we have considered one side of Tor traffic:client-to-entry and exit-to-server

exit-to-serverclient-to-entryclient

serverentry

exit

Page 28: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2

AS5

AS4

AS6

AS3

client-to-entryclient

serverentry

exit

However, because of policies,routing is often asymmetric

Page 29: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2

AS5

AS4

AS6

AS3entry-to-client

However, because of policies,routing is often asymmetric

client-to-entryclient

serverentry

exit

Page 30: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2

AS5

AS4

AS6

AS3entry-to-client

While AS4 does not see client-to-entry traffic,it sees entry-to-client traffic

client-to-entryclient

serverentry

exit

Page 31: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2

AS5

AS4

AS6

AS3server-to-exit

The same applies to server-to-exit traffic

exit-to-serverclient

serverentry

exit

Page 32: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

In terms of timing properties, both sides of a TCP connection are highly correlated

Page 33: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

seeing one direction

seeing two directions

When collecting TCP

is almost equivalent to

timing information,

In terms of timing properties, both sides of a TCP connection are highly correlated

(e.g., data packets)

(ACKs & data packets)

Seq: 8282, ACK: 392

Seq: 392, ACK: 8282

Page 34: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Considering only one direction,only AS5 is potentially compromising

AS1

AS2 AS4

AS6

AS3

AS5

client

serverentry

exit

Page 35: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Considering both directions,AS3, AS4 and AS5 are potentially compromising

AS1

AS2

AS6

AS5

AS4AS3

client

serverentry

exit

Page 36: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

#2. Natural BGP dynamics increases the number of AS-level adversaries

Page 37: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Initially, only AS5 is compromising

exitclient

destination

entry

AS1

AS2 AS4

AS6

AS3

AS5

Page 38: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2

AS5

AS4

AS6

AS3

Assume that the link between AS4 and AS5 fails

client

serverentry

exit

Page 39: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2

AS5

AS4

AS6

AS3

Traffic gets rerouted via AS3

client

serverentry

exit

Page 40: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2 AS4

AS6

Now, both AS3 and AS5 are seeing client-to-entry and exit-to-server traffic

AS5

AS3

client

serverentry

exit

Page 41: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

#3. BGP hijacking attacks enable on-demand, fine-grained Tor attacks

Page 42: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Initially, only AS5 is compromising

exitclient

destination

entry

AS1

AS2 AS4

AS6

AS3

AS5

Page 43: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

client

server

entry

exit

AS1

AS2

AS5

AS4

AS6

AS3

Assume that AS3 is a malicious AS,and wants to observe Tor traffic

Page 44: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

client

entry

AS1

AS2

AS5

AS4

AS6

AS3

AS3 can put itself on server-to-exit pathsby hijacking Tor prefixes

exit10.0.0.1

server

Path: 6

10.0.0.0/16

Page 45: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Path: 6

10.0.0.0/16

client

entry

AS1

AS2

AS5

AS4

AS6

AS3

exit10.0.0.1

server 10.0.0.0/24 Path: 3 2 5 6

AS3 can put itself on server-to-exit pathsby hijacking Tor prefixes

Page 46: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS1

AS2

AS5

AS4

AS6

exit

server

AS3

client

entry

Page 47: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

In April 2014,Indosat leaked >320k BGP routes over 2 hours

Indosat

One of Indonesia’s largest telecommunicationsproviders

Include 38 guard and 17 exit11 were both guard and exit

Affected 44 Tor Relays

Page 48: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Defenses

Against Passive Attacker: asymmetric traffic analysis

Against Active Attacker: BGP attacks

- IPSec, traffic obfuscation, etc.

- Avoid having the same ASes on both ends

- Reactive: monitoring control plane and data plane

- Proactive: select more “resilient” relays

Page 49: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Defenses

Against Passive Attacker: asymmetric traffic analysis

Against Active Attacker: BGP attacks

- IPSec, traffic obfuscation, etc.

- Avoid having the same ASes on both ends

- Proactive: select more “resilient” relays

- Reactive: monitoring system

not so practical

LasTor, Astoria, etc.

Our work

Page 50: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

50

Proactive Defense

Tor: Proactive Defense

Page 51: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Two Tor clients are using the same Tor guard

51

AS 1

AS 2

AS 3

10.0.0.0/16 Path: 1

10.0.0.0/16 Path: 2 1

AS 4

10.0.0.0/16 Path: 3 2 1

Client (AS2)

Client (AS4)

guard

AS 5

Tor: Proactive Defense

Page 52: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

AS 5 hijacks Tor prefix (equally-specific)

52

AS 1

AS 2

AS 3

10.0.0.0/16 Path: 1

10.0.0.0/16 Path: 2 1

AS 4

10.0.0.0/16 Path: 3 2 1

Client (AS2)

Client (AS4)

guard

AS 5

10.0.0.0/16 Path: 5

Tor: Proactive Defense

Page 53: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Tor client (AS2) is resilient to this attack,while Tor client (AS4) is not

53

AS 1

AS 2

AS 3

10.0.0.0/16 Path: 1

10.0.0.0/16 Path: 2 1

AS 4

10.0.0.0/16

Client (AS2)

Client (AS4)

guard

AS 5

10.0.0.0/16 Path: 5

Path: 3 5

Tor: Proactive Defense

Page 54: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Key Insight:

Choose a guard relay such that a Tor client AS is resilient to attacks on its guard relay

54Tor: Proactive Defense

guard middle exitclient server

Page 55: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

55

Reactive Defense

Tor: Reactive Defense

Page 56: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

BGP Monitoring System

Live monitoring system

run detection analytics on the updates

live BGP updates for Tor relay IPs

Tor: Reactive Defense

trigger/log warnings

Page 57: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Detection Analytics

Tor: Reactive Defense

Anomaly detection in real time

- Frequency Analytic

- Time Analytic

Key Insight:Attacks are infrequent

and short-lived

Page 58: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Detection Analytics

Tor: Reactive Defense

Anomaly detection in real time

- Frequency Analytic

- Time Analytic

Key Insight:Attacks are infrequent

and short-lived

Evaluation

Preliminary evaluation from March to May 2016

Frequency Analytic: False Positive 0.38%

Time Analytic: False Positive 0.19%

Most Tor prefixes are announced by a single AS in all updates

Page 59: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Data/script available on:

Tor: Reactive Defense

raptor.princeton.edu/tor_metrics/

Page 60: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Data/script available on:

Tor: Reactive Defense

raptor.princeton.edu/tor_metrics/

Page 61: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

Future works on monitoring system

Tor: Reactive Defense

- Play with the data

- Tune parameters: threshold, time window, etc.

- Interpret warnings: pattern? duplicated warnings?

- BGP Collectors: which ones to pick?

Page 62: The Onion Router · 2017-12-07 · TOR: The Onion Router 11/09/2017. Looking at an Internet ... Tor network. Traffic correlation attacks require to see client-to-entry ... Manipulate

62

Project site: raptor.princeton.edu

Summary & Resources

Tor BGP data/script: raptor.princeton.edu/tor_metrics

Tor code (resilient relay): github.com/inspire-group/Counter-Raptor-Tor-Client

- Raptor: network dynamics empower adversaries

- Counter-Raptor: proactive and reactive defenses