nick mathewson the torproject  · extend by ip:port was insufficient: nodes don't all know...

50
Technical changes since the last Tor talk Nick Mathewson The Tor Project <nickm@torproj ect.org> Defcon XV Aug 4, 2007

Upload: others

Post on 21-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Technical changessince the last Tor talk

Nick MathewsonThe TorProject

<[email protected]>

Defcon XV Aug 4, 2007

Page 2: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

● Torwas working, usable, and seemed prettysecure. (v 0.0.7.2)

● Pretty small network.● No GUI—hard to use.● Wegot a couple of Defcon talks!

Marty!We've got to go back to the future2004!

Page 3: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

● Hacking on Tor.(Latest is 0.2.0.4-alpha)– Security: adding features/fixing security bugs.– Scalability: adding capacity is hard.– Scalability: using capacity is hard.– Usability: adding GUIs, fixing bugs.– Integration: working nice with other apps is hard.– Lots more: See the changelog.

● Growing the network: ~200kuser, ~1kserver.

What we've been up to since then.

Page 4: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Outline

● Prelude: brief, fast introduction to Tor● Directories and server discovery changes:More secure, more scalable!

● Path generation changes:More efficient, less filling!

● Circuit-building protocol changes:Oops. Crypto is hard.

● Some fun new tools and features:What do you mean, I need to edit a file?

Page 5: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Intro anonymity: anonymity networkshide users among users.

Alice2

Bob1

Bob2

Alice1

Alice3

Network

Page 6: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Intro Tor: There are a bunch of servers,connected via TLS (ssl).

SS

S

SS

S

S

S

S

Page 7: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Intro Tor: clients build circuits througha network of decrypting relays.

1.

SS

S

SS

S

S

S

S

Alice2

2.3.

Alice1

Page 8: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Intro Tor: circuits are used to relaymultiple TCP streams.

1.

SS

S

SS

S

S

S

S

Alice2

2.3.

Bob1

Bob2

Alice1

4.

See also:PipeNet,Onion Routing

6.5.

Page 9: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

A hostile first hop can tell Alice istalking, but not to whom.

SS

S

SS

S

S

S

S

Alice2

Bob1

Bob2

Alice1

Page 10: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

A hostile last hop can tell somebody istalking to Bob, but not who.

SS

S

SS

S

S

S

S

Alice2

Bob1

Bob2

Alice1

Page 11: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

But: two hostile hops can correlatetraffic patterns and link Alice to Bob.

SS

S

SS

S

S

S

S

Alice2

Bob1

Bob2

Alice1

No obviousfix that isn’textra-slow.

Page 12: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

I. Directories and server discovery

Page 13: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

● Every client must know every server.– (If you just ask a server for a list of neighbors, it cantrivially lie.)

● All clients must know the same servers.● Servers shouldn’t be able to impersonate eachother.– (Use self-signed descriptions; identity by PK.)

● Bandwidth matters a lot.

We need to tell clients about servers.

Page 14: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Server discovery is hard becausemisinformed clients lose anonymity.

SS

S

SS

S

S

S

S

Alice2

Bob1

Bob2

Alice1

Known to Alice1

Known to Alice2

Page 15: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

2004: every authority published a biglist of server information.

That was slow.S1

S2

Sn

Authority

Authority

Authority

Client

Client

Client

... ....

Page 16: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Adding caches helped withperformance...

S1

S2

Sn

Authority

Authority

Authority

Client

Client

Client

...

Cache

Cache

Cache

Cache

....

Page 17: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

But a single bad authority could stillbreak clients badly...

S1

S2

Sn

Authority

Authority

Authority

Client

Client

Client

...

Cache

Cache

Cache

Cache

....

Page 18: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

And most information was redundant.Client Cache

“What's the directory?”

Sign(Desc1,Desc2,Desc3..Desc99)

“What's the directory?”

Sign(Desc1,Desc3..Desc99,Desc100)

Page 19: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

So split directory into status (signed)and individual descriptors

Client Cache“What do authorities A and B say?”

SignA(digest list), SignB(digest list)

“Send me descriptor with digest X”

Descriptor with digest X

(2005)

Remaining Problems:partitioning, redundancy.

Page 20: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Naming and requesting descriptors bydigest prevents attacks.

S1 Authorities

Client

Cache

“Use server whose identity key is X”.

“Here’s one just for you!”

ID = X

Page 21: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Authorities now vote on a singleconsensus status document.

(2007)

S1

S2

Sn

Authority

Authority

Authority

...

1. Distribute signed opinions.2. Compute result of vote,and sign it.3. Distribute signatures; makemulti-signed document.4. Clients check signatures.5. Profit!

Page 22: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Authorities say more than “yes/no” foreach server.

● Named? Authority?● Running? Guard?● Valid?● Fast?● Stable?● Bad exit?● Exit?

(Actually determiningthese can be hard.)

(Keywords define clientbehavior; authoritiesimprove criteria.)

Page 23: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

II. Path generation

Page 24: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

2004: all servers chosen with equal*probability, regardless of capacity.

S1Client

bw=x

p=2x

bw=4xbw=x

bw=x/2

bw=2x

bw=2x

bw=x

bw=x

bw=x/2

Big servers wereunderused.

Tiny serverswere overloaded.

Page 25: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Now: Bandwidth is not uniform, so don'tselect uniformly.

S1Client

p=x

p=2x

p=4xp=x

p=x/2

p=2x

p=2x

p=x

p=x

p=x/2

Page 26: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

(But cap the maximum to prevent trustbottlenecks.)

S1Client

p=x

p=2x“I can push a

terabit. No, really!”

p=x

p=2x

p=2x

p=x

Page 27: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Unstable servers are useful,but not for (SSH, IM, ...)

Client

1 hour

10 days

10 days

1 hour

10 days

Page 28: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Use long-lived servers for long-livedconnections.

Client

1 hour

10 days

10 days

1 hour

10 days

Okay forport 22.

Page 29: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Our original “random” path-selectionapproach made sure that every client

would eventually be profiled.

Alice loses if first and last hop are evil. (Correlation attacks)

Suppose c/n nodes (bandwidthwise) are compromised.

Therefore, (c/n)^2 of Alice's circuits are compromised.

Therefore, if Alice's behavior stays the same, she will eventually lose.

Page 30: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Tor clients now use “guard” servers togive long-term Alice a chance.

Alice

S

S S

S

S

S

Chosen at random*, held fixed**.

If Alice’s guards are good, Alice never has avulnerable path.

Page 31: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Okay, so guard nodes might go down.

SS X

Page 32: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

So add more as needed,but keep them in order...

SSS SX

Page 33: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

...so we can go back to the originalset when they come back online.

SS

Page 34: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Old Tor: circuits built on-demand only.

This was slow.

Page 35: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Predict desired ports based on pastbehavior.

Alice

S S(exit to 80,22)S

S S(exit to 8001)

S

Page 36: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

“Cannibalize” unused circuits forfaster response to requests no circuit

supports.

Alice

S SS

S(exit to

weird port)

Service onweird port

Page 37: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

III. Circuit-building protocol

Page 38: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Extend by IP:Port was insufficient:nodes don't all know each other.

Alice S1

S2

“Extend this circuit to S2 at18.244.0.188:9010” “Uh, how?”

In practice, server knowledge is not 100%synchronized.

So, use identity key and IP.

Page 39: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Using key-only ID for this createdan MITM attack.

Alice S1

S2

“Extend this circuit toS2 at evil:9010”

Only good for traffic analysis...but other users were effective.

(So, don’t use only identity key.)

evil

Page 40: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Using encrypted create cell for firsthop was needless crypto.

OldAlice

S“Uh, guys? This is TLS.”

NewAlice

S

E(g^x) g^y,H(K=g^xy)

X Y,H(K=H(X|Y))

Already encrypted,authenticated

Page 41: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Speaking of cryptography,check for bad values of g^x, g^y.

Client Bad server Server 2E2(gx)

E2(g0)

gy,H(g0y)g0, H(gx0)

“oops.” (but once we checkedfor bad g^x,g^y, IanGoldberg could provethis protocol secure.)

(Also, we patched OpenSSL for this.)

Page 42: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

III. Tools and features

Page 43: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Old Tor: everybody must speak SOCKS.

browser

Tor

???????

Privoxy/polipo

HTTP SOCKS

AppTCP

gaim SOCKS

???????

Page 44: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

The old solutions kind of sucked.

browser

Tor

Privoxy/polipo

HTTP SOCKS

SOCKS

gaim SOCKS

Replacedlibccalls

Linux/BSDApp

On windows, you coulddo a net driver...OSX was screwed.

Page 45: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

TransPort (+iptables/pf) support any TCP

App

Tor

Youcan also do use a VM as your router:see JanusVM.

Privoxy/polipo

HTTP SOCKS

AppLinux,BSDor OSX

TCP TCP +address

App SOCKS

Page 46: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Problem: DNS leaks are hard to solve.

TorDumbApp

SOCKS“get me 1.2.3.4!”

DNS

“Where

is naug

hty.com

?”

“1.2.3.4

!”

Page 47: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Old solution: “use SOCKS4a or else!”

TorSmartApp

SOCKS“get me naughty.com!”

Page 48: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

New solution: Tor acts as a DNS server

TorDumbApp SOCKS

“get me 1.2.3.4!”

DNS

“Where i

s naught

y.com?”

“1.2.3.4!”

This also lets dumb apps handle.onion addresses.

Page 49: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Problem: editing text files is hard.So, add support for external GUIs.

Tor

Vidalia

TorK

....

Page 50: Nick Mathewson The TorProject  · Extend by IP:Port was insufficient: nodes don't all know each other. Alice S1 S2 “Extend this circuit to S2 at 18.244.0.188:9010”

Things to do:● Tor: https://torproject.org

– Try it out; want to run a server?– See docs and specs for more detail.

● Donate to Tor!– https://torproject.org/donate.html– (We’re a tax-deductible charity!)

● Donate to EFF too!– I’m in the dunk tank at 6:30

● See more talks!– Roger at 2 on anti-censorship– Mike at 5 on securing the network andapps.