Internet censorship and circumvention

David Fifield
david@bamsoftware.com

CS3640

https://www.bamsoftware.com/talks/uiowa-cs3640-2023

Learning objectives

Some documented Internet censorship events in 2023

https://explorer.ooni.org/findings
OONI Explorer Censorship Findings (21): Guinea blocked WhatsApp, Telegram, Facebook, Twitter, Instagram, and YouTube; Tanzania blocked Clubhouse; etc.

Abstract model of network censorship

Diagram of a censorship model, with a 'client' node in the middle of a censor-controlled network, connected by network links to an outside 'destination' node.

How might a middlebox detect that a client is trying to access a prohibited destination and/or prohibited information?

http://example.com/article
https://example.com/article

How might a middlebox detect that a client is trying to access a prohibited destination and/or prohibited information?

  • DNS query
  • Destination IP address
  • URL path (unencrypted only)
  • Keywords (unencrypted only)
  • TLS SNI
  • Client IP address?
  • Packet sizes and timing (website fingerprinting)?
  • Correlation with other connections?

Having detected something it wants to prevent, how might a middlebox block a connection?

  • Drop packets
  • Blackhole an IP address (or port)
  • Inject false DNS responses
  • Inject HTTP redirect to a block page (unencrypted only)
  • Inject TCP RST packet
  • Throttle (slow down the connection)?

DNS resolution from the command line

Unix
$ dig dw.com
Windows
C:\> nslookup dw.com

DNS resolution from the command line

$ dig dw.com

; <<>> DiG 9.16.44-Debian <<>> @1.1.1.1 dw.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23145
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;dw.com.                                IN      A

;; ANSWER SECTION:
dw.com.                 164     IN      A       194.55.30.46
dw.com.                 164     IN      A       194.55.26.46

;; Query time: 3 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Thu Dec 07 03:45:39 UTC 2023
;; MSG SIZE  rcvd: 67

DNS injection (Turkmenistan)

95.85.120.6 is the IP address of a host located in Turkmenistan.
(It's not a DNS server though!)

What happens when you send a DNS query through the firewall hosts that surround Turkmenistan's network?

Unix
$ dig @95.85.120.6 dw.com
Windows
C:\> nslookup dw.com 95.85.120.6

DNS injection (Turkmenistan)

$ dig @95.85.120.6 dw.com

; <<>> DiG 9.16.44-Debian <<>> @95.85.120.6 dw.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22268
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;dw.com.                                IN      A

;; ANSWER SECTION:
dw.com.                 300     IN      A       127.0.0.1

;; Query time: 246 msec
;; SERVER: 95.85.120.6#53(95.85.120.6)
;; WHEN: Thu Dec 07 03:48:15 UTC 2023
;; MSG SIZE  rcvd: 40

Reference: Measuring and Evading Turkmenistan's Internet Censorship 2023.

DNS injection (China)

159.226.244.24 is the IP address of a host located in China. (Also not a DNS server.)

Unix
$ dig @159.226.244.24 dw.com
Windows
C:\> nslookup dw.com 159.226.244.24

DNS injection (China)

$ dig +short @159.226.244.24 dw.com
75.126.164.178
$ dig +short @159.226.244.24 dw.com
67.15.129.210
$ dig +short @159.226.244.24 dw.com
128.121.146.101
$ dig +short @159.226.244.24 dw.com
31.13.95.34
$ dig +short @159.226.244.24 dw.com
69.63.181.12
$ dig +short @159.226.244.24 dw.com
168.143.162.58

Reference: How Great is the Great Firewall? Measuring China's DNS Censorship.

DNS injection

How does providing a fake DNS response prevent a user from accessing a domain?

The DNS injection systems in Turkmenistan and China are bidirectional, meaning they don't make a distinction between inbound and outbound packets.

(Remote censorship measurement systems like Censored Planet take advantage of this and other properties, to measure levels of censorship without needing a physical presence in another country.)

Not all forms of censorship are this easy to test and see.

Circumvention

What can a client do to circumvent a block of some desired destination/information?

Against a naive censor:
Against a sophisticated censor:

Circumvention systems

All-in-one systems:

Key ideas in circumvention

The censor can use the system too, and study how it works.

What prevents a censor from discovering all your proxy IP addresses and blocking them?

The key question is:

What does it cost a censor to block the system?

Protocol obfuscation is not enough.

You need to somehow protect the endpoints too.

If you are interested

https://github.com/net4people/bbs, a censorship circumvention forum that I manage.

https://ntc.party/, another active forum.

https://snowflake.torproject.org/, run a browser extension to help people circumvent censorship.

https://ooni.org/, install an app to measure censorship.

David Fifield
david@bamsoftware.com