1 00:00:00,000 --> 00:00:00,580 All righty. 2 00:00:00,580 --> 00:00:09,440 Hi, everybody, and welcome to Chrome Alone, a discussion about transforming a browser into a C2 platform. 3 00:00:10,580 --> 00:00:15,920 So I'm Mike Weber, and I've been building offensive Chrome extensions since 2018. 4 00:00:15,920 --> 00:00:24,080 I gave a talk back at DerbyCon about this a couple of years ago, and the reason I'm still doing it is because it is so damn effective. 5 00:00:24,460 --> 00:00:39,340 I currently work at Praetorian Security where I make malicious extensions and other fun tools for our red team, and it's regularly still getting them from pretty much no access at all to just GGing our clients completely in a really quick amount of time. 6 00:00:39,340 --> 00:00:45,840 So I'm excited to get to share this stuff with you so you can also do this on your targets and really just have a good time with Chrome. 7 00:00:47,680 --> 00:00:50,800 Fun fact, there are a lot of Mike Webbers in security. 8 00:00:51,100 --> 00:00:54,300 The list on screen is all of those who I am not. 9 00:00:54,300 --> 00:00:58,160 If you need an easy reminder, I'm the Mike Webber that works for Praetorian Security. 10 00:00:58,160 --> 00:01:04,920 Sometimes we have a Roman motif going on, and in case it's not clear from the intro slide, I love the movie Home Alone. 11 00:01:06,980 --> 00:01:10,760 So small note here, this is a very compressed presentation. 12 00:01:10,880 --> 00:01:18,520 There are going to be times where I definitely just have a throwaway sentence that's like, and then you just implement a Socks proxy in JavaScript at the end. 13 00:01:18,680 --> 00:01:32,780 And in those moments, if you're like, I feel like I need more information, I would direct you to the GitHub repository, which should be live now, containing a full implementation of everything that I'm about to talk about that will run on Windows with Chrome. 14 00:01:33,580 --> 00:01:41,060 And when that does happen, I will also throw up a friendly reminder that drawing the owl is super easy and don't worry about it. 15 00:01:42,340 --> 00:01:45,480 So why are we targeting the browser in the first place to do this? 16 00:01:45,480 --> 00:01:51,000 Why don't we just use Cobalt Strike or Nighthawk or Meterpreter or whatever your favorite implant is. 17 00:01:51,060 --> 00:01:55,460 And the main reason for that is the browsers are everywhere. 18 00:01:55,460 --> 00:01:56,940 They're running on everything. 19 00:01:56,940 --> 00:02:03,760 So Chrome, Edge, Firefox, whatever, everybody's going to have to run these in their enterprise. 20 00:02:03,760 --> 00:02:11,340 So you don't have to worry that someone said, well, you can't run the browser, because that's the only way they have to access their internal resources. 21 00:02:11,340 --> 00:02:23,480 So if you have a centralized single sign-on service like, say, Office 365 or Google Workspace or Okta, then the main way you're going to be accessing this is through your browser. 22 00:02:23,480 --> 00:02:29,340 And that's why it's a really juicy target for us to infect so we can kind of just, like, go along for the ride. 23 00:02:30,200 --> 00:02:34,720 And specifically from the world of browsers, we're going to target Chromium. 24 00:02:34,720 --> 00:02:36,800 So that's Edge and Chrome specifically. 25 00:02:36,800 --> 00:02:43,520 And the reason we're going to do that is it's been around for a long time and there's more built-in features than anyone is even aware of. 26 00:02:43,520 --> 00:02:53,020 The thing is practically an operating system, and there's two features specifically that we're going to be taking advantage here as we build out our sort of, like, browser implant. 27 00:02:53,020 --> 00:02:59,840 One of them is browser extensions, and the other one is something you might be less familiar with, which is isolated web applications. 28 00:03:00,860 --> 00:03:03,680 Browser extensions I probably don't need to explain to you. 29 00:03:03,680 --> 00:03:10,080 Every time you install an ad blocker or something to review your grammar or run an LLM in the browser, you're installing a browser extension. 30 00:03:10,360 --> 00:03:21,620 And they have a lot more capabilities built into them than you're often using in the first place, which is why it's a super common way that malicious actors are going to run around and have fun inside your browser. 31 00:03:21,620 --> 00:03:31,980 So tale as old as time, people have been doing adware and click fraud or crypto mining or stealing all of your cookies and your bank account creds, the simpler stuff. 32 00:03:32,040 --> 00:03:37,520 And more recently, you can see people executing some pretty complicated attacks using the browser as their mechanism. 33 00:03:37,520 --> 00:03:44,220 So there's supply chain attacks where people use their extension or infect one extension and use that to infect more extensions and spread around. 34 00:03:44,460 --> 00:03:53,400 Or you'll find malware families like LLM C2, which after they get on your machine, they'll actually sideload an extension in order to steal creds and do some other fun stuff. 35 00:03:53,400 --> 00:03:55,380 And that's the approach that we're going to take. 36 00:03:56,660 --> 00:04:00,040 Pen testers know that this is a thing, so there's a million tools out there. 37 00:04:00,040 --> 00:04:01,300 I can't call them all out. 38 00:04:01,300 --> 00:04:14,920 I am going to explicitly call out a malicious extension called cursed Chrome, which is a really awesome way to turn someone's browser into a sort of HTTP proxy, and you can just steal all their cookies in their session and run around their network. 39 00:04:14,920 --> 00:04:18,080 It's great, and we're going to do that, plus a little more. 40 00:04:19,180 --> 00:04:26,020 Because it's such a common exploit vector, Google has tried to lock down the Chromium source code base. 41 00:04:26,140 --> 00:04:30,980 You might be familiar with, hey, you know, uBlock origin doesn't seem to work anymore. 42 00:04:31,200 --> 00:04:37,120 The reason for this is they've been trying to restrict the number of capabilities that are allowed within extensions these days. 43 00:04:37,120 --> 00:04:40,160 So, specifically, there's two capabilities that we're going to miss. 44 00:04:40,160 --> 00:04:43,760 One is you can't man in the middle browser traffic easily anymore with a permission. 45 00:04:43,780 --> 00:04:44,660 That's a bummer. 46 00:04:44,660 --> 00:04:46,460 That was great for capturing creds. 47 00:04:46,460 --> 00:04:54,300 And the other one is it's a little challenging to try to hide dynamic code execution in your extension without explicitly saying you're asking for it. 48 00:04:54,780 --> 00:05:07,660 And the reason that that comes up is the Chrome store review, so when you have an extension and you submit it to Google so they can actually share it with everybody else, they've changed that process so there's a lot more scrutiny of the actual extensions. 49 00:05:07,660 --> 00:05:11,280 You pretty much need to write an essay to explain why you're asking for every permission now. 50 00:05:11,280 --> 00:05:13,120 You used to just be able to submit to the store. 51 00:05:13,420 --> 00:05:14,600 Those days are gone. 52 00:05:15,080 --> 00:05:18,940 And finally, they do occasionally remove capabilities from the browser. 53 00:05:18,940 --> 00:05:22,300 So, I know I'm talking about how there's a million legacy features that we're going to use. 54 00:05:22,300 --> 00:05:23,340 They take them out sometimes. 55 00:05:23,340 --> 00:05:41,960 So, there was this really cool thing called Chrome apps that let you do stuff like host a web server in Chrome or, you know, make an SSH connection to something else, and it got deprecated in 2025, except, you know, what is dead may never die, and now they've gifted us this thing called isolated web applications. 56 00:05:42,220 --> 00:05:45,940 And you might be wondering, Mike, what on earth is an isolated web app? 57 00:05:45,940 --> 00:05:50,680 And I'm going to steal something from Google's presentation last year at ClickOn19. 58 00:05:51,420 --> 00:05:59,500 Pretty much when you need to create a new API in Chrome, they have a set of restrictions that you need to follow to make sure that it's safe to add. 59 00:05:59,560 --> 00:06:08,000 Specifically, it still needs to be safe to visit a web page, and you have to make sure that if you're asking for something on the machine, you ask the user for meaningful consent. 60 00:06:08,600 --> 00:06:16,860 And shockingly, or maybe not so shockingly, they get requests from people all the time that would like to violate these principles when they add an API into the browser. 61 00:06:17,180 --> 00:06:32,540 So, you know, very much in the spirit of yes, and, we have gotten isolated web apps, which is pretty much a part of the browser where they're going to add these APIs that they explicitly understand are dangerous and not what you expect from a web browsing experience. 62 00:06:32,640 --> 00:06:43,740 So, there's permissions, once again, now we can make direct socket connections on TCP or UDP, we can have socket servers, you can hit some web USB mechanisms that have been blocked for years. 63 00:06:44,060 --> 00:06:47,300 Specifically, this is the example they give when talking about it. 64 00:06:47,460 --> 00:07:02,200 There was a testing center that wanted to run Chrome in kiosk mode, but they also wanted to make sure that users weren't running like chat GPT in another monitor, so they wanted to have a permission that lets you just dump all of the screens without ever asking the user permission to do so, 65 00:07:02,200 --> 00:07:06,380 because they figure a cheater will just say, no, I'm not going to let you see if I'm running chat GPT. 66 00:07:06,540 --> 00:07:10,980 So, there's this extra suite of powerful permissions that's now built into the browser. 67 00:07:10,980 --> 00:07:12,500 It's in Chrome right now. 68 00:07:12,760 --> 00:07:20,720 And they recognize that this is dangerous, so there's extra protections to stop you from being able to run too crazy with this stuff. 69 00:07:20,720 --> 00:07:25,420 Specifically, all of the code needs to be explicitly written in advance and signed. 70 00:07:25,420 --> 00:07:30,880 There's a whole bundling mechanism, and that is tied to a cryptographic public key. 71 00:07:31,280 --> 00:07:37,940 Theoretically, they'll be able to use this to lock the keys down to specific vendors, but right now you can just self-sign and run these things in any browser. 72 00:07:38,660 --> 00:07:40,980 Additionally, there's a lot of isolation in place. 73 00:07:41,000 --> 00:07:50,680 Isolated web apps are not supposed to interact with the rest of the browser, so they shouldn't be able to see your cookies, they shouldn't be able to read anything from local storage or do any browsing, to be honest. 74 00:07:50,680 --> 00:07:55,060 And this is mainly enforced through a really strict content security policy. 75 00:07:55,060 --> 00:07:57,420 Everything needs to be in the bundle, and that's it. 76 00:07:57,640 --> 00:08:07,720 And they even acknowledge in the slide that, you know, well, you could just embed an entire JavaScript interpreter, but we're not going to have to do anything remotely that complicated to really have fun with this. 77 00:08:08,700 --> 00:08:17,760 So, for those of you who are content security policy heads, if you check the specification for isolated web apps, this is the actual content security policy. 78 00:08:17,760 --> 00:08:21,220 For those of you who can't just read content security policy, don't sweat it. 79 00:08:21,220 --> 00:08:30,760 Essentially what this is saying is you're not able to dynamically execute code from the internet unless you're doing it inside WebAssembly. 80 00:08:30,760 --> 00:08:37,120 And that's a really great loophole that we're going to drive a train through, but we'll come back to that one later. 81 00:08:37,260 --> 00:08:52,980 The final bit I have about Google's opinions on isolated web apps is in the presentation, these are all quotes taken verbatim as they discuss isolated web apps, and most of this is kind of meant in a sort of joking way, but I feel if you ever ask the question who's going to use this besides malware authors, 82 00:08:52,980 --> 00:08:57,560 you have to consider that some malware authors will actually use this capability. 83 00:08:59,220 --> 00:09:03,060 So, the way that we're going to talk about this is in the form of a case study. 84 00:09:03,060 --> 00:09:12,040 So, we're going to talk about a red teaming scenario that you might encounter where we want to go against a hardened target, and we're going to make some assumptions for them. 85 00:09:12,040 --> 00:09:17,860 So, we're going to say they're running Okta for single sign on and they've got it properly configured, we can't brute force passwords. 86 00:09:18,060 --> 00:09:27,560 We're going to say they have amazing secrets management and the secrets we need to hit our objective are inside Vault and nowhere else, so no red teaming will get you there. 87 00:09:27,660 --> 00:09:42,140 They use a hardware token for multi-factor authentication over web authentication, so you need someone to click a UB key to get to our goal, and we'll even give them the bone and say, minus one exception, their endpoint detection response is totally dialed in. 88 00:09:42,260 --> 00:09:57,680 So, to be specific about this user that we're going to target, they log into SSO once a day in Chrome, they never log into Vault, the creds we need to hit our goal are going to be inside Vault, and in order to access that repository with our final secrets, 89 00:09:57,680 --> 00:10:02,560 you're going to need to have MFA authentication with a UB key as well as SSO. 90 00:10:02,560 --> 00:10:06,980 And now, here's the part where I rig it for me, the presenter. 91 00:10:07,240 --> 00:10:13,840 We're going to say that we've successfully tricked this targeted user into running one PowerShell script on a Windows host. 92 00:10:13,840 --> 00:10:17,920 Just to be clear, the tool that's being presented now is a post-exploitation tool. 93 00:10:18,080 --> 00:10:24,560 Initial access is left as an exercise to the reader, though if you can get initial access from a PowerShell script, you're probably good. 94 00:10:24,760 --> 00:10:34,560 But outside of that script, assume EDR is fine-tuned, the SOC is great, and Chrome has all the network traffic whitelisted, so we'll have no problem doing anything out of Chrome. 95 00:10:36,420 --> 00:10:45,460 So I've got this great architecture diagram, which I'm sure you can all parse and read super easily on the screen, and there's really only two takeaways that I want you to have from this. 96 00:10:45,460 --> 00:10:54,460 One of them is that we're going to run an isolated web application inside one instance of Chrome, and then we're going to install a Chrome extension into a separate instance of Chrome. 97 00:10:54,460 --> 00:10:59,680 And then these are going to both talk back to our C2 server, which is running in the cloud. 98 00:11:00,260 --> 00:11:01,440 I've used Amazon here. 99 00:11:01,440 --> 00:11:03,080 You can use whatever cloud you want. 100 00:11:03,800 --> 00:11:27,860 But in general, I don't think this really describes the problem, and I've mentioned I'm a fan of Home Alone, so I think we're better off describing it from the view of turning the browser into a fun house of traps, and each trap that we've set is going to solve a specific part of our challenges to go from zero to getting the win that we need at the end of the assessment. 101 00:11:27,920 --> 00:11:30,860 So to be a little more concise, we have a plan. 102 00:11:30,860 --> 00:11:35,240 First we're going to need to sideload a Chrome extension and an isolated web app. 103 00:11:35,600 --> 00:11:41,240 Then we're going to use that to capture SSO credentials for Okta using the Chrome extension. 104 00:11:41,500 --> 00:11:48,980 We're then going to tunnel all of our web traffic from the user's position via a Socks proxy implemented with isolated web apps. 105 00:11:49,480 --> 00:12:01,940 Then we're going to do some shenanigans to trick the user into authenticating the vault with their web authentication token using extensions, and then finally, once more, back to the isolated web apps for RDP, and don't worry, this slide is coming back. 106 00:12:01,940 --> 00:12:03,760 I'll keep you updated as we're going. 107 00:12:04,620 --> 00:12:19,640 So first things first, we've got to sideload these extensions, and the way that Chrome extensions are loaded by the browser is essentially there's a JSON file on disk that just describes, hey, here's the permissions I need my extension to run, and here's where it's stored on disk. 108 00:12:19,640 --> 00:12:21,140 It's just a JSON file. 109 00:12:21,780 --> 00:12:27,140 Individual extensions request permissions, and they often request really dangerous permissions. 110 00:12:27,140 --> 00:12:27,880 It's super common. 111 00:12:27,880 --> 00:12:34,800 So like this example I have on the right, which is going to look very similar to our final extension, is actually Adobe Acrobat. 112 00:12:34,800 --> 00:12:36,440 Everybody requests dangerous extensions. 113 00:12:36,440 --> 00:12:37,880 It's just super common. 114 00:12:38,820 --> 00:12:44,240 And in order to stop people from just tweaking these things constantly, there is a little bit of protection in the browser. 115 00:12:44,320 --> 00:13:00,020 Specifically, there's a sort of like HMAC hash, which is calculated by the browser for each blob of JSON, and normally that would be very complicated to reverse engineer, but Chromium is open source, so you can just read the source code and reverse engineer it yourself and then sign your own stuff, 116 00:13:00,020 --> 00:13:01,640 and this has been happening for years. 117 00:13:01,640 --> 00:13:06,440 You can go as far back as 2016 and find Adware people taking advantage of this. 118 00:13:06,500 --> 00:13:13,380 More recently, pen testers such as Nicholas Murray and Gordon Long have written public POCs for being able to calculate these hashes. 119 00:13:13,480 --> 00:13:14,480 That's great. 120 00:13:14,640 --> 00:13:17,060 We're going to have one that's implemented in PowerShell. 121 00:13:17,980 --> 00:13:25,700 And the final bit about side-loading Chrome extensions I'm going to cover is there's developer permissions that you can ask for by going into the UI and flicking some buttons. 122 00:13:25,820 --> 00:13:26,940 These are really powerful. 123 00:13:26,940 --> 00:13:30,700 These let us do things like read the file URIs, which lets us build out a file browser. 124 00:13:30,900 --> 00:13:35,000 We're just obviously going to flip all of these things on because we're side-loading, so why not? 125 00:13:35,000 --> 00:13:45,600 And unfortunately, isolated web apps are a bit more new, so side-loading those isn't covered, so we have to talk through what do you do to even install these things? 126 00:13:45,820 --> 00:13:50,380 First of all, let's say that we have a signed web app bundle that has an egg in it. 127 00:13:50,380 --> 00:13:51,840 In this case, I'll say Google Keep. 128 00:13:51,840 --> 00:14:00,740 Then we turn on a bunch of flags and we get this super-duper polished internal web UI, which you click a button and then load a signed web app bundle for. 129 00:14:00,740 --> 00:14:09,160 So if you do all of that, and then you take a look, we'll just grep through the entire profile folder for where our egg shows up, and it shows up in two places. 130 00:14:09,160 --> 00:14:16,440 It shows up in the bundle that we just loaded, that makes sense, and it shows up in this thing, sync data level DB 003.log. 131 00:14:16,440 --> 00:14:21,120 You might think, well, .log might be a text file, and sadly, it's not. 132 00:14:21,500 --> 00:14:27,780 It's not even JSON, it's some sort of hybrid mess, but we did get a hint with this level DB bit. 133 00:14:27,780 --> 00:14:34,200 So, it's actually just one of the many open-source Google internal data formats. 134 00:14:34,320 --> 00:14:35,760 In this case, it's level DB. 135 00:14:35,760 --> 00:14:37,340 This is used within Chrome. 136 00:14:37,420 --> 00:14:45,140 And all you need to know about this is it's essentially a very nice key value storage system. 137 00:14:45,140 --> 00:14:46,880 So, the key is very simple. 138 00:14:46,880 --> 00:14:53,360 It's literally just like the string web apps DT and then an ID based off of our public key for our app. 139 00:14:53,360 --> 00:14:56,280 But this value over here is a lot more. 140 00:14:56,280 --> 00:15:00,440 And luckily, once again, it's open source, so we can just read the spec. 141 00:15:00,480 --> 00:15:13,000 And the first seven bytes are just some, uh, a CRC32 calculation based off of the content, the length, and, uh, a type which we're gonna be lazy for, and we're just gonna say full all the way through. 142 00:15:13,180 --> 00:15:28,320 And that's CRC32, it's actually CRC32C, I didn't realize there were many variations of CRC32, but, uh, once again, just go to the source code, you can pull their implementation, uh, I'm an idiot, so I decided to write this myself in PowerShell, it does work, 143 00:15:28,320 --> 00:15:31,620 it was painful, you can use my implementation, don't worry about this. 144 00:15:31,820 --> 00:15:39,080 And finally we have the remaining, you know, infinite more bytes as part of that value pair. 145 00:15:39,080 --> 00:15:41,880 And what this is, is a Google protobuf object. 146 00:15:41,880 --> 00:15:51,280 Uh, protobuf, for those who aren't familiar with it, is essentially just a serialization mechanism, so you predefine these proto definitions, and then everything gets written out to disk. 147 00:15:51,480 --> 00:16:00,940 So, a protobuf definition looks something like this, this is right from the source code, and essentially it's a type, a name, and an offset. 148 00:16:00,940 --> 00:16:16,180 So, you know, at position two on our protobuf object, that's a string, that's the name of our application, at position seven is the sources object, which is a different type, because of course you can nest these, a sources object is in fact a series of bools that say how is this web app installed, 149 00:16:16,180 --> 00:16:24,020 was it sideloaded, is it a core system component, you better believe when we sideload, we say it's super important in core, don't you dare uninstall it. 150 00:16:24,340 --> 00:16:42,520 And finally, we just need to go generate an app that describes, uh, the application we're sideloading, turn that into a protobuf object, calculate the CRC32C hash for it, add that into the level DB structure, turn on a couple of flags, because isolated web apps are not enabled by default in the browser, 151 00:16:42,520 --> 00:16:45,180 and lucky for us, that's in JSON, so that's actually really easy to do. 152 00:16:45,660 --> 00:17:01,400 And then we need to calculate the isolated web app ID, run the app from the command line, so there's literally like a dash app ID flag you can run Chrome with to open an app, uh, directly, and finally when you do that, as a precaution, they make you show an interface for web apps, 153 00:17:01,400 --> 00:17:04,280 there's no headless mode for running isolated web apps. 154 00:17:04,280 --> 00:17:17,260 So we're gonna steal a page from red teaming, and we're going to use hidden desktop, uh, mechanisms, where we essentially, when we launch that Chrome process, we give it a different desktop handle, and that just, the user just never sees it. 155 00:17:17,260 --> 00:17:18,620 You'll see what this looks like in the demo. 156 00:17:19,160 --> 00:17:35,960 And obviously, uh, I don't expect all of you to be able to take that information and sideload all of this, don't worry, this is implemented in the repository I posted earlier under the doorknob project, and uh, doorknob is just a series of PowerShell scripts that are gonna let you sideload extensions and isolated web apps, 157 00:17:35,960 --> 00:17:42,660 and they'll generate the loader for you, and it just works, it's a lot less painful than grabbing a superheated doorknob, you run the scripts and you're good to go. 158 00:17:43,540 --> 00:17:45,200 So that's the first part of the plan. 159 00:17:45,200 --> 00:17:48,620 Now we've got all of our stuff loaded into the browser, it's time to take advantage of it. 160 00:17:48,740 --> 00:17:51,680 So, first things first, we need those octa creds. 161 00:17:52,000 --> 00:17:58,740 And this is going to be the most straightforward Chrome extension in terms of malicious extensions that you're gonna have. 162 00:17:59,060 --> 00:18:11,280 Uh, we're going to have a malicious extension that asks for pretty much every permission we can, we're sideloading so no one's gonna tell us no, so we're gonna ask for background permissions to make sure this runs even if the user closes Chrome, we're gonna ask for the ability to read the clipboard, 163 00:18:11,280 --> 00:18:24,280 we're gonna ask for cookies permissions so we can steal all of the user sessions out of the browser, we're gonna ask for declarative net requests because we're going to actually use this to turn off certain, uh, internal protections in Chrome that let us do other silly things, 164 00:18:24,280 --> 00:18:29,440 which I'll cover in a bit, and, uh, of course, why not ask for history so we can tell where the user's been going. 165 00:18:29,860 --> 00:18:43,180 And this used to be enough to also steal credentials that were being submitted, uh, in any form, but unfortunately manifest v3 stopped us from so we need to rely on another mechanism in extensions, which is content scripts. 166 00:18:43,480 --> 00:18:57,740 So what we're going to do is we're going to inject JavaScript into every single tab that's running and then that JavaScript is going to, uh, intercept every mechanism we care about so we can add events to forms, for example, and submission, and then we steal all of the content. 167 00:18:58,340 --> 00:19:17,160 And essentially there's a lot of different barriers within Chrome to stop you from doing something like this, so we're just going to add our malicious JavaScript into every single part of Chrome we possibly can and we're going to build a sort of like microservices nightmare within Chrome that lets different parts of it talk to our C2, 168 00:19:17,160 --> 00:19:18,440 even when they shouldn't. 169 00:19:18,860 --> 00:19:31,300 And, um, if you might be thinking, well, won't people notice that you're running JavaScript in every single tab, in which case I would say you have a lot of faith in the user, but additionally, we're going to do this all with WebAssembly instead of JavaScript. 170 00:19:31,500 --> 00:19:36,040 And I don't know how many of you have tried to reverse engineer WebAssembly, but it's not fun. 171 00:19:36,120 --> 00:19:40,300 This is not easy to manage in any way or form from within the browser. 172 00:19:40,980 --> 00:19:55,620 Additionally, the way we're going to compile our JavaScript is we're going to do this through Golang, so the entire Go runtime is going to be built into this really cool file format that's super easy to parse, and I don't know how many of you used to reverse engineer Go malware, 173 00:19:55,620 --> 00:19:59,820 but until there was great tooling for it, it wasn't super great to reverse engineer. 174 00:20:00,120 --> 00:20:04,960 And lucky for us, the tooling for WebAssembly right now is not fantastic. 175 00:20:04,960 --> 00:20:08,060 Ghidra cannot show you hello world written in this. 176 00:20:08,060 --> 00:20:18,200 I mean, obviously with enough time you can figure out what's being sent, but any analyst that just sees this is probably not going to be able to pull out information very quickly to figure out what we're doing. 177 00:20:18,280 --> 00:20:23,140 And the way that WebAssembly permissions are asked for in the browser, it's really all or nothing. 178 00:20:23,140 --> 00:20:25,760 You either say you can run WebAssembly or you can't. 179 00:20:25,760 --> 00:20:26,040 That's it. 180 00:20:26,040 --> 00:20:37,200 There's no granularity to it, and even if you could turn it off, that permission we asked for earlier, we're going to use to disable content security policy processing for all websites we visit. 181 00:20:37,200 --> 00:20:39,680 So we're loading this in everything and no one can stop us. 182 00:20:39,940 --> 00:20:55,700 And if you're feeling like particularly malicious, you can actually use WebAssembly to invoke JavaScript code to load more WebAssembly, so you build this like nesting doll of WebAssembly that calls out to JavaScript to load more WebAssembly that calls out to JavaScript. 183 00:20:55,700 --> 00:20:56,640 You get the idea. 184 00:20:56,640 --> 00:20:59,160 You can really waste a lot of time with this. 185 00:20:59,720 --> 00:21:07,580 And as a result, like, this is essentially what it looks like when you write something in WebAssembly versus JavaScript. 186 00:21:07,580 --> 00:21:10,620 What you're actually seeing is the exact same code. 187 00:21:11,120 --> 00:21:17,860 So on the right, this is JavaScript to load WebAssembly, and this is the only thing that any analyst will be able to see in all of those tabs we're running. 188 00:21:17,860 --> 00:21:20,840 It's just there's a WebAssembly file, it's being run. 189 00:21:20,840 --> 00:21:27,320 And then you can throw a bunch of decoy code in there from whatever an LLM decides to shit out, but this is essentially the part that's important. 190 00:21:28,460 --> 00:21:40,240 In Go, I don't expect people to be able to read this and understand it immediately, but we're doing the same thing, and there's an interop object within WebAssembly that we can use to call back out to JavaScript and do the exact same things. 191 00:21:40,240 --> 00:21:51,340 It's a little more verbose, but ultimately, you can replicate probably 90 to 95% of what you can do in JavaScript within Go, and then you're off to the races. 192 00:21:51,540 --> 00:21:59,180 So as a result of this, uh, there's absolutely no way that you can expect a malware analyst to take a look at this. 193 00:21:59,180 --> 00:22:06,740 What will happen is they'll poke their head in, they'll see it's WebAssembly, and then sort of throw up their shoulders and shrug, and either it gets in or it doesn't. 194 00:22:06,740 --> 00:22:12,100 I can say that we've submitted malicious extensions into the Chrome store using this approach, and it's never been blocked. 195 00:22:12,100 --> 00:22:14,620 We've got plenty of extensions, more than we need. 196 00:22:14,620 --> 00:22:15,920 This is very effective. 197 00:22:16,440 --> 00:22:20,280 So, now we've got our extension, like what are we actually doing with it? 198 00:22:20,400 --> 00:22:23,840 And this is where, you know, JavaScript comes to the rescue. 199 00:22:23,920 --> 00:22:26,680 We just add event listeners to the submit function on forms. 200 00:22:26,680 --> 00:22:30,460 We can add it to a couple of places, like hitting the key or clicking a mouse button. 201 00:22:30,720 --> 00:22:34,920 We can even intercept or man-in-the-middle certain functions, like when you call web authentication. 202 00:22:34,920 --> 00:22:36,020 We'll cover that later. 203 00:22:37,080 --> 00:22:44,680 Uh, essentially, every site that you visit, we can identify the form, add our listener to it, and then JavaScript gets the ability to process all of its results. 204 00:22:44,680 --> 00:22:52,740 And obviously, just to be clear, the implant that you're able to get on GitHub does not pop up an alert window and highlight it in the big red box, it just sends it to the C2. 205 00:22:54,580 --> 00:23:02,640 And just like in the movie Home Alone, sometimes the most cleverly laid traps are not enough, and we need an old man with a shovel to come beat the shit out of someone. 206 00:23:02,640 --> 00:23:07,520 And that's where the shelling out capability, uh, within Chrome is really helpful for us. 207 00:23:07,520 --> 00:23:15,140 And this presentation's more about using Chrome, but for those of you who want to go a little farther, let's talk about our old man with a shovel, native messaging. 208 00:23:15,260 --> 00:23:24,620 And native messaging, in a nutshell, is pretty much just a way to tell Chrome, hey, when I invoke this JavaScript piece, I want you to run an executable on disk. 209 00:23:24,720 --> 00:23:35,800 And normally, you need to, like, install a registry key, and have a file on disk, and the registry key points to a JSON file, but because we're sideloading, all of this is handled. 210 00:23:35,800 --> 00:23:40,780 So once again, doorknob, or the sideloader piece, will just be able to install all of this for you. 211 00:23:40,780 --> 00:23:58,420 So you'll have a registry key, or on macOS it's a file on disk, that points to a JSON file, that JSON file is very short, it's pretty much just a name and a path to the executable you want to run, and then in your JavaScript code, you open a connection to your native messaging host, 212 00:23:58,420 --> 00:24:00,300 and it ends up looking something like this. 213 00:24:00,300 --> 00:24:05,240 Which is Chrome just straight up shelling out, and then running whatever binary you've told it to. 214 00:24:05,240 --> 00:24:18,980 So, I will say, this is not subtle, like, I wouldn't expect a SOC analyst to miss this, it's pretty blatant, but you still can't block it, because this is the only way that Chrome interacts with native messaging hosts. 215 00:24:18,980 --> 00:24:25,060 So if you use, say, one password, the way that it interacts with the one password on host is the same mechanism. 216 00:24:25,060 --> 00:24:26,660 So they can't block it. 217 00:24:27,440 --> 00:24:40,680 For red teamers who want to get fancy, what you probably would do is instead of embedding a binary to just interpret shell commands, what you'd want to do is have a whitelisted application that you have a DLL you can sideload, and in that sideloaded DLL, 218 00:24:40,680 --> 00:24:48,040 that's where you would run your code to, I don't know, run, maybe that's when you run your cobalt strike beacon, or whatever stage 2 implant you actually want to run. 219 00:24:48,920 --> 00:25:03,200 So this is all collected in Hot Wheels, which is a weaponized web assembly browser extension, and that will give you credential jacking, shelling out, session theft by stealing cookies, file read operations, and the ability to read arbitrary history. 220 00:25:03,200 --> 00:25:06,900 And this extension will run on both Edge and in Chrome. 221 00:25:06,900 --> 00:25:11,100 Obviously this is implementation via Chrome, but it works on both. 222 00:25:12,060 --> 00:25:13,820 So that's how we're getting creds. 223 00:25:13,820 --> 00:25:16,600 Now we need to figure out how we're going to tunnel our traffic. 224 00:25:17,340 --> 00:25:28,640 And normally I would say let's just use curse Chrome, that's exactly what it's for, but it only does HTTP, and we just spent 10 minutes talking about isolated web apps, so let's actually use the damn things. 225 00:25:28,760 --> 00:25:34,980 And the way that we're going to do this is through the direct sockets permission, which this is the main feature we're going to abuse. 226 00:25:34,980 --> 00:25:49,580 So if you go read the explainer for direct sockets, it tells us that the use case for using direct sockets is when you want to speak to an SSH server, or RDP into something, or touch virtual desktop infrastructure, all of the things that we would want to do in an offensive context as a red teamer. 227 00:25:49,580 --> 00:25:52,140 This is perfect, it's like our shopping list. 228 00:25:52,160 --> 00:26:03,360 So the first thing you might think, or what I tried to do was, oh great, I'll turn Chrome into a version of Responder that listens for NTLM hashes and we'll just start jacking creds and that'll be super cool. 229 00:26:03,540 --> 00:26:10,080 And then I realized that the isolated web app API implementations are a little more janky than that, and you have to read the spec carefully. 230 00:26:10,080 --> 00:26:20,320 So for example, when I try to listen on port 135, I find out that it has to be over port 3276, or 678. 231 00:26:20,320 --> 00:26:26,700 And I don't know why that is, but it doesn't really matter, because we can still make arbitrary connections outwards, and that's just as important. 232 00:26:27,680 --> 00:26:40,760 So once again, your first reaction might be, oh great, I'm gonna write like an SMB client, and an RDP client, an SSH client, but then it's like, uh, just slow down and write a SOCKS proxy, and then connect through that through all of your local hosts. 233 00:26:40,760 --> 00:26:45,060 It's a lot less implementation work, it's a lot less complicated, and it's much more straightforward. 234 00:26:45,480 --> 00:26:46,800 So that's what we're gonna do. 235 00:26:46,940 --> 00:26:54,300 We're going to write a SOCKS server, and then we just need to like overcome that, that isolation issue, where isolated web apps aren't supposed to talk with anyone else. 236 00:26:54,540 --> 00:27:01,220 But because we can make SOCKET servers, we just write a SOCKET server in JavaScript, and have our Chrome extension connect back to it. 237 00:27:01,220 --> 00:27:05,020 This is the, that building out of that microservices nightmare I was talking about earlier. 238 00:27:05,460 --> 00:27:09,880 So, by their powers combined, we're, we're just done. 239 00:27:09,880 --> 00:27:11,240 That's it, that's all you need to do. 240 00:27:11,440 --> 00:27:16,900 And uh, yeah, right, this is the part where this talk would be two hours if I didn't do this, I'm sorry. 241 00:27:17,020 --> 00:27:20,640 So, lucky for you, we've got the blowtorch capability. 242 00:27:20,640 --> 00:27:24,380 Uh, I've named it this because this is the most overkill part of the project, really. 243 00:27:24,480 --> 00:27:38,280 Uh, this gives us full SOCKS proxying out of the browser, so if we wanted to replicate what Cursed Chrome does, we would dump the cookies from the target browser, uh, using Hot Wheels, and then import that into our browser, which is locally on the attacker machine, 244 00:27:38,280 --> 00:27:43,580 and then we just pointed at our SOCKS proxy, and now we've replicated the same features you would have in Cursed Chrome. 245 00:27:43,860 --> 00:27:46,580 Except now we can RDP into things, and that's pretty cool. 246 00:27:47,160 --> 00:27:50,400 Which brings us to the final part of the plan. 247 00:27:50,400 --> 00:27:54,980 We also need to solve this tricky bit with web authentication and clicking buttons. 248 00:27:55,540 --> 00:28:10,340 And when I say this, what I'm talking about is, like, maybe you're more familiar with Fido or U2F or, you know, pass keys or whatever, but essentially there is a device or a piece of software on your machine that stores a key, and in order to sign a request, 249 00:28:10,340 --> 00:28:14,900 the user needs to interact with something, say like a little button that you press on the side of your machine. 250 00:28:14,920 --> 00:28:21,620 And there's even a few other security components to it, like you can only run it from, uh, the website that you request the web authentication request on. 251 00:28:21,620 --> 00:28:28,520 It's got the same origin protect, uh, policy protections, and, uh, even if they were different, then, uh, you know, the user would get an indication. 252 00:28:29,000 --> 00:28:39,580 So my first thought was, well, in 2018, someone gave a DEF CON talk about abusing web USB to do this, and isolated web apps have this really cool thing called unrestricted web USB. 253 00:28:39,780 --> 00:28:41,500 Why don't I just use that? 254 00:28:41,500 --> 00:28:44,700 And, um, unfortunately, I couldn't get it to work. 255 00:28:44,700 --> 00:28:50,960 I don't know if that's a side effect of it being new, or they knew, let's make it unrestricted except for the bad stuff. 256 00:28:50,960 --> 00:28:51,980 Could be a skill issue. 257 00:28:51,980 --> 00:28:53,000 I, I don't know. 258 00:28:53,000 --> 00:28:59,760 But the answer was, isolated web apps are cool, but we still got Chrome extensions, so let's try taking advantage of it through that. 259 00:28:59,920 --> 00:29:04,440 So the first thing that we want to do is break that same origin policy restriction. 260 00:29:04,500 --> 00:29:14,060 And we have JavaScript running in literally every tab, so what we can do is pick a tab and then open an iframe for the site we actually want to run. 261 00:29:14,060 --> 00:29:20,920 And then our injected content script can watch for some sort of, like, query token that triggers the web authentication request. 262 00:29:20,920 --> 00:29:22,160 So that ends up looking like this. 263 00:29:22,160 --> 00:29:28,300 You know, here we're on, like, demo.ubico.com, and now it's made a web authentication request to our key for octa.com. 264 00:29:28,360 --> 00:29:29,380 That's cool. 265 00:29:29,500 --> 00:29:32,680 But also, a user might notice this, and that's not great. 266 00:29:32,680 --> 00:29:36,340 I mean, I think plenty of users would miss this, to be honest, but, you know, let's be thorough. 267 00:29:37,060 --> 00:29:49,820 And to take advantage of this, uh, there's another question we need to answer, which is, if you trigger multiple web authentication requests in Chrome, and you do it in different tabs, what's the order that it's resolved? 268 00:29:50,520 --> 00:29:53,040 And here's where I was a little surprised. 269 00:29:53,040 --> 00:29:58,100 So say we've opened octa.com in one tab, and then we go to a new tab and open, you know, something different. 270 00:29:58,780 --> 00:30:05,500 And then when you, your YubiKey's flashing, you press the button, it actually resolves the first tab that you press, not the active tab. 271 00:30:05,500 --> 00:30:12,060 So from your perspective, you've just pressed your YubiKey and it didn't work, so you press it again, and now it works. 272 00:30:12,160 --> 00:30:16,080 But you don't realize that you've actually signed two requests instead of one. 273 00:30:16,900 --> 00:30:25,100 And this makes sense, you know, the YubiKey has no, uh, awareness of what's going on within Chrome, it just knows I got a request for octa, and then I got a request for Yubico. 274 00:30:25,100 --> 00:30:31,380 So, I, I don't really know exactly who would be the responsible party for fixing this, it's a reasonable way to do it. 275 00:30:32,220 --> 00:30:51,160 But what we're gonna do, it doesn't matter who needs to fix it, we're gonna abuse it, is we're going to hook that navigator dot credentials dot get function, so that whenever they normally would have to click their YubiKey, we're going to then find an inactive tab and trigger another web authentication request for our actual target, 276 00:30:51,160 --> 00:30:54,080 and then they'll click the button twice and trigger it. 277 00:30:54,080 --> 00:31:01,200 And the only indication they're gonna get in the UI component is a little dot on that icon there, which says there's a notification running on this tab. 278 00:31:01,240 --> 00:31:04,400 And if they've opened way too many tabs, they're not even gonna get that. 279 00:31:04,400 --> 00:31:09,020 So I think that it's reasonable to expect that this will probably work on just about any user. 280 00:31:10,380 --> 00:31:22,940 So, you know, the final attack chain, because these web authentication requests also expire, is you write a script that like logs in every five minutes and gets a challenge, you push that down to your infected browser, and then you just wait. 281 00:31:22,940 --> 00:31:26,100 We play this waiting game until they click the button and then we win. 282 00:31:26,600 --> 00:31:37,900 Alternatively, if you don't care about being sneaky, you could also be really obnoxious and just trigger it to open the request on every single tab the user's in until they click the button, that would also probably work. 283 00:31:37,900 --> 00:31:41,400 But, you know, ultimately we're looking to be sneaky and not too blatant. 284 00:31:42,500 --> 00:31:48,060 So, this is the paint bucket capability within uh, within the Chrome alone framework. 285 00:31:48,060 --> 00:31:53,000 And uh, the reason it's paint bucket is the first one might miss you, but the second one will definitely get you in the head. 286 00:31:53,420 --> 00:32:00,740 So, we can secretly coerce our target into answering whatever web authentication challenges we want and uh, and we're good. 287 00:32:00,740 --> 00:32:03,880 So the final thing we need to do is just, you know, RDP into the target. 288 00:32:03,880 --> 00:32:05,460 We've already talked about socks. 289 00:32:05,480 --> 00:32:07,300 Let's see what this actually looks like. 290 00:32:09,500 --> 00:32:13,000 So what we're looking at is a clean install. 291 00:32:13,000 --> 00:32:19,960 This is just a normal Chrome browser, nothing else fancy is going on and we're going to say we just coerced the user into running our script. 292 00:32:21,560 --> 00:32:24,920 So, they run our script and this is actually pretty quick how it happens. 293 00:32:24,920 --> 00:32:29,880 What's going to happen is it's going to very quickly close the browser and restart it. 294 00:32:29,880 --> 00:32:31,320 We've side loaded our extension. 295 00:32:31,320 --> 00:32:31,940 That's it. 296 00:32:31,940 --> 00:32:33,360 The user normally wouldn't see this as well. 297 00:32:33,360 --> 00:32:34,700 They might see Chrome flash. 298 00:32:34,960 --> 00:32:43,120 In the background, we've now launched a separate instance of Chrome that's running an isolated web application and we need to kill that and restart it a few times because Chrome. 299 00:32:43,360 --> 00:32:53,140 But uh, ultimately, in the background, there is now a second instance running on a separate desktop that's running our isolated web app that's handling all the socks proxying for us. 300 00:32:53,340 --> 00:33:00,520 So, the biggest giveaway for this is if you take a look at the command argument for it, you can see it's been hardcoded to run, you know, whatever our app ID is. 301 00:33:00,520 --> 00:33:01,260 But that's about it. 302 00:33:01,260 --> 00:33:02,220 That's all you see. 303 00:33:03,200 --> 00:33:09,240 So, now we're going to pop over to our C2 and there's a separate component within the repository called battle plan. 304 00:33:09,240 --> 00:33:20,820 This is just uh, like the, the Node.js server that we're going to push to AWS and a nice little uh, vibe coded uh, you know, web UI that's going to help us interact with it. 305 00:33:21,040 --> 00:33:26,060 So, obviously, the first thing we should do with all installed implants is pop calc. 306 00:33:26,060 --> 00:33:28,020 That's the way that you prove you've got shell access. 307 00:33:28,320 --> 00:33:30,180 So, we have an interactive shell. 308 00:33:30,180 --> 00:33:33,260 In this case, we're just going to run, you know, command dot exe with uh, calc. 309 00:33:33,380 --> 00:33:35,120 We can take a look at the user's machine. 310 00:33:35,220 --> 00:33:35,880 There we go. 311 00:33:35,880 --> 00:33:36,460 We've got calc. 312 00:33:36,460 --> 00:33:37,340 You could shell out. 313 00:33:37,340 --> 00:33:38,800 But that's not why we're here. 314 00:33:38,800 --> 00:33:39,900 This is really blatant. 315 00:33:39,900 --> 00:33:41,180 We're actually here for creds. 316 00:33:41,180 --> 00:33:42,460 So, what does that actually look like? 317 00:33:42,460 --> 00:33:44,160 So, say that they've gone to GitHub. 318 00:33:44,240 --> 00:33:45,920 They're typing their credentials in. 319 00:33:45,920 --> 00:33:46,600 They hit enter. 320 00:33:46,600 --> 00:33:48,160 Obviously, those creds don't exist. 321 00:33:48,260 --> 00:33:49,300 But it doesn't matter. 322 00:33:49,300 --> 00:33:50,480 We still capture the data. 323 00:33:50,480 --> 00:33:55,200 Every time that that's sent, it gets pushed back to our C2 and we capture it. 324 00:33:55,220 --> 00:33:57,240 So, now let's actually capture the creds we care about. 325 00:33:57,300 --> 00:33:58,700 This user is Harry. 326 00:33:58,960 --> 00:34:00,060 He's a cool guy. 327 00:34:00,060 --> 00:34:01,840 He's got a password he uses for everything. 328 00:34:02,000 --> 00:34:03,400 He's entering it in. 329 00:34:04,120 --> 00:34:05,580 And uh, let's see if we caught that. 330 00:34:05,580 --> 00:34:06,960 We don't worry about web authentication yet. 331 00:34:06,960 --> 00:34:08,240 That's coming soon. 332 00:34:08,980 --> 00:34:10,980 And uh , we can see it's wet bandits forever. 333 00:34:10,980 --> 00:34:12,260 Harry's a really cool guy. 334 00:34:12,260 --> 00:34:14,240 And now we've got his pa - his password. 335 00:34:14,300 --> 00:34:15,720 So, let's see if it works. 336 00:34:15,720 --> 00:34:20,560 We know that we've got, we've got this internal vault website that we normally can't access. 337 00:34:20,900 --> 00:34:24,000 So, we're going to force a socks proxy through his browser. 338 00:34:24,360 --> 00:34:27,880 And now, of course, we get internal DNS and all of the goodies that come with that. 339 00:34:28,060 --> 00:34:29,700 So, here's our vault instance. 340 00:34:29,700 --> 00:34:31,440 And let's try to log in as Harry. 341 00:34:32,080 --> 00:34:35,000 So, into Okta we go. 342 00:34:35,000 --> 00:34:36,900 You get to see how slow I type. 343 00:34:38,280 --> 00:34:40,800 How fast can I type wet bandits forever? 344 00:34:40,800 --> 00:34:41,860 Let's find out. 345 00:34:42,380 --> 00:34:44,320 Super fast. 346 00:34:49,140 --> 00:34:52,760 But also, once again, oh no, MFA. 347 00:34:52,760 --> 00:34:54,080 I guess it's game over. 348 00:34:54,340 --> 00:34:57,680 But it's not because we got a small Python script we've written. 349 00:34:57,680 --> 00:34:59,220 This is also in the demo repository. 350 00:34:59,220 --> 00:35:01,580 And what this is going to do is it's going to take those creds. 351 00:35:01,620 --> 00:35:02,780 It's going to hit Okta. 352 00:35:02,940 --> 00:35:04,660 And it's going to get that challenge. 353 00:35:04,660 --> 00:35:07,580 And we're going to push that challenge down to the user's browser. 354 00:35:08,040 --> 00:35:10,420 So, we're just waiting for a response right now. 355 00:35:10,420 --> 00:35:14,360 The user, meanwhile, goes to a totally different page and authenticates. 356 00:35:14,380 --> 00:35:17,820 And you might notice, in that background tab, we've got that notification. 357 00:35:18,360 --> 00:35:20,080 So, the user doesn't see it though. 358 00:35:20,080 --> 00:35:21,260 And they're clicking their Yubi key. 359 00:35:21,260 --> 00:35:24,860 I literally had to click the button like four times during this because it's so easy to misclick these things. 360 00:35:24,860 --> 00:35:27,600 So, no one thinks anything about clicking the button. 361 00:35:28,200 --> 00:35:34,080 But we've completed the entire login process and now we've got a client token to log into Vault. 362 00:35:34,080 --> 00:35:36,820 The user never visited Vault, but it doesn't matter. 363 00:35:36,820 --> 00:35:38,140 We've still got their challenge. 364 00:35:38,140 --> 00:35:40,120 And now we can just log directly into it. 365 00:35:40,200 --> 00:35:43,900 Uh, in Vault's case, there's a token, but obviously you would adapt this for whatever your target is. 366 00:35:44,320 --> 00:35:45,800 There's a shared key. 367 00:35:45,800 --> 00:35:47,760 Uh, there's this secret called SilverTuna. 368 00:35:47,760 --> 00:35:49,680 That's for all the Home Alone heads out there. 369 00:35:49,680 --> 00:35:52,240 I'm sure all five of you recognize it. 370 00:35:52,400 --> 00:35:57,160 Um, and then we've got the final credentials that we need to hit our objective. 371 00:35:57,480 --> 00:36:01,880 Uh, this is just a standard game of Active Directory, uh, login credential. 372 00:36:01,880 --> 00:36:10,820 We're going to force, uh, a Socks proxy to tunnel our RDP access along with all of those credentials to connect to the final target . 373 00:36:10,900 --> 00:36:14,880 So, here we're connecting, we're giving it the domain of Seven Kingdoms. 374 00:36:16,560 --> 00:36:19,360 And we're giving the super secret password a password. 375 00:36:19,980 --> 00:36:24,680 And then that's gonna get us, uh, an RDP connection into our domain controller. 376 00:36:24,680 --> 00:36:26,040 So, we're pretty much there. 377 00:36:26,260 --> 00:36:32,880 Uh, and just to demonstrate, this is going up to AWS and then tunneled through the browser's, uh, Socks proxy. 378 00:36:32,880 --> 00:36:34,200 But it's still very responsive. 379 00:36:34,200 --> 00:36:35,660 RDP's totally usable. 380 00:36:35,680 --> 00:36:37,140 SSH is totally usable. 381 00:36:37,140 --> 00:36:40,980 We can go onto the desktop and we can dump out the contents of our final flag. 382 00:36:40,980 --> 00:36:41,900 And boom. 383 00:36:41,900 --> 00:36:42,600 There we go. 384 00:36:42,600 --> 00:36:43,320 We've won. 385 00:36:43,320 --> 00:36:44,180 That's it. 386 00:36:45,520 --> 00:36:49,680 So, obviously 387 00:36:57,680 --> 00:36:59,340 this isn't a perfect technique. 388 00:36:59,340 --> 00:37:05,720 First of all, you need to be writing a script to automate, uh, that final pushing component for the, uh, the web authentication piece. 389 00:37:05,720 --> 00:37:09,380 But, uh, you know, hard things aren't free. 390 00:37:09,540 --> 00:37:14,600 It's also worth noting that Edge and Chrome are not perfectly identical implementations. 391 00:37:14,600 --> 00:37:21,000 So, for example, WebUSB within Edge, uh, the unrestricted permission, it doesn't exist. 392 00:37:21,380 --> 00:37:23,960 Obviously it doesn't really matter for us because we couldn't make it work. 393 00:37:23,960 --> 00:37:27,620 But I would expect those two browsers to sort of fork in the future. 394 00:37:27,620 --> 00:37:31,000 So, there might be some features that only Edge can handle versus Chrome. 395 00:37:32,000 --> 00:37:36,460 Uh, isolated web apps until very recently, they wouldn't even load in Edge. 396 00:37:36,460 --> 00:37:40,520 If you tried to load them, it just opened the window a hundred thousand times until it crashed your machine. 397 00:37:40,620 --> 00:37:44,600 But, uh, like two weeks ago I was just double checking and they work now. 398 00:37:44,600 --> 00:37:49,600 So, uh, look for Edge to become a valid infection vector in the near future for this repo as well. 399 00:37:50,520 --> 00:37:53,640 It is worth calling out that isolated web apps are constantly changing. 400 00:37:53,640 --> 00:37:57,200 They're still very new in the scheme of things for any product within Chrome. 401 00:37:57,200 --> 00:38:02,800 I would be unsurprised if suddenly it became a little more challenging to sideload isolated web apps in the future. 402 00:38:02,900 --> 00:38:05,880 Maybe they'll lock down those keys to only a couple of users. 403 00:38:06,240 --> 00:38:11,640 Uh, I would be surprised if they did that though because then I don't know how anyone would ever actually develop an isolated web app. 404 00:38:11,640 --> 00:38:14,520 So, they would have just created this functionality for no one to use. 405 00:38:14,660 --> 00:38:16,620 So, I don't really expect that's gonna be the case. 406 00:38:16,620 --> 00:38:23,480 The bigger thing I expect to watch for is them adding more dangerous APIs for us to run with and I'm very interested in that. 407 00:38:24,500 --> 00:38:29,200 The only other limitation right now is doorknobs implementation is Windows and Chrome only. 408 00:38:29,320 --> 00:38:32,900 So, if you go to that GitHub repo, you'll only find that implementation. 409 00:38:32,900 --> 00:38:34,720 But, you know, watch this space. 410 00:38:35,860 --> 00:38:41,040 If you're a defender and you're wondering how on earth would I stop this, I've got good news and bad news for you. 411 00:38:41,040 --> 00:38:45,060 The good news is Chrome extensions are very straightforward to block. 412 00:38:45,060 --> 00:38:47,520 There's a policy item that you can set. 413 00:38:47,520 --> 00:38:48,660 It's very easy to do. 414 00:38:48,660 --> 00:38:50,160 You can do this in Windows or Mac OS. 415 00:38:50,160 --> 00:38:55,260 You essentially just say, don't allow Chrome extensions to be installed if I haven't whitelisted them. 416 00:38:55,260 --> 00:38:57,000 That's done by two policies. 417 00:38:57,000 --> 00:38:59,940 Extension install block list and extension install allow list. 418 00:38:59,940 --> 00:39:04,180 And when our clients do this, we cannot install malicious extensions. 419 00:39:04,180 --> 00:39:07,020 You can't sideload them, you can't convince them to install it through the store. 420 00:39:07,020 --> 00:39:08,020 Very effective. 421 00:39:08,020 --> 00:39:10,080 So, you should absolutely do that. 422 00:39:10,320 --> 00:39:13,480 When it comes to isolated web apps though, it's too new. 423 00:39:13,480 --> 00:39:15,480 There is no policy for this yet. 424 00:39:15,480 --> 00:39:17,240 So, there's nothing that you can set. 425 00:39:17,240 --> 00:39:28,320 There's technically some policies you can set for specific permissions on like, if you're running Chrome OS, but most people here probably aren't doing that, so I don't think that's a sufficient fix. 426 00:39:28,320 --> 00:39:31,880 So, we're going to have to go to secondary indicators of compromise instead. 427 00:39:31,920 --> 00:39:41,340 So , you're going to watch for when applications that aren't Chrome start editing the secure preferences file, the preferences file, your local state object or your level DB files. 428 00:39:41,340 --> 00:39:43,740 Those are all things that no one should touch but Chrome. 429 00:39:45,020 --> 00:39:47,780 Ditto with any of the registry keys or files on disk. 430 00:39:47,860 --> 00:39:52,160 Is there anything to stop someone from injecting into Chrome and then doing exactly this? 431 00:39:52,380 --> 00:39:57,720 No, but we need every tool that we have in order to try to stop people from running with this. 432 00:39:58,860 --> 00:40:02,680 And with that in mind, thank you so much. 433 00:40:02,760 --> 00:40:08,260 If you would like to get access to this, I'll take claps, whatever, I've got five minutes, clap as long as you want. 434 00:40:15,110 --> 00:40:20,210 All the codes available online right now, unless something horrible has happened, theoretically that QR code is there. 435 00:40:20,290 --> 00:40:26,630 If you have any questions, or you have any examples of success stories using this tool, please hit me up. 436 00:40:26,630 --> 00:40:29,050 It motivates me to live. 437 00:40:29,050 --> 00:40:29,810 It is wonderful. 438 00:40:29,810 --> 00:40:31,970 I love watching people own stuff with this. 439 00:40:31,970 --> 00:40:36,650 So, hit me up, I'm Bouncy Hat on Twitter and Mastodon on the InfoSec Exchange Mastodon. 440 00:40:37,210 --> 00:40:39,430 Thank you so much and have a wonderful DEF CON.