start	end	text
0	580	All righty.
580	9440	Hi, everybody, and welcome to Chrome Alone, a discussion about transforming a browser into a C2 platform.
10580	15920	So I'm Mike Weber, and I've been building offensive Chrome extensions since 2018.
15920	24080	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.
24460	39340	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.
39340	45840	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.
47680	50800	Fun fact, there are a lot of Mike Webbers in security.
51100	54300	The list on screen is all of those who I am not.
54300	58160	If you need an easy reminder, I'm the Mike Webber that works for Praetorian Security.
58160	64920	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.
66980	70760	So small note here, this is a very compressed presentation.
70880	78520	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.
78680	92780	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.
93580	101060	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.
102340	105480	So why are we targeting the browser in the first place to do this?
105480	111000	Why don't we just use Cobalt Strike or Nighthawk or Meterpreter or whatever your favorite implant is.
111060	115460	And the main reason for that is the browsers are everywhere.
115460	116940	They're running on everything.
116940	123760	So Chrome, Edge, Firefox, whatever, everybody's going to have to run these in their enterprise.
123760	131340	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.
131340	143480	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.
143480	149340	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.
150200	154720	And specifically from the world of browsers, we're going to target Chromium.
154720	156800	So that's Edge and Chrome specifically.
156800	163520	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.
163520	173020	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.
173020	179840	One of them is browser extensions, and the other one is something you might be less familiar with, which is isolated web applications.
180860	183680	Browser extensions I probably don't need to explain to you.
183680	190080	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.
190360	201620	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.
201620	211980	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.
212040	217520	And more recently, you can see people executing some pretty complicated attacks using the browser as their mechanism.
217520	224220	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.
224460	233400	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.
233400	235380	And that's the approach that we're going to take.
236660	240040	Pen testers know that this is a thing, so there's a million tools out there.
240040	241300	I can't call them all out.
241300	254920	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.
254920	258080	It's great, and we're going to do that, plus a little more.
259180	266020	Because it's such a common exploit vector, Google has tried to lock down the Chromium source code base.
266140	270980	You might be familiar with, hey, you know, uBlock origin doesn't seem to work anymore.
271200	277120	The reason for this is they've been trying to restrict the number of capabilities that are allowed within extensions these days.
277120	280160	So, specifically, there's two capabilities that we're going to miss.
280160	283760	One is you can't man in the middle browser traffic easily anymore with a permission.
283780	284660	That's a bummer.
284660	286460	That was great for capturing creds.
286460	294300	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.
294780	307660	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.
307660	311280	You pretty much need to write an essay to explain why you're asking for every permission now.
311280	313120	You used to just be able to submit to the store.
313420	314600	Those days are gone.
315080	318940	And finally, they do occasionally remove capabilities from the browser.
318940	322300	So, I know I'm talking about how there's a million legacy features that we're going to use.
322300	323340	They take them out sometimes.
323340	341960	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.
342220	345940	And you might be wondering, Mike, what on earth is an isolated web app?
345940	350680	And I'm going to steal something from Google's presentation last year at ClickOn19.
351420	359500	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.
359560	368000	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.
368600	376860	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.
377180	392540	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.
392640	403740	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.
404060	407300	Specifically, this is the example they give when talking about it.
407460	422200	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,
422200	426380	because they figure a cheater will just say, no, I'm not going to let you see if I'm running chat GPT.
426540	430980	So, there's this extra suite of powerful permissions that's now built into the browser.
430980	432500	It's in Chrome right now.
432760	440720	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.
440720	445420	Specifically, all of the code needs to be explicitly written in advance and signed.
445420	450880	There's a whole bundling mechanism, and that is tied to a cryptographic public key.
451280	457940	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.
458660	460980	Additionally, there's a lot of isolation in place.
461000	470680	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.
470680	475060	And this is mainly enforced through a really strict content security policy.
475060	477420	Everything needs to be in the bundle, and that's it.
477640	487720	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.
488700	497760	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.
497760	501220	For those of you who can't just read content security policy, don't sweat it.
501220	510760	Essentially what this is saying is you're not able to dynamically execute code from the internet unless you're doing it inside WebAssembly.
510760	517120	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.
517260	532980	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,
532980	537560	you have to consider that some malware authors will actually use this capability.
539220	543060	So, the way that we're going to talk about this is in the form of a case study.
543060	552040	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.
552040	557860	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.
558060	567560	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.
567660	582140	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.
582260	597680	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,
597680	602560	you're going to need to have MFA authentication with a UB key as well as SSO.
602560	606980	And now, here's the part where I rig it for me, the presenter.
607240	613840	We're going to say that we've successfully tricked this targeted user into running one PowerShell script on a Windows host.
613840	617920	Just to be clear, the tool that's being presented now is a post-exploitation tool.
618080	624560	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.
624760	634560	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.
636420	645460	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.
645460	654460	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.
654460	659680	And then these are going to both talk back to our C2 server, which is running in the cloud.
660260	661440	I've used Amazon here.
661440	663080	You can use whatever cloud you want.
663800	687860	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.
687920	690860	So to be a little more concise, we have a plan.
690860	695240	First we're going to need to sideload a Chrome extension and an isolated web app.
695600	701240	Then we're going to use that to capture SSO credentials for Okta using the Chrome extension.
701500	708980	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.
709480	721940	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.
721940	723760	I'll keep you updated as we're going.
724620	739640	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.
739640	741140	It's just a JSON file.
741780	747140	Individual extensions request permissions, and they often request really dangerous permissions.
747140	747880	It's super common.
747880	754800	So like this example I have on the right, which is going to look very similar to our final extension, is actually Adobe Acrobat.
754800	756440	Everybody requests dangerous extensions.
756440	757880	It's just super common.
758820	764240	And in order to stop people from just tweaking these things constantly, there is a little bit of protection in the browser.
764320	780020	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,
780020	781640	and this has been happening for years.
781640	786440	You can go as far back as 2016 and find Adware people taking advantage of this.
786500	793380	More recently, pen testers such as Nicholas Murray and Gordon Long have written public POCs for being able to calculate these hashes.
793480	794480	That's great.
794640	797060	We're going to have one that's implemented in PowerShell.
797980	805700	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.
805820	806940	These are really powerful.
806940	810700	These let us do things like read the file URIs, which lets us build out a file browser.
810900	815000	We're just obviously going to flip all of these things on because we're side-loading, so why not?
815000	825600	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?
825820	830380	First of all, let's say that we have a signed web app bundle that has an egg in it.
830380	831840	In this case, I'll say Google Keep.
831840	840740	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.
840740	849160	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.
849160	856440	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.
856440	861120	You might think, well, .log might be a text file, and sadly, it's not.
861500	867780	It's not even JSON, it's some sort of hybrid mess, but we did get a hint with this level DB bit.
867780	874200	So, it's actually just one of the many open-source Google internal data formats.
874320	875760	In this case, it's level DB.
875760	877340	This is used within Chrome.
877420	885140	And all you need to know about this is it's essentially a very nice key value storage system.
885140	886880	So, the key is very simple.
886880	893360	It's literally just like the string web apps DT and then an ID based off of our public key for our app.
893360	896280	But this value over here is a lot more.
896280	900440	And luckily, once again, it's open source, so we can just read the spec.
900480	913000	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.
913180	928320	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,
928320	931620	it was painful, you can use my implementation, don't worry about this.
931820	939080	And finally we have the remaining, you know, infinite more bytes as part of that value pair.
939080	941880	And what this is, is a Google protobuf object.
941880	951280	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.
951480	960940	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.
960940	976180	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,
976180	984020	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.
984340	1002520	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,
1002520	1005180	and lucky for us, that's in JSON, so that's actually really easy to do.
1005660	1021400	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,
1021400	1024280	there's no headless mode for running isolated web apps.
1024280	1037260	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.
1037260	1038620	You'll see what this looks like in the demo.
1039160	1055960	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,
1055960	1062660	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.
1063540	1065200	So that's the first part of the plan.
1065200	1068620	Now we've got all of our stuff loaded into the browser, it's time to take advantage of it.
1068740	1071680	So, first things first, we need those octa creds.
1072000	1078740	And this is going to be the most straightforward Chrome extension in terms of malicious extensions that you're gonna have.
1079060	1091280	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,
1091280	1104280	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,
1104280	1109440	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.
1109860	1123180	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.
1123480	1137740	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.
1138340	1157160	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,
1157160	1158440	even when they shouldn't.
1158860	1171300	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.
1171500	1176040	And I don't know how many of you have tried to reverse engineer WebAssembly, but it's not fun.
1176120	1180300	This is not easy to manage in any way or form from within the browser.
1180980	1195620	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,
1195620	1199820	but until there was great tooling for it, it wasn't super great to reverse engineer.
1200120	1204960	And lucky for us, the tooling for WebAssembly right now is not fantastic.
1204960	1208060	Ghidra cannot show you hello world written in this.
1208060	1218200	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.
1218280	1223140	And the way that WebAssembly permissions are asked for in the browser, it's really all or nothing.
1223140	1225760	You either say you can run WebAssembly or you can't.
1225760	1226040	That's it.
1226040	1237200	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.
1237200	1239680	So we're loading this in everything and no one can stop us.
1239940	1255700	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.
1255700	1256640	You get the idea.
1256640	1259160	You can really waste a lot of time with this.
1259720	1267580	And as a result, like, this is essentially what it looks like when you write something in WebAssembly versus JavaScript.
1267580	1270620	What you're actually seeing is the exact same code.
1271120	1277860	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.
1277860	1280840	It's just there's a WebAssembly file, it's being run.
1280840	1287320	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.
1288460	1300240	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.
1300240	1311340	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.
1311540	1319180	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.
1319180	1326740	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.
1326740	1332100	I can say that we've submitted malicious extensions into the Chrome store using this approach, and it's never been blocked.
1332100	1334620	We've got plenty of extensions, more than we need.
1334620	1335920	This is very effective.
1336440	1340280	So, now we've got our extension, like what are we actually doing with it?
1340400	1343840	And this is where, you know, JavaScript comes to the rescue.
1343920	1346680	We just add event listeners to the submit function on forms.
1346680	1350460	We can add it to a couple of places, like hitting the key or clicking a mouse button.
1350720	1354920	We can even intercept or man-in-the-middle certain functions, like when you call web authentication.
1354920	1356020	We'll cover that later.
1357080	1364680	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.
1364680	1372740	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.
1374580	1382640	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.
1382640	1387520	And that's where the shelling out capability, uh, within Chrome is really helpful for us.
1387520	1395140	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.
1395260	1404620	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.
1404720	1415800	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.
1415800	1420780	So once again, doorknob, or the sideloader piece, will just be able to install all of this for you.
1420780	1438420	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,
1438420	1440300	and it ends up looking something like this.
1440300	1445240	Which is Chrome just straight up shelling out, and then running whatever binary you've told it to.
1445240	1458980	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.
1458980	1465060	So if you use, say, one password, the way that it interacts with the one password on host is the same mechanism.
1465060	1466660	So they can't block it.
1467440	1480680	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,
1480680	1488040	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.
1488920	1503200	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.
1503200	1506900	And this extension will run on both Edge and in Chrome.
1506900	1511100	Obviously this is implementation via Chrome, but it works on both.
1512060	1513820	So that's how we're getting creds.
1513820	1516600	Now we need to figure out how we're going to tunnel our traffic.
1517340	1528640	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.
1528760	1534980	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.
1534980	1549580	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.
1549580	1552140	This is perfect, it's like our shopping list.
1552160	1563360	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.
1563540	1570080	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.
1570080	1580320	So for example, when I try to listen on port 135, I find out that it has to be over port 3276, or 678.
1580320	1586700	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.
1587680	1600760	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.
1600760	1605060	It's a lot less implementation work, it's a lot less complicated, and it's much more straightforward.
1605480	1606800	So that's what we're gonna do.
1606940	1614300	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.
1614540	1621220	But because we can make SOCKET servers, we just write a SOCKET server in JavaScript, and have our Chrome extension connect back to it.
1621220	1625020	This is the, that building out of that microservices nightmare I was talking about earlier.
1625460	1629880	So, by their powers combined, we're, we're just done.
1629880	1631240	That's it, that's all you need to do.
1631440	1636900	And uh, yeah, right, this is the part where this talk would be two hours if I didn't do this, I'm sorry.
1637020	1640640	So, lucky for you, we've got the blowtorch capability.
1640640	1644380	Uh, I've named it this because this is the most overkill part of the project, really.
1644480	1658280	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,
1658280	1663580	and then we just pointed at our SOCKS proxy, and now we've replicated the same features you would have in Cursed Chrome.
1663860	1666580	Except now we can RDP into things, and that's pretty cool.
1667160	1670400	Which brings us to the final part of the plan.
1670400	1674980	We also need to solve this tricky bit with web authentication and clicking buttons.
1675540	1690340	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,
1690340	1694900	the user needs to interact with something, say like a little button that you press on the side of your machine.
1694920	1701620	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.
1701620	1708520	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.
1709000	1719580	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.
1719780	1721500	Why don't I just use that?
1721500	1724700	And, um, unfortunately, I couldn't get it to work.
1724700	1730960	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.
1730960	1731980	Could be a skill issue.
1731980	1733000	I, I don't know.
1733000	1739760	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.
1739920	1744440	So the first thing that we want to do is break that same origin policy restriction.
1744500	1754060	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.
1754060	1760920	And then our injected content script can watch for some sort of, like, query token that triggers the web authentication request.
1760920	1762160	So that ends up looking like this.
1762160	1768300	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.
1768360	1769380	That's cool.
1769500	1772680	But also, a user might notice this, and that's not great.
1772680	1776340	I mean, I think plenty of users would miss this, to be honest, but, you know, let's be thorough.
1777060	1789820	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?
1790520	1793040	And here's where I was a little surprised.
1793040	1798100	So say we've opened octa.com in one tab, and then we go to a new tab and open, you know, something different.
1798780	1805500	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.
1805500	1812060	So from your perspective, you've just pressed your YubiKey and it didn't work, so you press it again, and now it works.
1812160	1816080	But you don't realize that you've actually signed two requests instead of one.
1816900	1825100	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.
1825100	1831380	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.
1832220	1851160	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,
1851160	1854080	and then they'll click the button twice and trigger it.
1854080	1861200	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.
1861240	1864400	And if they've opened way too many tabs, they're not even gonna get that.
1864400	1869020	So I think that it's reasonable to expect that this will probably work on just about any user.
1870380	1882940	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.
1882940	1886100	We play this waiting game until they click the button and then we win.
1886600	1897900	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.
1897900	1901400	But, you know, ultimately we're looking to be sneaky and not too blatant.
1902500	1908060	So, this is the paint bucket capability within uh, within the Chrome alone framework.
1908060	1913000	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.
1913420	1920740	So, we can secretly coerce our target into answering whatever web authentication challenges we want and uh, and we're good.
1920740	1923880	So the final thing we need to do is just, you know, RDP into the target.
1923880	1925460	We've already talked about socks.
1925480	1927300	Let's see what this actually looks like.
1929500	1933000	So what we're looking at is a clean install.
1933000	1939960	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.
1941560	1944920	So, they run our script and this is actually pretty quick how it happens.
1944920	1949880	What's going to happen is it's going to very quickly close the browser and restart it.
1949880	1951320	We've side loaded our extension.
1951320	1951940	That's it.
1951940	1953360	The user normally wouldn't see this as well.
1953360	1954700	They might see Chrome flash.
1954960	1963120	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.
1963360	1973140	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.
1973340	1980520	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.
1980520	1981260	But that's about it.
1981260	1982220	That's all you see.
1983200	1989240	So, now we're going to pop over to our C2 and there's a separate component within the repository called battle plan.
1989240	2000820	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.
2001040	2006060	So, obviously, the first thing we should do with all installed implants is pop calc.
2006060	2008020	That's the way that you prove you've got shell access.
2008320	2010180	So, we have an interactive shell.
2010180	2013260	In this case, we're just going to run, you know, command dot exe with uh, calc.
2013380	2015120	We can take a look at the user's machine.
2015220	2015880	There we go.
2015880	2016460	We've got calc.
2016460	2017340	You could shell out.
2017340	2018800	But that's not why we're here.
2018800	2019900	This is really blatant.
2019900	2021180	We're actually here for creds.
2021180	2022460	So, what does that actually look like?
2022460	2024160	So, say that they've gone to GitHub.
2024240	2025920	They're typing their credentials in.
2025920	2026600	They hit enter.
2026600	2028160	Obviously, those creds don't exist.
2028260	2029300	But it doesn't matter.
2029300	2030480	We still capture the data.
2030480	2035200	Every time that that's sent, it gets pushed back to our C2 and we capture it.
2035220	2037240	So, now let's actually capture the creds we care about.
2037300	2038700	This user is Harry.
2038960	2040060	He's a cool guy.
2040060	2041840	He's got a password he uses for everything.
2042000	2043400	He's entering it in.
2044120	2045580	And uh, let's see if we caught that.
2045580	2046960	We don't worry about web authentication yet.
2046960	2048240	That's coming soon.
2048980	2050980	And uh , we can see it's wet bandits forever.
2050980	2052260	Harry's a really cool guy.
2052260	2054240	And now we've got his pa - his password.
2054300	2055720	So, let's see if it works.
2055720	2060560	We know that we've got, we've got this internal vault website that we normally can't access.
2060900	2064000	So, we're going to force a socks proxy through his browser.
2064360	2067880	And now, of course, we get internal DNS and all of the goodies that come with that.
2068060	2069700	So, here's our vault instance.
2069700	2071440	And let's try to log in as Harry.
2072080	2075000	So, into Okta we go.
2075000	2076900	You get to see how slow I type.
2078280	2080800	How fast can I type wet bandits forever?
2080800	2081860	Let's find out.
2082380	2084320	Super fast.
2089140	2092760	But also, once again, oh no, MFA.
2092760	2094080	I guess it's game over.
2094340	2097680	But it's not because we got a small Python script we've written.
2097680	2099220	This is also in the demo repository.
2099220	2101580	And what this is going to do is it's going to take those creds.
2101620	2102780	It's going to hit Okta.
2102940	2104660	And it's going to get that challenge.
2104660	2107580	And we're going to push that challenge down to the user's browser.
2108040	2110420	So, we're just waiting for a response right now.
2110420	2114360	The user, meanwhile, goes to a totally different page and authenticates.
2114380	2117820	And you might notice, in that background tab, we've got that notification.
2118360	2120080	So, the user doesn't see it though.
2120080	2121260	And they're clicking their Yubi key.
2121260	2124860	I literally had to click the button like four times during this because it's so easy to misclick these things.
2124860	2127600	So, no one thinks anything about clicking the button.
2128200	2134080	But we've completed the entire login process and now we've got a client token to log into Vault.
2134080	2136820	The user never visited Vault, but it doesn't matter.
2136820	2138140	We've still got their challenge.
2138140	2140120	And now we can just log directly into it.
2140200	2143900	Uh, in Vault's case, there's a token, but obviously you would adapt this for whatever your target is.
2144320	2145800	There's a shared key.
2145800	2147760	Uh, there's this secret called SilverTuna.
2147760	2149680	That's for all the Home Alone heads out there.
2149680	2152240	I'm sure all five of you recognize it.
2152400	2157160	Um, and then we've got the final credentials that we need to hit our objective.
2157480	2161880	Uh, this is just a standard game of Active Directory, uh, login credential.
2161880	2170820	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 .
2170900	2174880	So, here we're connecting, we're giving it the domain of Seven Kingdoms.
2176560	2179360	And we're giving the super secret password a password.
2179980	2184680	And then that's gonna get us, uh, an RDP connection into our domain controller.
2184680	2186040	So, we're pretty much there.
2186260	2192880	Uh, and just to demonstrate, this is going up to AWS and then tunneled through the browser's, uh, Socks proxy.
2192880	2194200	But it's still very responsive.
2194200	2195660	RDP's totally usable.
2195680	2197140	SSH is totally usable.
2197140	2200980	We can go onto the desktop and we can dump out the contents of our final flag.
2200980	2201900	And boom.
2201900	2202600	There we go.
2202600	2203320	We've won.
2203320	2204180	That's it.
2205520	2209680	So, obviously
2217680	2219340	this isn't a perfect technique.
2219340	2225720	First of all, you need to be writing a script to automate, uh, that final pushing component for the, uh, the web authentication piece.
2225720	2229380	But, uh, you know, hard things aren't free.
2229540	2234600	It's also worth noting that Edge and Chrome are not perfectly identical implementations.
2234600	2241000	So, for example, WebUSB within Edge, uh, the unrestricted permission, it doesn't exist.
2241380	2243960	Obviously it doesn't really matter for us because we couldn't make it work.
2243960	2247620	But I would expect those two browsers to sort of fork in the future.
2247620	2251000	So, there might be some features that only Edge can handle versus Chrome.
2252000	2256460	Uh, isolated web apps until very recently, they wouldn't even load in Edge.
2256460	2260520	If you tried to load them, it just opened the window a hundred thousand times until it crashed your machine.
2260620	2264600	But, uh, like two weeks ago I was just double checking and they work now.
2264600	2269600	So, uh, look for Edge to become a valid infection vector in the near future for this repo as well.
2270520	2273640	It is worth calling out that isolated web apps are constantly changing.
2273640	2277200	They're still very new in the scheme of things for any product within Chrome.
2277200	2282800	I would be unsurprised if suddenly it became a little more challenging to sideload isolated web apps in the future.
2282900	2285880	Maybe they'll lock down those keys to only a couple of users.
2286240	2291640	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.
2291640	2294520	So, they would have just created this functionality for no one to use.
2294660	2296620	So, I don't really expect that's gonna be the case.
2296620	2303480	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.
2304500	2309200	The only other limitation right now is doorknobs implementation is Windows and Chrome only.
2309320	2312900	So, if you go to that GitHub repo, you'll only find that implementation.
2312900	2314720	But, you know, watch this space.
2315860	2321040	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.
2321040	2325060	The good news is Chrome extensions are very straightforward to block.
2325060	2327520	There's a policy item that you can set.
2327520	2328660	It's very easy to do.
2328660	2330160	You can do this in Windows or Mac OS.
2330160	2335260	You essentially just say, don't allow Chrome extensions to be installed if I haven't whitelisted them.
2335260	2337000	That's done by two policies.
2337000	2339940	Extension install block list and extension install allow list.
2339940	2344180	And when our clients do this, we cannot install malicious extensions.
2344180	2347020	You can't sideload them, you can't convince them to install it through the store.
2347020	2348020	Very effective.
2348020	2350080	So, you should absolutely do that.
2350320	2353480	When it comes to isolated web apps though, it's too new.
2353480	2355480	There is no policy for this yet.
2355480	2357240	So, there's nothing that you can set.
2357240	2368320	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.
2368320	2371880	So, we're going to have to go to secondary indicators of compromise instead.
2371920	2381340	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.
2381340	2383740	Those are all things that no one should touch but Chrome.
2385020	2387780	Ditto with any of the registry keys or files on disk.
2387860	2392160	Is there anything to stop someone from injecting into Chrome and then doing exactly this?
2392380	2397720	No, but we need every tool that we have in order to try to stop people from running with this.
2398860	2402680	And with that in mind, thank you so much.
2402760	2408260	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.
2415110	2420210	All the codes available online right now, unless something horrible has happened, theoretically that QR code is there.
2420290	2426630	If you have any questions, or you have any examples of success stories using this tool, please hit me up.
2426630	2429050	It motivates me to live.
2429050	2429810	It is wonderful.
2429810	2431970	I love watching people own stuff with this.
2431970	2436650	So, hit me up, I'm Bouncy Hat on Twitter and Mastodon on the InfoSec Exchange Mastodon.
2437210	2439430	Thank you so much and have a wonderful DEF CON.
