WEBVTT

00:00.000 --> 00:06.780
Welcome to my talk, 7 Volms in 7 Days, where we're going to be breaking bloatware faster than it's been built.

00:07.180 --> 00:10.860
To start this, I need to tell you a story of where I'm playing games.

00:10.860 --> 00:13.280
It's summer holiday back in South Africa.

00:13.400 --> 00:16.900
I'm taking some time out and playing my favorite game.

00:17.040 --> 00:25.540
At the end of that session, though, I notice at the bottom right, Asus Driver Hub is asking me to install a driver update.

00:25.680 --> 00:29.440
A little confused by this, I click it, and a browser opens up.

00:29.440 --> 00:36.360
This driverhub.asus.com is in a browser, and it's asking me for more things to install.

00:36.380 --> 00:39.200
This is fairly confusing, but I continue with the progress.

00:39.680 --> 00:43.700
Eventually, a modal pops up, asking me to restart now.

00:43.800 --> 00:49.020
Now, I've already been a little suspicious by this point, but I've been really suspicious right now.

00:49.020 --> 00:50.360
How could this be working?

00:50.360 --> 00:53.200
The installation completed, and I need to reboot?

00:53.400 --> 00:56.960
Is there some cloud-related thing here that I need to consider?

00:57.020 --> 00:58.540
I'm not really sure yet.

00:58.540 --> 01:02.660
So I go back to Driver Hub, and I click that Reboot Now button.

01:03.020 --> 01:05.740
The reboot happens instantly.

01:05.900 --> 01:07.280
There is no cloud involved.

01:07.280 --> 01:11.740
I have an okay internet connection, but the speed at which this happened was fairly confusing.

01:12.240 --> 01:22.620
Anyways, my computer comes back, and I quickly pop open the DevTools, and I realize there's a local web server running on my computer with which this Driver Hub website is interacting.

01:23.240 --> 01:29.020
It's also the end of my holiday now, because I decided I'm going to take this journey that I'm going to tell you about right now.

01:29.480 --> 01:31.700
So thank you for coming to my talk.

01:31.700 --> 01:32.840
My name is Leon Jacobs.

01:32.840 --> 01:38.860
I'm from South Africa, and I work for a company called Orange Cyber Defense, more specifically in their SensePost team.

01:38.860 --> 01:40.300
You can find me online.

01:40.300 --> 01:46.480
I'm leonjzde, basically everywhere, and I do like research, hacking, and building stuff.

01:47.120 --> 01:52.180
Today I'm going to tell you the story about hacking bloatware and a whole bunch of vulnerabilities that I found.

01:52.180 --> 02:00.160
We're going to look at four products, which include ACES Driver Hub, MSI Center, Acer Control Center, and Razer Synapse 4.

02:00.260 --> 02:07.140
All of these ones have been fixed, so if you update to the latest versions of this stuff, you'll be fine.

02:07.460 --> 02:11.780
At the end of all of that, we'll have some sort of conclusion and talk about what all of this means.

02:12.520 --> 02:14.280
I need to perfect some of this talk.

02:14.280 --> 02:20.280
There's going to be a whole bunch of tools that you're going to see, like the list on the left, and we're going to look at a whole bunch of code snippets.

02:20.280 --> 02:28.720
I've tried my best to sort of isolate the bits that you need to look at, but keep in mind that it's going to be quite fast-paced, so pay attention.

02:29.060 --> 02:34.860
The first product to look at will be this ACES Driver Hub, and the two CVEs that I found in that.

02:35.140 --> 02:40.000
When you look at these processes, one of the really useful tools you can use is called Process Explorer.

02:40.180 --> 02:46.500
And specific to ACES Driver Hub, when you look at what backs that program, there are two processes.

02:46.520 --> 02:50.460
There's ADU.exe and ACES Driver Hub.exe.

02:50.540 --> 02:56.080
And more interestingly, ADU.exe listens on a TCP socket, so things can connect to it.

02:56.240 --> 03:04.260
Now, at this point, I'm looking at these things on my home PC where I play games, but I realize if I want to do some research, I want to install this in a virtual machine.

03:04.640 --> 03:11.460
Thankfully, or as to no one's surprise, when you install ACES Driver Hub in a VM, it goes, this is not an ACES product.

03:11.500 --> 03:12.740
It's not wrong.

03:12.740 --> 03:15.560
So we needed to do a little bit of work to get that going.

03:15.840 --> 03:22.400
Opening the installer in something like Binary Ninja, it has this really nice feature where you can take some code and patch out a branch.

03:22.400 --> 03:25.560
Maybe you want to invert the code flow or do something else with it.

03:25.560 --> 03:26.900
It's fairly simple.

03:27.260 --> 03:34.100
So with the installer, I do exactly that, really with the point being so I can get a successful installation in my Parallels VM.

03:34.540 --> 03:37.980
With that installed, I can finally open Driver Hub in this VM.

03:37.980 --> 03:39.380
And again, the VM is handy.

03:39.380 --> 03:43.480
I can snapshot, roll back, do all the kinds of things without it being a pain.

03:43.740 --> 03:47.380
But when I open it up, again, it tells me this is not an ACES product.

03:47.500 --> 03:49.080
Confault them, they're right.

03:49.520 --> 04:02.080
But when you open Burp and sort of see what the requests look like when you open ACES Driver Hub, you quickly realize there's an initialized call where the local web server responds with this is a supported product or not.

04:02.320 --> 04:08.360
Because this is Burp, I can very easily change a false to true and suddenly my product is supported in my VM.

04:08.360 --> 04:10.700
I didn't get all the fancy driver updates.

04:10.700 --> 04:15.660
I could install the Armory crate, but it was good enough premise for me to start playing around with this stuff.

04:16.500 --> 04:17.800
I've mentioned this before.

04:17.800 --> 04:19.540
There were two interesting processes.

04:19.540 --> 04:26.660
And for this part, we're focusing specifically on ADU.exe because that's the one that has the TCP socket that it was listening on.

04:26.960 --> 04:33.280
Opening up ADU.exe and something like Binary Ninja, you'll see a whole bunch of features that this has.

04:33.320 --> 04:35.600
Of course, the web server was of interest of me.

04:35.600 --> 04:42.020
So, when doing some string searches, you can find endpoints that look like HTTP endpoints that you could call.

04:42.200 --> 04:46.860
One of those is this reboot endpoint, which is really patient zero what I was working with.

04:47.080 --> 04:53.180
Following the flow in how is the reboot implemented, you'll end up in a code piece that will look something like this.

04:53.280 --> 04:58.160
Really, the interesting part is the call to exit windows, which will exit windows.

04:58.340 --> 05:03.300
To visualize what we know so far, we can quickly have a look at how this would work.

05:03.300 --> 05:07.520
Imagine a browser where you're browsing to driverhub.acess.com.

05:07.520 --> 05:19.200
When that page loads, a JavaScript fetch request is made to a local web server, which then a native code makes a Win32 API call to exit windows and reboots your computer.

05:19.540 --> 05:26.900
I wanted to create a small testing harness for this, so I wrote some PowerShell to sort of replicate this reboot feature.

05:27.180 --> 05:31.920
I make a web request that looks something like this, and the first response I get was an access denied.

05:31.920 --> 05:37.020
Now, one thing that's really interesting when you look at these things, they often emit an insane amount of logs.

05:37.020 --> 05:42.200
Logs are really handy for developers, but they're also handy if you don't really know how the software is structured.

05:42.660 --> 05:45.940
In the case of ACES driverhub, exactly the same thing is true.

05:46.100 --> 05:51.140
There is a log file with a random name that they use, but it's quite useful in telling you what's wrong.

05:51.360 --> 05:57.840
In this case, I can see there seems to be some origin-related error where the origin that I passed along was not allowed.

05:57.840 --> 05:59.180
In fact, I didn't pass one.

05:59.180 --> 06:05.220
So I modify my test harness, add the origin of driverhub.aces.com, and I get a new error.

06:05.440 --> 06:09.700
And everyone knows when you get a new error, that's a sign of progress, which is great.

06:09.960 --> 06:14.480
Looking at the logs, I can now see the origin is allowed, but the body is empty.

06:14.660 --> 06:19.200
So I clearly need to send some content along to actually invoke this reboot.

06:19.520 --> 06:23.260
But keep in mind that driverhub.aces.com lives in a browser.

06:23.340 --> 06:31.580
So we can open the console and inspect the JavaScript that's being used to speak to that local web server and get a sense of what parameters might be used.

06:31.780 --> 06:41.020
In this case over here, you finally, between this minified mess, as you would expect, find a post request that gives you an idea of what the structure looks like for that web server.

06:41.360 --> 06:46.080
If I take that knowledge and update my small test harness, it would look something like this.

06:46.080 --> 06:49.660
And I'm finally at a place where I can also reboot my computer.

06:49.740 --> 06:53.360
Totally unnecessary, but this is a good harness for me to play with.

06:53.780 --> 06:54.460
Cool.

06:54.460 --> 06:57.180
With understanding that, let's move on into the first bug.

06:57.180 --> 07:00.320
And it's something that I'm just going to call the string contains bug.

07:00.540 --> 07:06.600
And to understand the string contains bug, we first need to understand how origin header validation is supposed to work.

07:06.760 --> 07:14.720
Imagine for a moment two tabs where one is driverhub.aces.com and the other is driverhub.notaces.com.

07:14.800 --> 07:19.840
Both of these tabs, both of these domains, serve hypothetically exactly the same content.

07:19.840 --> 07:24.120
There's no difference but the domain from which you're using to browse to the content.

07:24.480 --> 07:36.260
When the page loads and you might want to invoke the reboot feature, a fetch request will be made to the reboot endpoint, after which, as a security mechanism by the browser, an origin header gets attached.

07:36.320 --> 07:40.740
This is a way for the web server on the other end to kind of know where this request came from.

07:40.940 --> 07:44.360
And our driverhub implemented this security feature.

07:44.360 --> 07:47.720
When it is not aces.com, the request will fail.

07:47.720 --> 07:51.220
It's where the access denied originally comes from.

07:51.940 --> 08:01.680
Now, the challenge is, is while reversing this stuff, I often sort of rename symbols, sort of try and figure out if I have a rough idea of what a function does, I'll give it a name with a question mark.

08:01.760 --> 08:06.500
And in this scenario here, I think the function I found here was a string contains function.

08:06.520 --> 08:08.440
Question mark was, I think.

08:08.520 --> 08:12.880
But I noticed an invocation that included this .aces.com argument.

08:13.040 --> 08:22.680
Diving into string contains, you can see there's a mem compare call that has an iterator to sort of compare the input arguments over what the iterator is.

08:22.840 --> 08:25.720
To visualize this, it can look something like this.

08:25.740 --> 08:32.340
Imagine you're going to driverhub.aces.com, and it wants to know if this is the aces.com origin where you're at.

08:32.340 --> 08:40.680
Using the iterator, it will check the string for nine bytes exactly until it goes, okay, this looks like aces.com is where this origin came from.

08:41.020 --> 08:52.060
However, because this is a string contains, if you pass something like driverhub.aces.com, the same effect will occur except it will actually stop the moment .aces.com is met.

08:52.060 --> 08:56.640
Meaning any origin really can be used for you to make a request.

08:56.720 --> 08:57.840
So that's okay.

08:58.280 --> 09:03.700
Take my test harness, and you see that I can do exactly the kind of reboot with the wrong origin.

09:04.280 --> 09:09.140
Now, you may have come to this talk for a vulnerability, but I'm really just showing you how to reboot your friend's computer.

09:09.400 --> 09:19.420
But no, more importantly, you can now use an arbitrary origin as long as it contains .aces.com and interact with this local web server that driverhub gives you.

09:19.640 --> 09:23.560
Now, rebooting is fun, but what's more interesting is gaining RCE.

09:24.200 --> 09:30.300
You might remember from a previous slide that there were a whole bunch of endpoints that we could look at.

09:30.400 --> 09:35.820
There are many, many other ones that are interesting here, but one we'll focus on right now is the update app endpoint.

09:36.180 --> 09:42.380
Just like reboot, we can find the post body that update app wants, and it looks something like this.

09:42.380 --> 09:50.280
Focus on the URL element for a moment, and we can try and pass a full URL to an EXE, sort of test what this thing does.

09:50.280 --> 09:52.820
Like, if I give it a URL, will it download?

09:53.140 --> 10:05.220
We update our test harness with exactly that URL path that we give, invoke the request, and if we inspect the log files, we see a line that tells us this agent URL can't find .aces.com in it.

10:05.440 --> 10:18.020
Well, I showed you the string contains bug, so exactly the same vulnerability exists here where you can just give it a URL to any origin, as long as .aces.com exists, and it would download that, which is quite handy.

10:18.420 --> 10:25.120
The challenge, though, is when you run it, continue looking at our log files, we get a new error, the universal indicator of progress.

10:25.220 --> 10:28.920
Tells us that this one is not signed, this executable that we've sent.

10:28.920 --> 10:32.340
But the progress here is our content has downloaded.

10:32.680 --> 10:41.800
Of course, the reverse engineering journey continues, and we finally have a look at what the PE signature validation looks like, and you see a line like this.

10:41.800 --> 10:45.400
Does one of the properties contain ACES tech computer ink?

10:45.660 --> 10:47.940
Doesn't really check if the source is valid.

10:48.200 --> 10:54.620
Thankfully, tooling already exists that lets us clone PE signatures from a valid binary to whatever we want.

10:54.740 --> 11:01.140
Critically, the signature won't be valid, but the properties exist, which ACES would then be happy with.

11:01.300 --> 11:08.920
So, I want to show you a very quick demo of what this would look like, putting these things together, and sort of getting remote code execution with one click.

11:09.400 --> 11:13.600
What you're going to see now on the left-hand side is a web browser of your victim.

11:13.600 --> 11:16.700
Somehow, you've coerced someone to browse to your website.

11:16.700 --> 11:22.020
A website that has .aces.com in the URL, a subdomain, whatever you have.

11:22.120 --> 11:25.440
On the right-hand side is just a little bit of showing what's happening.

11:25.440 --> 11:32.100
We'll tell the log files of ADU.exe to see the progress of that process.

11:32.100 --> 11:36.280
So on the right, we start telling the log files.

11:36.280 --> 11:41.680
On the left, I go to my domain, browse to my fancy website, and we pop Calc with one click.

11:48.400 --> 11:55.060
What's really interesting about this setup, though, is none of the components of ACES Driver Hub runs in an elevated context.

11:55.060 --> 11:57.720
They're all normal user processes that run.

11:57.880 --> 12:06.900
However, you can imagine most gamers, they're probably an admin on their computer, but they have a UAC setting where they'll need to at least click accept or deny.

12:07.280 --> 12:20.220
It turns out, if you have a side-by-side assembly manifest or what seems to be known as a UAC manifest that you apply to your target payload, this entire process actually bypasses the UAC prompt as well.

12:20.220 --> 12:25.660
So if you're an admin, this code execution actually turns code execution in an elevated context.

12:26.040 --> 12:32.720
Now, Windows has some heuristics to sort of determine, and this is an installer-based thing, should I run elevated or not?

12:32.720 --> 12:41.640
But the way to make this deterministic is to actually attach an XML like this, which has this requested execution level field.

12:42.100 --> 12:57.980
With this XML at hand, you can run a tool called mt.exe, which you'll get with Visual Studio, pass it the manifest and your target executable, and it'll look something like what you probably have seen before, that sort of signature yellow-blue shield that it has on top of it,

12:57.980 --> 13:01.780
indicating that when you run this, it might run in an elevated context.

13:02.060 --> 13:12.920
So for exactly the same exploits, if you pass along a exe that you've added this manifest to, that code execution will turn into an elevated code execution, bypassing UAC.

13:14.540 --> 13:22.200
Talking about an impact for this, when I looked at my motherboard that started all of this, there's this handy... I wondered, where did this come from?

13:22.200 --> 13:27.840
You look at the BIOS and there's this line that says you can download and install ACES driver hub automatically.

13:28.060 --> 13:31.520
When I found these vulnerabilities, I disabled that fairly quickly.

13:31.520 --> 13:36.460
But that should give you an idea how some of the software might actually end up on people's computers in the first place.

13:37.080 --> 13:40.840
Okay, so that's ACES driver hub, so let's look at a quick summary.

13:40.840 --> 13:46.460
It could be an alternative way to reboot your friend's computer, or a way to execute arbitrary code.

13:46.580 --> 13:53.600
It can auto-install itself based on this BIOS setting, but really it's the sort of misuse of this strange RPC mechanism.

13:53.600 --> 13:57.400
How you invoke those HTTP requests is not great.

13:57.760 --> 14:08.520
The Chrome working group actually has a spec proposal which should gate access to local resources, similar to how webcams and microphones would be gated today.

14:08.560 --> 14:16.880
So what it really implies is they're proposing that a little pop-up comes up saying, hey, this website wants to speak to something on the local network, which sounds like a handy thing.

14:17.340 --> 14:21.300
And I think, a little bit to no one's surprise, the disclosure was a little messy.

14:21.300 --> 14:23.060
I'll get back to that a little bit later.

14:23.680 --> 14:26.240
Now back, I'm still on my holiday, I'm a little excited.

14:26.240 --> 14:28.120
I found some really cool vulnerabilities.

14:28.120 --> 14:30.980
I'm going to tell ACES about this, and it's nice.

14:30.980 --> 14:34.080
I've disabled this stuff so that no one else exploits me.

14:34.100 --> 14:36.980
But I did have a moment and wonder, what are other vendors doing?

14:36.980 --> 14:41.040
If this is one not small vendor, what other things can we see?

14:41.660 --> 14:49.980
So I Googled around for products, companies that do similar things, and unfortunately I come across MSICenter next.

14:50.820 --> 15:02.600
The thing with MSICenter though, once you install it, like in my VM, it has this pop-up, this display that says, for you to use this, you need to add your local user to the administrators group.

15:02.780 --> 15:08.160
It's a little confusing to me because all of the processes that run in the backend already run in an elevated context.

15:08.160 --> 15:11.280
So I'm not sure why my user needs to be admin already.

15:11.660 --> 15:19.160
But, much like ACES driver hub, it also has a component that has a local TCP socket that listens for connections.

15:19.260 --> 15:22.740
The difference though, in this case, is actually elevated as well.

15:23.060 --> 15:34.100
Because this is a TCP socket, and I don't really know what it looks like, I opened the client and Wireshark to see what the connection between a client and that elevated service would look like.

15:34.120 --> 15:36.360
And you would see some output that looks like this.

15:36.360 --> 15:41.440
It's a binary protocol that goes in, but the bits that come out seem to be JSON.

15:42.100 --> 15:44.540
And it's familiar, but not entirely.

15:44.780 --> 15:51.260
The nice thing though, because the MSI center clients is written in .NET, the reversing of this is fairly easy.

15:51.260 --> 15:56.620
There's no obfuscation or anything like that, so it's a little bit like looking at a source code review from that perspective.

15:57.060 --> 16:00.600
Anyways, when you go through this code a little bit, four interesting things come out.

16:00.600 --> 16:06.120
There's a launch server method that does some housekeeping, makes sure the port's available, etc.

16:06.300 --> 16:14.320
Then registers two callbacks, where code runs when a new connection comes in, and code that runs when data is read into that connection.

16:14.560 --> 16:23.820
But finally, and probably the most important part, is this data response function that takes a structure of the data that came in on the socket and hands it off to other components.

16:23.820 --> 16:25.460
We'll talk about that in a bit.

16:26.180 --> 16:34.760
One of the ways in which the software knows where things should go is these definitions, sort of static byte structures of features that it supports.

16:34.760 --> 16:43.780
Here's an example of a reboot and an uninstall function, but many components in this bloatware has different definitions, which you can see an example of here.

16:44.060 --> 16:56.160
With those byte structures defined, there is this sort of very primitive compare bytes call that sort of figures out based on how all of the features that the software supports, when does which block run.

16:56.440 --> 16:59.580
And that would look something like this for the reboot case.

16:59.720 --> 17:04.040
A more complete example, you'll actually see two distinct things here.

17:04.040 --> 17:14.520
One is a plug-in loader, which we'll get to in a second, but in this case for reboots, it actually finally does the reboot by running shutdown.exe as an outcome of this thing.

17:14.840 --> 17:23.700
So what we're really saying is we just have a TCP connection that we can make to the service and send through the bytes for these commands to make it do something.

17:23.980 --> 17:28.340
So I did exactly that, but when I sent this along, nothing happens.

17:28.760 --> 17:36.040
Referring back a little to the Wireshark output that I was looking at, I realized that I didn't know yet what those first four bytes were for.

17:36.120 --> 17:42.580
The bits afterwards started looking familiar to commands that are implemented in this bloatware, but the first bytes I wasn't too sure of.

17:42.760 --> 17:51.420
But regardless at this point, I don't really know what it means yet, you sort of yellow it, add the four bytes to your POC, send it on, and your computer reboots again.

17:51.760 --> 17:55.660
Now this might be a talk , seven ways to reboot your computer, but no.

17:56.420 --> 18:02.880
More importantly, we now have the primitive where we can interact with the privilege process from a non-privileged context.

18:03.160 --> 18:09.480
Now before we get into the bugs, I do want to talk a little bit about MSI Center's software architecture, because I think that is quite interesting.

18:09.840 --> 18:13.740
When MSI Center boots up, it has this idea of a component loader.

18:13.740 --> 18:28.440
It scans the program files directory for any DLL that matches this API underscore star DLL format, tries and loads it, kicking off an initializer that would register that DLL as a component that contains commands.

18:29.100 --> 18:33.000
Practically what it means is you end up with this sort of component command map.

18:33.420 --> 18:39.060
Every component has a unique ID, and each one of those components implement unique commands.

18:39.320 --> 18:50.200
And mapping that to the TCP protocol, it means every TCP frame defines the component it wants to target with those first four bytes, and then which of those commands that it wants to run.

18:50.660 --> 19:04.280
More crucially, with the component loader, and you'll remember this from the plugin loader earlier, there is this piece of code that gets to this transfer command part, which tries to find the component that is loaded, and sends it off to that plugin.

19:04.380 --> 19:07.560
Really, just hoping that plugin knows what to do with it.

19:07.980 --> 19:12.920
Okay, so let's look at the first bug, which is a local privilege escalation in this MSI Center.

19:13.600 --> 19:21.580
One of those commands that exist within the MSI Central server component is called command auto-update SDK.

19:21.900 --> 19:23.760
And you can see it accepts two arguments.

19:23.760 --> 19:26.560
One is a target program, and the other one is an executable program, and it executes the arguments for it.

19:26.560 --> 19:28.340
Now, I think you know where this is going.

19:29.160 --> 19:38.720
More importantly, when that command is invoked, the target you want to run, let's say there's an executable on your desktop, gets copied to C Windows 10 MSI Center SDK.

19:39.120 --> 19:53.440
Some verification work, which we'll talk about in a bit, happens, but eventually this execute task function runs, which schedules an immediate scheduled task, that's a mouthful, to run that executable and any arguments, and if its supervisor is set as true,

19:53.440 --> 19:55.880
which is the default, it runs that system.

19:56.500 --> 20:04.040
The part before that happens, though, is a code signing check that actually checks if this thing that I'm trying to run is actually signed by MSI.

20:04.160 --> 20:09.160
I don't have an MSI code signing cert, so naturally I can't pass this check.

20:09.380 --> 20:15.660
And the right way to do it is with the WinVerify trust call, which they do in native code, so that was a bit of a bummer.

20:15.840 --> 20:21.460
And it leaves me with this sort of sad holiday vibes that it's also the end of the holiday and I don't have a cool vulnerability.

20:22.020 --> 20:26.580
Until I realize, hold on, I need to really look at this thing, there is something to look at.

20:27.320 --> 20:35.260
So if we revisit this auto command SDK, auto update SDK command, and break it down, the first step is to copy the target we want to run.

20:35.360 --> 20:41.740
So if we take prog.exe, the software will copy that to MSI center SDK and the Windows temp directory.

20:42.060 --> 20:52.220
It would then do the verification, and verification is running WinVerify trust over that target file that got written to the temp file, to the Windows temp directory.

20:52.860 --> 21:01.360
If the WinVerify trust passes, the schedule task is executed, which is really just saying run that MSI center SDK as system.

21:01.760 --> 21:08.020
Because it's fairly quick, eventually the schedule task will run it, which again will be a system.

21:08.020 --> 21:13.800
But the challenge here is, the one that got verified and the one that got run isn't bound in any way.

21:13.860 --> 21:17.280
Which gives us this opportunity for a race condition that we could exploit.

21:17.660 --> 21:29.580
Taking copy target and imagining we run it at two exactly same times, one might be prog.exe, another could be this, I don't know what MSI server.exe does, but it was useful because it had a valid signature.

21:29.720 --> 21:37.840
If we run both of those at the same time, and it copies it to the same directory, which one of these two is the schedule task going to run?

21:37.840 --> 21:41.100
And if we do it really quickly, there's an opportunity to run the wrong one.

21:41.580 --> 21:45.160
So my exploit plan here is to race to execute with two threads.

21:45.160 --> 21:51.160
One for this legitimate MSI server thing, did nothing, but it was handy for insert.

21:51.300 --> 21:56.260
And the second is then for my payload, which I was using to just add users to the local system.

21:56.860 --> 22:03.360
The end means that that schedule task would be confused about which one to run, because there's no binding to who got verified yet.

22:03.780 --> 22:08.820
So if we take a look at a quick demo of what this privilege escalation might look like, it would be something like this.

22:09.380 --> 22:11.860
At the back is MSI center server running.

22:12.100 --> 22:18.640
Just to show the context, I start by checking that I don't have an MSI user, and I try and add it.

22:18.640 --> 22:21.800
It's really just to indicate that I don't have access to do that right now.

22:22.340 --> 22:28.020
I then run my POC, which takes an executable, which is not signed, and adds a user.

22:28.420 --> 22:35.540
Once the race is won, I can double check, and I now have a new user, which is also an administrator, added to the local box.

22:43.120 --> 22:48.600
That's a very complicated exploit though, because LPE2 is significantly simpler.

22:49.480 --> 23:01.340
Continuing this process of learning of which commands exist, there's one that lives in API support, the DLL, also has an execute task routine, but the difference here is it was its own implementation of execute task.

23:01.380 --> 23:06.540
It matches the function prototype, but none of the security features that existed in this common lib.

23:06.540 --> 23:14.500
And you can see probably the developers wanted to get everyone to use the same library, but someone decided not to, or there's some legacy code, I don't know.

23:14.580 --> 23:18.660
But what is nice about this re-implementation is there's literally zero verification.

23:18.760 --> 23:23.120
You pass the target, it schedules the task, and it runs.

23:23.460 --> 23:29.060
So my exploit now becomes sort of four lines, I give it the task, and you know, we get local privilege escalation.

23:29.060 --> 23:30.260
It's fairly silly.

23:31.120 --> 23:41.980
Okay, so in summary, for the MSI center, I don't have a, there's another way to reboot a computer if that's what you're into, but more importantly, code execution in a privilege context.

23:41.980 --> 23:51.960
Comes pre-installed when you buy a laptop, for many of these laptops, but it's yet another example of this sort of RPC mechanism that gets misused or is not well implemented.

23:53.300 --> 24:02.220
It's a bit of a depressing outcome, but I sort of continue, you know, sort of day three, day four of my hacking rampage, and Acer control center unfortunately comes on my radar.

24:02.580 --> 24:08.880
Acer decided to squish two bugs into one CVE, but that's fine, so let's take a closer look at that.

24:09.320 --> 24:22.240
When you install it, if I recall, this one doesn't do any verification, it's happy to run on my Parallels VM, but when you look under the hood, you'll see that there isn't really a TCP service that we can target, but instead it's a named pipe.

24:22.580 --> 24:29.180
However, the one of the services, or the privileged services, sorry, one of the services is privileged, which makes it an interesting target.

24:29.520 --> 24:38.080
If you reverse some of the stuff, you sort of get an idea on how the software is put together, you'll see there's really two components, which is very classic client-server architecture.

24:38.320 --> 24:50.840
There's this native binary running as a service in an elevated context, and then there's this normal user client that you would run, but that's written in .NET, and you can already see which one of those two would be easier to reverse.

24:51.280 --> 24:55.500
Because a named pipe exists, that's sort of the mechanism in which these two can connect.

24:56.040 --> 25:02.200
Taking a look at the client, one of the functions that you find that's very interesting is called send command by named pipe.

25:02.200 --> 25:06.300
It takes the pipe, a seven, a target path, and a hundred and thirty.

25:06.940 --> 25:19.800
When you look at this in a bigger picture, when that gets sent over to the native binary, somewhere in some of the logic over there, which you'll reverse, there's eventually a create process as user call with exactly that target that you've given it.

25:19.800 --> 25:27.800
So it's such a silly, like connect to the named pipe, pass a target, run thing, that really for the demo I just sort of give you a screenshot over here.

25:27.940 --> 25:29.600
The interesting part is coming.

25:29.820 --> 25:40.880
But what's nice about this is there was some encoding that I could just rip out of the ACER control center client, implement it in a small.net program, give it a pass, and it would run.

25:41.220 --> 25:48.040
But the first thing that confused me here though is this service is running in an elevated context and my notepad was not.

25:48.040 --> 25:52.220
Like I was only getting low code execution as a low privileged user.

25:52.260 --> 25:54.580
And I wasn't too sure what was going on there yet.

25:55.020 --> 26:03.620
Regardless, moving on to the named pipe, I sort of look at the access and I realize it has this file all access thing, which is something you explicitly need to get wrong.

26:03.620 --> 26:04.820
Like you need to go set that.

26:04.820 --> 26:06.100
This is not the default.

26:06.420 --> 26:12.680
Which means although it's not a low privilege escalation, a local privilege escalation, it's actually remote code execution.

26:12.680 --> 26:15.040
So I can run notepad on your friend's computer.

26:15.500 --> 26:18.480
So if we take a look at a quick demo, let's see what that looks like.

26:18.720 --> 26:21.420
On the left hand side I have an attacker VM .

26:21.420 --> 26:23.880
It's not connected to any domain or anything interesting.

26:24.080 --> 26:27.560
And on the right hand side there's a user running ACER control center.

26:28.140 --> 26:31.600
I have a quick look at what the IP config is between the two.

26:32.040 --> 26:40.000
When that is done, I run my POC, which connects to the remote end and asks it to spawn notepad over that named pipe.

26:48.460 --> 26:53.980
I like remote code execution, but I don't like not understanding why it wasn't as a system.

26:54.100 --> 26:56.320
So I still had some questions remaining.

26:56.560 --> 26:58.660
Why is this system thing happening?

26:58.740 --> 27:03.120
What is that 113 that I've got that I'm sending along with the argument?

27:03.300 --> 27:07.080
And if assuming 7 is a command, what other commands exist?

27:07.400 --> 27:14.180
Continuing looking at the server side, elevated binary, eventually you find the other commands that exist there.

27:14.180 --> 27:20.220
I had this weird pointer matching thing to invoke them, but regardless they'll look something like this.

27:20.380 --> 27:26.680
None of the functions that I could see in the ACER control center client would invoke any of these other functions.

27:26.680 --> 27:37.400
So I sort of left to a place where I needed to manually build my client, invoke command 6, 5, 4, 3, and get a sense of what the arguments would look like and how they would get invoked.

27:37.480 --> 27:47.480
To use that, I used my favorite tool called Frida, which I really like, just to get a sense at run time what does the invocation look like and which code parts finally trigger that.

27:47.680 --> 27:53.320
The unfortunate thing sadly comes along, none of those code parts seem to be doing anything interesting.

27:53.320 --> 27:56.640
In fact, it was just a bunch of registry read and write, etc.

27:56.760 --> 28:03.120
So I revisit that run command function where I have a path and I have this 113 that comes in.

28:03.380 --> 28:10.400
I'm a few days into this reversing process and I start realizing the fatigue kicks in, but thankfully I had a closer look.

28:10.700 --> 28:16.020
One section of this function has a specific condition for that argument that takes the 113.

28:16.220 --> 28:30.180
In fact, when you make it 114, in fact, incremented by one, you might notice that X3000 matches a constant when you look at the Windows SDK to have a SID initialized for a higher integrity process.

28:30.700 --> 28:36.580
So when this initialized SID function finishes, a token gets built and that gets used to run the target process.

28:37.420 --> 28:42.060
What that really means is, when you have 113, it runs as a normal user.

28:42.060 --> 28:46.760
When you make it 114, it will run in an elevated context.

28:46.920 --> 28:57.540
So change send command by name pipe, making 113, 114 and you now have an elevated command or an LPE on that system.

28:57.700 --> 29:04.160
The really neat thing because of the broken name pipe permissions, this will work remotely as well.

29:05.920 --> 29:16.080
Okay, so in summary for the AC control center, while I don't have another reboot POC for you, you have the ability to execute code in an elevated context on the other end.

29:16.180 --> 29:25.140
This is also pre-installed on a whole bunch of laptops and while it's not a TCP service, it's sort of the same thing when the name pipe is configured like that.

29:25.220 --> 29:27.980
So you definitely want to avoid that if you're doing that stuff.

29:29.120 --> 29:35.740
Okay, the last target that I want to talk about is Razer Synapse 4, which also has the CVE.

29:36.240 --> 29:40.660
When you install Razer Synapse, it's their newer version of their product.

29:40.660 --> 29:44.020
3 has been out for a while, but this one is not too old yet.

29:44.240 --> 29:46.360
It will look something like this when you're installed.

29:46.360 --> 29:50.900
I don't own any Razer products, so the menus and things are empty, but that's fine.

29:51.440 --> 30:02.000
For one moment though, when you look at what's happening under the hood, you need to appreciate the amount of processes that's running here for when you probably want to change the RGB on your products.

30:02.060 --> 30:06.660
I don't think it's necessary for that much, but this is not my domain.

30:06.980 --> 30:13.120
Regardless, the keen eye here may have already noticed the process that's got the name and what's about to happen.

30:13.120 --> 30:15.240
The Razer Elevation Service.

30:15.280 --> 30:19.600
It runs a system and this is an interesting target.

30:19.880 --> 30:27.220
The challenge with it though is it doesn't, unlike the previous targets, there's no listening ports or name pipes or anything like that.

30:27.220 --> 30:30.660
It's written in C++, which makes the reversing a little bit more challenging.

30:31.020 --> 30:33.800
And so this target seemed a little hard at first.

30:34.260 --> 30:39.120
Attach ProcMon to it and I interact with it using that Electron client.

30:39.560 --> 30:45.180
Eventually I could get an interaction with the Razer Elevation Service when I installed another component.

30:45.180 --> 30:47.020
This Razer Chroma thing.

30:47.020 --> 30:50.420
I don't know what that is, but the installation triggered the code path.

30:50.980 --> 30:56.800
And it's at this point I realized I needed to reverse that client to see how exactly this code execution works.

30:57.140 --> 31:01.980
Because it's an Electron app, the sources will be bundled in what's called an ASAR archive.

31:01.980 --> 31:11.840
And the Node team kindly maintains a tool that lets you extract these, which really just means you can end up with the JavaScript source code of that Electron application when you run this tool.

31:12.080 --> 31:16.280
I like reading source code to find vulnerabilities, so this is incredibly handy.

31:16.720 --> 31:23.900
When you dig into the detail, you'll find that they're doing what's called a foreign function interface using this Node FFI library.

31:23.900 --> 31:29.960
In fact, it looks like a private fork of a public tool that they're using here, so you can see the changes that they have made.

31:30.220 --> 31:44.520
But to understand how this works, what really happens is in the JavaScript Node world, you can call a function like simple service initialize here, and the Node FFI library takes care of all the translation and loading of native code to make the same function call.

31:44.520 --> 31:46.540
It's a very nice obstruction layer.

31:46.740 --> 31:57.420
It also supports multi-platform, multi-architecture, so Node FFI will take care of is it x86, is it Mac, whatever you're running for, and just call that native code in the end.

31:57.960 --> 32:08.640
What this looks like in the Razor Synapse app is you'll have a definition, client side, which when I looked at this the first time, I thought this was Frida, the first time I'm seeing Frida use non-reversing case.

32:09.120 --> 32:14.180
But it's really a simple definition of what those function calls would look like in the native world.

32:14.400 --> 32:24.480
To double check that, you open the simple service DLL that they're using in Binary Ninja or your favorite reversing tool, look at the exports and you can clearly see the matching between the two.

32:24.680 --> 32:30.620
So using this foreign function interface, they're calling a DLL natively as the first translation step.

32:30.880 --> 32:34.420
I of course wanted to play with this, so I came up with a small testing plan.

32:34.760 --> 32:42.800
This simple service DLL, and that's literally what it's called in this product, is a DLL I wanted to load and run some functions on it myself.

32:43.240 --> 32:51.400
And I'd use this reverse JavaScript client, the electron client, to sort of get an idea of what the call flows would be, what the arguments would be, et cetera.

32:51.980 --> 32:58.440
Eventually I end up in a POC, like extremely minified, it's significantly longer, that looks something like this.

32:58.440 --> 33:01.900
There's a function called simple launch user app process.

33:02.120 --> 33:04.920
It takes a few arguments but the first three are interesting.

33:05.260 --> 33:13.440
And while running this, of course using some Frida to get a sense of what the arguments look like, I realized that there's some paths that I can add.

33:13.620 --> 33:20.180
When I initially ran this it didn't work and it needed a little bit of tweaking to understand how those paths relate to each other.

33:20.500 --> 33:27.520
It's a little complex but I suspect this is a security feature that they've implemented to try and make sure that code only runs from a specific folder.

33:27.840 --> 33:35.080
You see parameter one needs to be a folder relative to this app data path and parameter two needs to be relative to parameter one.

33:35.560 --> 33:47.860
Anyways, what that really boils down to is if you want to make this call you can give this comment as an argument, which is a path relative to app data, and then assuming your payload lives there, give that argument to run.

33:48.040 --> 33:57.480
When you run that, the DLL would be extremely verbose in what it's doing and one of the lines you might spot there is this one that says this PE file is not trusted.

33:57.780 --> 34:11.560
Now I haven't been able to have a, well I don't have a Razor Synapse code signing so I'm fairly disappointed at this stage, until I realize that actually the code signing is in that client DLL that I have complete control over.

34:11.560 --> 34:18.920
They're doing it correctly when verified trust is the way to do this, but I can simply patch that out, which is exactly what I did.

34:18.980 --> 34:26.240
Make a copy of simple service DLL, patch out the PE certificate validation and rerun the POC.

34:26.640 --> 34:33.620
In this case now, while everything works, there's no error, I also don't have a user added, which is a fairly confusing thing.

34:34.320 --> 34:45.000
That's when I realized actually I've already had this trick where the side by side assembly manifest can get added to an EXE and I needed this add user POC of mine to run in an elevated context.

34:45.120 --> 34:54.480
So doing exactly the same trick by having the MT.EXE attach this manifest to my payload, I can get code execution the way I wanted it to be.

34:54.860 --> 35:00.680
So if we take a quick look at what the Razor Synapse privilege escalation would look like, it would be something like this.

35:01.120 --> 35:11.240
I first just check that the task is running, that Razor elevation service, I then double check that I don't have my Razor user yet, and I also can't add it.

35:12.020 --> 35:20.880
Once that is done, I run what's now called Razor Pwn over here, which will load my modified DLL with all the security checks patched out.

35:21.180 --> 35:26.400
And if you quickly see, there will be a pop up that shows a new user added to this machine.

35:26.400 --> 35:28.940
And we have LPE on our machine.

35:34.530 --> 35:39.750
I was building these slides for this talk when I'm talking to a colleague about this bug.

35:40.350 --> 35:42.930
And he effectively made my LPE a one liner.

35:43.410 --> 35:48.650
The part that I haven't shown you yet is actually the interface of the Razor elevation service is a com object.

35:48.650 --> 35:57.330
And I'm a few days into my reversing journey and getting a lot of fun, but I'm not really thinking very straight and actually not being successful with com interfacing.

35:57.650 --> 36:07.350
We have a look at OLE view again and we get this prog ID for the Razor elevation service, and my colleague shows me how to do the interaction with com objects in PowerShell.

36:07.510 --> 36:16.790
The first thing you can do is instantiate a new object using the prog ID that you've enumerated, and then you can run get member on that to see which methods exist.

36:16.810 --> 36:18.670
You can't really see where this is going.

36:18.990 --> 36:26.770
There's a launch process, you've got an option of two, of which you just pass in a pass and it would run that target for you in an elevated context.

36:26.930 --> 36:34.270
So you can ignore all this complicated patching and just use this one liner to get LPE and Razor Synapse 4 unpatched.

36:35.570 --> 36:38.370
Okay, so let's wrap up quickly.

36:39.170 --> 36:42.610
I didn't only have success, there were definitely some failed attempts.

36:42.610 --> 36:50.770
I looked at a few targets, which included the HP support exist, Gigabyte control center, which has a very interesting architecture, and Lenovo Vantage.

36:50.930 --> 37:01.730
Just last month, Atreides partners released a blog post where they also looked at Lenovo Vantage, but I think the researcher had more sleep than me and they found some really cool bugs that I encourage you to have a look at.

37:01.730 --> 37:04.630
A whole bunch of registry things that I didn't know was possible.

37:04.750 --> 37:05.930
So have a look at that.

37:06.490 --> 37:17.650
In summary, the vulnerabilities that we've looked at included these six CVEs, they've all been reported and fixed, and Acer decided to make two bugs one, which I don't really understand, but that's fine.

37:17.850 --> 37:19.750
But like I said, they're all fixed.

37:20.210 --> 37:23.190
It leaves me a little bit to talk about the disclosure for a bit.

37:23.190 --> 37:26.430
And if you are a vendor, please hear me out.

37:26.590 --> 37:33.890
In the case of Acer, I tried to disclose these vulnerabilities, but their disclosure page has a WAF and it's blocking bad payloads.

37:33.910 --> 37:38.570
I'm sending them bad payloads, please accept them so that you can have a look at the detail.

37:38.570 --> 37:42.090
So it made for a frustrating runaround to get that reported.

37:42.570 --> 37:51.190
On a more serious note, there was a research collision here where another researcher, two months after I reported, also reported similar bugs.

37:51.190 --> 38:06.030
In fact, the same original origin bypass, but instead of telling the researcher this has already been reported and worked on, they sent us the email with exactly the same CVE announcement, except when you click on the email, the CVE is credited to me,

38:06.030 --> 38:08.430
effectively stringing this researcher along.

38:08.630 --> 38:10.170
I'm really sorry about that, Mr.

38:10.170 --> 38:18.010
Rue, but what's interesting, if you look at their blog, they have since hacked more Acer's things, which I think is a little bit of a revenge hack and very funny to see.

38:18.590 --> 38:21.870
On the positive side, MSI responded incredibly fast.

38:21.870 --> 38:27.830
Like the communication was clear, they were the first ones to fix their bugs, etc., so that's definitely a win.

38:28.230 --> 38:34.250
From a razor perspective, though, they used a bug bounty program which effectively fronted the security team.

38:34.330 --> 38:46.270
When I reached out trying to talk to someone to talk about this DEF CON talk, the CVE, etc., I couldn't believe how many tickets on an internal system ended up in my mailbox as they sort of pushing this around, who can I talk to?

38:46.490 --> 38:51.910
It unnecessarily delayed the process, I think, and I think the communication could be a little bit better there.

38:52.590 --> 38:55.930
I'm going to leave you with this idea of what I'm going to call the Pwn Triad.

38:56.070 --> 39:10.430
If you find a privileged service that has an RPC mechanism, be it a named pipe, com object, TCP, whatever you think you're having, check if there's an authentication or a validation issue, which there probably is, and you will find a vulnerability.

39:10.950 --> 39:14.110
In fact, this could also just be a recipe for free CVEs.

39:14.610 --> 39:20.890
In conclusion, I think products built in 2025 doing silly RPC things like this is really unnecessary.

39:21.250 --> 39:27.930
In fact, if you think you need that bloatware thing twice, there's probably better resources to get that.

39:28.310 --> 39:35.010
And if you want to go CVE hunting, check what you have installed right now, and just before you uninstall them, maybe you can get a free bug.

39:35.670 --> 39:39.590
For all of these vulnerabilities, there's a bunch of POCs that I put on GitHub.

39:39.730 --> 39:43.730
If you want to play with them, I think there's some more attack surface in many of these tools.

39:43.830 --> 39:47.070
You can get it in this QR code, which should be public after this talk.

39:47.710 --> 39:52.410
That's what I wanted to show you for bloatware hunting, vulnerability hunting.

39:52.610 --> 39:53.350
Thank you.

