start	end	text
0	7660	It is my absolute pleasure to introduce these two first time DEF CON speakers, Alejandro and Boya.
8200	15680	The title of their talk is Kill Chain Reloaded, Abusing Legacy Pass for Stealth Persistence.
15680	17620	With that, take it away, guys.
24050	25430	Hello, everyone.
25450	28470	First of all, thank you for inviting us to DEF CON.
28470	30930	It's an honor for us to be here.
30930	34810	Our English is not perfect, but we will try to explain everything as clear as possible.
34890	37750	We ask for your patience and please don't be too hard with us.
39170	41690	This is my colleague, Alejandro Hernando.
41690	45950	We both work in the hacking department at Accenture Spain in red team and research.
46270	49190	We love breaking things and finding more abilities.
49870	54950	Here is your social media just in case you want to contact us or ask anything about this talk.
57110	58430	I am Borja Martinez.
58430	61250	I also work in the hacking department at Accenture Spain.
61250	66090	Sometimes I participate in Capture the Flag competition as a member of the team.
66770	68390	But now we are retired.
68930	74130	Here is my social network for any questions or doubts you may have after the presentation.
76330	77230	Okay.
77810	82530	In this part we will focus on how we do threat hunting to find vulnerable artifacts.
82870	85430	Our methodology to look for these drivers.
85670	88590	Specific software and drivers we use in our research.
89310	94570	Vulnerabilities we found in UFI software to develop advanced boot kits and new persistent techniques.
94610	99470	Finally how we use these vulnerable drivers to get persistent in real red team exercises.
102380	102900	Okay.
102900	107980	Before we go deeper we're going to explain why I think this topic is especially important today.
108340	113900	In recent years we have seen that threats which look almost theoretical are now completely real.
114020	120960	Boot kits like Black Lotus for example have managed to run malware on Windows 11 system with secure boot enabled.
121480	126080	So system with all security enabled can still be fully compromised.
126300	130560	And we are not talking about all APTS from 10 years ago.
130580	134720	That is the reality we find when researching low level security.
136660	140740	One common mistake is to think that if you have secure boot enabled you are protected.
140880	142360	But it isn't that simple.
142360	148100	Secure boot works with a list of trusted binaries and another list called DBX for revoked binaries.
148420	154080	If a vulnerable binary is in the DBX secure boot will allow it anyway even if it's compromised.
154120	156940	Also many vendors don't update that quickly.
157900	163280	There are cases where it takes months to revoke binaries with critical vulnerabilities like Black Lotus.
165720	169200	But not everything is caught by attackers.
169200	171440	Sometimes there are failures from inside.
171460	175380	In July 2024 a crash type update broke computers all over the world.
175560	182460	The faulty agents could abuse this especially in corporate environment as airport, banks, hospital or were affected.
182860	188020	And this was without malware, without exploit, only about binary running a critical part of the system.
188340	193580	We mention this because boot kits won the single level of control but with a malicious and persistent goal.
193800	197620	It's a good example of how one single binary can break everything.
200180	205780	Here is a quick table with some of the most well known boot kits used in real operations.
205840	207440	Many link to APTS.
207720	213200	Most of them load before the operating system so no EDR, antivirus or side channel solution can see them.
213340	216240	They control the system from the moment you turn it on.
218900	219660	Okay.
220060	222760	We have been researching all this for a long time.
222760	229100	We want persistent, we have used vulnerable software, signed files in trusting drivers.
229220	232740	And change everything to execution and total control.
232740	238040	We will show how we did threat hunting for signed artifacts that lets us do this in real scenarios.
241560	248980	You will see how we use virus total, retro hunt and the Microsoft catalog to find components with useful functions.
249360	252540	Physical memory access, can I rewrite and so on.
252680	260700	We will also explain how we exploit these pieces to inject code into UFI, manipulate the whole process and keep persistent without leaving traces.
260820	266000	And the most important thing is how to use all this in real extreme exercises without raising alert.
267060	267920	Okay.
268020	268980	Demo time.
281320	282080	Okay.
282280	286100	Here you can see someone can link to a virus total enterprise account.
286100	288240	In virus total we do two main things.
288360	292200	Search basic things or use the other rules with retro hunt.
292280	297020	For retro hunt as you can see our script uses pin port to select interesting functions.
297040	304160	On the right you see all the drivers we use as a black list to avoid drivers that already work or known to be vulnerable.
304920	309780	We do a quick demo run, as you can see it finds many drivers with those functions very fast.
310460	314700	That's running and before we had already launched two more.
315340	320220	One with 4,000 results and another with 10,000 results.
321480	327360	On the other hand we sometimes search for things like WPBH which Alejandro will explain later.
328500	331860	We attach for example to only see same binaries.
337070	347410	And I will say it's by looking for certificates like Microsoft Windows UFI driver, publisher or Microsoft corporation UFI CR2011.
354740	361180	There are more options but these are a few examples so I don't understand how we search for useful binaries.
364230	369050	The demo is ‑‑ okay.
369890	375330	Here for example you see 64 AFI and it's all the binary sign.
381250	382110	Okay.
382110	386190	Also based on research from GitHub project we made this script.
386350	391190	The script inquires to a Microsoft catalog like we have done before with retro hunt.
391190	393490	Searching for driver with interesting function.
393690	395010	Now we run this script.
395010	398690	It searches all the pages and when it finds a string like go away.
398970	399850	Spoiler.
400070	401990	It downloads all the files.
402790	411190	So this is the first demo showing you how we found some drivers and EFI files which we will later use in our research.
411750	415430	With the next demo you will see more clearly how we use these files.
443600	444560	Okay.
447780	457040	Before going to the technical part I'll give some context about what UFI is, what a loader is and why these are so important for our research.
457200	461860	When we turn on a computer the first thing that runs is not Windows, not ADR, not antivirus.
461860	463080	The firmware runs first.
463080	464040	UFI.
464200	469080	UFI is like a operating system without memory, heap, services and drivers.
469180	475680	It has many phases but the most interesting for us is DXE where EFI modules are loaded.
475760	480880	After initial UFI runs the loader which loads the system kernel.
480920	486140	In Windows it's usually booting GFWUFI or booting GREFI.
486220	489720	In Linux it can be grab, sim or something custom.
489960	491540	And here is the key point.
491540	496820	Everything that's happened before ExitBoot services it's outside the radar of formal security solutions.
496860	505800	If we can put a signed EFI in loading path we can interbind, redirect, persist or exploit the boot before the OS can defend itself.
505860	510980	And now I give the floor to my colleague Alejandro who will explain this part in more detail.
515280	517100	Okay, just a second.
522720	524140	All right.
524220	529080	As we discussed before you can't just run an EFI binary on the system.
529140	536780	We must consider the security mechanisms that Windows implement to block the execution in the preboot environment.
539120	545640	Secureboot aims to block the execution of an authorized code from running in the preboot environment.
545680	550880	It does so by allowing only signed trusted binaries to execute.
551000	554540	However, there are a lot of vulnerable applications in the wild.
554540	557240	For example, Neorizon DataSuite boot loaders.
557240	562220	Neorizon DataSuite boot loaders before June 2022 were assigned.
562220	564680	However, they were also vulnerable.
565000	569560	They allow the loading of arbitrary unsigned EFI binaries.
569760	579540	With arbitrary EFI execution an attacker can bypass platform security, install persistent boot gates, perform preboot attacks and fully control the system.
579540	582640	Including settings and boot flow.
583500	592080	On the other hand, Microsoft mitigates this class of secureboot bypasses like the Neorizon DataSuite boot loaders using the DVX.
592080	602400	DVX is a UFI secureboot revocation list and it contains signatures of known binaries that are no longer trusted.
602400	605620	Even if they were originally signed.
605680	611740	Even though the binary is signed, secureboot refuses to execute if it matches any DVX entry.
611960	615900	Microsoft distributes DVX through Windows updates.
615900	619180	Usually as part of regular security patches.
619180	631740	However, in 2024, Microsoft published the secureboot object repository on github to openly share the contents of the secureboot DVX list and related signature databases.
631740	640940	This repository allows security researchers to inspect which UFI boot loaders and certificates have been revoked by secureboot updates.
642140	655120	So, using this resource, we downloaded a publicly available edition of secureboot restore, we extracted the hashes, and we compared those hashes against the entries in the DVX.
655360	660100	We found that some versions of shield loader are correctly listed in the DVX.
660100	663660	Specifically, those matching the hash line above.
663880	668480	This hash corresponds to the entries of the CVE we talked about before.
668480	673060	However, we also found several other versions of the boot loader.
673060	677000	These have different hashes and were not present in the DVX.
677120	682240	This suggests that additional vulnerable variants of shield loader may exist in the wild.
682240	690760	It has not been added to Microsoft's revocation list and may still be trusted by secureboot on system that rely on DVX protection.
691740	697060	So, let's now take a closer look at how reboot restore actually works.
697060	703980	Reboot restore is a software that restores a computer to a preset state every time it restarts.
703980	707420	Its main EFI binary is shield loader.
707420	713040	Before we get into the loader internals, here's how shield loader gets into the chain.
713260	719080	First, looks for the ESP, the EFI system partition for the boot loader.
719740	725980	Shield loader is renamed or copied over the boot loader.
725980	730900	When the finger invokes boot loader, it actually runs shield loader first.
731080	739720	Shield loader then implements its own logic, the compression, signature checks and so on, before finally loading the real boot manager.
741060	743620	Okay, but what does shield loader do?
743620	748720	We divide the shield loader operation in four phases.
748960	756580	First, shield loader opened the ESP volume, located the file shield manager underscore, notice underscore, this is important.
756900	760660	Allocate the file size and read all bytes into a buffer.
760740	765760	If that works, we end up with the proprietary format binary, NAUI.
766100	771440	In memory, if it fails, the loader falls back to scanning every installed finger volume.
771600	773820	We'll talk about this proprietary format later.
774780	777440	Then, the loader invokes parse heater.
777440	787180	This routine first inspects the 200 byte heater at the start, it reads the ASCII magic and extracts both the compressed and uncompressed file length.
787180	789320	After that, it goes through the chunks.
789320	797900	And for every chunk, it calls decompress on the payload and if it doesn't compress it, it simply main copy the raw data.
798120	801380	And this is how the proprietary format looks like.
801380	803820	This is the EF underscore format.
803820	810040	We have the 200 byte heaters, with magic, compressed and uncompressed file length.
810040	811180	Then the chunks.
811180	813260	Mark as compressed or not.
813260	817560	And finally, the trailer where the signature is located.
819020	825880	After that, the shield loader looks for the signature of the trailer, the last 800 bytes.
826300	830920	So after decompressing and allocating the image, the boot loader goes into phase three.
830920	834540	In this phase, the loader invokes check signature.
834540	840760	Then it jumps to the last 800 bytes of the buffer where it inspects the trailer.
840880	850660	If the magic is wrong, the prediction fails or something doesn't look good, check signature returns false and the loader aborts with EFI security violation.
851820	857500	Finally, in phase four, the loader hands off to the standard EFI boot services.
857720	862140	It calls load image and returns a new EFI handle.
862160	867700	It then invokes a start image, which transfers control into the loaded P.
867700	871300	And this is almost the full chain of shield loader.
871300	875680	But we also found an interesting proprietary format EFI file.
875680	879880	Remember that underscore EFI files like this.
879880	887460	Additionally, in one finger version, we discover a containing name shell dot EF underscore.
887460	894080	This is actually a sign UFI shell binary with only a small subset of command enable.
894080	903120	Although if functionality is limited, we can leverage it later as a convenient trusted entry point into the UFI environment.
904440	907300	Right, but what does shell loader do?
907420	913200	Remember that shield loader loads shield manager.
913200	923340	So after the compression, the EFI in shield manager, the loader skips the custom format and directly load another EFI image.
924060	932080	Any EFI executable placed at shield dot EFI at ESP will be loaded and run without checks.
932080	934080	This means two things.
934080	936680	First, there's no security verification.
936680	940320	Load unsigned EFI never calls check signature.
940320	942400	Also, there is no container parsing.
942600	946240	It expects an extra P image so you can drop any EFI file there.
946240	955400	You can write your own EFI binary and compile it and put it as shield dot EFI into the ESP partition and shield manager will load it for you.
955920	963880	So this is supported so we can abuse this to load our own unsigned EFI binary.
963880	966220	So let's look at this in a demo.
970500	971080	Okay, so this is the demo .
971080	971680	Okay .
973740	975340	Well, let's begin the demo.
975340	978960	First, we verify that secure boot is enabled.
979140	985880	If the publisher command returns true, it means secure boot is active and functioning properly.
985880	988900	In this case, we can see that this is enabled.
989280	992140	Next, we run our EFI install.
992160	997820	This tool replaces the files in the ESP, EFI system partition, with our own.
997820	1001940	So what happens after the system reboots?
1001940	1006500	Remember that we have replaced it, the original boot loader, with our install.
1006500	1010680	At this point, shield loader loads shield manager.
1010680	1017680	Shield manager then loads shield dot EFI, which is our custom unsigned binary.
1017840	1025240	This binary calls and reallocates another image and at this point, this binary displays this custom SDR splash screen.
1025740	1032500	And once the animation completes, we chain load the original boot manager and Windows boot success.
1033160	1034460	Okay.
1042910	1046850	So, but, what about the local protection?
1046850	1056310	When you enable BitLocker on a noise volume, the VNK is sealed in the TPN against the current values of several PCRs.
1056330	1064230	With secure boot enable, usually PCR7 records a hash of every EFI executable that runs from the kernel.
1064230	1068690	Boot manager, VCD, early drivers, and so on.
1068710	1080270	If any one PCR is different, after boot, the comparison, the unseal fails and Windows falls back to BitLocker recovery mode.
1080610	1084150	Okay, so, what does our proof of concept do?
1084150	1088090	First, we suspend BitLocker protection indefinitely.
1088210	1095930	We achieve this by using WMI to run disabled key protectors with disabled count equal to zero.
1095930	1102650	This prevents triggering BitLocker recovery after modifying EFI files in the ESP partition.
1102650	1111550	Then, we mount the EFI system partition, backup original boot loaders, and save boot manager and boot 64 for later restoration.
1111930	1114890	Finally, we apply the modified boot files.
1114890	1131830	To do this, we override the boot loader with shield loader, and we continue by replacing the expected shield manager, the shield manager underscore, remember, with shell dot EF underscore, which is the sign EFI shell with a limited command set enable.
1132030	1142210	We also need to copy a stage zero dot EFI that is a sign tool capable of enrolling unsigned binaries into machine owner key.
1142490	1151030	And last but not least, we copy loader dot EFI that is our final unsigned payload into ESP.
1151530	1153310	Okay, that was a lot of things.
1153310	1155830	Let's see it in action.
1156470	1157550	Okay.
1162670	1163670	Good.
1164130	1169450	In this demo, we start by verifying that BitLocker protection is enabled.
1169530	1176090	Using the manage BD command, we confirm that BitLocker is indeed active.
1176150	1180990	After that, we run our EFI installer and reboot the system.
1182950	1187870	Remember that secure boot is also enabled at this point.
1188850	1199030	As part of the installer process, it replaces the files in the ESP, EFI system partition, and disable BitLocker protection using WMI.
1199370	1210210	After reboot, instead of the usual boot flow, we load shell dot EF underscore, which is the sign proprietary version of the EFI shell we talked about before.
1210210	1213990	The EFI shell with a limited command set enable.
1214550	1218630	From this restricted EFI shell, we download a stage zero.
1218630	1224190	A sign EFI binary designed to enroll any binary into the machine owner key.
1224370	1231890	In this case, we enroll loader dot EFI, which is actually a fully functional version of the EFI shell.
1232250	1238570	Now that we have a fully capable shell, let's attempt to load and sign EFI binary.
1238670	1243090	As expected, this fails because secure boot is still enforced.
1243330	1253170	To bypass this, we can do a lot of things, but we locate the EFI protocol handles associated with the security architecture protocols.
1253530	1260650	Once identified, we patch them with the opcodes XR, RAX, RAX, and then return.
1261190	1274170	In this example, to bypass secure boot protection, we first need to identify the addresses of the security architecture protocols handles, and once located, we modify the corresponding opcodes.
1274530	1285690	For demonstration purposes, we are applying the patch byte-by-byte, rather than using a more automated or optimized method.
1285730	1293450	So we just show up the left, and then return.
1293490	1298350	This should disable the secure boot validation mechanism.
1298470	1305250	So now, we need to try to run our EFI and sign EFI binary again.
1305250	1322510	And it works, because we previously disabled BitLocker using WMI, we are able to chain load the original boot manager, allowing Windows to boot successfully without any BitLocker recovery screen or recovery patch.
1322510	1323570	All right.
1325430	1327110	Thank you.
1328130	1330090	Okay, let's continue.
1333100	1334860	Well, enough of CR.
1334860	1339420	Let's do something more interesting, like achieving persistence.
1339600	1345660	One technique we can try to abuse is WPPT, the Windows Platform Binary Table.
1345760	1354820	WPPT lets the firmware place one native application as C Windows System 32 and execute it in the session manager context.
1355160	1355960	This is important.
1355960	1362320	In other research, this approach appears to work when the binary is signed with an old certificate.
1362600	1368980	However, in our test on Windows 11 2482, this doesn't work if the certificate is revoked.
1369200	1376060	Since many of the leaked co-signing certificates are now revoked, we need to find new ways to achieve our goals.
1376520	1380240	So we can simply drop in a native application and run it.
1380240	1382500	That's a problem, because we need to modify it.
1382500	1388940	But what if instead we find a signed native application that's vulnerable and exploit it to do whatever we want?
1389240	1391540	And that's exactly what we've done.
1393200	1396900	We've found a signed application from Lenovo.
1396900	1408480	This binary was used by Lenovo Service Engine, LSA, to smuggle a big blob of PDF files, registry keys, and config data from firmware into Windows.
1408480	1417320	It uses a proprietary ACP table called LUFT table that isn't part of the ACP specification.
1417320	1420420	Only Lenovo's binary parses it.
1420700	1428200	This lets an attacker to install an arbitrary driver or service completely from ACP.
1428200	1432620	So you are installing after the boot from the pre-boot environment.
1432620	1434360	This will be interesting.
1434720	1440380	So no disk write needed until the session manager does it for you.
1440580	1446340	So we need to construct a new LUFT table, a new Lenovo table.
1446400	1449080	That needs to drop help.sys.
1449080	1454700	Help.sys is a non-signed vulnerable driver we found over there.
1455760	1459500	We use this to construct our LUFT table.
1459700	1466240	Then we also need to fill our table to create a service key under, for example, two server driver.
1466240	1467580	It can be whatever name.
1467980	1472680	We also need to set display name, image path, type, error control values.
1472680	1476640	And after that we reuse slot 6 in the STD.
1476640	1481640	The slot 6 points to the SMT entry of the OEMs.
1481700	1492000	We need that slot points to the start of our buffer that we filled with our LUFT table.
1492000	1495000	After that we also need to fix the checksum.
1496120	1500340	Okay, but what does the Lenovo native application do?
1500500	1512980	Well, it looks for a custom ACP table named LUFT, writes the binary to this calling the function level as say binary to C, Windows system 32, drivers, whatever that is.
1512980	1523020	Then it invokes create registry keys on every subdescriptors which in turn writes or patches the registry so the binary will launch automatically.
1523560	1527360	Right, we also need to construct our WPBT.
1527360	1534880	We need to find a readable random space or we can just allocate it because we have random execution, we have EFI execution.
1534880	1541100	So we can allocate and copy our real payload that is the Lenovo native sign application there.
1541240	1547920	We also need to overwrite the first 16 bytes in the SRAT with this WPBT heater.
1547920	1553220	This silently turns the SRAT into a WPBT and the system observes it.
1553220	1555540	We also need to fix the checksum.
1555540	1558820	So to summarize what we are going to do.
1559040	1566440	Finger first finish post enters accessible services and real time memory still contains our injected blobs.
1566540	1580640	Windows loader, scan the STD, find our Lenovo proprietary table, put the rampage that used to be SRAT but now begins with WPBT, sees a valid length and checksums and asserts it as WPBT.
1580820	1589600	After that the session manager copies the Lenovo sign application from the WPBT to this and executes it as NT process start.
1589900	1602660	Then the Lenovo native sign app started by run service 1, parses the lab, drop help.sys, write the registry values and start the service or schedule it for the next boot depending on the flags.
1602660	1608080	On the next boot, Windows sees a legitimate driver entry under services to service driver.
1608080	1611800	Loads help.sys and the system is compromised.
1611800	1614600	It's better to see it in action.
1623460	1631360	In this demo we once again begin by verifying that secure boot is enabled.
1633620	1638980	We also confirm that the target service that we are using does not exist on the system.
1638980	1642340	We are going to do everything of this from the pre-boot environment.
1642740	1654380	As usual we run our EFI installer and afterwards we validate that neither the help.sys driver nor the Lenovo native application file is present.
1654700	1657580	We then proceed to reboot the machine.
1657820	1666580	Upon reboot we chain load our custom EFI binary which launches an EFI shell for demonstration purposes.
1667080	1669480	Wait a few seconds until the system reboots.
1671300	1672240	Okay.
1672820	1679580	So remember we modified the EFI system partition to replace the boot loader with shield loader then shield manager.
1679580	1687480	Shield manager is loading our custom EFI file and this custom EFI file right now is loading a fully functional EFI shell.
1687480	1698480	From this EFI shell then we need to patch the WPBT, the Windows platform binary table and create our custom LUFT table.
1698480	1702080	The Lenovo custom table.
1702900	1711140	As the system boots, the session manager executes the Lenovo native application before prompting the user to log in.
1711360	1713600	So here it is.
1713600	1723060	Then the application with the LUFT table loads our signed vulnerable driver, help.sys into memory and write this into this.
1723320	1730960	And after that it configures the appropriate registry keys to register the service and ensure it starts automatically.
1731980	1733580	Only two key left.
1733580	1741740	So type and then arrow control values, start values, arrow control and then the system should start.
1744780	1745720	Okay.
1745720	1753560	We need to confirm at first we didn't have a help.sys driver, not the Lenovo native application on the system.
1753560	1764080	We are trying to put those files from the pre-boot environment and we need to check if after boot, if those files exist.
1764080	1776880	So once Windows finishes booting, we need to confirm the presence of the help.sys driver and the WPBT, the renamed Lenovo native application.
1777360	1782620	So first we need to check if our help.sys driver is present on the system.
1782860	1785080	And here it is.
1785420	1791620	And we also need to confirm that the Lenovo native application is over there.
1791620	1792340	And here it is.
1792340	1797160	We also can check its signature to see if it belongs to Lenovo.
1797360	1805020	And finally the most important part is that we need to verify that our new service exists.
1805720	1807160	And here it is.
1807160	1811060	We have two service drivers installed on the system.
1811240	1817080	It's successfully loading a kernel driver and on the next reboot it will be launched automatically.
1817280	1822020	So now we have a vulnerable driver installed from the pre-boot.
1822020	1826080	And now Borja will show you some ways to express this.
1836170	1837130	Okay.
1841960	1842940	Okay.
1842940	1852160	In this last part of our presentation, we'll show you how we completed the full persistent chain from the system boot using legitimate signed but vulnerable drivers.
1852160	1855400	The key thing here, we found these vulnerabilities ourselves.
1855400	1862600	And we are using the method that my colleagues have presented earlier to load this driver right from the system start up.
1865760	1868180	This is essentially a big WOD.
1868180	1871100	Brand young vulnerable driver technique but with full control.
1871100	1875900	We analyze, choose and exploit driver that haven't previously been reported as vulnerable.
1875900	1878480	Just provided direct kernel access.
1878660	1881180	Would that this achieve real persistence?
1881280	1886500	From the moment the system boot until our payload runs without detection by security solutions.
1886500	1887780	The flow like this.
1887780	1893140	At the F8 stage we place a signed AFI file loaded before the operating system starts.
1893180	1897960	From there we automated the loading of one of these vulnerable driver.
1897960	1902560	Once the driver is loaded, we gain kernel full access using primitives.
1902720	1906160	With kernel level access we implant silent and persistent malware.
1906420	1915380	We discover this driver by analyzing numerous artifacts from the Microsoft catalog using retro hand in virus total and exploring other repositories as we've mentioned earlier.
1915380	1921100	Many of these driver came of major vendor yet they have no detection whatsoever.
1921340	1930700	We identify vulnerabilities in our CTL handling allowing user land control memory to invoke sensitive function without validation and even modify critical system structures.
1931040	1936860	With this vulnerability we can bypass driver signal to informant, EDRs and other run time protections.
1936860	1945160	Hook a driver function by modifying the import of the state board from kernel mode and register system call back to hide our activity and evade detection.
1945280	1949520	The critical point, there is nothing malicious from the system's perspective.
1949520	1952920	Everything is signed, legitimate and it's completely vulnerable.
1953060	1956820	This type of persistent is very hard to detect and even harder to remove.
1956820	1963360	It plays in a real environment, it ensures total control after every reboot without touching disk or visible processes.
1964260	1967400	This is a real and interesting case.
1967580	1976420	A send driver from Huawei not originally intended for malicious use but whose features are perfect for persistent and kernel level protection.
1976580	1982780	This driver installed with Huawei AI service just remains active even after you install the software.
1982780	1987120	This persistent behavior is particularly useful for an offensive property.
1987320	1988800	What does this actually do?
1988800	1998000	It registers callbacks for process creation and termination using PSR create process notify routine monitoring specific user defined processes.
1998080	1999740	But this goes further.
1999740	2006620	It also registers process access filtered via OB register callbacks intercepting calls like open process.
2007140	2014980	If it detects a dangerous permission like process terminate, it removes them on the fly protecting the process from being killed or injected.
2015540	2020820	Even if someone manages to terminate the process, the driver automatically restarts it.
2020820	2026040	It achieves this by injecting an EPC to legitimate processes like service X.
2026040	2029700	Quietly executing hidden command to restart the target service.
2033330	2038830	The most serious issue isn't just the driver protect and restart processes from kernel mode.
2038830	2044350	But that all this power is available from user language that require a privileged signature or validation.
2044650	2048610	The driver creates a device object accessible by any process.
2048690	2056390	It's WAI gallery work driver controlling application can send command ignoring right signature authentication needed.
2056470	2061530	Huawei even provide a tool Eagle check X communicating with the driver via OCTL.
2061530	2071450	Internally this command trigger OCTL 0X222004 passing a unicode string with the process path like C Windows system 32 notepad X.
2071450	2074250	It's pointing the driver to protect this process.
2076590	2079930	Here the vulnerability, the driver validating nothing.
2080030	2088270	No check of command sender identity, no validation of the process that works in error signature, no limits on which or how many processes can be protected.
2088550	2097370	This means you can't seal any process including malware, protect your exploitation tools, prevent EDR or forensics tool from killing the processes.
2097990	2108770	Moreover if the process dies the driver automatically restarted effectively becoming a functional rootkit distributing by legitimate vendor control by sending simple string from user LAN.
2113500	2115880	From an offensive viewpoint it's perfect.
2116480	2126300	Kernel level persistence, real time protection, user LAN control, zero validation, authentication, you don't even need to exploit it, the driver isn't inherently vulnerable.
2127760	2135900	Once the driver receives a command from user LAN to protect a process , for example C Windows 32 notepad X, it's internally validation is extremely weak .
2136300	2145720	Instead of checking digital signature, hashing binaries or validation executables, it's simple compare the command line as a plain text.
2146440	2157660	It's called PS get process pip to access the target processes PEB and then uses KE stack attached process to read its command line directly from memory.
2158080	2166320	Then it compares this command line of string with the one received via OCTL using RTL compare unicode string.
2166600	2167980	What's wrong here?
2167980	2179260	Comparison is case sensitive, no path normalization, no handling of symbolic link, space or path variance, only a test comparison, no binary signature hash or meta data verification.
2180260	2185520	To see simplifications, you can easily bypass protection by slightly altering the path or casing.
2185600	2189740	You can protect arbitrary processes even malicious ones fully in EDR.
2190660	2193020	The design is fundamentally broken.
2193020	2197020	A slight difference in case is enough to bypass or abuse the mechanism.
2197200	2199440	For attackers this is an opportunity.
2199480	2208880	Protect malicious payloads as legitimate, evade detection, bypass invalidation, automatically seal anything you run without complex techniques.
2210740	2215520	Okay, this part of the driver is extremely dangerous for persistence.
2215520	2221320	Even if the Huawei software is uninstalled, the driver is still loaded in memory with kernel privileges.
2221320	2224000	Removing it requires manual intervention.
2224000	2227400	Use command like AC stop, AC delete or remove.
2227480	2233180	If someone kills a protected process, the driver automatically restarts it without the user line intervention.
2234640	2247380	It uses APC injection, construct command like AC start my service, find an active thread, it's a trusted process, usually service X, uses key insert QAPC to execute command silently.
2247700	2253180	The processor restarts silently, invisibly and automatically kernel persist without touching the disk.
2254820	2262360	This method evades most CDRs because process creation occurs from kernel space rather than user line bypassing security hooks.
2262360	2268780	For red teams this means stealth persistence, invisible process creation, active defense against terminations.
2270880	2273920	This driver behavior makes it essentially a primitive rocket.
2273920	2279340	It not only protects a process but also completely disables normal OS monitoring and control mechanism.
2279480	2285940	It removes process terminate from kernel mode, blocking user level tools from terminate protected processes.
2286000	2293480	Everything occurs in kernel space and detectable by user line tools like tax manager, EDRs or antivirus solutions.
2293480	2300400	Command and control action inject directly into legitimate process like services X for the high end activity.
2300760	2305680	No signature validation means malicious or custom binaries are protected without detection.
2306500	2315820	Offensive implications, persistent execution, real time evasion of monitoring and hooks, no user line agents needed for protection.
2315820	2316500	Okay.
2316500	2317460	Demo time.
2326980	2327800	Okay.
2327920	2331860	First we develop a proof of concept that deploys a malicious service called hell.
2332120	2340980	When we launch the POC register and start a hell service on the business system, the service directly interacts with the vulnerable driver that we have described earlier.
2341320	2347120	Upon activation, the service establishes a reverser granting us a remote control over the compromising point.
2347120	2352820	As a visual indicator, the service also pwned a prompt window displaying the message, hello DEF CON 33.
2353660	2357360	Confirming successful execution and persistent on the target machine.
2357600	2361720	Next, we attempt to terminate the malicious process using tax manager.
2361720	2369000	However, when we took this process, the system immediately returned an access DNA message.
2370440	2375580	It's a direct result of the kernel protection implemented through the vulnerable driver.
2375620	2379440	The driver steals away the privileges required to terminate the process.
2379520	2385340	Effectively hardening the malicious service against any action from EDR tools or local administrative attempts.
2385940	2389020	The system is protected by an EDR solutions.
2389580	2394660	Fully operational and configuring with all protection at the highest enforcement level phase 3.
2395020	2401980	Remote payload execution at active protection against termination, the EDR doesn't generate any alert or suspicious events.
2402780	2408900	The second part of the demo, we presented a variant leveraging another vulnerable driver to discover our research.
2408960	2411580	In this case, our role is different.
2412000	2422540	To bypass protective process light, PPL, and still see terminated process , protective processes such as antivirus or EDR actions.
2422940	2435340	To achieve this, we exploited the functionality exposed the vulnerable driver, specifically on a CTL interface that allow us to invoke the sub W terminate process function directly from the kernel node.
2435340	2446140	Using this technique, the driver can terminate highly privileged process including antivirus on EDR without restriction and without generating any alert in the console on the EDR event logs.
2446340	2457160	As a proof of concept, we've created an executable that interacts with the health service and also leverages the vulnerable function to kill the antivirus on an EDR process, as can be seen in task manager.
2457580	2468160	As we mentioned before, this is just a POC, but the entire process could be made significantly sturdier and more sophisticated for a real world team operation.
2470580	2471380	Okay.
2481890	2483030	Thank you.
2495270	2498550	To sum up the talk, let's quickly go over the key points.
2498550	2501970	Secure boot improves security, but this has clear limitations.
2502050	2508970	We've found that legitimate signed binaries can still be abused, especially when the DVX revocation list isn't properly updated.
2509650	2513110	UFI remains a critical and often overlooked attack surface.
2513390	2521530	It's allowed code execution very early in the boot process, far before traditional security tools can react providing a perfect window for persistence.
2521890	2527350	The bring your vulnerable driver lets us abuse legitimate driver to gain direct kernel access.
2527810	2533890	We've demonstrated it has poorly implemented your CTL enabled privilege escalation and the ability to disable protections.
2534070	2538170	Every component we use is legitimate, signed and allowed silently.
2538370	2544370	We didn't need any traditional malware just public, just a tool that we've revered most offensively.
2544510	2548890	This clearly shows that the most effective offensive techniques don't rely on obvious malware.
2549130	2555910	With the right vulnerabilities and smart use of legitimate components, it's possible to fully compromise the system silently and persistently.
2556670	2561010	If you are interested in digging deeper, here are the references we use for our research.
2561130	2566230	Don't worry I won't copy them now, the slides will be uploaded after the talk so you can check everything later.
2567810	2570750	Okay, thank you for your time and attention.
2570750	2573150	The GitHub repository is now a bible.
2573530	2577250	We hope you enjoyed the talk and maybe learned something new today.
2577390	2581090	Also thank you to our friends who have supported us during the project.
2581090	2582230	Thank you so much.
