[00:01.500 --> 00:06.260] Alright, welcome back and let's resume with the talks. [00:06.980 --> 00:11.280] Up next, we have the very famous Vivek Ramachandran. [00:11.760 --> 00:14.080] Now we all know who this personality is. [00:16.840 --> 00:20.840] He has over a decade's researching experience. [00:20.840 --> 00:23.880] He has done a lot of research with Wi-Fi security as well. [00:24.360 --> 00:31.120] He has identified attacks such as Caffe Latte attack, broken WPA encoding, and a lot more. [00:31.120 --> 00:37.520] He has been a regular speaker at premier conferences such as Black Hat and DEF CON. [00:38.640 --> 00:44.500] Now, his talk is with respect to identifying weaknesses in secure web gateways. [00:44.580 --> 00:52.620] At times, mitigating web-based initial access threats, enterprises deploy something called as a secure web gateway. [00:52.620 --> 01:07.980] And in this talk, he will explore on how to conduct reconnaissance against SVGs, identify the vendor and location, reconstruct the rules and policies applied, and identify bypasses based on these insights. [01:08.280 --> 01:17.000] He will also introduce a tool called as SVG Recon, a new tool in order to automate enumeration processes. [01:17.220 --> 01:24.960] This tool has been rigorously tested against all leading vendors in the market and has proven to be highly effective. [01:24.960 --> 01:27.060] Quite a good day for us to see this tool. [01:27.060 --> 01:36.700] So here, Vivek will be talking about how easy it is for an attacker to deploy JavaScript via their websites and deliver malware to enterprise browsers. [01:36.700 --> 01:43.380] So please welcome the founder of SquareX, the founder of Pentest Academy, Vivek Ramachandran. [01:48.500 --> 01:51.900] Thank you so much for that kind and sweet introduction. [01:52.360 --> 01:53.500] You said decade. [01:53.500 --> 01:54.860] I've been doing this two decades. [01:54.860 --> 01:56.820] I'm starting to get a bit dated now. [01:59.480 --> 02:01.880] So yeah, welcome to my talk. [02:01.880 --> 02:05.720] A bunch of great people as well, and they'll do an introduction shortly. [02:05.940 --> 02:07.900] So, SWG Recon. [02:08.360 --> 02:14.120] Today, I'm also doing a main stage talk later on SWGs and how they can be broken, track four. [02:15.060 --> 02:18.640] It's a continuation of this, so feel free to show up for that as well. [02:18.960 --> 02:22.120] Now, a little bit about myself. [02:22.520 --> 02:25.860] I started doing security almost 24 years back. [02:26.440 --> 02:32.200] Discovered a bunch of attacks, did my very first DEF CON main stage all the way back in 2007. [02:32.200 --> 02:34.000] It's almost 17 years. [02:34.740 --> 02:41.820] Founded a couple of companies, Pentest Academy, and now I run this company called SquareX where we do browser-native security. [02:43.260 --> 02:45.760] Also, I have a wonderful team. [02:46.040 --> 02:48.160] Most of the work was done by these guys. [02:50.700 --> 02:51.860] Hello, everyone. [02:51.860 --> 02:52.840] I'm Shorin. [02:52.840 --> 02:56.060] I work as a principal software engineer at SquareX. [02:56.260 --> 03:03.240] My research is mainly around extensions and we'll see how we're going to use extensions in this talk as well. [03:03.340 --> 03:10.740] My work has been published in Black Hat Europe before and I'm also giving a few more talks in this DEF CON. [03:14.640 --> 03:15.780] Hello, all. [03:15.780 --> 03:16.720] Happy to see you here. [03:16.720 --> 03:17.880] My name is Dakshita. [03:17.880 --> 03:20.960] I do help out with security research at SquareX. [03:20.960 --> 03:27.000] I've been here since the beginning of the company, so really happy to be part of the ride and happy to share this talk with you. [03:31.430 --> 03:34.170] And this was my co-speaker, Jesvin. [03:35.110 --> 03:41.370] Unfortunately, last-minute US immigration issues and he couldn't make it, so he says hi. [03:43.910 --> 03:46.530] Okay, so secure web gateways. [03:46.570 --> 04:04.470] I think if you look at web browsing in the enterprise today, you have sassy SSE solutions with secure web gateways and the promise that SWGs made that they could look at SSL traffic by doing SSL interception and then just by looking at the network traffic of HTML, [04:04.470 --> 04:08.230] CSS, and JavaScript, figure out application layer attacks. [04:08.850 --> 04:14.270] Anyone here uses SWGs, as they're called, in their enterprise? [04:14.270 --> 04:15.530] Okay, someone? [04:15.530 --> 04:16.890] Okay, just one. [04:17.690 --> 04:27.350] Now, for the purpose of this talk, I'm basically using SWG as a collective term for a lot of security controls which exist with it. [04:27.710 --> 04:31.450] SSL interception, malware detection, DLP, firewall. [04:31.710 --> 04:38.770] So for the talk purpose, all of these components are working together and that's what we are going to go ahead and see how we can recon. [04:39.770 --> 04:41.730] Now, how do SWGs work? [04:41.730 --> 04:51.990] So if you look at a standard file download, what ends up happening is, let's say a user whose computer's traffic is going through the SWG ends up clicking on a link. [04:52.250 --> 04:56.610] There's a HTTP content disposition header which kind of, you know, shows up. [04:56.730 --> 05:15.030] The SWG figures out with that and maybe a couple of other metrics that this is an active file download and then the SWG will either cache it in the cloud, wait for the whole file to be cached, run an AV scan, or it'll start allowing the download while it is analyzing. [05:15.430 --> 05:20.670] And based upon if it feels this is bad, then it'll end up blocking or killing the download in between. [05:21.210 --> 05:38.630] Now similarly for files, or rather websites, if there is a malicious website with HTML, CSS, JavaScript, and maybe it figures that out that this is a clone or a spear phishing website, it'll try to fingerprint that and if you just took that very same website, [05:38.630 --> 05:44.710] put it up on a new domain, typically SWGs will block it or at least that is the promise. [05:47.780 --> 05:55.220] Now from an attacker's perspective, I think browser is a very, very interesting component. [05:55.360 --> 06:12.560] Especially in today's world where hybrid work is happening, your entire workforce is traveling, and really the browser has become the gateway or the access to all your enterprise as well as resources on the internet which your team ends up using. [06:12.560 --> 06:31.440] And that is really where from an attacker's perspective, being able to smuggle malware, malicious files, spear phishing websites, all of that through a secure web gateway which is analyzing all of that traffic in between is very important and crucial. [06:31.460 --> 06:43.880] So because this is the recon village, the entire focus here is hey, could an attacker with absolute zero knowledge figure out if all the traffic is going through a SWIG? [06:44.080 --> 06:48.260] And if yes, what kind of policies, rules, etc. [06:48.260 --> 06:49.600] have been applied, right? [06:49.600 --> 06:52.820] So of course, this talk is just 40-45 minutes. [06:52.820 --> 06:56.960] So I'm going to talk about some of the more interesting use cases. [06:57.320 --> 07:03.680] And at the very end, we'll actually leave you with a GitHub repo where you can download and try this tool out. [07:03.990 --> 07:07.280] And where we plan to cover a lot of other cases. [07:07.440 --> 07:13.220] Much more fine-grained analysis which unfortunately, in such a short talk is very difficult to cover. [07:13.980 --> 07:23.700] So when you look at SWIG enumeration of all the rules and policies, primarily we've kind of broken it down for the purpose of this talk into 5 categories. [07:23.880 --> 07:28.900] The first is vendor detection which is, can you figure out who the vendor is? [07:29.500 --> 07:38.000] I was telling the organizers it's fairly incidental that we have a sassy SSE vendor who is also a sponsor of the recon village. [07:39.960 --> 07:46.880] After the vendor detection is done, how do you figure out what kind of category-based web filtering is applied? [07:47.160 --> 07:51.220] The allowed file types, file sizes, a couple of other things. [07:51.720 --> 07:56.780] And beyond that, if you guys are interested, feel free to show up for the 5pm talk today. [07:58.680 --> 08:02.020] Okay, so identifying SWIG vendors. [08:02.020 --> 08:04.740] Let's have Dakshita run us through it. [08:06.440 --> 08:12.820] First we'll see how we're going to identify which SWIG is being used. [08:13.000 --> 08:14.920] Primarily we do it through two methods. [08:14.920 --> 08:17.500] First is to check for the IP range. [08:17.760 --> 08:19.980] And secondly is to check for connectivity. [08:20.220 --> 08:24.660] Once we've done both of these checks, we kind of know who the vendor is. [08:24.760 --> 08:47.220] If we take a look at how this works, we're just going to send a request and the request will go through the secure web gateway to this website called api.ipapi.is and this essentially gives a JSON response and this response contains the IP address where we can then figure out the ASN, [08:47.220 --> 08:51.040] the organization, and from this way we can figure out who the vendor is. [08:51.200 --> 08:53.000] This is pretty straightforward here. [08:56.160 --> 09:04.160] So just to add to that, SWIG vendors have to have very massive data centers, right, where all of this scrubbing is going on. [09:04.160 --> 09:14.720] And most of the time these data centers are so big and so geographically distributed that you actually see dedicated ASNs for certain vendors. [09:14.860 --> 09:32.740] And most of these IP address ranges are also published many times on the vendor website itself and because all the traffic goes through the proxy, if an attacker were to set up a website where he can basically ping or use one of the open kind of IP pinging services, [09:32.740 --> 09:37.840] it's very easy for him to go ahead and figure out what IP address range is there. [09:38.200 --> 09:48.220] Honestly, there are probably 7 or 8 SWIG vendors in the whole world through which most of the traffic ends up going and this makes it fairly easy to fingerprint. [09:48.520 --> 09:51.480] At the very end of the talk, we'll show you some demos. [09:51.700 --> 09:55.620] Again, the whole idea here is to be vendor agnostic, not to name and shame. [09:55.940 --> 10:00.540] So we'll try not to go ahead and show vendor logos and things like that, right? [10:00.700 --> 10:03.760] Of course, also don't want to get sued. [10:05.820 --> 10:09.640] Okay, so Shaury will talk about the URL categories. [10:13.110 --> 10:24.470] Okay, so just to add one more thing, so you know, sometimes it might happen that the secure web gateways might not actually be sending the traffic from a specific IP or an ASN. [10:24.470 --> 10:28.690] They might also use some sort of a cloud service or they might also use something else. [10:28.690 --> 10:33.450] So in that case, our logic will basically fall back to the connectivity endpoints. [10:33.450 --> 10:41.430] So generally, secure web gateways also have some connectivity endpoints which you can actually call to see whether the secure web gateway is connected or not. [10:41.450 --> 10:49.450] So we have an exhaustive list of those endpoints and using that also, we can figure out which vendor it is in case the ASN check doesn't work. [10:49.790 --> 10:53.170] Now coming back to the allowed URL categories. [10:53.390 --> 11:02.190] So what happens is that typically one of the first policies that any enterprise setup is that what kind of websites are allowed in the network. [11:02.430 --> 11:06.830] Now these can basically be, for example social networking is allowed or not, right? [11:06.830 --> 11:09.010] Or it can be like sports websites allowed or not. [11:09.090 --> 11:15.790] So this is like a very basic check that most people do to filter out what kind of traffic can actually open in the enterprise network. [11:15.870 --> 11:21.630] Now as an attacker, it can actually be helpful as well to get in the system and we'll see how that can be. [11:21.770 --> 11:27.970] So before doing that, we'll see how we can actually recon what kind of categories are allowed in the network. [11:28.550 --> 11:33.330] So typically, you know, there are a lot of different categories. [11:33.370 --> 11:36.870] There is an exhaustive list of categories that Swig supports. [11:37.070 --> 11:39.990] Many of them are also available in their documentation. [11:40.390 --> 11:45.190] Now what we're going to do is that we have a list of URLs. [11:45.330 --> 11:49.610] These URLs fall under different categories and we're going to do a similar thing. [11:49.610 --> 11:57.350] We're going to call all these endpoints from the given device and see which of them are basically opening and which of them are not opening. [11:57.670 --> 12:06.950] Now if in case it gets blocked, we know that based on the policy of the enterprise, this specific category is not allowed to be opened. [12:07.110 --> 12:08.950] Now how do we figure that out? [12:09.090 --> 12:13.690] So typically when you open a webpage , there's an HTTP status code that is written. [12:13.810 --> 12:26.550] So in case it comes out as 200, and that is something we have made sure in the list that whatever endpoint we are hitting or whatever URL we are hitting, generally gives a 200 when it's allowed to be opened. [12:26.610 --> 12:37.810] So in case it's getting blocked by the SWIG, in that case, they'll send like a 4xx response or they'll send a redirect response with a 3xx series. [12:38.150 --> 12:43.390] So whenever we get a status code similar to that, there's a good chance that it's actually being blocked. [12:43.850 --> 12:59.270] In some cases, like this was a possible thought we had, that there might be some vendors who might actually return a 2xx instead of doing a 3xx or 4xx, but at least in the run that we did for any of the major vendors, we did not find that. [12:59.450 --> 13:04.090] However, a possible solution for that could actually be to look at the content text. [13:04.090 --> 13:09.710] Because typically the block page text of a given vendor might be quite similar. [13:09.950 --> 13:17.370] So we can, in case we get a 2xx response, we can look at the HTML content of that page and see if it is something related to a block page. [13:17.470 --> 13:22.490] So in that way, we can also cover cases in case a vendor gives a 2xx response. [13:23.150 --> 13:31.850] Now , similar to that, there are also some common categories which often can be used by attackers. [13:32.030 --> 13:36.110] For example, what kind of domains are allowed? [13:36.170 --> 13:40.150] Sometimes there might be a recently registered domain, whether they're allowed or not. [13:40.210 --> 13:43.190] And there can also be things like a free hosting website. [13:43.790 --> 13:50.530] We have seen cases where people have running phishing campaigns which are typically hosted on any of the online blog pages. [13:50.530 --> 13:53.410] Because they have an older domain, they have a good reputation. [13:53.410 --> 13:55.350] And they often are allowed in the network. [13:55.490 --> 14:00.290] So these checks that we have made, make sure to also open all these categories. [14:01.010 --> 14:07.490] Now, let's say you understood what categories are allowed after the recon. [14:07.730 --> 14:16.030] Now, taking a step further, if we want to see how an attacker can leverage what kind of categories are allowed, we can look at these four different ways. [14:16.070 --> 14:20.530] So the first one is that let's say I go ahead and I register a new domain. [14:20.710 --> 14:25.290] And I figure out that my domain is basically a very new domain. [14:25.490 --> 14:33.130] Now, there are pages of specific SWIG vendors where you can actually go and submit your domain for a classification check. [14:33.490 --> 14:40.890] Now, typically what vendors start with is a categorization based on a domain, rather than doing it on a whole URL. [14:40.890 --> 14:46.110] So I'll do a submission first, making sure that my page looks for a given category. [14:46.170 --> 14:54.530] And once that submission is done, after a while I will simply add a phishing page or a malicious page in a given subdomain. [14:54.610 --> 15:01.230] So for a good period of time, your SWIG will still categorize it as that specific domain which it previously categorized as. [15:01.450 --> 15:07.530] So it's one of the ways you can actually leverage the knowledge of what kind of category is supported in a malicious way. [15:07.530 --> 15:11.530] The other one I already mentioned, you can also use free hosting websites. [15:11.910 --> 15:21.950] One other way is that if you know that a specific category was missed out by the admin in the configuration, you can actually register a domain in that specific category. [15:22.310 --> 15:28.650] And you can have a specific plan to open a certain category of domains in that specific network. [15:28.990 --> 15:35.370] Similarly, one of the most missed out events could also be if recently registered domains are allowed. [15:35.370 --> 15:42.250] Because in some cases, when a domain is very recently registered, they might give an NA or uncategorized response. [15:42.250 --> 15:47.950] So if in case the admin has not set a policy, it can be a very easy way to get into the system. [15:48.870 --> 15:50.710] Now, we'll look at... [15:50.710 --> 15:51.990] Yeah. [15:53.290 --> 16:03.510] So one funny quirk is, which we found with some vendors, is you can buy a new domain and just redirect that domain to a well-known one. [16:03.510 --> 16:08.750] So let's say you buy xxxwhatever.com and just redirect that to yahoo.com. [16:08.750 --> 16:17.030] A lot of swigs today end up following the redirection and by default place you in the same bucket as yahoo.com. [16:17.250 --> 16:23.970] So this is as crazy as it sounds, but in some of the tests that we ran, we actually found this. [16:28.000 --> 16:28.740] Okay. [16:28.740 --> 16:32.840] So now we'll look at a bit about the file types. [16:32.860 --> 16:40.840] Sometimes a certain category of files might also be allowed or not allowed in a given organization based on the policies. [16:42.560 --> 16:46.920] So Vivek will now take this up and show how different vendors set this up. [16:48.780 --> 16:53.520] So this was the part which was the most interesting when we started doing this research. [16:54.080 --> 17:00.540] By the way, this is based upon the public documentation available today on all swig vendors. [17:00.940 --> 17:08.120] Now, you won't believe, there are swig vendors who can only scan up to 15 megabits of file size. [17:08.860 --> 17:26.240] So, literally, if a malware author wanted to go ahead and get this bypassed, all he has to do is have a file size larger, and unless the organization is blocking all files above 15 megs, he can easily bypass that thing. [17:26.240 --> 17:28.700] Now, why is this limitation there, right? [17:28.700 --> 17:32.540] So when we were doing this research, I was thinking, well, why would you want to do this? [17:32.540 --> 17:36.720] Like, today you have so much of memory CPU available in the cloud. [17:37.040 --> 17:39.400] Why have these crazy limitations? [17:39.880 --> 17:42.700] By the way, one of the vendors is also at 2 megs. [17:43.900 --> 17:44.860] Unbelievable. [17:46.060 --> 17:55.580] Now, our hypothesis here is, look, anytime you have to do a deep analysis of a large file, you need to throw a lot of CPU and memory at it, right? [17:55.580 --> 18:00.700] So now imagine a swig vendor who's looking at millions of requests per second. [18:00.700 --> 18:15.540] If they had to go through hundreds of thousands of files and push a lot of CPU memory at it to do that analysis, I don't think you can actually offer your swig or sassy SSE product at $2 to $3 a month per endpoint. [18:15.620 --> 18:22.740] It is just cost prohibitive to go ahead and run such large and in-depth analysis in the cloud. [18:23.100 --> 18:28.320] So if you look at it, file scanning size limits, that's a pretty big one. [18:28.780 --> 18:39.560] And most of the time in our tests, if you just go above it, unless the organization is blanket-blocking everything above a certain size, your malware, whatever you have, would just kind of go through. [18:40.100 --> 18:42.940] The second is file type scanning. [18:43.160 --> 18:46.200] There's massive variation here as well. [18:46.880 --> 18:53.500] Also, a lot of web-native compiled versions of files aren't looked at. [18:53.500 --> 18:55.560] How many of you have heard of WebAssembly? [18:55.560 --> 18:56.540] Wasm. [18:56.900 --> 19:09.160] So you can go about compiling so much of interesting logic into a Wasm module, which is really binary for what it's worth, gets loaded by the browser, runs in the context of the browser. [19:09.160 --> 19:14.920] At this point in time, you could literally write an entire credential stealer in Wasm if you so wanted. [19:15.260 --> 19:17.560] Unfortunately, swigs can't look at it. [19:17.700 --> 19:19.860] They can't look at images. [19:19.880 --> 19:22.620] Now, why could images be interesting? [19:22.620 --> 19:26.680] Come to our talk in the main stage talk today at 5pm. [19:26.700 --> 19:35.080] We'll look at how you can actually hide malware and do something called last-mile reassembly to pick malware out and just drop it in the browser. [19:36.860 --> 19:38.520] Zip recursion levels. [19:38.520 --> 19:40.920] This one was the most interesting. [19:41.940 --> 19:50.080] If you basically have zip files placed recursively, a lot of vendors, unfortunately, cannot scan beyond a few steps. [19:50.080 --> 19:53.860] Some of them actually blatantly just allow it to go through. [19:54.500 --> 19:57.660] And as i said, this is public documentation. [19:57.660 --> 20:00.580] This is not something we tested against different vendors. [20:01.040 --> 20:03.200] Again, there's no need to name and shame. [20:03.500 --> 20:06.060] We just call them swig vendor A to E. [20:11.310 --> 20:14.670] So we tested a bunch of different file types. [20:14.670 --> 20:18.950] So all we did is put all of them on an S3 bucket and went ahead to download it. [20:18.970 --> 20:22.390] And we'll basically see whether this download goes through or not. [20:22.390 --> 20:25.430] So if we get a 200 okay, that means it went through. [20:25.430 --> 20:31.210] So this is how we figure out whether certain file types has been blocked, whether there's been certain policies set up. [20:31.210 --> 20:41.830] So usually what happens is that if swig is not able to scan it, then the admin generally has a policy, can set a policy to say block it completely or just let it pass through. [20:41.830 --> 20:47.850] So this way we can figure out what are the different file types that can go through without being blocked. [20:48.730 --> 20:50.770] So what can we say from this? [20:50.770 --> 20:58.010] So popular file formats like images, audio, videos, generally they are allowed because they tend to be harmless. [20:58.010 --> 21:02.610] But there is many different ways you can hide malware and embed them within it. [21:02.610 --> 21:04.010] So we can use that. [21:04.010 --> 21:05.570] The attackers can use that. [21:05.690 --> 21:08.070] And archives are generally allowed as well. [21:08.070 --> 21:09.630] And they have limited capabilities. [21:09.630 --> 21:13.830] Swigs generally do not scan archives as in-depth as they should. [21:13.830 --> 21:22.590] So we can transform the content, maybe do recursive zipping and so on and find ways to deliver this to the client side. [21:22.590 --> 21:27.430] Password protected zips are also pretty questionable ones. [21:27.430 --> 21:36.130] So if you password protect some content, if the swig is by default not blocking this, you can get it through to the victim. [21:36.470 --> 21:38.050] Finally, office file formats. [21:38.050 --> 21:40.170] So this one is a pretty interesting one. [21:40.230 --> 21:44.710] So there are a few ways we can embed malware through office file formats. [21:44.710 --> 21:51.070] One is definitely through macros, which is the active content within the office files. [21:51.130 --> 22:02.930] Additionally, because the more recent office file formats are actually a zip, so the OXML formats are actually zip, they can actually compress really large file sizes within them. [22:02.930 --> 22:07.590] So you can embed pretty large malware within the office file and zip it up. [22:07.590 --> 22:09.570] So that is one way we can bypass it as well. [22:09.570 --> 22:13.490] And of course, you can password protect your office document, which anybody can do. [22:13.490 --> 22:16.030] And that's another way that we can bypass this. [22:19.450 --> 22:30.910] So I think one of the other things we saw was SWIGs and even endpoint security exceptionally bad at looking at malicious office documents with macros in it. [22:31.270 --> 22:33.550] It's unbelievably bad. [22:33.790 --> 22:35.790] So, EXCs has been pretty good. [22:35.790 --> 22:39.190] I think, you know, most folks have evolved their whole EXC analysis. [22:39.250 --> 22:43.850] You know, static dynamic, there are so many threat feeds and what not. [22:43.910 --> 22:46.090] Office documents, we were surprised. [22:46.090 --> 22:48.030] I mean, this is all about SWIGs. [22:48.030 --> 22:50.150] Maybe we'll do one on endpoint security. [22:50.310 --> 22:55.990] But very, very surprised at how easy it is to kind of go ahead and subvert. [22:59.660 --> 23:07.600] So now we'll look at how we can check what are the different kinds of file size limits enforced by the policy. [23:07.840 --> 23:15.980] So often, what people do is they simply block any kind of downloads which are happening greater than or less than a given file size. [23:15.980 --> 23:20.480] So as part of the recon, it's also good to know what kind of file sizes are actually supported. [23:20.920 --> 23:25.680] It's also very similar to how we were checking different file, supported file types. [23:25.700 --> 23:31.500] So we basically have a bunch of files of different different sizes of a given category. [23:31.500 --> 23:35.120] So let's say I have like five, six different files of Word documents. [23:35.180 --> 23:39.980] And then I will basically categorize them into small size, medium size, and large size. [23:40.100 --> 23:45.540] And then when I upload those files in a given endpoint, or let's say if I try to download them. [23:45.540 --> 23:48.240] So in this case, we're going to download that file. [23:48.280 --> 23:52.580] We'll see what kind of file sizes are allowed to be downloaded. [23:52.940 --> 23:58.420] So to know if a file download is successful, we, again, do the same thing. [23:58.420 --> 24:01.300] We see if the status check is coming out as 200. [24:01.520 --> 24:09.560] In some cases, we saw that often vendors return a 200 status, but there's a file size mismatch. [24:09.760 --> 24:18.240] So they basically send back a file, but it is not the same as what we were initially requesting, because they scanned it, and they found it to be malicious, for example. [24:18.500 --> 24:26.960] So in those cases, what we're going to do is, we're going to use the file hash, compare them, because we are downloading these files from our own bucket. [24:26.960 --> 24:28.860] We know what are the file hashes. [24:28.860 --> 24:33.300] We compare that, and through that, we can know if the download was successful or not. [24:33.480 --> 24:42.240] So through the 200 status check, as well as the file hash check, we are able to do this recon on what kind of file sizes are actually supported. [24:43.620 --> 24:47.460] Now, let's say I know what kind of file sizes are supported. [24:47.460 --> 24:49.960] Now, as an attacker, how can I use that? [24:50.060 --> 24:54.900] So one of the most common ways of doing that would be actually to break files into different chunks. [24:55.500 --> 25:03.640] I can actually break a particular file, break it into chunks, and then I have another client-side script running, which can stitch everything together. [25:03.800 --> 25:11.480] So it's one of the ways such kind of recon can help an attacker to deliver a malicious file in a given device. [25:11.780 --> 25:18.120] Similar to how Dakshita mentioned earlier, you know, even the newer office formats are actually zip files. [25:18.120 --> 25:21.380] So you can put some malicious files inside them as well. [25:21.700 --> 25:24.420] Similarly, large image sizes. [25:24.420 --> 25:30.360] Sometimes, you know, people often don't put a limit on things like images. [25:30.460 --> 25:40.300] And if an admin misses out on such a policy, you can actually use something like technography to, you know, put some sort of malicious file within an image itself. [25:40.300 --> 25:44.920] So it will look like a legit image format, but it can actually have a malicious file. [25:45.040 --> 25:49.460] And then at the client-side, you can again take that malicious file outside your given image. [25:49.940 --> 26:00.540] Similarly, you know, like any kind of web resource, like HTML, JavaScript, WebAssembly, all these can also be used to actually embed a malicious file. [26:02.080 --> 26:09.220] Now we'll look at, you know, now we'll look at how we can also identify the unmonitored channels. [26:12.480 --> 26:15.220] Yeah, so this one is interesting. [26:15.800 --> 26:24.800] I think the promise that SWIX came up with is, you know, we are going to monitor all traffic coming in from a user's browser, probably from an endpoint. [26:24.880 --> 26:27.460] But the web is evolving really fast, right? [26:27.460 --> 26:38.160] Like, large vendors like Google and everybody, right from the browser's perspective, new protocol's perspective, there's leaps and bounds in which, you know, new things are coming up. [26:38.160 --> 26:56.060] And this is really very interestingly, today SWIX are unable to monitor unbelievably anything which goes through WebSockets, because WebSockets is binary streams anyway, so you can actually smuggle through things via WebSocket and completely evade SWIX detection today. [26:56.360 --> 27:07.900] Similarly, protocols like gRPC, WebRTC, WebTransport, SSC, WebPush protocols, unbelievably, all of these are completely unmonitored at this point in time. [27:07.900 --> 27:15.020] So, you really do not need to send a malicious file through your regular HTTP. [27:15.020 --> 27:18.660] You can just go about using one of these, and there is full bypass. [27:18.940 --> 27:28.180] As crazy as it sounds, a lot of SWIX vendors recommend that you actually block these protocols on the browser. [27:29.380 --> 27:44.860] But if you block these, the overall seamlessness with which the web loads live, let's say, any form of audio stream and all of that, there is perceptible loss in the user's experience. [27:45.000 --> 27:48.560] But at this point in time, these channels are completely unmonitored. [27:53.170 --> 28:02.110] So, you can actually go about smuggling various things through it, different kind of documents and all of that, and I think Shaurya can explain more about it. [28:02.110 --> 28:06.190] Yeah, so, it's pretty simple. [28:06.370 --> 28:12.030] What we're going to do here is we're going to actually download a given file through one of these channels. [28:12.030 --> 28:17.090] By doing so, we can figure out what channels admin has missed out on the policy. [28:17.230 --> 28:23.230] So, like Vivek mentioned, most of the time, these vendors recommend to block these kind of protocols. [28:23.310 --> 28:34.870] So, in case an admin has missed out on these policies, during this recon, we can actually find out which particular channel, which is usually unmonitored, is allowed based on the policy. [28:35.230 --> 28:43.150] So, we have different types of files, and we're going to just download them through all of these different newer protocols. [28:44.350 --> 28:48.070] Now, the next one is identifying the DLP policies. [28:52.910 --> 29:02.370] One of the interesting things I wanted to mention about these unmonitored channels is in a lot of enterprises, now you have managed browsers. [29:02.370 --> 29:07.850] You can manage your Chrome, Edge, and there's a bunch of ways to go about doing it. [29:08.010 --> 29:22.830] So, in the recon, even though the SWIG itself isn't really doing anything here, you can actually figure out if some of these protocols were blocked on the browser side itself, and that kind of shows that probably the enterprise is using some kind of managed browser solution. [29:24.270 --> 29:24.890] Okay. [29:24.930 --> 29:26.670] DLP is very interesting. [29:26.850 --> 29:41.870] I think, again, the same promise, when a file is getting uploaded, you can go about running regular expressions, other pattern matching, and all of that, and then figure out if something is admissible, inadmissible, allow or block it. [29:41.910 --> 29:52.710] And this is really where it's very easy for an attacker to go about simulating a file upload from the user's perspective, and try to enumerate various DLP policies. [29:53.010 --> 30:14.150] Now, if an attacker, in one of the earlier enumerations, figures out the exact vendor name, and of course, you know, most nation state attackers or more sophisticated ones would have access to the products as well, it is actually possible to build out very granular DLP testing policies based upon who the vendor is, [30:14.150 --> 30:15.030] by the way. [30:15.110 --> 30:31.930] For the purpose of this talk, we've tried to keep it generic, but with understanding of who the vendor is, you can literally figure out every way that they currently allow you to slice and dice DLP policies, and go about creating tests for that, which can run entirely by the client. [30:35.150 --> 30:35.830] Okay. [30:35.930 --> 30:41.230] So, the different ways by which you can go about deploying this, i think Shaury will take over that. [30:42.130 --> 30:49.350] Primarily, just to give you a high level, is, one is an attacker-controlled website, and the other is through a malicious extension. [30:52.350 --> 30:52.770] Yeah. [30:52.850 --> 31:11.170] So, the reason for using an extension here, is because, you know, since we have a bunch of URL categories, and a bunch of URLs, it's not possible for a single attacker to go ahead and buy all these domains, and update all the course policies. [31:11.170 --> 31:16.730] So, we're going to use extensions here, because extensions are highly privileged inside the browser. [31:16.750 --> 31:27.210] So, if you're making a request from the background script or service worker, as it's called now, you will actually be able to make calls without having any kind of course restrictions. [31:27.310 --> 31:38.350] So, this would make the whole recon process quite easy, because you can actually have a huge list of URLs of different categories, and actually call them up from an extension. [31:38.910 --> 31:52.070] In case, you know, installing an extension is not an option, then of course you can fall back to a normal attacker-controlled website as well, and from that you can also make this request, but in that case you will have to take care of the course restrictions. [31:52.910 --> 31:58.130] Also, you know, if it's happening through an extension, it happens very silently. [31:58.350 --> 32:05.790] So, that's also very convenient for an attacker, in case, you know, he's able to install some sort of an extension through any kind of social engineering measures. [32:05.810 --> 32:12.170] Like, for example, you know, let's say ChatGPT releases a new version, and you just ask them, you know, hey, can I get access to that? [32:12.170 --> 32:17.650] And people are going to search online, and they'll see, oh, there's an extension, which is allowing a free access to that. [32:17.650 --> 32:22.550] They install it on their computer, and you can have your recon process running from there, in the background. [32:22.710 --> 32:28.410] Since there is no tab open, if you are doing it from the background strip, it's way more convenient for an attacker. [32:28.470 --> 32:37.770] So, both these methods are available, but for this talk, what we are going to use is an extension, because it's much more convenient for any kind of lifting the course restrictions. [32:40.770 --> 32:51.890] So, the important thing you have to understand is, you can do this with an attacker-controlled website, minus the URL category one. [32:51.890 --> 32:59.750] And the only reason is, I mean, of course, you as an attacker could also set up all of these different URL categories, and then you don't need an extension as well. [32:59.890 --> 33:05.450] All the other recons that we've shown can actually happen through an attacker-controlled website, right? [33:05.830 --> 33:07.690] So, that's an important distinction. [33:07.690 --> 33:13.990] It's just, how much does an attacker want to invest in setting up, you know, his whole backend infrastructure? [33:14.410 --> 33:15.030] Okay. [33:15.110 --> 33:17.970] So, Shoray will show you guys a quick demo. [33:17.970 --> 33:23.950] The important thing is, we will release this tool on GitHub, and you can go get it after the talk. [33:24.430 --> 33:30.550] Of course, for purposes of the talk, if you do live enumeration, you will end up seeing a lot of vendor names. [33:31.110 --> 33:33.070] How many of you want to see vendor names? [33:34.730 --> 33:35.850] No way. [33:37.530 --> 33:40.130] So, for the purpose of the talk, it's a video. [33:40.130 --> 33:41.870] I hate doing that, you know. [33:41.870 --> 33:44.570] I did my very first talk at DEF CON in 2007. [33:44.570 --> 33:46.050] Always did live ones. [33:46.830 --> 33:54.090] But there's a threatscape beyond the attack, which is the legal threatscape, so I want to be sure to navigate that well as well. [33:54.270 --> 34:04.750] So, we'll show you a video demo, but I guess much of it is, you know, fairly logical, and then hey, on GitHub, pick up the tool, try it out, you know, on your own. [34:07.460 --> 34:08.160] Okay. [34:08.160 --> 34:17.100] So, in this video, we will see a real recon running in an environment where a SWG vendor is present. [34:17.280 --> 34:25.040] For the purpose of this recon, there are a few policies which I want to let you all know was actually configured there. [34:25.200 --> 34:34.400] So , the web sockets and the web socket over SSL, both of these were blocked on the network of the enterprise where this recon was running. [34:34.400 --> 34:41.520] At the same time, all kinds of files which are greater than 500 KB were blocked. [34:41.880 --> 34:46.040] Similarly, a DLP policy was actually set for credit card numbers. [34:46.040 --> 34:50.000] So, there was no DLP policy set for social security numbers. [34:50.000 --> 34:51.780] So, this is how it looks like. [34:52.760 --> 34:58.300] So, you know, what we are going to do is, we are going to simply go ahead, open an extension page. [34:58.300 --> 35:04.480] So, if you see on the top, once you have the extension installed, you can actually access an extension page. [35:04.480 --> 35:06.240] So, I open this extension page. [35:06.240 --> 35:08.680] The purpose of showing this is via a UI. [35:08.960 --> 35:16.060] All these checks are actually running on the background strip, so you don't even have to open this extension page if you are using it in a real environment. [35:16.540 --> 35:21.520] So, I'm just going to go and show how it happens when you click on start analysis. [35:22.060 --> 35:26.800] So, it's going to do a bunch of these checks at the same time on different sites. [35:26.800 --> 35:31.680] So, you can see on the top left, you can see on the top left, [35:36.430 --> 35:40.850] yeah , so on the top left, the vendor was basically identified, but we have blurred this out. [35:41.670 --> 35:52.350] Similarly, all these kinds of enumerations are running, and we are able to see that what kind of protocols are basically allowed in the network, what kind of categories are being allowed. [35:52.390 --> 35:59.810] So, we can see the whole enumeration thing is running, and we are seeing that what is the status code we are getting for each of the URLs we are trying it out with. [35:59.990 --> 36:04.710] So, as I mentioned before, in this particular admin policy, the WebSockets were blocked. [36:04.710 --> 36:10.110] So, we can see that it's appearing as a cross, while the other ones are unable and showing as a check. [36:10.110 --> 36:21.030] So, we can see that in this case, certain kind of categories got blocked, some got partially blocked, and some got completely blocked. [36:21.110 --> 36:34.250] So, the partially blocked implies that certain URLs, so this can also happen that some URLs might have multiple categories, and some of them might get blocked under a different category. [36:34.270 --> 36:38.010] So, in that case, those will basically fall under the partially one. [36:38.010 --> 36:50.530] Similarly, we can see what is happening when we are uploading different kinds of DLP, check the DLP policies, we are uploading files which have social security numbers, or the files which have credit card numbers. [36:50.670 --> 36:59.830] So, this gives a very good view of what kind of file types are supported, what kind of file sizes are supported, and what kind of protocols are supported. [37:00.690 --> 37:06.450] Also, to mention, like I mentioned before, any file greater than 500 KB was blocked. [37:06.450 --> 37:13.330] So, you can see here that in the file size check, all the files which are greater than 500 KB are actually getting blocked. [37:14.750 --> 37:27.310] So, this is how the tool would look like, and once the whole recon is done, you can see the whole list of different categories, the different subcategories, and simple check marks to show what is supported and what is not. [37:27.790 --> 37:33.050] So, now we'll just quickly see how we can prepare ourselves for using this tool. [37:33.190 --> 37:35.190] So, this is the GitHub repo link. [37:35.890 --> 37:39.470] It's a simple Chrome extension, Chromium -based extension. [37:39.470 --> 37:42.990] You can run it over Brave, Chrome browser, any of them. [37:43.150 --> 37:47.750] You simply have to follow the instructions on the readme on how to build the extension. [37:47.990 --> 37:54.530] Once you have the extension built, you have to load this extension in your browser in the developer mode. [37:54.570 --> 38:00.550] The moment you do that, you will be able to access that extension page, and you will be able to run the whole recon. [38:06.110 --> 38:07.190] Thank you so much. [38:07.190 --> 38:08.090] Any questions? [38:08.090 --> 38:09.490] Anyone has any questions? [38:09.770 --> 38:12.950] I don't know if you have time to take questions. [38:13.290 --> 38:14.770] Organizers, anyone? [38:17.090 --> 38:18.510] Yeah, okay. [38:26.560 --> 38:27.640] Okay. [38:28.040 --> 38:38.020] So, we have a main stage talk today at 5 p.m., where we're going to talk about an entire new class of attacks, which we call Last Mile Reassembly. [38:38.020 --> 38:44.220] And we'll show you how those attacks primarily target the architecture of secure web gateways. [38:44.680 --> 38:55.860] We show over 25 bypasses, but honestly, based upon that entire attack genre that we plan to introduce, you can go about extrapolating and building many more attacks. [38:55.860 --> 39:01.180] So, if this was interesting, definitely track 4, 5 p.m., please do come. [39:01.180 --> 39:01.680] Yeah? [39:01.680 --> 39:03.000] Thank you so much. [39:03.000 --> 39:03.820] Thank you.