WEBVTT

00:00.000 --> 00:01.880
We have a real treat for you today.

00:01.880 --> 00:07.140
It's Russia's firewall and defending against the future of digital repression.

00:07.320 --> 00:09.960
With Benjamin Mixon-Baca.

00:10.000 --> 00:11.240
Have a great talk.

00:11.240 --> 00:12.480
Yeah, thank you.

00:16.220 --> 00:17.500
Hi.

00:18.960 --> 00:21.460
Thank you for coming to my talk today.

00:21.460 --> 00:26.380
I hope you are excited to learn about Russia's fancy new firewall.

00:26.820 --> 00:31.980
So to sort of motivate this discussion, I'm going to start with an example.

00:32.960 --> 00:39.240
So imagine you want to surprise your grandmother for her birthday.

00:39.580 --> 00:43.900
She absolutely loves cherry peach and eggplant cobbler.

00:44.140 --> 00:57.360
And so you being the good grandson or granddaughter that you are, you go online and you are searching for recipes and you expect to see images like what you see here, right, on your phone.

00:57.640 --> 01:05.780
And to your horror, your dismay, your disgust, you see these block pages, right?

01:05.780 --> 01:16.840
And then you start to freak out because you know, you know, five minutes from now the autonomous drone swarm is going to arrest you, right?

01:16.840 --> 01:23.560
And you are sure about this because your buddy Trevor last week just got arrested for looking up cat pictures.

01:23.560 --> 01:26.540
So, you know, you are super nervous.

01:26.540 --> 01:33.960
And for anyone who wants to know, I have the prompt that I used to generate this cool image of me getting arrested.

01:35.060 --> 01:38.660
So what makes this possible?

01:39.260 --> 01:41.760
That's sort of a two‑part question.

01:42.360 --> 01:47.500
There's going to be a policy component and then there's going to be sort of a more technical component.

01:48.460 --> 01:56.760
In Russia specifically, there's about seven or eight laws related to information controls.

01:57.160 --> 01:58.940
So here they are right there.

01:58.940 --> 02:06.740
The most relevant for this discussion though is federal law number 90FZ, the sovereign internet law.

02:06.960 --> 02:24.880
And it basically sets guidelines for who is supposed to do the regulations, like what body does it, who has to abide by them, so which network operators and fines and things like that.

02:26.300 --> 02:34.260
So Roskomnadzar is the body responsible for enforcing censorship in Russia.

02:34.260 --> 02:37.680
Here's a picture of their seal and their headquarters.

02:37.980 --> 02:39.640
They go by Arcane for short.

02:39.640 --> 02:50.100
But basically they coordinate with network operators, ISPs, data centers and things like that to actually enforce the censorship laws in Russia.

02:53.820 --> 02:55.760
So what's blocked?

02:56.320 --> 03:01.900
So mostly things that are related to politics are going to be blocked in Russia.

03:01.900 --> 03:06.360
So CNN, X is blocked.

03:06.800 --> 03:08.380
Google is blocked.

03:08.380 --> 03:10.040
Voice of America is blocked.

03:10.040 --> 03:17.780
So basically anything that the government deems will be destabilizing to the country is blocked.

03:18.640 --> 03:22.800
That pretty much completes the policy portion of this discussion.

03:22.800 --> 03:25.940
I think it's good to just have some context around that.

03:25.940 --> 03:32.420
But this is primarily going to be a technical discussion of sort of the nuts and bolts of how the TSP operates.

03:32.840 --> 03:42.840
So to start that portion, so here's a picture of a TSP that's deployed in a cabinet at a data center somewhere.

03:43.780 --> 03:52.340
The specific equipment that enforces this censorship policy is called the ecofilter DPI and you can see this image there.

03:53.200 --> 03:55.360
This is another picture of it.

03:55.740 --> 03:59.940
And it's manufactured by a company called RDP.RU.

04:00.540 --> 04:08.140
So they were the ones who won out on the bid to provide Roskomnadzar with the censorship equipment.

04:08.140 --> 04:18.620
But there was actually a bidding process and there's some leaked documents where you can read the reviews that all of these companies, this 12 in total, you know, how they performed.

04:19.160 --> 04:23.480
The ecofilter is pretty impressive for a few reasons.

04:24.640 --> 04:34.880
If you look at the other equipment, they all basically can process on the order of 10 gigs per second or so of network traffic.

04:35.060 --> 04:42.140
The ecofilter, by contrast, its data sheet says that a single device can process on the order of over 100 gigs per second for one device.

04:42.140 --> 04:44.780
So that's very impressive.

04:44.780 --> 04:51.880
I've worked on kind of similar DPI applications myself and it's pretty challenging hitting, you know, 1 or 10 gigs per second, much less 100.

04:53.000 --> 04:56.860
So yeah, that's just, you know, part of the reason why it's impressive in my opinion.

04:57.320 --> 05:03.160
Some of the other equipment are all Linux based, not all of them, but the ones that I looked into are Linux based.

05:03.160 --> 05:07.020
There's actually ISOs that you can download if you want to poke around.

05:07.400 --> 05:11.280
I did that for another one of the devices called carbon filter.

05:11.740 --> 05:22.040
So there's some goodies in there if anyone's interested in seeing, you know, what else is out there looking for vulnerabilities in this equipment, you know, it might be fun, fun exercise to do.

05:24.620 --> 05:32.860
So just to contextualize censorship, I'm going to start off by discussing a little bit of the great firewall of China.

05:32.860 --> 05:35.940
For those of you who don't know, it's called the GFW.

05:36.240 --> 05:45.120
And it, up until this point, was basically the state of the art for censorship equipment and it's pretty different from the TSPU.

05:45.480 --> 05:59.280
So the GFW is deployed, what's known as on path, which means that while it can basically observe and see everything that is traversing the network, it can't, for example, drop packets, right?

05:59.280 --> 06:01.860
And it can't, for example, throttle connections.

06:02.020 --> 06:10.520
So when you make a request for your recipe for your grandmother, your request is going to traverse a series of nodes.

06:11.200 --> 06:22.240
Eventually, and I believe it's somewhere around the 14th hop, so it's kind of deeper into the network, it's going to hit a port mirror and a copy of your request is going to go to the GFW equipment.

06:22.920 --> 06:30.100
And it's going to check, maybe it'll check the SNI, like in a TLS request or something, but it's going to check that.

06:30.100 --> 06:37.840
And because it's on path, your actual request will also go to the end server that you're trying to get that recipe from, right?

06:38.440 --> 06:46.060
And because it's on path, it has to do something typically called like a reset injection in order to disrupt your request.

06:46.720 --> 06:50.940
So when that happens, you'll see a block page or something.

06:51.640 --> 06:58.420
And if you're really unlucky, you might have, you might be greeted by one of these autonomous drones to come and arrest you.

06:59.500 --> 07:00.840
So that's bad.

07:01.500 --> 07:09.000
So by contrast, the TSP device, they are in path and this is part of the reason why I was saying it's impressive.

07:09.340 --> 07:21.200
Because hitting that speed of traffic with an in path device without sacrificing quality of service, just from a technical standpoint is pretty incredible.

07:21.660 --> 07:23.120
So it's in path.

07:23.560 --> 07:30.680
And it's also much closer in the network than the GFW where the GFW is something like 14 hops away.

07:30.680 --> 07:33.060
The TSP is more like 5.

07:33.060 --> 07:38.920
And when we were doing experiments and measuring where the TSP was, that's what we found.

07:39.000 --> 07:43.840
So you make a request.

07:44.040 --> 07:53.340
And almost immediately your request is, you know, hit by the TSP and it will see, you know, what you're requesting.

07:53.340 --> 07:56.140
It will see that it's supposed to be blocked.

07:56.900 --> 07:59.720
And because it's in path, it can throttle the connection, right?

07:59.720 --> 08:11.480
Which is a pretty nasty way of doing censorship because it's harder to tell if it's legitimate, like legitimate disruption or just like actual censorship.

08:11.480 --> 08:14.600
So that's one of the reasons why this is kind of a pain.

08:15.640 --> 08:25.040
So just to summarize, basically the sovereign internet law, the RUNet law in Russia, the TSP is one element of that.

08:25.040 --> 08:28.640
But there's, it's actually a fairly broad spectrum approach.

08:28.640 --> 08:38.260
They have, in Russia I believe they have like a national domain name service, the NDSI, so that they can control their domain names.

08:38.440 --> 08:42.440
They also have a national root certificate authority.

08:43.160 --> 08:49.960
And the, basically all the apps in Russia that are produced there have to have one of these trusted root certificates.

08:49.960 --> 08:55.160
So if you look at, for example, Yandex browser, that certificate is embedded in the app.

08:55.160 --> 08:58.340
So you basically have no privacy if you're using Russian apps.

08:58.340 --> 09:04.220
They're also locking down their BGP routes so traffic can't get rerouted.

09:04.220 --> 09:11.020
They're using something called RPKI or resource public key encryption or infrastructure.

09:11.440 --> 09:14.480
So it's a very broad spectrum approach.

09:16.000 --> 09:19.760
So what can we do to kind of get around this?

09:19.760 --> 09:25.540
Are we going to have to repurpose our microwaves to fry all of these nasty drones?

09:26.260 --> 09:26.980
Maybe.

09:26.980 --> 09:32.680
So for some of you hardware hackers out there, you know, maybe you'll get a chance to fry some drones with a microwave.

09:32.920 --> 09:34.440
And if you do, you can teach me.

09:34.440 --> 09:35.420
That would be cool.

09:35.460 --> 09:43.400
But in the interim, there's, I think, some other approaches that I'm going to discuss as far as getting around the censorship.

09:46.160 --> 09:52.300
So why is there this divergence in the deployment?

09:52.300 --> 09:55.500
Why is the TSPU in path?

09:55.500 --> 09:56.620
Why is it closer?

09:56.620 --> 09:59.920
There's a, you know, when compared to the GFW.

10:00.040 --> 10:04.280
Well, there's about three factors that I think are important to call out here.

10:04.280 --> 10:10.260
One is the difference in ISP ecosystem in China compared to Russia.

10:10.260 --> 10:15.020
The other is the economics of equipment that can do the censorship.

10:15.720 --> 10:18.020
And data, the scale of data.

10:18.020 --> 10:27.700
So if you look up the autonomous system numbers in Russia, there's, I think, something like an order of magnitude more ASs in Russia than China.

10:28.120 --> 10:32.320
Their ISPs are also more regionally distributed.

10:32.320 --> 10:44.380
So to actually deploy this censorship apparatus with this type of network kind of necessitates that it be deployed in path and close to the network.

10:47.440 --> 10:57.060
Researchers didn't used to think that it would be possible to have in path devices about 20 years ago when the GFW was first implemented.

10:57.140 --> 11:05.480
But the cost of microprocessors and the density of transistors has made it such that this is feasible again.

11:05.480 --> 11:21.580
And I think between that and just how much data we're all spitting out and consuming, having a censorship apparatus which is closer to users makes it, you know, this is actually a more ideal approach.

11:22.260 --> 11:29.900
I think another interesting thing about this deployment strategy is it also gives Russia finer granularity to perform censorship.

11:29.900 --> 11:32.960
So it can be very regionally specific and targeted.

11:33.320 --> 11:37.440
So that's, that's kind of an interesting aspect of it.

11:37.680 --> 11:43.200
So how do I know that the TSPU is deployed this way?

11:45.520 --> 11:53.500
Well, around 2020, 2021 2022, I was working on something unrelated.

11:53.500 --> 12:01.000
I was looking at vulnerabilities in VPN software and in specifically in the Linux networking code.

12:01.400 --> 12:08.360
And my buddy, Dewin, who had, he had just finished doing a censorship study for Russia.

12:08.360 --> 12:14.660
And he started talking about a really interesting circumvention strategy.

12:14.660 --> 12:30.640
And it turns out that what he said was if he tried to connect to X or Twitter from a vantage point inside of Russia and he tried to connect to it, his connection would get throttled.

12:31.100 --> 12:44.700
But when he, if he would spoof a SYN packet to his vantage point in Russia from the outside world from Twitter and then connect to the, to the Twitter server, his connection went through.

12:45.380 --> 12:56.860
And that sounded really familiar to me because I had been looking at vulnerabilities and stuff and kind of are elbow deep in the, in the Linux kernel stuff.

12:57.220 --> 13:00.320
And so what was I looking at?

13:00.320 --> 13:03.900
Well, I was looking at the connection tracking frameworks.

13:04.420 --> 13:14.100
And connection tracking, it turns out, is common across a lot of different types of devices and intrusion detection systems, right?

13:14.100 --> 13:19.560
So here's some connection tracking code for the Zeek IDS.

13:20.920 --> 13:22.800
So that's something I want to call out.

13:22.800 --> 13:26.700
It's trying to figure out what direction the packet is going in.

13:26.700 --> 13:28.420
So is it the client or the server?

13:29.300 --> 13:34.120
Here's Suricata's connection tracking code with just a snippet of it.

13:34.660 --> 13:40.380
And kind of doing a similar thing is trying to figure out which direction the packet is coming from.

13:40.940 --> 13:44.280
This is what I was really looking at at the time.

13:44.320 --> 13:46.300
This is the net filter code.

13:46.340 --> 13:56.820
And there's some special logic to, to figuring out which direction a packet's going in.

13:56.820 --> 14:02.520
And particularly for TCP, this is very challenging.

14:03.080 --> 14:07.380
And that's because TCP has something called simultaneous open.

14:07.380 --> 14:18.060
So because of simultaneous open, it's, there's not a deterministic way to figure out which side of a connection is the client versus which side is the server.

14:18.520 --> 14:20.880
So this becomes really important.

14:21.340 --> 14:23.180
So what is simultaneous open?

14:23.820 --> 14:31.160
So there is the client on the left hand side, I think, with the peaches.

14:31.380 --> 14:33.960
There's the TSPU censorship device in the middle.

14:33.960 --> 14:36.320
And then there's the web server on the right.

14:36.580 --> 14:41.140
So the TSPU, it's going to have to track the state of a connection.

14:41.240 --> 14:43.120
So it's going to track that in a global table.

14:43.120 --> 14:45.340
This is modeled after the way Linux does it.

14:45.340 --> 14:49.000
But it's kind of similar for, for pretty much anything that's tracking connections.

14:49.000 --> 14:51.040
So anyways, it's going to have a global table.

14:51.460 --> 14:56.480
It's going to track what's called the originator or orage variable.

14:56.480 --> 15:00.220
So that's a connection tuple that's internal to external.

15:00.960 --> 15:05.700
It's going to also track a connection tuple in the reverse direction.

15:05.700 --> 15:06.420
So the reply.

15:06.420 --> 15:07.860
So that would be the server.

15:07.940 --> 15:10.340
Or external to internal.

15:10.700 --> 15:16.340
And in the case of TCP, it has to also track its view of the TCP state.

15:17.260 --> 15:23.600
So with simultaneous open, let's just pretend that the web server initiates a connection .

15:23.600 --> 15:25.200
So it's going to send a SYN packet.

15:25.200 --> 15:29.040
From the TSPU's perspective, it's going to be in a SYN sent state.

15:29.960 --> 15:36.340
And then because we're doing simultaneous open, the client is going to send a connection request, a SYN packet.

15:36.740 --> 15:40.420
And from the TSPU's perspective, it's going to be SYN sent 2.

15:40.420 --> 15:44.040
So that's just another way of saying simultaneous open.

15:45.780 --> 15:48.060
Then the web server is going to send a SYNACK.

15:48.060 --> 15:50.800
So we're in SYN received state.

15:51.260 --> 15:54.380
And then of course the client sends its SYNACK.

15:54.380 --> 15:56.740
So still SYN received.

15:57.180 --> 16:01.700
And then the web server is going to complete its side of the 3-way handshake.

16:01.700 --> 16:04.960
And now the TSPU thinks it's in an established state.

16:05.220 --> 16:11.800
And the client finishes its side of the 3-way handshake and now it's also in, now we're established.

16:12.060 --> 16:17.520
So that pretty much summarizes how simultaneous open works.

16:18.900 --> 16:30.820
And it turns out that because of that, because of the directions of connections, especially with TCP, that it allows us to use what's called the server side bypass.

16:30.820 --> 16:35.000
So when you're talking about censorship circumvention, there's kind of 2 flavors of strategies.

16:35.140 --> 16:44.660
There's the server side strategies, which just means that the server initiates or modifies or sends packets in some way to bypass the firewall.

16:45.040 --> 16:48.600
And so I'm just going to call this the simultaneous open bypass.

16:52.850 --> 16:54.030
All right.

16:54.590 --> 17:04.850
So, for the censorship circumvention strategy to work, the, your internal client has to coordinate with an external server.

17:05.270 --> 17:10.190
So this external client is somebody, you know, outside of Russia, for example.

17:10.210 --> 17:17.690
And so the way the strategy works is you'll have to send a SYN packet towards your internal vantage point.

17:18.170 --> 17:21.190
And the TSPU thinks it's in SYN sent state.

17:22.070 --> 17:25.870
If you'll notice that packet, it doesn't actually reach the client.

17:25.870 --> 17:27.750
So it is TTL limited.

17:28.330 --> 17:43.910
And that's significant because if it were to reach the client, then that client would send probably a reset ACK and it would reset the state of the connection from the TSPU's perspective and it would basically corrupt the state that we need to be in.

17:44.330 --> 17:47.490
And so the internal client then sends a SYN packet.

17:48.270 --> 17:51.530
And so this is from the TSPU's perspective, it's in SYN sent.

17:51.870 --> 18:00.930
But in reality, it's going to be, the states are going to be inconsistent between the TSPU and the actual connection end points.

18:01.750 --> 18:04.430
So then the web server is going to send a SYN ACK.

18:04.590 --> 18:06.750
TSPU thinks it's in SYN received.

18:07.530 --> 18:19.330
And then the client is going to send its last ACK and then it's going to actually make a request to your web server or to the recipe website or whatever.

18:19.970 --> 18:22.370
So I'm going to kind of skip over that for now.

18:22.370 --> 18:23.550
I'll get back to that in a second.

18:23.550 --> 18:31.230
But basically what that allows you to do is bypass the throttling that would normally happen.

18:33.010 --> 18:40.330
So there's some other security implications for some of this connection tracking stuff that I was telling you about.

18:41.430 --> 18:48.010
It turns out that you can use that to mess with VPNs as well.

18:48.590 --> 18:55.870
So we just presented a paper on some of these, some attacks that we had developed against VPNs.

18:55.870 --> 19:00.810
We developed an exploit primitive that we call the port shadow.

19:00.810 --> 19:06.230
And it basically allows you to port scan somebody behind a VPN.

19:06.230 --> 19:10.450
It allows you to de-anonymize or remove the encryption from the VPN.

19:10.610 --> 19:17.010
And it also allows you to basically reroute packets in really interesting ways.

19:17.010 --> 19:24.110
And in particular, it allows you to basically escalate from an adjacent position to in path.

19:24.290 --> 19:35.050
So this connection tracking stuff is actually like, it's super important and it has broad security implications that I think that's an important thing to understand.

19:35.130 --> 19:41.050
So here if you want to read more about the technical details of some of that stuff, just download the slides.

19:41.470 --> 19:44.350
There's the links to it.

19:45.890 --> 19:51.570
So I just finished, or I just kind of went over the server side bypass strategies.

19:52.610 --> 20:01.670
And while we were doing all of this analysis, we were, you know, sending TCP packets with different flags and in different sequences.

20:01.670 --> 20:05.730
And we kind of stumbled upon a client side bypass strategy.

20:05.730 --> 20:15.630
So with a client side bypass strategy, that means the client sends packets in some weird way to be able to bypass the firewall.

20:16.170 --> 20:24.250
And it turns out that if you send five acts in a particular order, you can also bypass the censorship.

20:25.330 --> 20:36.590
So to understand how, we're kind of, we have a hypothesis as to why it is five acts that allows for this type of behavior and it has to do with the TLS four way handshake.

20:37.570 --> 20:42.810
So let's just assume that you kind of, you already do your TCP three way handshake.

20:42.810 --> 20:46.910
The last act that the client sends, let's just count that as the first act.

20:46.910 --> 20:50.370
So that's act number one from the client to the server.

20:51.910 --> 20:58.590
And then when you initiate a TLS four way handshake, you're going to have to send what's called a client hello.

20:58.930 --> 21:02.770
And it's typically broken across at least two packets with acts.

21:02.970 --> 21:07.690
So that's going to be act number one, act number two and act number three.

21:07.690 --> 21:18.930
And then at that point, the TSP, when there's a TLS connection, it has to figure out how to block specific content.

21:18.930 --> 21:22.790
And typically it uses what's called SNI based filtering to do that.

21:22.790 --> 21:34.690
So the server name indication is plain text and that's what the TSP devices will use to basically fingerprint a connection and perform censorship.

21:35.850 --> 21:44.250
So then the web server, after it gets a client hello, it's going to send its own server hello.

21:44.830 --> 21:48.150
And that's basically just negotiating cryptographic parameters.

21:48.790 --> 21:51.510
And then the client is going to acknowledge that.

21:51.510 --> 21:53.210
So that's act number four.

21:54.250 --> 22:01.870
And then the web server is probably going to push data at that point and then the client of course is going to act those packets.

22:02.690 --> 22:05.570
And that's typically when censorship happens.

22:05.570 --> 22:10.490
So what we found, and again, this was pretty much just like serendipitous.

22:10.490 --> 22:12.010
It was completely accidental.

22:13.470 --> 22:18.390
What we found was that, let's just say you go through the regular TCP three way handshake.

22:18.990 --> 22:28.550
So we found that if you send one, two, three, four, five acts, and then you actually start your client hello.

22:29.230 --> 22:34.950
So client hello with the S&I that would normally be blocked.

22:36.330 --> 22:40.850
What we think is happening is that there's a buffer inside the TSP devices.

22:41.750 --> 22:46.810
And because of that, they need to buffer some amount of TCP packets with data in it.

22:46.810 --> 22:58.270
And because of that, there is, you know, it uses the fact that these are act packets with data to basically do the reassembly and check for an S&I to see whether or not it's blocked.

22:58.270 --> 23:01.150
And we think that this somehow disrupts the internal state.

23:01.810 --> 23:05.770
And that's why this client side bypass strategy works.

23:05.770 --> 23:07.590
That's our working theory.

23:08.150 --> 23:10.230
But yeah, it was just kind of interesting to see.

23:12.010 --> 23:16.690
So then, yeah, the client will, or the web server will send a server hello.

23:17.630 --> 23:24.290
Client is going to act that and the server is going to send some data, write your recipe that you wanted.

23:26.150 --> 23:28.710
And then there's no throttling.

23:28.710 --> 23:31.470
So we just, we thought that was really interesting, right?

23:31.470 --> 23:40.370
And like I said, our theory is that it's because there's a buffer and it needs to keep track of and do reassembly with those packets.

23:42.850 --> 23:48.810
So there's some emerging threats and challenges in this space.

23:49.670 --> 24:02.530
What I didn't talk about too much was the fact that a lot of people in Russia use VPNs, specifically shadow socks or similar fully encrypted protocols to bypass censorship.

24:04.250 --> 24:21.890
And in fact, if you try to download a VPN in Russia, they have issued, the Russian government has asked Google, Google play, Apple app store and other app store providers to remove VPNs from their, you know, from their offering for Russian citizens.

24:21.890 --> 24:22.430
So it's illegal.

24:22.430 --> 24:29.630
And it's also illegal to provide information about how to get around censorship.

24:30.350 --> 24:34.230
So this is a website called Apple censorship dot com.

24:34.230 --> 24:39.590
It's deployed by or maintained by the great fire project.

24:39.590 --> 24:45.790
So it's a nifty, nifty website for seeing what's blocked in various countries.

24:46.190 --> 24:48.810
They also have one for Google censorship.

24:48.950 --> 24:55.290
So you can see here there's VPNs that are not accessible in Russia or China.

24:57.310 --> 25:21.750
So this is created kind of an interesting, this is kind of created a market force where because there's VPNs are no longer, you know, legal to have in those countries, we're starting to see an increase in backdoored and malware, like VPNs with basically malware in them.

25:22.170 --> 25:33.130
There's a project called the domain name tools investigations and they actually have seen a surge in malware URLs for, for VPNs.

25:33.130 --> 25:44.710
And that's pretty consistent with, so this is, in this case it's , it's Chinese VPNs but my preliminary analysis of Russian based VPNs is kind of showing agreement with this.

25:45.870 --> 25:53.450
So if, if, if anyone is interested in kind of checking that, that work out by them, that, you know, go, you know, here's the, the URL for it.

25:55.190 --> 25:58.490
So what does that, what do backdoored VPNs look like?

25:58.490 --> 26:02.070
Well, here's an example that I worked on a little while ago.

26:02.370 --> 26:05.990
This VPN, it's called an accelerator, it's called Quafon.

26:06.430 --> 26:10.050
So here's the legitimate website for this app.

26:10.470 --> 26:12.190
That's its domain.

26:12.850 --> 26:21.010
And then here is the, the, basically the malicious website.

26:22.310 --> 26:23.830
So obviously they're different.

26:23.830 --> 26:29.210
If you look at their whois information, it's, it's going to be, it's going to be different, you'll know.

26:30.110 --> 26:40.010
And it turns out that when you start reverse engineering the APK for the malicious VPN, it's, for those of you who don't know, this is, this is obfuscation.

26:40.010 --> 26:42.190
There's some reflection going on.

26:42.210 --> 26:48.750
There's also the, the names of various strings and class names and method names are encrypted.

26:48.770 --> 26:50.150
So you can see that here.

26:50.150 --> 26:51.650
So those get decrypted.

26:51.650 --> 26:55.630
And then, and then it tries to load a shared library.

26:55.630 --> 26:59.570
This is actually a packer called Zhiguo.

26:59.570 --> 27:01.870
It's by Qiho 360.

27:01.870 --> 27:04.090
They're a big Chinese cyber security firm.

27:04.090 --> 27:09.170
And this is the, the packer that they use for, for obfuscating their apps.

27:09.750 --> 27:33.110
Um, so in addition to the, the like malicious VPNs, uh, there's also a threat that, um, some providers who you might think are legitimate are not fully transparent in terms of like who, um, who they're, like you don't, you, you might like, uh, look up,

27:33.110 --> 27:35.930
like do some research on, on who they are.

27:36.070 --> 27:42.830
Um, and on their website you will think, uh, that it's one company and then it turns out that it's another company.

27:42.830 --> 27:58.890
So actually, uh, uh, an organization by the name of the Tech Transparency Project, they uncovered, uh, recently connections between, um, several, uh, Chinese, uh, VPNs and, uh, the People's Liberation Army.

27:59.670 --> 28:03.110
And I was kind of working on some similar work at the time.

28:03.390 --> 28:13.710
Um, specifically there's, uh, VPNs that are pretty popular, uh, by one of them is called TurboVPN, but there's like three other VPNs, uh, from that report.

28:14.010 --> 28:27.130
But if you look, uh, so if you dig into their business records, if you go to, um, opencorporates.com and look up Innovative Connecting, you'll see that their copyright information is actually, shows that they're based out of, uh, Beijing.

28:27.190 --> 28:31.550
Uh, but if you were to look on their website or their Google Play profile, it says Singapore.

28:31.550 --> 28:38.990
So, and, and that information is not, uh, immediately obvious, uh, when you actually look, uh, look up this organization.

28:39.850 --> 28:42.170
Um, but it's actually worse than that.

28:42.170 --> 28:48.330
So it turns out, so I was reverse engineering these apps because we were really concerned about the transparency of these providers.

28:48.750 --> 28:52.390
Uh, and they use, uh, a tunneling protocol called Shadow Socks.

28:52.390 --> 28:56.370
Uh, Shadow Socks uses symmetric cryptography.

28:56.830 --> 29:05.310
And what's even worse is that, uh, in the case of these apps, they actually hard code the password into the APK.

29:05.670 --> 29:08.390
Um, so that's really bad, right?

29:08.390 --> 29:18.950
Like that basically means that anyone on the network who can, um, enumerate the IPs of the VPN servers can do, decrypt, uh, the traffic for these, for these particular VPNs.

29:18.950 --> 29:21.150
And that's exactly what I did.

29:21.350 --> 29:28.570
Uh, so that's, um, obfuscated traffic and then, oops, and then that's the decrypted version of the same traffic.

29:29.250 --> 29:43.030
And there's actually, in addition to the three VPNs from the tech transparency project, uh, reporting, uh, I also uncovered, uh, five other VPN providers that are all, they all appear to be linked to Chihuahua 360.

29:43.110 --> 29:45.210
Uh, I'm still working on confirming that.

29:45.210 --> 29:48.350
They're for sure, uh, controlled by a Chinese national.

29:48.490 --> 29:52.290
Uh, but that information's not disclosed.

29:52.350 --> 29:56.490
So there's a, uh, kind of a transparency issue with that.

29:56.490 --> 30:08.430
And the fact that they also use, uh, symmetric cryptography with, uh, hard coded passwords is, um, you know, a pretty big, pretty big security issue.

30:09.010 --> 30:12.830
So I just presented some of that work at a workshop called Folkeye.

30:12.830 --> 30:20.090
Uh, if you want to read about the technical details of that, um, that's the link to the, to the report there.

30:20.450 --> 30:32.970
Uh, and then one of the last, um, one of the last threats, uh, that, uh, is sort of an emerging thing is the, it seems like the Russian government is going towards whitelisting.

30:33.330 --> 30:35.630
And that's going to be a real challenge to get around.

30:36.110 --> 30:48.010
Uh, but in the interim, um, I was saying we found, we discovered, um, client side bypass strategies, right?

30:48.470 --> 30:56.170
Those are preferred to the server side bypass strategies because in the server side case, right, you need an external machine to sort of coordinate with.

30:56.370 --> 31:00.870
Uh, and that doesn't really work for big companies like Google, Twitter.

31:01.210 --> 31:04.950
Uh, and so really what you want are client side bypass strategies.

31:06.010 --> 31:19.770
But it doesn't really work for us to like test one vantage point and then just randomly discover, you know, accidentally techniques because it's really hard for us to be able to, uh, deploy those at scale.

31:20.370 --> 31:23.970
So it's kind of like a whack-a-mole scenario, right?

31:23.970 --> 31:27.630
We find one thing and then we might be able to tell one or two people and that's it.

31:27.630 --> 31:29.670
Like how do we, how do we scale this up?

31:30.730 --> 31:43.030
Well, there's fundamental design issues in, uh, network protocols and specifically in like things like stateful firewalls trying to track them.

31:43.510 --> 31:59.350
Uh, so you can think of those like cracks or chinks in the armor, uh, for the, uh, for the firewall and what we're basically trying to do now, what we're in the process of developing are, is essentially something like an embedded state machine that, um,

31:59.350 --> 32:03.730
can basically automatically discover new client side bypass strategies.

32:03.730 --> 32:05.790
I know there's some other work in this space.

32:05.850 --> 32:10.610
Uh, this is, uh, an example of, uh, TLA plus.

32:10.610 --> 32:11.790
It's a temporal logic.

32:11.790 --> 32:13.210
It's a logic programming language.

32:13.210 --> 32:35.710
But the idea is to use something like this to basically, uh, provide developers, uh, with, um, some means of automatically, uh, bypassing censorship, uh, without having to, um, without having to depend on end users having rooted devices, uh, or be, uh,

32:35.710 --> 32:36.610
super technical.

32:36.610 --> 32:44.950
You know, we, we want this to be something that anyone can use, uh, that developers can, uh, benefit from and, uh, yeah.

32:44.950 --> 32:47.770
So that's, that's kind of the direction things are going now.

32:48.510 --> 32:51.190
So, let's see.

32:53.570 --> 32:56.610
Kind of flew through the talk a little bit.

32:57.630 --> 33:01.830
Um, so I'm going to go, I'm going to, I have a demo now.

33:01.830 --> 33:19.270
This demo is not, um, it's basically just going over like how connection tracking works , um, and showing how even in the face of SNI based filtering, uh, how people are typically getting around that and just explaining some of the connection tracking stuff.

33:19.530 --> 33:30.850
So to, to do this, I, I, uh, installed this, um, this, uh, it's basically a, a network, uh, network filter, uh, module for doing SNI based filtering.

33:30.850 --> 33:35.590
Uh, so shout out to LockNair for writing that, uh, this cool module.

33:35.830 --> 33:38.850
So if anyone wants to check that out.

33:39.650 --> 33:40.610
Um.

33:52.000 --> 34:02.720
Okay, I'm going to run the, just an example of how, uh, a stateful firewall that does, uh, SNI based filtering, uh, could work just based on my observations.

34:02.720 --> 34:07.380
This is basically the topology I've got going on, uh, in my test environment.

34:07.780 --> 34:26.740
Um, so the TSP devices, effectively this, this device here, this NAT gateway, um, the, the target behind the TSP, uh, which would be like a Russian citizen, for example, is this some web client, whatever.

34:26.880 --> 34:33.540
Um, and to get to the internet, their traffic has to get routed through the NAT gateway or TSP.

34:33.960 --> 34:39.340
Uh, so I'm just going to show, uh, with and without, uh, SNI based filtering using that filter.

34:39.460 --> 34:43.060
Uh, and then I'm going to show, um, how things kind of currently work.

34:43.080 --> 34:52.980
Uh, I'm going to use open VPN in this example, but in reality, the TSP actually does block, uh, open VPN, uh, at least the vanilla version of that protocol.

34:53.140 --> 34:55.680
Uh, but this is just for illustrative purposes.

34:56.320 --> 35:07.280
So to get started, uh, I have several terminals open, uh, the upper or the, I'm sorry, left-hand side, uh, is the firewall or TSP device.

35:07.820 --> 35:10.560
So that's both of these, these terminals here.

35:10.740 --> 35:13.920
The upper right is going to be the VPN server.

35:14.440 --> 35:22.620
And then, uh, these two devices in the lower right are going to be, uh, the targets behind the TSP device.

35:23.740 --> 35:27.540
So, um, I'm just going to make sure my routes are correct.

35:27.560 --> 35:29.180
Real quick.

35:29.400 --> 35:38.700
Uh, so I want to do, I'm just going to,

35:41.890 --> 35:47.750
I just want to make sure I don't get all my SSH traffic.

35:47.830 --> 35:52.550
Uh, so I'm just going to download facebook.com real quick.

35:53.390 --> 35:54.010
Right.

35:54.010 --> 35:57.450
And so obviously that's getting routed through the TSP device.

35:57.450 --> 36:07.830
And if I look at the connection tracking table, uh, we should see, yep, there's Facebook's, um, IP address.

36:07.830 --> 36:15.170
And you'll see, uh, in the, uh, originator direction, this is the target's, uh, IP address.

36:15.170 --> 36:20.270
And that would be their public IP address in, in real life, whatever, um, whatever their ISP assigned to them.

36:20.350 --> 36:23.390
This is Facebook's destination IP address.

36:23.430 --> 36:30.510
Uh, and you can see this is the, in the originator direction, the source port, the destination port is going to be obviously 443.

36:30.510 --> 36:35.510
And then we have the, uh, contract information in the reply direction.

36:35.510 --> 36:41.510
So the connection tuples, uh, source sources and destination ports and IPs are, are flipped.

36:41.510 --> 36:47.410
Uh, in this case, the connection is in the assured state because packets have been sent in both directions.

36:48.690 --> 36:57.430
Um, and so now that that's taken care of, what I'm going to do is add a SNI based firewall rule.

36:57.430 --> 37:05.030
Uh, in this case, I'm just using a net filter, um, just for ease of demonstration.

37:05.290 --> 37:14.050
This is a, this is a custom module that, um, someone wrote and I'll post a link just to give credit where credit's due.

37:14.050 --> 37:17.850
Cause I thought this was really cool, um, implementation.

37:18.710 --> 37:29.010
So now that the SNI based net filter filtering is in place, we'll try to go ahead and get Facebook again.

37:29.010 --> 37:35.230
And I'm going to again dump, uh, the network interface.

37:36.850 --> 37:46.410
So obviously now, because the firewall is in path, it can drop any packets it wants, right?

37:46.670 --> 37:48.410
It doesn't have to do reset injection.

37:48.410 --> 37:53.130
It can just drop arbitrary packets and interfere pretty invasively that way.

37:55.430 --> 37:56.110
Okay.

37:59.550 --> 38:00.310
Right.

38:00.310 --> 38:12.550
So now that, uh, I've done that, what I want to do is, um, run a, run a VPN client.

38:12.790 --> 38:15.430
In this case, I'm going to do a client to config.

38:15.430 --> 38:16.650
There's no reason to do that.

38:16.670 --> 38:20.010
In particular, why I'm doing it that way.

38:20.750 --> 38:24.610
There we go.

38:25.230 --> 38:25.810
All right.

38:25.810 --> 38:27.970
So the connection's initiated.

38:27.970 --> 38:37.950
I do have to, uh, delete the current default route, which is through the, um, through the TSPU interface.

38:38.830 --> 38:44.090
And then I'm going to add a default route for the ton zero interface, which is

38:49.760 --> 38:54.500
the route add default dev.

38:55.600 --> 38:57.320
Okay.

38:57.500 --> 39:11.640
So now the not port two, cause I don't want my SSH traffic.

39:11.860 --> 39:19.280
So now, uh, when I do wget, uh, facebook.com, I should.

39:19.500 --> 39:20.700
Yep.

39:20.700 --> 39:21.780
So I got that.

39:23.740 --> 39:24.600
Okay.

39:24.600 --> 39:26.680
That looks right.

39:26.780 --> 39:32.220
Now I'm going to dump the, uh, connection tracking table again.

39:33.040 --> 39:36.920
Uh, this time we can see that old connection.

39:36.920 --> 39:48.960
These are old, uh, connection tuples from when, um, when the SNI firewall rule was in place originally, um, and couldn't get through.

39:49.240 --> 39:57.920
Uh, but you'll notice that, uh, for this particular connection tuple, um, where is it?

39:59.000 --> 40:15.900
There is, um, no, there's no entry for the current, uh, connection to Facebook, but there is a connection, uh, in the connection tracking table for the VPN connection.

40:15.900 --> 40:27.840
So anytime a connection traverses an in-path device in this way, the contract table is going to be populated with, um, these connection tracking entries.

40:28.420 --> 40:33.360
So that is how one would do SNI based filtering with net filter.

40:33.360 --> 40:42.580
You might implement some additional optimizations like using X data path or EBPF or, or some other, um, data plane toolkit.

40:42.580 --> 40:59.080
There's like DPDK for example, uh, or PF ring, or you might do it in hardware or something, but, um, hopefully this kind of gives you a sense for the, you know, how, how this would work for, um, at least in this case.

40:59.080 --> 40:59.940
So, yep.

40:59.940 --> 41:00.820
Thank you.

41:07.740 --> 41:09.020
Um, yeah.

41:09.020 --> 41:11.680
So that's pretty much, uh, that's pretty much what I got.

41:11.680 --> 41:14.880
Um, and that's my contact info.

41:15.380 --> 41:17.720
Uh, and, um, yeah.

41:17.760 --> 41:19.500
So thank you.

