start	end	text
0	1880	We have a real treat for you today.
1880	7140	It's Russia's firewall and defending against the future of digital repression.
7320	9960	With Benjamin Mixon-Baca.
10000	11240	Have a great talk.
11240	12480	Yeah, thank you.
16220	17500	Hi.
18960	21460	Thank you for coming to my talk today.
21460	26380	I hope you are excited to learn about Russia's fancy new firewall.
26820	31980	So to sort of motivate this discussion, I'm going to start with an example.
32960	39240	So imagine you want to surprise your grandmother for her birthday.
39580	43900	She absolutely loves cherry peach and eggplant cobbler.
44140	57360	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.
57640	65780	And to your horror, your dismay, your disgust, you see these block pages, right?
65780	76840	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?
76840	83560	And you are sure about this because your buddy Trevor last week just got arrested for looking up cat pictures.
83560	86540	So, you know, you are super nervous.
86540	93960	And for anyone who wants to know, I have the prompt that I used to generate this cool image of me getting arrested.
95060	98660	So what makes this possible?
99260	101760	That's sort of a two‑part question.
102360	107500	There's going to be a policy component and then there's going to be sort of a more technical component.
108460	116760	In Russia specifically, there's about seven or eight laws related to information controls.
117160	118940	So here they are right there.
118940	126740	The most relevant for this discussion though is federal law number 90FZ, the sovereign internet law.
126960	144880	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.
146300	154260	So Roskomnadzar is the body responsible for enforcing censorship in Russia.
154260	157680	Here's a picture of their seal and their headquarters.
157980	159640	They go by Arcane for short.
159640	170100	But basically they coordinate with network operators, ISPs, data centers and things like that to actually enforce the censorship laws in Russia.
173820	175760	So what's blocked?
176320	181900	So mostly things that are related to politics are going to be blocked in Russia.
181900	186360	So CNN, X is blocked.
186800	188380	Google is blocked.
188380	190040	Voice of America is blocked.
190040	197780	So basically anything that the government deems will be destabilizing to the country is blocked.
198640	202800	That pretty much completes the policy portion of this discussion.
202800	205940	I think it's good to just have some context around that.
205940	212420	But this is primarily going to be a technical discussion of sort of the nuts and bolts of how the TSP operates.
212840	222840	So to start that portion, so here's a picture of a TSP that's deployed in a cabinet at a data center somewhere.
223780	232340	The specific equipment that enforces this censorship policy is called the ecofilter DPI and you can see this image there.
233200	235360	This is another picture of it.
235740	239940	And it's manufactured by a company called RDP.RU.
240540	248140	So they were the ones who won out on the bid to provide Roskomnadzar with the censorship equipment.
248140	258620	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.
259160	263480	The ecofilter is pretty impressive for a few reasons.
264640	274880	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.
275060	282140	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.
282140	284780	So that's very impressive.
284780	291880	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.
293000	296860	So yeah, that's just, you know, part of the reason why it's impressive in my opinion.
297320	303160	Some of the other equipment are all Linux based, not all of them, but the ones that I looked into are Linux based.
303160	307020	There's actually ISOs that you can download if you want to poke around.
307400	311280	I did that for another one of the devices called carbon filter.
311740	322040	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.
324620	332860	So just to contextualize censorship, I'm going to start off by discussing a little bit of the great firewall of China.
332860	335940	For those of you who don't know, it's called the GFW.
336240	345120	And it, up until this point, was basically the state of the art for censorship equipment and it's pretty different from the TSPU.
345480	359280	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?
359280	361860	And it can't, for example, throttle connections.
362020	370520	So when you make a request for your recipe for your grandmother, your request is going to traverse a series of nodes.
371200	382240	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.
382920	390100	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.
390100	397840	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?
398440	406060	And because it's on path, it has to do something typically called like a reset injection in order to disrupt your request.
406720	410940	So when that happens, you'll see a block page or something.
411640	418420	And if you're really unlucky, you might have, you might be greeted by one of these autonomous drones to come and arrest you.
419500	420840	So that's bad.
421500	429000	So by contrast, the TSP device, they are in path and this is part of the reason why I was saying it's impressive.
429340	441200	Because hitting that speed of traffic with an in path device without sacrificing quality of service, just from a technical standpoint is pretty incredible.
441660	443120	So it's in path.
443560	450680	And it's also much closer in the network than the GFW where the GFW is something like 14 hops away.
450680	453060	The TSP is more like 5.
453060	458920	And when we were doing experiments and measuring where the TSP was, that's what we found.
459000	463840	So you make a request.
464040	473340	And almost immediately your request is, you know, hit by the TSP and it will see, you know, what you're requesting.
473340	476140	It will see that it's supposed to be blocked.
476900	479720	And because it's in path, it can throttle the connection, right?
479720	491480	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.
491480	494600	So that's one of the reasons why this is kind of a pain.
495640	505040	So just to summarize, basically the sovereign internet law, the RUNet law in Russia, the TSP is one element of that.
505040	508640	But there's, it's actually a fairly broad spectrum approach.
508640	518260	They have, in Russia I believe they have like a national domain name service, the NDSI, so that they can control their domain names.
518440	522440	They also have a national root certificate authority.
523160	529960	And the, basically all the apps in Russia that are produced there have to have one of these trusted root certificates.
529960	535160	So if you look at, for example, Yandex browser, that certificate is embedded in the app.
535160	538340	So you basically have no privacy if you're using Russian apps.
538340	544220	They're also locking down their BGP routes so traffic can't get rerouted.
544220	551020	They're using something called RPKI or resource public key encryption or infrastructure.
551440	554480	So it's a very broad spectrum approach.
556000	559760	So what can we do to kind of get around this?
559760	565540	Are we going to have to repurpose our microwaves to fry all of these nasty drones?
566260	566980	Maybe.
566980	572680	So for some of you hardware hackers out there, you know, maybe you'll get a chance to fry some drones with a microwave.
572920	574440	And if you do, you can teach me.
574440	575420	That would be cool.
575460	583400	But in the interim, there's, I think, some other approaches that I'm going to discuss as far as getting around the censorship.
586160	592300	So why is there this divergence in the deployment?
592300	595500	Why is the TSPU in path?
595500	596620	Why is it closer?
596620	599920	There's a, you know, when compared to the GFW.
600040	604280	Well, there's about three factors that I think are important to call out here.
604280	610260	One is the difference in ISP ecosystem in China compared to Russia.
610260	615020	The other is the economics of equipment that can do the censorship.
615720	618020	And data, the scale of data.
618020	627700	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.
628120	632320	Their ISPs are also more regionally distributed.
632320	644380	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.
647440	657060	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.
657140	665480	But the cost of microprocessors and the density of transistors has made it such that this is feasible again.
665480	681580	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.
682260	689900	I think another interesting thing about this deployment strategy is it also gives Russia finer granularity to perform censorship.
689900	692960	So it can be very regionally specific and targeted.
693320	697440	So that's, that's kind of an interesting aspect of it.
697680	703200	So how do I know that the TSPU is deployed this way?
705520	713500	Well, around 2020, 2021 2022, I was working on something unrelated.
713500	721000	I was looking at vulnerabilities in VPN software and in specifically in the Linux networking code.
721400	728360	And my buddy, Dewin, who had, he had just finished doing a censorship study for Russia.
728360	734660	And he started talking about a really interesting circumvention strategy.
734660	750640	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.
751100	764700	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.
765380	776860	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.
777220	780320	And so what was I looking at?
780320	783900	Well, I was looking at the connection tracking frameworks.
784420	794100	And connection tracking, it turns out, is common across a lot of different types of devices and intrusion detection systems, right?
794100	799560	So here's some connection tracking code for the Zeek IDS.
800920	802800	So that's something I want to call out.
802800	806700	It's trying to figure out what direction the packet is going in.
806700	808420	So is it the client or the server?
809300	814120	Here's Suricata's connection tracking code with just a snippet of it.
814660	820380	And kind of doing a similar thing is trying to figure out which direction the packet is coming from.
820940	824280	This is what I was really looking at at the time.
824320	826300	This is the net filter code.
826340	836820	And there's some special logic to, to figuring out which direction a packet's going in.
836820	842520	And particularly for TCP, this is very challenging.
843080	847380	And that's because TCP has something called simultaneous open.
847380	858060	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.
858520	860880	So this becomes really important.
861340	863180	So what is simultaneous open?
863820	871160	So there is the client on the left hand side, I think, with the peaches.
871380	873960	There's the TSPU censorship device in the middle.
873960	876320	And then there's the web server on the right.
876580	881140	So the TSPU, it's going to have to track the state of a connection.
881240	883120	So it's going to track that in a global table.
883120	885340	This is modeled after the way Linux does it.
885340	889000	But it's kind of similar for, for pretty much anything that's tracking connections.
889000	891040	So anyways, it's going to have a global table.
891460	896480	It's going to track what's called the originator or orage variable.
896480	900220	So that's a connection tuple that's internal to external.
900960	905700	It's going to also track a connection tuple in the reverse direction.
905700	906420	So the reply.
906420	907860	So that would be the server.
907940	910340	Or external to internal.
910700	916340	And in the case of TCP, it has to also track its view of the TCP state.
917260	923600	So with simultaneous open, let's just pretend that the web server initiates a connection .
923600	925200	So it's going to send a SYN packet.
925200	929040	From the TSPU's perspective, it's going to be in a SYN sent state.
929960	936340	And then because we're doing simultaneous open, the client is going to send a connection request, a SYN packet.
936740	940420	And from the TSPU's perspective, it's going to be SYN sent 2.
940420	944040	So that's just another way of saying simultaneous open.
945780	948060	Then the web server is going to send a SYNACK.
948060	950800	So we're in SYN received state.
951260	954380	And then of course the client sends its SYNACK.
954380	956740	So still SYN received.
957180	961700	And then the web server is going to complete its side of the 3-way handshake.
961700	964960	And now the TSPU thinks it's in an established state.
965220	971800	And the client finishes its side of the 3-way handshake and now it's also in, now we're established.
972060	977520	So that pretty much summarizes how simultaneous open works.
978900	990820	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.
990820	995000	So when you're talking about censorship circumvention, there's kind of 2 flavors of strategies.
995140	1004660	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.
1005040	1008600	And so I'm just going to call this the simultaneous open bypass.
1012850	1014030	All right.
1014590	1024850	So, for the censorship circumvention strategy to work, the, your internal client has to coordinate with an external server.
1025270	1030190	So this external client is somebody, you know, outside of Russia, for example.
1030210	1037690	And so the way the strategy works is you'll have to send a SYN packet towards your internal vantage point.
1038170	1041190	And the TSPU thinks it's in SYN sent state.
1042070	1045870	If you'll notice that packet, it doesn't actually reach the client.
1045870	1047750	So it is TTL limited.
1048330	1063910	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.
1064330	1067490	And so the internal client then sends a SYN packet.
1068270	1071530	And so this is from the TSPU's perspective, it's in SYN sent.
1071870	1080930	But in reality, it's going to be, the states are going to be inconsistent between the TSPU and the actual connection end points.
1081750	1084430	So then the web server is going to send a SYN ACK.
1084590	1086750	TSPU thinks it's in SYN received.
1087530	1099330	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.
1099970	1102370	So I'm going to kind of skip over that for now.
1102370	1103550	I'll get back to that in a second.
1103550	1111230	But basically what that allows you to do is bypass the throttling that would normally happen.
1113010	1120330	So there's some other security implications for some of this connection tracking stuff that I was telling you about.
1121430	1128010	It turns out that you can use that to mess with VPNs as well.
1128590	1135870	So we just presented a paper on some of these, some attacks that we had developed against VPNs.
1135870	1140810	We developed an exploit primitive that we call the port shadow.
1140810	1146230	And it basically allows you to port scan somebody behind a VPN.
1146230	1150450	It allows you to de-anonymize or remove the encryption from the VPN.
1150610	1157010	And it also allows you to basically reroute packets in really interesting ways.
1157010	1164110	And in particular, it allows you to basically escalate from an adjacent position to in path.
1164290	1175050	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.
1175130	1181050	So here if you want to read more about the technical details of some of that stuff, just download the slides.
1181470	1184350	There's the links to it.
1185890	1191570	So I just finished, or I just kind of went over the server side bypass strategies.
1192610	1201670	And while we were doing all of this analysis, we were, you know, sending TCP packets with different flags and in different sequences.
1201670	1205730	And we kind of stumbled upon a client side bypass strategy.
1205730	1215630	So with a client side bypass strategy, that means the client sends packets in some weird way to be able to bypass the firewall.
1216170	1224250	And it turns out that if you send five acts in a particular order, you can also bypass the censorship.
1225330	1236590	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.
1237570	1242810	So let's just assume that you kind of, you already do your TCP three way handshake.
1242810	1246910	The last act that the client sends, let's just count that as the first act.
1246910	1250370	So that's act number one from the client to the server.
1251910	1258590	And then when you initiate a TLS four way handshake, you're going to have to send what's called a client hello.
1258930	1262770	And it's typically broken across at least two packets with acts.
1262970	1267690	So that's going to be act number one, act number two and act number three.
1267690	1278930	And then at that point, the TSP, when there's a TLS connection, it has to figure out how to block specific content.
1278930	1282790	And typically it uses what's called SNI based filtering to do that.
1282790	1294690	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.
1295850	1304250	So then the web server, after it gets a client hello, it's going to send its own server hello.
1304830	1308150	And that's basically just negotiating cryptographic parameters.
1308790	1311510	And then the client is going to acknowledge that.
1311510	1313210	So that's act number four.
1314250	1321870	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.
1322690	1325570	And that's typically when censorship happens.
1325570	1330490	So what we found, and again, this was pretty much just like serendipitous.
1330490	1332010	It was completely accidental.
1333470	1338390	What we found was that, let's just say you go through the regular TCP three way handshake.
1338990	1348550	So we found that if you send one, two, three, four, five acts, and then you actually start your client hello.
1349230	1354950	So client hello with the S&I that would normally be blocked.
1356330	1360850	What we think is happening is that there's a buffer inside the TSP devices.
1361750	1366810	And because of that, they need to buffer some amount of TCP packets with data in it.
1366810	1378270	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.
1378270	1381150	And we think that this somehow disrupts the internal state.
1381810	1385770	And that's why this client side bypass strategy works.
1385770	1387590	That's our working theory.
1388150	1390230	But yeah, it was just kind of interesting to see.
1392010	1396690	So then, yeah, the client will, or the web server will send a server hello.
1397630	1404290	Client is going to act that and the server is going to send some data, write your recipe that you wanted.
1406150	1408710	And then there's no throttling.
1408710	1411470	So we just, we thought that was really interesting, right?
1411470	1420370	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.
1422850	1428810	So there's some emerging threats and challenges in this space.
1429670	1442530	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.
1444250	1461890	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.
1461890	1462430	So it's illegal.
1462430	1469630	And it's also illegal to provide information about how to get around censorship.
1470350	1474230	So this is a website called Apple censorship dot com.
1474230	1479590	It's deployed by or maintained by the great fire project.
1479590	1485790	So it's a nifty, nifty website for seeing what's blocked in various countries.
1486190	1488810	They also have one for Google censorship.
1488950	1495290	So you can see here there's VPNs that are not accessible in Russia or China.
1497310	1521750	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.
1522170	1533130	There's a project called the domain name tools investigations and they actually have seen a surge in malware URLs for, for VPNs.
1533130	1544710	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.
1545870	1553450	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.
1555190	1558490	So what does that, what do backdoored VPNs look like?
1558490	1562070	Well, here's an example that I worked on a little while ago.
1562370	1565990	This VPN, it's called an accelerator, it's called Quafon.
1566430	1570050	So here's the legitimate website for this app.
1570470	1572190	That's its domain.
1572850	1581010	And then here is the, the, basically the malicious website.
1582310	1583830	So obviously they're different.
1583830	1589210	If you look at their whois information, it's, it's going to be, it's going to be different, you'll know.
1590110	1600010	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.
1600010	1602190	There's some reflection going on.
1602210	1608750	There's also the, the names of various strings and class names and method names are encrypted.
1608770	1610150	So you can see that here.
1610150	1611650	So those get decrypted.
1611650	1615630	And then, and then it tries to load a shared library.
1615630	1619570	This is actually a packer called Zhiguo.
1619570	1621870	It's by Qiho 360.
1621870	1624090	They're a big Chinese cyber security firm.
1624090	1629170	And this is the, the packer that they use for, for obfuscating their apps.
1629750	1653110	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,
1653110	1655930	like do some research on, on who they are.
1656070	1662830	Um, and on their website you will think, uh, that it's one company and then it turns out that it's another company.
1662830	1678890	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.
1679670	1683110	And I was kind of working on some similar work at the time.
1683390	1693710	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.
1694010	1707130	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.
1707190	1711550	Uh, but if you were to look on their website or their Google Play profile, it says Singapore.
1711550	1718990	So, and, and that information is not, uh, immediately obvious, uh, when you actually look, uh, look up this organization.
1719850	1722170	Um, but it's actually worse than that.
1722170	1728330	So it turns out, so I was reverse engineering these apps because we were really concerned about the transparency of these providers.
1728750	1732390	Uh, and they use, uh, a tunneling protocol called Shadow Socks.
1732390	1736370	Uh, Shadow Socks uses symmetric cryptography.
1736830	1745310	And what's even worse is that, uh, in the case of these apps, they actually hard code the password into the APK.
1745670	1748390	Um, so that's really bad, right?
1748390	1758950	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.
1758950	1761150	And that's exactly what I did.
1761350	1768570	Uh, so that's, um, obfuscated traffic and then, oops, and then that's the decrypted version of the same traffic.
1769250	1783030	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.
1783110	1785210	Uh, I'm still working on confirming that.
1785210	1788350	They're for sure, uh, controlled by a Chinese national.
1788490	1792290	Uh, but that information's not disclosed.
1792350	1796490	So there's a, uh, kind of a transparency issue with that.
1796490	1808430	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.
1809010	1812830	So I just presented some of that work at a workshop called Folkeye.
1812830	1820090	Uh, if you want to read about the technical details of that, um, that's the link to the, to the report there.
1820450	1832970	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.
1833330	1835630	And that's going to be a real challenge to get around.
1836110	1848010	Uh, but in the interim, um, I was saying we found, we discovered, um, client side bypass strategies, right?
1848470	1856170	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.
1856370	1860870	Uh, and that doesn't really work for big companies like Google, Twitter.
1861210	1864950	Uh, and so really what you want are client side bypass strategies.
1866010	1879770	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.
1880370	1883970	So it's kind of like a whack-a-mole scenario, right?
1883970	1887630	We find one thing and then we might be able to tell one or two people and that's it.
1887630	1889670	Like how do we, how do we scale this up?
1890730	1903030	Well, there's fundamental design issues in, uh, network protocols and specifically in like things like stateful firewalls trying to track them.
1903510	1919350	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,
1919350	1923730	can basically automatically discover new client side bypass strategies.
1923730	1925790	I know there's some other work in this space.
1925850	1930610	Uh, this is, uh, an example of, uh, TLA plus.
1930610	1931790	It's a temporal logic.
1931790	1933210	It's a logic programming language.
1933210	1955710	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,
1955710	1956610	super technical.
1956610	1964950	You know, we, we want this to be something that anyone can use, uh, that developers can, uh, benefit from and, uh, yeah.
1964950	1967770	So that's, that's kind of the direction things are going now.
1968510	1971190	So, let's see.
1973570	1976610	Kind of flew through the talk a little bit.
1977630	1981830	Um, so I'm going to go, I'm going to, I have a demo now.
1981830	1999270	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.
1999530	2010850	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.
2010850	2015590	Uh, so shout out to LockNair for writing that, uh, this cool module.
2015830	2018850	So if anyone wants to check that out.
2019650	2020610	Um.
2032000	2042720	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.
2042720	2047380	This is basically the topology I've got going on, uh, in my test environment.
2047780	2066740	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.
2066880	2073540	Um, and to get to the internet, their traffic has to get routed through the NAT gateway or TSP.
2073960	2079340	Uh, so I'm just going to show, uh, with and without, uh, SNI based filtering using that filter.
2079460	2083060	Uh, and then I'm going to show, um, how things kind of currently work.
2083080	2092980	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.
2093140	2095680	Uh, but this is just for illustrative purposes.
2096320	2107280	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.
2107820	2110560	So that's both of these, these terminals here.
2110740	2113920	The upper right is going to be the VPN server.
2114440	2122620	And then, uh, these two devices in the lower right are going to be, uh, the targets behind the TSP device.
2123740	2127540	So, um, I'm just going to make sure my routes are correct.
2127560	2129180	Real quick.
2129400	2138700	Uh, so I want to do, I'm just going to,
2141890	2147750	I just want to make sure I don't get all my SSH traffic.
2147830	2152550	Uh, so I'm just going to download facebook.com real quick.
2153390	2154010	Right.
2154010	2157450	And so obviously that's getting routed through the TSP device.
2157450	2167830	And if I look at the connection tracking table, uh, we should see, yep, there's Facebook's, um, IP address.
2167830	2175170	And you'll see, uh, in the, uh, originator direction, this is the target's, uh, IP address.
2175170	2180270	And that would be their public IP address in, in real life, whatever, um, whatever their ISP assigned to them.
2180350	2183390	This is Facebook's destination IP address.
2183430	2190510	Uh, and you can see this is the, in the originator direction, the source port, the destination port is going to be obviously 443.
2190510	2195510	And then we have the, uh, contract information in the reply direction.
2195510	2201510	So the connection tuples, uh, source sources and destination ports and IPs are, are flipped.
2201510	2207410	Uh, in this case, the connection is in the assured state because packets have been sent in both directions.
2208690	2217430	Um, and so now that that's taken care of, what I'm going to do is add a SNI based firewall rule.
2217430	2225030	Uh, in this case, I'm just using a net filter, um, just for ease of demonstration.
2225290	2234050	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.
2234050	2237850	Cause I thought this was really cool, um, implementation.
2238710	2249010	So now that the SNI based net filter filtering is in place, we'll try to go ahead and get Facebook again.
2249010	2255230	And I'm going to again dump, uh, the network interface.
2256850	2266410	So obviously now, because the firewall is in path, it can drop any packets it wants, right?
2266670	2268410	It doesn't have to do reset injection.
2268410	2273130	It can just drop arbitrary packets and interfere pretty invasively that way.
2275430	2276110	Okay.
2279550	2280310	Right.
2280310	2292550	So now that, uh, I've done that, what I want to do is, um, run a, run a VPN client.
2292790	2295430	In this case, I'm going to do a client to config.
2295430	2296650	There's no reason to do that.
2296670	2300010	In particular, why I'm doing it that way.
2300750	2304610	There we go.
2305230	2305810	All right.
2305810	2307970	So the connection's initiated.
2307970	2317950	I do have to, uh, delete the current default route, which is through the, um, through the TSPU interface.
2318830	2324090	And then I'm going to add a default route for the ton zero interface, which is
2329760	2334500	the route add default dev.
2335600	2337320	Okay.
2337500	2351640	So now the not port two, cause I don't want my SSH traffic.
2351860	2359280	So now, uh, when I do wget, uh, facebook.com, I should.
2359500	2360700	Yep.
2360700	2361780	So I got that.
2363740	2364600	Okay.
2364600	2366680	That looks right.
2366780	2372220	Now I'm going to dump the, uh, connection tracking table again.
2373040	2376920	Uh, this time we can see that old connection.
2376920	2388960	These are old, uh, connection tuples from when, um, when the SNI firewall rule was in place originally, um, and couldn't get through.
2389240	2397920	Uh, but you'll notice that, uh, for this particular connection tuple, um, where is it?
2399000	2415900	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.
2415900	2427840	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.
2428420	2433360	So that is how one would do SNI based filtering with net filter.
2433360	2442580	You might implement some additional optimizations like using X data path or EBPF or, or some other, um, data plane toolkit.
2442580	2459080	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.
2459080	2459940	So, yep.
2459940	2460820	Thank you.
2467740	2469020	Um, yeah.
2469020	2471680	So that's pretty much, uh, that's pretty much what I got.
2471680	2474880	Um, and that's my contact info.
2475380	2477720	Uh, and, um, yeah.
2477760	2479500	So thank you.
