studying the great firewall of china - stanford...

83
Studying the Great Firewall of China: From Internet Filtering to Actively Probing Anti-Censorship Tools Roya Ensafi [email protected] April 28, 2016 1

Upload: others

Post on 16-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Studying the Great Firewall of China: From Internet Filtering to

Actively Probing Anti-Censorship Tools

Roya [email protected]

April 28, 20161

Page 2: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Roadmap

● Surveillance / Censorship Location Doesn’t Matter!○ The Great Cannon of China

● Is the GFW a country-wide, distributed NIDS?○ Analyzing the Great Firewall of China Over Space and Time

● How is the GFW blocking Tor?○ Examining How the GFW Discovers Hidden Circumvention Servers*

2* Applied Networking Research Prize, IRTF 2016

Page 3: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Roadmap

● Surveillance / Censorship Location Doesn’t Matter!○ The Great Cannon of China

● Is the GFW a country-wide, distributed NIDS?○ Analyzing the Great Firewall of China Over Space and Time

● How is the GFW blocking Tor?○ Examining How the GFW Discovers Hidden Circumvention Servers

3

Page 4: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Surveillance / Censorship Location Doesn’t Matter!● Why care about surveillance and censorship in other countries?

○ Advocacy is important

Page 5: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Surveillance / Censorship Location Doesn’t Matter!● Why care about surveillance and censorship in other countries?

○ Advocacy is important

○ National firewalls can harm international traffic

○ GFW can cause harm → Great Cannon [1]

[1] Analysis of China’s “Great Cannon” by B. Marczak, N. Weaver, J. Dalek, R. Ensafi, D. Fifield, S. McKune, A. Rey, J. Scott-Railton, R. Deibert and V. Paxson (In: USENIX FOCI’15)

Page 6: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

China's Attack Against GitHub● The Great Cannon of China is an attack tool

● Target were hosters of greatfire.org○ GitHub and Cloudflare

GET hm.baidu.com/h.js

Page 7: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Great Cannon

GET hm.baidu.com/h.js

Target TrafficREROUTED

AttackIs request for Baidu script?

1/50 probability?

Page 8: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Great Cannon

GET hm.baidu.com/h.js

Target TrafficREROUTED

AttackIs request for Baidu script?

1/50 probability?

YES:INJECT .js

Page 9: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Great Cannon

GET hm.baidu.com/h.js

Target TrafficREROUTED

AttackIs request for Baidu script?

1/50 probability?

NOYES:INJECT .js

Page 10: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Great Cannon

GET hm.baidu.com/h.js

Target TrafficREROUTED

AttackIs request for Baidu script?

1/50 probability?

NOYES:INJECT .js

SENDREQUEST

Page 11: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Great Cannon for Targeted Exploitation

Page 12: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Great Cannon for Targeted Exploitation

Target TrafficREROUTED

AttackIs request from

US Defense Contractor?

Page 13: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Great Cannon for Targeted Exploitation

Target TrafficREROUTED

AttackIs request from

US Defense Contractor?

YES:INJECT 0-day

Page 14: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Lessons Learned● Widespread deployment of HTTPS crucial

○ Particularly, we need HTTPS’ authentication here, and not encryption

● Exploitation of plain text traffic will not stop

National Firewalls are powerful

Page 15: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Much Already Known About GFW

● Thanks to numerous research papers andblog posts, we know…○ What is blocked

○ How it is blocked

● Is filtering centralized?

15

Page 16: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Roadmap

● Surveillance / Censorship Location Doesn’t Matter!○ The Great Cannon of China

● Is the GFW a country-wide, distributed NIDS?○ Analyzing the Great Firewall of China Over Space and Time

● How is the GFW blocking Tor?○ Examining How the GFW Discovers Hidden Circumvention Servers

16

Page 17: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Is the GFW a Country-wide Distributed NIDS?● Rent a control machine (VPS)

● Cooperate with volunteers

● Not always possible to rent VPS in interesting area

Page 18: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Side Channels to the Rescue!

Page 19: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

● Side channels turn ordinary machines into vantage points!

Solving the Vantage Point Problem

???

Origin

Target

Page 20: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Idle Scan● Idle Scan uses side channel techniques to bounce scans off of a “Target” host

to stealthily scan an “Origin” [2]

● Spooky scan a.k.a Hybrid Idle scan can detect the direction of blocking between an Origin and a Target [3]

Origin

Target

[2] Idle Port Scanning and Non-interference Analysis of Network Protocol Stacks Using Model Checking by Roya Ensafi, J.Park, D. Kapur, and J. Crandall (In: USENIX Sec’ 2010)

[3] Detecting Intentional Packet Drops on the Internet via TCP/IP Side Channels by Roya Ensafi, Jeffrey Knockel, Geoffrey Alexander, and Jedidiah R. Crandall (In: PAM’14)

Page 21: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Spooky Scan Requirements● Global IPID machine for the Origin

● Target that has open port

21

Origin

Target

Page 22: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

No direction blocked

Spooky Scan

MM

Origin

Target

(1) SYN/A

CK

Origin IPID:1000

SYN Backlog0

(2) IPID: 1

000

Page 23: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

No direction blocked

Spooky Scan

MM

Origin

Target

(1) SYN/A

CK

(3) Spoof SYN

Origin IPID:1000

SYN Backlog01

(2) IPID: 1

000

Page 24: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

No direction blocked

Spooky Scan

MM

Origin

Target

(1) SYN/A

CK

(2) IPID: 1

000

(3) Spoof SYN

(4) SYN/ACK

Origin IPID:10001001

SYN Backlog010

(5) RST, IPID: 1001

Page 25: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Spooky Scan

MM

Origin

Target

(1) SYN/A

CK

(2) IPID: 1

000

(3) Spoof SYN

(4) SYN/ACK

(5) RST, IPID: 1001

(6) SYN/A

CK

(7) IPID: 1

002

Origin IPID:100010011002

SYN Backlog010

No direction blocked

Page 26: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Spooky Scan

MM

Origin

Target

(1) SYN/A

CK

(2) IPID: 1

000

(3) Spoof SYN

(4) SYN/ACK

(6) SYN/A

CK

(7) IPID: 1

001

Target to Origin Blocked

Origin IPID:10001001

SYN Backlog01

Page 27: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Target to Origin Blocked Origin to Target Blocked

Spooky Scan

MM

Origin

Target

Origin

Target

MM

(1) SYN/A

CK

(2) IPID: 1

000

(2) IPID: 1

000Origin IPID:10001001

Origin IPID:1000

...1004

(3) Spoof SYN

(4) SYN/ACK

(4) SYN/ACK

(5) RST

(3) Spoof SYN

(6) SYN/A

CK

(7) IPID: 1

004

SYN Backlog01

SYN Backlog01

(1) SYN/A

CK

(6) SYN/A

CK

(7) IPID: 1

001

Page 28: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Real DataPhase 1: just query IPID

Phase 2: send 5 spoofed SYN packets per sec & query IPID for 120 sec

IPID

diff

eren

ce

Target to Origin Blocked

Origin to Target Blocked

No direction blocked

???

Origin

Target

Page 29: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Spooky scan is Used in Practice.● Find Global IPID machines (list of origins)

● Find network you can spoof packets from

● Check if your targets satisfy necessary requirements

● Then, run the Spooky scan to detect the direction of blocking between origin

and target

BOOM! DONE!

Page 30: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Remember the Challenges: Ethics, Scalability● Side channels address scalability

● How can we address the ethics problem?○ Infrastructure machines!

Page 31: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Can We Use Spooky Scan to Learn about GFW?● Many open questions about the GFW and Tor

○ Does censorship of Tor differ for users in different regions?

○ Does filtering depend on when and

where you are?

○ Does blocking change from one ISP to another?

● Revisit old beliefs about the GFW○ Is the GFW a country-wide distributed NIDS?

[4] Analyzing the Great Firewall of China Over Space and Time by Roya Ensafi, P. Winter, A. Mueen, and J. Crandall (In: PETS’15)

Page 32: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Methodology - Relays and Origins

(Map data @ 2014 Google, INEGI)

Page 33: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

● We ran Hybrid Idle Scans for 27 days

● Each pair of origins and servers were tested hourly for a day

(Map data @ 2014 Google, INEGI)

Methodology - Machines Under Our Control

????Origins Targets

Page 34: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Results: No Obvious Geographical Pattern● No geographical or topological pattern is visible. Instead, the distribution

matches the geographic Internet penetration patterns of China.

● More in Ensafi et.al. PETS ‘15

(Map data @ 2014 Google, INEGI) (Map data @ 2014 Google, INEGI)

Page 35: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Roadmap

● Surveillance / Censorship Location Doesn’t Matter!○ The Great Cannon of China

● Is the GFW a country-wide, distributed NIDS?○ Analyzing the Great Firewall of China Over Space and Time

● How is the GFW blocking Tor?○ Examining How the GFW Discovers Hidden Circumvention Servers

35

Page 36: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How is the GFW blocking Tor?

We focus on the GFW and Tor

● GFW is a sophisticated censorship system

● Tor has a long history of being used for circumventing government

censorship

36

Page 37: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Censorship Arms Race: GFW vs. Tor

Tim

e

37

Use public Tor network tocircumvent GFW

Page 38: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Censorship Arms Race: GFW vs. Tor

Tim

e

38

Use public Tor network tocircumvent GFW Download consensus and block

relays

Page 39: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Censorship Arms Race: GFW vs. Tor

Tim

e

39

Use public Tor network tocircumvent GFW

Introduce private bridges, whose distribution is rate-limited

Download consensus and block relays

Page 40: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Censorship Arms Race: GFW vs. Tor

Tim

e

40

Use public Tor network tocircumvent GFW

Introduce private bridges, whose distribution is rate-limited

Download consensus and block relays

Use DPI to detect Tor TLS handshake

Page 41: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Fingerprinting the Tor TLS Handshake

● TLS handshake is unencrypted and leaks information

● Tor’s use of TLS has some peculiarities○ X.509 certificate life times

○ Cipher suites

○ Randomly generated server name indication (e.g., www.6qgoz6epdi6im5rvxnlx.

com)

● GFW looks (at least) for cipher suites in the TLS client hello

41

Page 42: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Censorship Arms Race: GFW vs. Tor

Tim

e

42

Use public Tor network tocircumvent GFW

Introduce private bridges, whose distribution is rate-limited

Introduce pluggable transports to hide Tor’s handshake: obfs2, obfs3

Download consensus and block relays

Use DPI to detect Tor TLS handshake

Page 43: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Tor Pluggable Transport

● Pluggable transports are drop-in modules for traffic obfuscation

● Many modules have been written, but we focus on○ obfs2 (First deployed module)

■ First 20 bytes can be used to detect Tor traffic with high confidence.

○ obfs3 (obfs2’s successor)

■ Makes Tor traffic look like a uniformly random byte stream

43

Page 44: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Encryption Reduces Blocking Accuracy

44

● Detection of pluggable transports is uncertain

○ Implies false positives → collateral damage

● GFW added active probing to complement the DPI fingerprinting

Page 45: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Encryption Reduces Blocking Accuracy

45

● Detection of pluggable transports is uncertain

○ Implies false positives → collateral damage

● GFW added active probing to complement the DPI fingerprinting

Page 46: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How does GFW Block Tor Hidden Circumvention Servers?

1. Network monitoring (e.g., switch mirror port)

46

TLS connection

Page 47: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How does GFW Block Tor Hidden Circumvention Servers?

1. Network monitoring (e.g., switch mirror port)

2. DPI for suspicious traffic (e.g., cipher suite)

47

TLS connection

Cipher list in TLS client hello

looks like vanilla Tor!

c02bc02fc00ac009c013c014c012c007c011003300320045003923566788

Page 48: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Tor handshake

How does GFW Block Tor Hidden Circumvention Servers?

1. Network monitoring (e.g., switch mirror port)

2. DPI for suspicious traffic (e.g., cipher suite)

3. Actively probing server to verify suspicion

48

TLS connection

Active prober

Page 49: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Tor handshake

How does GFW Block Tor Hidden Circumvention Servers?

1. Network monitoring (e.g., switch mirror port)

2. DPI for suspicious traffic (e.g., cipher suite)

3. Actively probing server to verify suspicion

49

TLS connection

Tor handshake

Yes, it was vanilla Tor!

Active prober

Page 50: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Tor handshake

How does GFW Block Tor Hidden Circumvention Servers?

1. Network monitoring (e.g., switch mirror port)

2. DPI for suspicious traffic (e.g., cipher suite)

3. Actively probing server to verify suspicion

4. Blocking server

50

TLS connection

Active prober

Tor handshake

Block server

Page 51: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Censorship Arms Race: GFW vs. Tor

Tim

e

51

Use public Tor network tocircumvent GFW

Introduce private bridges, whose distribution is rate-limited

Introduce pluggable transports to hide the handshake such as obfs2,

obfs3

Download consensus and block relays

Use DPI + Active probing

Use DPI to detect Tor TLS handshake

Page 52: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Many Questions about Active Probing are Unanswered!

● We set out to answer: [5]○ Implementation, i.e., how does it block?

○ Architecture, i.e., how is a system added to China’s backbone?

○ Policy, i.e., what kind of protocols does it block?

○ Effectiveness, i.e., what’s the degree of success at discovering Tor bridges?

52[5] How the Great Firewall discovers hidden circumvention servers By Roya Ensafi, D. Fifield, P. Winter, N. Feamster, N. Weaver, and V. Paxson (In: IMC’15)

Page 53: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How Can We Design Measurements?

Page 54: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Overview of Our Datasets:

54

EC2-Vanilla

Unicom ISP

Clients in China

Shadow Infrastructure

EC2-Obfs2 EC2-Obfs3

EC2-Vanilla EC2-Obfs2 EC2-Obfs3

Amazon AWS

CERNET Network

● Clients in China repeatedly connected

to bridges under our control

● Pcap files of both the clients and

the bridges

Page 55: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

30000..30300..30600

Vanilla Tor

Client in China

Sybil Infrastructure

Forwarding 600 ports to Tor port

Overview of Our Datasets:

55

● Redirected 600 ports to Tor port

● Client in China connects to 600 ports

● Pcap files of both the client and

the relay

Page 56: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Overview of Our Datasets:

56

Server Log Analysis

● Web server that also runs a Tor bridge located in US

● Web server logs dating back to Jan 2010

Page 57: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

30000..30300..30600

Vanilla Tor

Client in China

Sybil Infrastructure

Forwarding 600 ports to Tor port

Overview of Our Datasets:

57

EC2-Vanilla

Unicom ISP

Clients in China

Shadow Infrastructure

EC2-Obfs2 EC2-Obfs3

EC2-Vanilla EC2-Obfs2 EC2-Obfs3

Amazon AWS

CERNET Network

Server Log AnalysisApplication logs of a web server that also runs a Tor bridge since 2010.

Page 58: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How to Distinguish Probers from Genuine Clients?

58

Page 59: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How to Distinguish Probers from Genuine Clients?

● Detecting probers in Sybil dataset is easy,

○ Probers:■ Visited our vanilla Tor bridge after our client established connections

■ Originated from China

59

Page 60: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How to Distinguish Probers from Genuine Clients?

● Detecting probers in Sybil dataset is easy,

○ Probers:■ Visited our vanilla Tor bridge after our client established connections

■ Originated from China

● For the other datasets, we adopt an algorithm:○ If the cipher suites is in the TLS client hello => Vanilla bridge probes

○ If the first 20 bytes can reveal Obfs2 => Obfs2 bridges probers

○ ...60

Page 61: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How Many Unique Probers did We Find?

61

Page 62: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

● Using Sybil, Shadow and Log dataset○ In total, we collected 16,083 unique prober IP addresses

Sybil1,090

Shadow135

Log 14,802

How Many Unique Probers did We Find?

62

22 hours

3 months

2

89

20

GFW’s famous IP:

202.108.181.70

~ 5 years

Page 63: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Where Are the Probers Coming from?

63

Sybil1,090

Shadow135

Log 14,802

Page 64: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Where Are the Probers Coming from?● Reverse DNS suggests ISP pools

○ adsl-pool.sx.cn

○ kd.ny.adsl

○ online.tj.cn

● Majority of probes come from three autonomous

systems○ ASN 4837, 4134, and 17622

64

Sybil1,090

Shadow135

Log 14,802

Page 65: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Can We Fingerprint Active Probers?

65

Page 66: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Can We Fingerprint Active Probers?

66

● TCP layer → TSval○ TSval intercept: (rough) system uptime

Page 67: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Can We Fingerprint Active Probers?

● TCP layer → TSval○ TSval intercept: (rough) system uptime○ GFW likely operate a handful of physical probing systems

67

Shadow exp. with 158 Prober IPs

Sybil exp. with 1,182 Prober IPs

Log dataset with 14,912 Prober IPs

Page 68: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Can We Fingerprint Active Probers?

● TCP layer → ISN○ TCP uses 32-bit initial sequence numbers (ISNs)○ Protects against off-path attackers○ Attacker must guess correct ISN range to inject segments○ Every SYN segment should have random ISN

68

Page 69: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Can We Fingerprint Active Probers?

● TCP layer → ISN○ TCP uses 32-bit initial sequence numbers (ISNs)○ Protects against off-path attackers○ Attacker must guess correct ISN range to inject segments○ Every SYN segment should have random ISN○○

69

Page 70: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Can We Fingerprint Active Probers?

● TCP layer → ISN○ TCP uses 32-bit initial sequence numbers (ISNs)○ Protects against off-path attackers○ Attacker must guess correct ISN range to inject segments○ Every SYN segment should have random ISN○○

70

Page 71: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

What do These Patterns Mean?● Active probing connections leak shared state

○ ISNs, TSval, source ports, ...

● GFW likely operates only few physical systems

● Thousands of IP addresses are controlled by central source

● Does does not seem like off-the-shelf networking stack

● User space TCP stack?

71

Page 72: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How Quickly do Active Probes Show Up?

72

Page 73: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How Quickly do Active Probes Show Up?

● Sybil dataset shows that system now works in real time

○ Median delay between Tor connection and

subsequent probing connection is ~500ms

○ 1,182 distinct probes just in 22 hs

73

Page 74: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

How Quickly do Active Probes Show Up?

● Sybil dataset shows that system now works in real time

○ Median delay between Tor connection and

subsequent probing connection is ~500ms

○ 1,182 distinct probes just in 22 hs

74

Page 75: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

What Other Protocols are Probed?

● SSH: In 2011, not anymore?

● VPN: OpenVPN occasionally, SoftEther

● AppSpot: To find GoAgent?

● Anything else?

75

Page 76: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Pluggable Transports that Work in China

● ScrambleSuit and Obfs4○ Clients must prove knowledge of shared secret

● meek○ Tunnels traffic over CDNs (Amazon, Azure, Google)

● FTE○ Shapes ciphertext based on regular expressions

● More is in the making!○ WebRTC-based transport

76

Page 77: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Summary of Key Findings

● GFW “hijacks” many IP addresses, controls them centrally○ Important for future threat models

● Censorship system is modular○ Tor’s pluggable transports caused GFW to build pluggable censorship

● System now works in real-time

77

Page 78: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Trolling the GFW: Block List Exhaustion

for ip_addr in “$ip_addrs”; do

for port in $(seq 1 65535); do

timeout 5 tor --usebridges 1 --bridge “$ip_addr:$port”

done

done

One /24 network can add 16 million blocklist entries

Page 79: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Lessons Learned (1/2)

● GFW not perfect... and does not have to be!○ Good enough if 99% of users are affected

○ 1% will always be able to circumvent anyway

● Information asymmetry makes our job hard○ Circumvention code and designs often fully transparent

○ GFW, however, fully opaque

79

Page 80: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Lessons Learned (2/2)

● Biggest challenges often not technical○ Usability of Tor Browser

○ How do we broadcast what pluggable transports work?

● We don’t always get our threat models right○ Our adversary isn’t omniscient computer scientist

○ Our adversary is underpaid and just wants to get job done

80

Page 81: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

● Project page: https://nymity.ch/active-probing/

● Log and Sybil data sets are available online

● Contact: [email protected]

● Twitter: @_ _royaen_ _

81

Page 82: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Much Already Known About GFW

● Thanks to numerous research papers andblog posts, we know…○ What is blocked

○ How it is blocked

○ Where the GFW is, topologically

● Unfortunately, most studies are one-off

○ Continuous measurements challenging

82

Page 83: Studying the Great Firewall of China - Stanford Universitynetseminar.stanford.edu/seminars/04_28_16.pdf · 2017-03-18 · The Great Cannon of China Is the GFW a country-wide, distributed

Censored Planet

● Goal is to discover how filtering and controls:○ Vary across regions and countries

○ Evolve over time.

● Using side channel-based measurements○ Broad coverage from many representative vantage points

○ Minimal (or zero) risk to third parties

● http://www.cs.princeton.edu/~rensafi/projects/Censored-Planet/index.html

83