start	end	text
0	6780	Welcome to my talk, 7 Volms in 7 Days, where we're going to be breaking bloatware faster than it's been built.
7180	10860	To start this, I need to tell you a story of where I'm playing games.
10860	13280	It's summer holiday back in South Africa.
13400	16900	I'm taking some time out and playing my favorite game.
17040	25540	At the end of that session, though, I notice at the bottom right, Asus Driver Hub is asking me to install a driver update.
25680	29440	A little confused by this, I click it, and a browser opens up.
29440	36360	This driverhub.asus.com is in a browser, and it's asking me for more things to install.
36380	39200	This is fairly confusing, but I continue with the progress.
39680	43700	Eventually, a modal pops up, asking me to restart now.
43800	49020	Now, I've already been a little suspicious by this point, but I've been really suspicious right now.
49020	50360	How could this be working?
50360	53200	The installation completed, and I need to reboot?
53400	56960	Is there some cloud-related thing here that I need to consider?
57020	58540	I'm not really sure yet.
58540	62660	So I go back to Driver Hub, and I click that Reboot Now button.
63020	65740	The reboot happens instantly.
65900	67280	There is no cloud involved.
67280	71740	I have an okay internet connection, but the speed at which this happened was fairly confusing.
72240	82620	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.
83240	89020	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.
89480	91700	So thank you for coming to my talk.
91700	92840	My name is Leon Jacobs.
92840	98860	I'm from South Africa, and I work for a company called Orange Cyber Defense, more specifically in their SensePost team.
98860	100300	You can find me online.
100300	106480	I'm leonjzde, basically everywhere, and I do like research, hacking, and building stuff.
107120	112180	Today I'm going to tell you the story about hacking bloatware and a whole bunch of vulnerabilities that I found.
112180	120160	We're going to look at four products, which include ACES Driver Hub, MSI Center, Acer Control Center, and Razer Synapse 4.
120260	127140	All of these ones have been fixed, so if you update to the latest versions of this stuff, you'll be fine.
127460	131780	At the end of all of that, we'll have some sort of conclusion and talk about what all of this means.
132520	134280	I need to perfect some of this talk.
134280	140280	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.
140280	148720	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.
149060	154860	The first product to look at will be this ACES Driver Hub, and the two CVEs that I found in that.
155140	160000	When you look at these processes, one of the really useful tools you can use is called Process Explorer.
160180	166500	And specific to ACES Driver Hub, when you look at what backs that program, there are two processes.
166520	170460	There's ADU.exe and ACES Driver Hub.exe.
170540	176080	And more interestingly, ADU.exe listens on a TCP socket, so things can connect to it.
176240	184260	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.
184640	191460	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.
191500	192740	It's not wrong.
192740	195560	So we needed to do a little bit of work to get that going.
195840	202400	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.
202400	205560	Maybe you want to invert the code flow or do something else with it.
205560	206900	It's fairly simple.
207260	214100	So with the installer, I do exactly that, really with the point being so I can get a successful installation in my Parallels VM.
214540	217980	With that installed, I can finally open Driver Hub in this VM.
217980	219380	And again, the VM is handy.
219380	223480	I can snapshot, roll back, do all the kinds of things without it being a pain.
223740	227380	But when I open it up, again, it tells me this is not an ACES product.
227500	229080	Confault them, they're right.
229520	242080	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.
242320	248360	Because this is Burp, I can very easily change a false to true and suddenly my product is supported in my VM.
248360	250700	I didn't get all the fancy driver updates.
250700	255660	I could install the Armory crate, but it was good enough premise for me to start playing around with this stuff.
256500	257800	I've mentioned this before.
257800	259540	There were two interesting processes.
259540	266660	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.
266960	273280	Opening up ADU.exe and something like Binary Ninja, you'll see a whole bunch of features that this has.
273320	275600	Of course, the web server was of interest of me.
275600	282020	So, when doing some string searches, you can find endpoints that look like HTTP endpoints that you could call.
282200	286860	One of those is this reboot endpoint, which is really patient zero what I was working with.
287080	293180	Following the flow in how is the reboot implemented, you'll end up in a code piece that will look something like this.
293280	298160	Really, the interesting part is the call to exit windows, which will exit windows.
298340	303300	To visualize what we know so far, we can quickly have a look at how this would work.
303300	307520	Imagine a browser where you're browsing to driverhub.acess.com.
307520	319200	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.
319540	326900	I wanted to create a small testing harness for this, so I wrote some PowerShell to sort of replicate this reboot feature.
327180	331920	I make a web request that looks something like this, and the first response I get was an access denied.
331920	337020	Now, one thing that's really interesting when you look at these things, they often emit an insane amount of logs.
337020	342200	Logs are really handy for developers, but they're also handy if you don't really know how the software is structured.
342660	345940	In the case of ACES driverhub, exactly the same thing is true.
346100	351140	There is a log file with a random name that they use, but it's quite useful in telling you what's wrong.
351360	357840	In this case, I can see there seems to be some origin-related error where the origin that I passed along was not allowed.
357840	359180	In fact, I didn't pass one.
359180	365220	So I modify my test harness, add the origin of driverhub.aces.com, and I get a new error.
365440	369700	And everyone knows when you get a new error, that's a sign of progress, which is great.
369960	374480	Looking at the logs, I can now see the origin is allowed, but the body is empty.
374660	379200	So I clearly need to send some content along to actually invoke this reboot.
379520	383260	But keep in mind that driverhub.aces.com lives in a browser.
383340	391580	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.
391780	401020	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.
401360	406080	If I take that knowledge and update my small test harness, it would look something like this.
406080	409660	And I'm finally at a place where I can also reboot my computer.
409740	413360	Totally unnecessary, but this is a good harness for me to play with.
413780	414460	Cool.
414460	417180	With understanding that, let's move on into the first bug.
417180	420320	And it's something that I'm just going to call the string contains bug.
420540	426600	And to understand the string contains bug, we first need to understand how origin header validation is supposed to work.
426760	434720	Imagine for a moment two tabs where one is driverhub.aces.com and the other is driverhub.notaces.com.
434800	439840	Both of these tabs, both of these domains, serve hypothetically exactly the same content.
439840	444120	There's no difference but the domain from which you're using to browse to the content.
444480	456260	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.
456320	460740	This is a way for the web server on the other end to kind of know where this request came from.
460940	464360	And our driverhub implemented this security feature.
464360	467720	When it is not aces.com, the request will fail.
467720	471220	It's where the access denied originally comes from.
471940	481680	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.
481760	486500	And in this scenario here, I think the function I found here was a string contains function.
486520	488440	Question mark was, I think.
488520	492880	But I noticed an invocation that included this .aces.com argument.
493040	502680	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.
502840	505720	To visualize this, it can look something like this.
505740	512340	Imagine you're going to driverhub.aces.com, and it wants to know if this is the aces.com origin where you're at.
512340	520680	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.
521020	532060	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.
532060	536640	Meaning any origin really can be used for you to make a request.
536720	537840	So that's okay.
538280	543700	Take my test harness, and you see that I can do exactly the kind of reboot with the wrong origin.
544280	549140	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.
549400	559420	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.
559640	563560	Now, rebooting is fun, but what's more interesting is gaining RCE.
564200	570300	You might remember from a previous slide that there were a whole bunch of endpoints that we could look at.
570400	575820	There are many, many other ones that are interesting here, but one we'll focus on right now is the update app endpoint.
576180	582380	Just like reboot, we can find the post body that update app wants, and it looks something like this.
582380	590280	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.
590280	592820	Like, if I give it a URL, will it download?
593140	605220	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.
605440	618020	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.
618420	625120	The challenge, though, is when you run it, continue looking at our log files, we get a new error, the universal indicator of progress.
625220	628920	Tells us that this one is not signed, this executable that we've sent.
628920	632340	But the progress here is our content has downloaded.
632680	641800	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.
641800	645400	Does one of the properties contain ACES tech computer ink?
645660	647940	Doesn't really check if the source is valid.
648200	654620	Thankfully, tooling already exists that lets us clone PE signatures from a valid binary to whatever we want.
654740	661140	Critically, the signature won't be valid, but the properties exist, which ACES would then be happy with.
661300	668920	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.
669400	673600	What you're going to see now on the left-hand side is a web browser of your victim.
673600	676700	Somehow, you've coerced someone to browse to your website.
676700	682020	A website that has .aces.com in the URL, a subdomain, whatever you have.
682120	685440	On the right-hand side is just a little bit of showing what's happening.
685440	692100	We'll tell the log files of ADU.exe to see the progress of that process.
692100	696280	So on the right, we start telling the log files.
696280	701680	On the left, I go to my domain, browse to my fancy website, and we pop Calc with one click.
708400	715060	What's really interesting about this setup, though, is none of the components of ACES Driver Hub runs in an elevated context.
715060	717720	They're all normal user processes that run.
717880	726900	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.
727280	740220	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.
740220	745660	So if you're an admin, this code execution actually turns code execution in an elevated context.
746040	752720	Now, Windows has some heuristics to sort of determine, and this is an installer-based thing, should I run elevated or not?
752720	761640	But the way to make this deterministic is to actually attach an XML like this, which has this requested execution level field.
762100	777980	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,
777980	781780	indicating that when you run this, it might run in an elevated context.
782060	792920	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.
794540	802200	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?
802200	807840	You look at the BIOS and there's this line that says you can download and install ACES driver hub automatically.
808060	811520	When I found these vulnerabilities, I disabled that fairly quickly.
811520	816460	But that should give you an idea how some of the software might actually end up on people's computers in the first place.
817080	820840	Okay, so that's ACES driver hub, so let's look at a quick summary.
820840	826460	It could be an alternative way to reboot your friend's computer, or a way to execute arbitrary code.
826580	833600	It can auto-install itself based on this BIOS setting, but really it's the sort of misuse of this strange RPC mechanism.
833600	837400	How you invoke those HTTP requests is not great.
837760	848520	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.
848560	856880	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.
857340	861300	And I think, a little bit to no one's surprise, the disclosure was a little messy.
861300	863060	I'll get back to that a little bit later.
863680	866240	Now back, I'm still on my holiday, I'm a little excited.
866240	868120	I found some really cool vulnerabilities.
868120	870980	I'm going to tell ACES about this, and it's nice.
870980	874080	I've disabled this stuff so that no one else exploits me.
874100	876980	But I did have a moment and wonder, what are other vendors doing?
876980	881040	If this is one not small vendor, what other things can we see?
881660	889980	So I Googled around for products, companies that do similar things, and unfortunately I come across MSICenter next.
890820	902600	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.
902780	908160	It's a little confusing to me because all of the processes that run in the backend already run in an elevated context.
908160	911280	So I'm not sure why my user needs to be admin already.
911660	919160	But, much like ACES driver hub, it also has a component that has a local TCP socket that listens for connections.
919260	922740	The difference though, in this case, is actually elevated as well.
923060	934100	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.
934120	936360	And you would see some output that looks like this.
936360	941440	It's a binary protocol that goes in, but the bits that come out seem to be JSON.
942100	944540	And it's familiar, but not entirely.
944780	951260	The nice thing though, because the MSI center clients is written in .NET, the reversing of this is fairly easy.
951260	956620	There's no obfuscation or anything like that, so it's a little bit like looking at a source code review from that perspective.
957060	960600	Anyways, when you go through this code a little bit, four interesting things come out.
960600	966120	There's a launch server method that does some housekeeping, makes sure the port's available, etc.
966300	974320	Then registers two callbacks, where code runs when a new connection comes in, and code that runs when data is read into that connection.
974560	983820	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.
983820	985460	We'll talk about that in a bit.
986180	994760	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.
994760	1003780	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.
1004060	1016160	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.
1016440	1019580	And that would look something like this for the reboot case.
1019720	1024040	A more complete example, you'll actually see two distinct things here.
1024040	1034520	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.
1034840	1043700	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.
1043980	1048340	So I did exactly that, but when I sent this along, nothing happens.
1048760	1056040	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.
1056120	1062580	The bits afterwards started looking familiar to commands that are implemented in this bloatware, but the first bytes I wasn't too sure of.
1062760	1071420	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.
1071760	1075660	Now this might be a talk , seven ways to reboot your computer, but no.
1076420	1082880	More importantly, we now have the primitive where we can interact with the privilege process from a non-privileged context.
1083160	1089480	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.
1089840	1093740	When MSI Center boots up, it has this idea of a component loader.
1093740	1108440	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.
1109100	1113000	Practically what it means is you end up with this sort of component command map.
1113420	1119060	Every component has a unique ID, and each one of those components implement unique commands.
1119320	1130200	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.
1130660	1144280	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.
1144380	1147560	Really, just hoping that plugin knows what to do with it.
1147980	1152920	Okay, so let's look at the first bug, which is a local privilege escalation in this MSI Center.
1153600	1161580	One of those commands that exist within the MSI Central server component is called command auto-update SDK.
1161900	1163760	And you can see it accepts two arguments.
1163760	1166560	One is a target program, and the other one is an executable program, and it executes the arguments for it.
1166560	1168340	Now, I think you know where this is going.
1169160	1178720	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.
1179120	1193440	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,
1193440	1195880	which is the default, it runs that system.
1196500	1204040	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.
1204160	1209160	I don't have an MSI code signing cert, so naturally I can't pass this check.
1209380	1215660	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.
1215840	1221460	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.
1222020	1226580	Until I realize, hold on, I need to really look at this thing, there is something to look at.
1227320	1235260	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.
1235360	1241740	So if we take prog.exe, the software will copy that to MSI center SDK and the Windows temp directory.
1242060	1252220	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.
1252860	1261360	If the WinVerify trust passes, the schedule task is executed, which is really just saying run that MSI center SDK as system.
1261760	1268020	Because it's fairly quick, eventually the schedule task will run it, which again will be a system.
1268020	1273800	But the challenge here is, the one that got verified and the one that got run isn't bound in any way.
1273860	1277280	Which gives us this opportunity for a race condition that we could exploit.
1277660	1289580	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.
1289720	1297840	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?
1297840	1301100	And if we do it really quickly, there's an opportunity to run the wrong one.
1301580	1305160	So my exploit plan here is to race to execute with two threads.
1305160	1311160	One for this legitimate MSI server thing, did nothing, but it was handy for insert.
1311300	1316260	And the second is then for my payload, which I was using to just add users to the local system.
1316860	1323360	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.
1323780	1328820	So if we take a look at a quick demo of what this privilege escalation might look like, it would be something like this.
1329380	1331860	At the back is MSI center server running.
1332100	1338640	Just to show the context, I start by checking that I don't have an MSI user, and I try and add it.
1338640	1341800	It's really just to indicate that I don't have access to do that right now.
1342340	1348020	I then run my POC, which takes an executable, which is not signed, and adds a user.
1348420	1355540	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.
1363120	1368600	That's a very complicated exploit though, because LPE2 is significantly simpler.
1369480	1381340	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.
1381380	1386540	It matches the function prototype, but none of the security features that existed in this common lib.
1386540	1394500	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.
1394580	1398660	But what is nice about this re-implementation is there's literally zero verification.
1398760	1403120	You pass the target, it schedules the task, and it runs.
1403460	1409060	So my exploit now becomes sort of four lines, I give it the task, and you know, we get local privilege escalation.
1409060	1410260	It's fairly silly.
1411120	1421980	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.
1421980	1431960	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.
1433300	1442220	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.
1442580	1448880	Acer decided to squish two bugs into one CVE, but that's fine, so let's take a closer look at that.
1449320	1462240	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.
1462580	1469180	However, the one of the services, or the privileged services, sorry, one of the services is privileged, which makes it an interesting target.
1469520	1478080	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.
1478320	1490840	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.
1491280	1495500	Because a named pipe exists, that's sort of the mechanism in which these two can connect.
1496040	1502200	Taking a look at the client, one of the functions that you find that's very interesting is called send command by named pipe.
1502200	1506300	It takes the pipe, a seven, a target path, and a hundred and thirty.
1506940	1519800	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.
1519800	1527800	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.
1527940	1529600	The interesting part is coming.
1529820	1540880	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.
1541220	1548040	But the first thing that confused me here though is this service is running in an elevated context and my notepad was not.
1548040	1552220	Like I was only getting low code execution as a low privileged user.
1552260	1554580	And I wasn't too sure what was going on there yet.
1555020	1563620	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.
1563620	1564820	Like you need to go set that.
1564820	1566100	This is not the default.
1566420	1572680	Which means although it's not a low privilege escalation, a local privilege escalation, it's actually remote code execution.
1572680	1575040	So I can run notepad on your friend's computer.
1575500	1578480	So if we take a look at a quick demo, let's see what that looks like.
1578720	1581420	On the left hand side I have an attacker VM .
1581420	1583880	It's not connected to any domain or anything interesting.
1584080	1587560	And on the right hand side there's a user running ACER control center.
1588140	1591600	I have a quick look at what the IP config is between the two.
1592040	1600000	When that is done, I run my POC, which connects to the remote end and asks it to spawn notepad over that named pipe.
1608460	1613980	I like remote code execution, but I don't like not understanding why it wasn't as a system.
1614100	1616320	So I still had some questions remaining.
1616560	1618660	Why is this system thing happening?
1618740	1623120	What is that 113 that I've got that I'm sending along with the argument?
1623300	1627080	And if assuming 7 is a command, what other commands exist?
1627400	1634180	Continuing looking at the server side, elevated binary, eventually you find the other commands that exist there.
1634180	1640220	I had this weird pointer matching thing to invoke them, but regardless they'll look something like this.
1640380	1646680	None of the functions that I could see in the ACER control center client would invoke any of these other functions.
1646680	1657400	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.
1657480	1667480	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.
1667680	1673320	The unfortunate thing sadly comes along, none of those code parts seem to be doing anything interesting.
1673320	1676640	In fact, it was just a bunch of registry read and write, etc.
1676760	1683120	So I revisit that run command function where I have a path and I have this 113 that comes in.
1683380	1690400	I'm a few days into this reversing process and I start realizing the fatigue kicks in, but thankfully I had a closer look.
1690700	1696020	One section of this function has a specific condition for that argument that takes the 113.
1696220	1710180	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.
1710700	1716580	So when this initialized SID function finishes, a token gets built and that gets used to run the target process.
1717420	1722060	What that really means is, when you have 113, it runs as a normal user.
1722060	1726760	When you make it 114, it will run in an elevated context.
1726920	1737540	So change send command by name pipe, making 113, 114 and you now have an elevated command or an LPE on that system.
1737700	1744160	The really neat thing because of the broken name pipe permissions, this will work remotely as well.
1745920	1756080	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.
1756180	1765140	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.
1765220	1767980	So you definitely want to avoid that if you're doing that stuff.
1769120	1775740	Okay, the last target that I want to talk about is Razer Synapse 4, which also has the CVE.
1776240	1780660	When you install Razer Synapse, it's their newer version of their product.
1780660	1784020	3 has been out for a while, but this one is not too old yet.
1784240	1786360	It will look something like this when you're installed.
1786360	1790900	I don't own any Razer products, so the menus and things are empty, but that's fine.
1791440	1802000	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.
1802060	1806660	I don't think it's necessary for that much, but this is not my domain.
1806980	1813120	Regardless, the keen eye here may have already noticed the process that's got the name and what's about to happen.
1813120	1815240	The Razer Elevation Service.
1815280	1819600	It runs a system and this is an interesting target.
1819880	1827220	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.
1827220	1830660	It's written in C++, which makes the reversing a little bit more challenging.
1831020	1833800	And so this target seemed a little hard at first.
1834260	1839120	Attach ProcMon to it and I interact with it using that Electron client.
1839560	1845180	Eventually I could get an interaction with the Razer Elevation Service when I installed another component.
1845180	1847020	This Razer Chroma thing.
1847020	1850420	I don't know what that is, but the installation triggered the code path.
1850980	1856800	And it's at this point I realized I needed to reverse that client to see how exactly this code execution works.
1857140	1861980	Because it's an Electron app, the sources will be bundled in what's called an ASAR archive.
1861980	1871840	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.
1872080	1876280	I like reading source code to find vulnerabilities, so this is incredibly handy.
1876720	1883900	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.
1883900	1889960	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.
1890220	1904520	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.
1904520	1906540	It's a very nice obstruction layer.
1906740	1917420	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.
1917960	1928640	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.
1929120	1934180	But it's really a simple definition of what those function calls would look like in the native world.
1934400	1944480	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.
1944680	1950620	So using this foreign function interface, they're calling a DLL natively as the first translation step.
1950880	1954420	I of course wanted to play with this, so I came up with a small testing plan.
1954760	1962800	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.
1963240	1971400	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.
1971980	1978440	Eventually I end up in a POC, like extremely minified, it's significantly longer, that looks something like this.
1978440	1981900	There's a function called simple launch user app process.
1982120	1984920	It takes a few arguments but the first three are interesting.
1985260	1993440	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.
1993620	2000180	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.
2000500	2007520	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.
2007840	2015080	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.
2015560	2027860	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.
2028040	2037480	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.
2037780	2051560	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.
2051560	2058920	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.
2058980	2066240	Make a copy of simple service DLL, patch out the PE certificate validation and rerun the POC.
2066640	2073620	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.
2074320	2085000	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.
2085120	2094480	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.
2094860	2100680	So if we take a quick look at what the Razor Synapse privilege escalation would look like, it would be something like this.
2101120	2111240	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.
2112020	2120880	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.
2121180	2126400	And if you quickly see, there will be a pop up that shows a new user added to this machine.
2126400	2128940	And we have LPE on our machine.
2134530	2139750	I was building these slides for this talk when I'm talking to a colleague about this bug.
2140350	2142930	And he effectively made my LPE a one liner.
2143410	2148650	The part that I haven't shown you yet is actually the interface of the Razor elevation service is a com object.
2148650	2157330	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.
2157650	2167350	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.
2167510	2176790	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.
2176810	2178670	You can't really see where this is going.
2178990	2186770	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.
2186930	2194270	So you can ignore all this complicated patching and just use this one liner to get LPE and Razor Synapse 4 unpatched.
2195570	2198370	Okay, so let's wrap up quickly.
2199170	2202610	I didn't only have success, there were definitely some failed attempts.
2202610	2210770	I looked at a few targets, which included the HP support exist, Gigabyte control center, which has a very interesting architecture, and Lenovo Vantage.
2210930	2221730	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.
2221730	2224630	A whole bunch of registry things that I didn't know was possible.
2224750	2225930	So have a look at that.
2226490	2237650	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.
2237850	2239750	But like I said, they're all fixed.
2240210	2243190	It leaves me a little bit to talk about the disclosure for a bit.
2243190	2246430	And if you are a vendor, please hear me out.
2246590	2253890	In the case of Acer, I tried to disclose these vulnerabilities, but their disclosure page has a WAF and it's blocking bad payloads.
2253910	2258570	I'm sending them bad payloads, please accept them so that you can have a look at the detail.
2258570	2262090	So it made for a frustrating runaround to get that reported.
2262570	2271190	On a more serious note, there was a research collision here where another researcher, two months after I reported, also reported similar bugs.
2271190	2286030	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,
2286030	2288430	effectively stringing this researcher along.
2288630	2290170	I'm really sorry about that, Mr.
2290170	2298010	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.
2298590	2301870	On the positive side, MSI responded incredibly fast.
2301870	2307830	Like the communication was clear, they were the first ones to fix their bugs, etc., so that's definitely a win.
2308230	2314250	From a razor perspective, though, they used a bug bounty program which effectively fronted the security team.
2314330	2326270	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?
2326490	2331910	It unnecessarily delayed the process, I think, and I think the communication could be a little bit better there.
2332590	2335930	I'm going to leave you with this idea of what I'm going to call the Pwn Triad.
2336070	2350430	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.
2350950	2354110	In fact, this could also just be a recipe for free CVEs.
2354610	2360890	In conclusion, I think products built in 2025 doing silly RPC things like this is really unnecessary.
2361250	2367930	In fact, if you think you need that bloatware thing twice, there's probably better resources to get that.
2368310	2375010	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.
2375670	2379590	For all of these vulnerabilities, there's a bunch of POCs that I put on GitHub.
2379730	2383730	If you want to play with them, I think there's some more attack surface in many of these tools.
2383830	2387070	You can get it in this QR code, which should be public after this talk.
2387710	2392410	That's what I wanted to show you for bloatware hunting, vulnerability hunting.
2392610	2393350	Thank you.
