1 of 48

Russia vs. Telegram

technical notes on the battle

Leonid Evdokimov

35c3, Leipzig, 29 Dec 2018

darkk.net.ru/35c3

2 of 48

$ whoami

Internet measurement fanatic

NOT a Telegram team member

One of the millions of Telegram users

3 of 48

Brief history

4 of 48

Pre-blocklist era

2007 May 23: court order for 4 (four) ISP to block access to “extremist” websites

2007 Jul 14: the 1st issue of the “Federal List of Extremist Materials”�by Ministry of Justice

5 of 48

Librarian’s resistance

2011 Feb: www.zhurnal.lib.ru is banned

Maksim Moshkow “transfers” domain to the Ministry of Justice (via DNS “A” RR)

Some ISPs block minjust.ru ¯\_(ツ)_/¯

6 of 48

Blocklist awakens

2012 Jul 10: Wikipedia strikes, Yandex & VK protest

2012 Jul 11: the internet restriction bill accepted by Duma (Parliament)

2012 Jul 28: the bill signed

7 of 48

What’s the blocklist like today?

XML file, signed by CN=Roskomnadzor with GOST, fetched by ISPs via SOAP, updated at least hourly.

ISPs control filtering equipment. Roskomnadzor monitors it.

8 of 48

Blocklist 2012 awards

8 Nov: Absurdopedia (Uncyclopedia)

11 Nov: Lurkmore memepedia, lib.rus.ec

17 Nov: Github repo with blocklist leak

18 Nov: Google’s https://….gstatic.com

9 of 48

Blacklisted resources in pre-Telegram era

Web Archive, GitHub, Google, LinkedIn, Pornhub, Reddit, VK, Wikipedia…

Comodo CA CRL & OCSP responders

127.0.0.1 (sic!)

10 of 48

“Revisor” — Roskomnadzor’s monitoring system

The law does not matter. The fine does.

2016 Jan: OpenWRT-based TP-Link MR3020, that was talking with C&C via https API without ca-certificates and via ssh without known_hosts

11 of 48

12 of 48

“Revisor” — complying with blackbox

No codified monitoring rules, just FAQ

Some ISPs reverse-engineer it

Some ISPs comply at best-effort

Some ISPs place it into a “sandbox”

13 of 48

Logo of Revisor-devoted Telegram chat @i_love_auditor

14 of 48

“Revisor” & DNS

ISPs are forced to comply with the black-box monitoring system

Stale IPs in dump.xml, “Revisor” using DNS… ⇒ ISPs feed A & AAAA from DNS directly to filters

15 of 48

“Revisor”-provoked so called “DNS-attacks”

2017 May 15: block IP from DNS? Bo-om!

Adding /32 from DNS to routing table?

2017 Jun 7: drop IX peers!

2018 Mar 14: routers go on strike!

16 of 48

Telegram:�Policeman Enters The Game

17 of 48

Telegram? Why?

2017 Apr 7: St.Petersburg bombing

2017 Jun 26, FSB: “terrorists used TG”�RKN promises to block, counts days.

2017 Jun 28: Telegram added to the “Information Distributors Registry

18 of 48

Telegram non-compliance

2017 Dec: Roskomsvoboda starts legal campaign Telegram vs. FSB

2018 Mar 20: court orders Telegram�to pass encryption keys to FSB

2018 Apr 16: RKN attempts to block

19 of 48

Civil cyber-war: leak of BGP-Blackholing letter

Mar 23: Mikhael Klimarev publishes leak

RKN plans ban of 15M IPs: 36 subnets�of Amazon, SoftLayer, … to block Zello.

Keywords: Null0, BGP, redistribute.

20 of 48

RKN-tan tries�to block 14 million�IP addresses of Amazon hosting half of Internet

@aquam1ne

21 of 48

Civil cyber-war: April, 16th, TZ=MSK

11:39 RKN bans TG’s ~/19, no effect�17:58 bans Amazon’s ~/13, TG works�18:33 adds missing TG’s /24 ¯\_(ツ)_/¯�20:21 Google’s /12, Amazon’s /15…

1.8 M IPs banned, Telegram is ~fine

22 of 48

Civil cyber-war: that escalated quickly

Apr 16: ~ 1.8 M banned IPs

Apr 17: ~ 16 M

Apr 22: ~ 19 M, local peak

23 of 48

Civil cyber-war: IP space sanity checks? Ha!

Overlapping subnets in blocklist:�52.0/11 ∩ 52.28/15�34.192/10 ∩ 34.240/13�52.192/11 ∩ 52.208/13�…

24 of 48

Civil cyber-war: URL sanity checks? Ha!

Malformed URL in blocklist:

<![CDATA[http:// 46.101.189.65]]>

^ whitespace

Guess, what filter do?

25 of 48

Civil cyber-war: major services by mistake? Ha!

RKN: significant ones are not affected�Affected: ~34 k .ru, .рф, .su services�Affected: vk.com (87.240.129.133)�Affected: Yandex.Metrica (213.180.193.119)�Affected: Yandex ads (77.88.21.90)

26 of 48

Civil cyber-war: fakenews? Sure!

RKN: “Google Play, Google Drive and google.ru IPs were not banned”

Data: dozens IPs of load balancers discovered via EDNS Client Subnet are actually blocklisted

27 of 48

G.DNS

28 of 48

Civil cyber-war: ISP non-compliance

29 of 48

Delayed compliance example, RIPE Atlas data

30 of 48

Civil cyber-war: lawful interception?

Sniffers used to hunt proxies?

28 Apr: public “tip”, 30 Apr: private tip

Unsecured SORMs, pumping 20 Gbit/s, leaking rpm repo, clickstream and PII?!

31 of 48

SORM: this incident was reported

32 of 48

Protest meetings because of app ban!

33 of 48

Civil cyber-war: Morse prank

D I G I T A L R E S I S T A N C E

34 of 48

Civil cyber-war: Morse prank

Countdown (cheap drama)

35 of 48

Civil cyber-war: Morse prank

“Truly, Popov!” – Radio Day greeting

36 of 48

Civil cyber-war: prank-effects�

Nice amplitude fade-out (thanks, RKN!)

“&.” TLD flash-blocking

15 M → 11 M banned IPs

Expired domains blocklist cleanup

37 of 48

Civil cyber-war: partial rollback

28 Apr: 19 M → 15 M (protest)�8 May: 15 M → 11 M (prank?)�8 Jun: 11 M → 3.7 M (?)�7 Jul: Open Letter on collateral damage had no effect, still ~3.7 M

38 of 48

PCAP or it didn’t happen

39 of 48

Selective protocol throttling

TG speaks Socks5, MTProto, MTproto-dd

~7500 kbps: Socks5, HTTP xor RC4

~22 kbps: MTProto, obfs4, `nc urandom`

Camouflage matters!

40 of 48

Proxy-hunting: MTProto

pkt.len-based hunting was noticed

Rostelecom was part of the experiment

Any IP:Port may be killed by “knocking”

Reuters: “alike experiment happened

41 of 48

Proxy-hunting: Socks5 in Moscow subway

  1. One uses Socks5 in subway
  2. Nmap scans IP:Port
  3. Socks5-scanner tries connect(TG)
  4. IP unreachable via some ISPs
  5. IP officially blocklisted

42 of 48

43 of 48

Secret blocklist private to some ISPs?

> 4. IP unreachable via some ISPs

Some other blacklists exist… regional?…

at least List of Extremist Materials

Block-race is still observed

44 of 48

And then things got worse

45 of 48

Roskomnadzor: The Phantom Menace

RKN deploys “anti-threat” equipment

That also acts as filter

RKN directly controls IP routing & DNS

Registry of “good” Internet Exchanges

46 of 48

so it goes

47 of 48

Thanks to!

Simone Basso, Maria Xynou, Moritz Bartl,�zapret-info, SPb CTF, Roskomsvoboda, Digital Resistance Measurement Squadron, “the one who is to blame”, “Revisor” fans,�NAG, RIPE Atlas, …

48 of 48

Thanks RKN & Durov for fun!

Questions?