start	end	text
1820	7940	Okay. Hi there. Thanks a lot for sticking up with us. Today I'm going to speak around
7940	14180	about driver jack, which is an unusual technique to load the driver on Windows 11, abusing
14180	23120	NTFS features and CDFS bug, I'd say. So just before starting, a few words about me. I'm
23120	28720	Alessandro Magnozzi. I work for BSI, British Standards Institute. I mainly do research,
28720	37100	but a huge part of my daily business is consulting in adversary simulation, device security and
37100	44400	AppSec. I go on Internet with the name klatsvirus. You can reach me out on GitHub or Twitter.
44700	53540	Feel free to reach out. Now, just before starting, I'm going to just give a bit of information
53540	61520	about this project. This project was started in 2022 with Jonas Lake from Secret Club. We
61520	66700	started working on a POC to abuse ISOs to load malicious drivers on Windows. Then we
66700	71300	completely forgot about that for at least one year because I was working on other stuff.
71300	76460	And then in 2023 I had an engagement that supported the development of this technique
76580	83520	a bit further. Now, the engagement was a bit like it was an OT engagement. It was a
83540	93120	deployment and the main aim of the engagement was to deploy a kernel rootkit on an OT workstation.
93460	99440	Now, regardless of the engagement, the engagement was pretty well and we found ourselves in
99520	107240	a situation where we could tamper ISO files that were distributed to machines via an update
107240	115040	catalog. So this gave us a motivation to read, resume the research that we were doing
115040	120600	in 2022 and we tried to understand if we could develop it further. Now, we didn't know exactly
120600	127240	what to expect from the malware that we were generating. We just know that we wanted something
127240	131960	to backdoor an installer, present on an ISO and then we want to weaponize it in the best
131960	137220	way possible. Of course, ISOs have been weaponized for years right now for their ability
137220	142620	to bypass multi W but this was not really what we wanted to do. We didn't want to just
143180	149860	provide an ISO to our customer. We had in the position of weaponizing an ISO. And then
149860	155180	we just wanted to execute some code and like deploy some vectors around, I don't know if
155180	162500	you, if you are aware, always aware about the, what Stuxnet was doing back in 2011 but
162500	167700	we wanted to achieve something like backdooring DLL on different softwares to intercept
167700	173200	communication, intercept code going and arriving from PLCs and doing stuff like that with
173780	183580	using side loading or DLL proxying on certain specific DLL used by this kind of software. And
183580	187780	the additional thing that we wanted to achieve was deploying a kernel driver on these
187780	195920	boxes. Now the, we started and one example of the ISOs that we end up backdooring was step 7
195920	201160	installation media and the reason for this is that it's naturally deployed by using ISO
201160	209920	files and it's pretty difficult to backdoor because step 7 utilized a bootstrap to launch
209920	215980	the installer meaning that, meaning that it actually performs an integrity check on the
215980	221200	content of the disk before actually launching the installer and it has two layer of checks so
221200	227920	you need to, you need to, if you want to execute malicious code using the installer, you need to
227920	233380	find a way to not tamper with any existing DLL and any existing executable on the disk.
235480	242380	Talking about deploying the Windows root kit, a Windows root kit, usually when you need to
242380	246700	deploy a root kit on Windows, a kernel root kit, a kernel driver on Windows, what you end up
246700	251640	doing is you call create service, you create a service for the service driver and then you start
251640	256700	the service with the driver. Of course one requirement for this is that the driver file that you
256700	264620	are loading needs to be on disk. Now this can be done manually by manually placing a registry
264620	271260	key in the file system and then calling antiload driver to load the driver. This is a bit more
271260	277260	stealth way of loading a driver and it's in the name of this thing is Windows log event
277260	282320	evasion because it doesn't generate the event that is usually created when you create a service and
282320	290260	start the service. But of course there is something else that sticks up. So like there is every time
290260	295860	you load the driver regardless if you are using the start service, the create service or you use
295860	304520	directly the antiload driver function, you generate an event which is the load driver event that
304520	309160	is a sysmon event and event six that provides all the information about the driver you
309160	317240	loaded. So even if it's more stealthy, there is still this that appears as an event on the
317240	323860	Windows log. So we wanted a technique that would help us bypass this event load driver as
323860	332700	well. And so we ended up creating four libraries framework. I mean two of them are the core of
332700	339880	this presentation which is IOCDFS lib and driver jack that will be abused to load a driver on
339880	344480	Windows. The other two are collateral projects. They were not supposed to be part of the
344480	350840	project. They just are RPC exec. I will just talk about it briefly. RPC execs is a less
350840	359540	common way to execute on Windows on local or remote processes without requiring RX memory to
359540	365040	be allocated in target process. And interleaver is a it became a sort of P manipulation
365040	372060	library that we cannot share completely but I will share a simple block which is coupling P. You
372060	377780	can find coupling P which is coupling preserve on my GitHub page. Now coupling P is a
377780	384100	short version of interleaver. It doesn't manipulate completely the P file but it's an
384100	392160	extension to what Nick Lenders implemented back in 2020. I don't remember exactly. So coupling
392160	401880	is a framework that takes target DLL, clone the export at this table and include it in DLL that
401880	409780	you developed. Now this is used usually for DLL side loading using the DLL main function as main
409780	415300	entry point for the DLL. Now the problem is that this process is destructive. So if you have
415300	421360	some exports in your payload DLL, these will be erased. So coupling P just solves the problem
421360	427100	and it just preserves the existing export at this table and just add the forwards afterward.
427100	435620	That's it. Not really a difficult project. RPC proxy invoke instead or RPC exec is a general
435620	444020	library that we implemented to as I said is to execute code on local or remote processes. It's
444480	451180	borrowed by browser exploitation. It abuses the NDR server call to execute arbitrary calls. It
451180	456740	doesn't require RX memory and we also implement it in a way that it doesn't require a valid
456740	464580	RPC binding handle for uh for execution. This is there is a reason for this. We wanted
464580	470600	something that we could use to execute arbitrary calls in any server, even in any service, in
470600	477440	any processes, even if it wasn't actually using RPC and we wanted to avoid maintaining like we
477440	483380	wanted to be able to erase tracks if we wanted and using this technique we can load RPC,
483380	490920	initialize it remotely, execute our stuff and then just get rid of RPCRT4 completely by freeing
490920	498020	the library and no traces will remain in the service. The process. The code is there. There
498020	504580	are also some demos around that you can check. It's just for functionality. The project code
504580	511580	is implemented and it has some not limitation but is implemented nerfed meaning that it's not
511580	518440	using for example code pattern search for uh for locating the required uh the required
518440	525020	entry point in RPCRT4. RPCRT4 changes over time a lot so you need to adjust it to depending
525020	528300	on your version, on your Windows version or you need to implement yourself the code that
528300	534860	actually do the pattern searches. Previous research. So when it comes to the core of the
534860	541120	research or loading a driver on Windows, you have a few ways to load a valid driver on a
541580	546460	Windows to execute unsigned code on Windows. You can either, actually there are four. So the
546460	552060	first one was implemented by Gabriel Landau not long ago uh by exploiting a new vulnerable
552060	556160	class that is false file immutability. I didn't put it in the slides just because it wasn't
556160	560020	available when I started doing this research but go check it out because it's an incredible
560020	566180	research. But the standard way to load unsigned code on Windows are either you, it's not
566180	572300	unsigned. You load signed code. So you have a kernel driver that you want to load. You join
572300	582360	the Microsoft developer program. Microsoft sign your own driver and you're good to go. You
582360	591180	can use a fake signature. So before 2015, Microsoft allowed kernel drivers signed with a
591180	598040	valid code signing certificate and cross signed by an EVCA certificate to load on Windows. So
598040	604780	if you have a certificate that was expired before or issued before 2015 and you have a leaked EVCA
604780	611900	certificate, you can still use, you can still set up your own fake timestamp server and you can
611900	618420	back sign one of these drivers and you can generate a signature that is expired. So signed
618420	626380	certificate but still valid to load on Windows. The third and last technique was using a
626380	633900	vulnerable driver. Now as you can understand, we didn't have any kernel driver on the
633900	639720	developer program. We didn't have any EVCA certificate leaked and unknown that we could use so
639720	645060	we went to the route of using a vulnerable driver to load our unsigned code. Now of course
646360	652740	we then started the research we want for abusable vulnerable drivers and we found four of
652740	657680	them, two of them we just report to the vendors because they were not useful to us. Two of
657680	664140	them we kept them. Now usually when you want to load unsigned code on Windows, you search for
664140	667820	of course there are a lot of vulnerabilities affecting vulnerable drivers. Buffer overflow, user
667820	673840	after free, there are a lot. Not just this that I included here. But usually what you want is
673840	679620	to have a stable physical memory read write, virtual memory read write or for example
680380	686540	unprotected MSR access. MSR stands for model specific register. Now the first, this was abused
686720	694980	a lot in 2018, 2020. So when you have and it appears when you have an unrestricted code called
694980	702460	to WRMSR. So there is a specific model specific register on Windows which is the well actually
702460	708340	another Windows. It's not specific to Windows. But it's the IA32L star that contains on
708340	717100	Windows the pointer to the system call dispatch function. So on before KPTI was introduced
717100	724560	this points to KI system call 64. After KPTI mitigation, this points to KI system call 64
724560	730480	shadow. But regardless, this points to a dispatch function that is responsible to switch to
734560	741160	from user mode to kernel mode and execute and dispatch to the relevant system call handler on
741160	747120	kernel side. Now if you have unrestricted call to and you can override this register, what you
747120	754720	can do is you can weaponize it to point to your user defined handler. And this is abused in MSR
754720	763540	by Xerox from back engineering. Magnificent tool. I have to be honest. And this literally
763540	771940	implements its own dispatch function that swap to kernel mode using the swap JS instruction.
772180	781000	Disables maps map and executes arbitrary code stored in a user mode buffer. Afterward it uses
781000	793940	ROP to, sorry, it uses ROP to restore maps map and restore the IA L32 L star. Now this, the
793940	797820	other, the other vulnerable pattern that we have is arbitrary physical memory access. Now
798680	804660	usually when this, this presents itself in two forms, either a call, a restricted call to
804660	812460	ZW map your section or that can map whatever physical address in a linear address or by using
812460	818100	MMAP IO space. Now the vulnerable pattern that we found the most was this. It's abusable,
818100	824320	it's less abusable than ZW map your section because these actually provide access that you
824320	829800	can't specify the access right. So you can't specify read right instead of read. And this
829800	834600	usually is used for privilege escalation. So if you have a pattern that like this, so you have
834680	840880	a call to MMAP IO space, IO allocate MDL and then MM build MDL for non-page pool and then
840880	846480	MMAP lock page specific, specify cache. You have a pattern where you can actually uh,
846480	853500	allocate page memory, page pool memory, sorry, non-page pool memory in a user mode buffer and
853500	858740	using a technique known as proc scanning, you can identify e-process structure in the non-page
858740	865920	pool and swap tokens around to achieve uh, privilege escalation. And then there is the
865920	871900	prints of all other vulnerabilities uh, arbitrary virtual read, arbitrary kernel virtual memory
871900	876680	read write. This presents itself in a lot of different ways. It can be a mem move, a mem copy,
876700	883600	a ZW write virtual memory. It can be a direct pointer assignment. Uh, it can be whatever. Now
883600	890260	this is used for a lot of different stuff uh, let alone bypass DSC for example or just mapping
890260	895580	arbitrary stuff in memory, in kernel memory and this is heavily abused by tools like KDMapper
895580	903120	or KDU to load your driver in memory. Now of course Windows doesn't like this uh, so they
903120	908600	started introducing a lot of different mitigations. Since 2018 there was the introduction
908600	916060	of uh, KBDI after the Spectre meltdown uh, attack. Uh, then they started introducing VBS,
916060	921860	virtualization based security and started enforcing HVCI. After the HVCI they introduced KDP
921860	928400	which we will see. And then they implemented the Microsoft uh, driver block list and
928400	934920	afterward they started introducing support first for kernel chat control enforcement technology
934920	943400	that uh, neutralizes ROP based attack. And then in like weeks ago uh, they announced that
943400	949780	Windows 11 24H2 will support uh, Intel DTRP, redirection protection that kills another
949780	959540	back class that we will gonna see like now. So VBS is uh, is really tough for uh, for
959540	964860	exploiting vulnerable drivers because HVCI want to prevent you from abusing a vulnerable
964860	973420	driver to load your VTL zero rootkit in memory. Now, how it works? Well, you have now the
973420	982540	Windows low is, is, is runs on top of the hypervisor and uh, it divides the trust level in
982540	989840	two trust level, the VTL one and VTL zero. Now your own kernel runs in VTL zero. Now this is
989840	995080	the guest uh, operating system, the guest OS and what it, what it, what it, what it does is
995080	1001980	that this uses a normal uh, page structured approach to, for address resolution to map a
1001980	1008740	physical address into a linear address. So you have your CR3, you have your um, you have your
1008740	1015220	uh, PML4 entry, then you have your uh, page directory pointer entry, then you have your page
1015220	1019100	directory entry, the page table entry and then finally you have your physical address. This
1019100	1024040	physical address though is a guest physical address. Meaning that there is another layer,
1024040	1031280	second layer access resolution that is, translates a guest physical address into a real
1031280	1039800	physical address that is managed entirely by, by the hypervisor. Uh, using extended page
1039800	1046320	tables. Now what is the problem for us? Is that before this was introduced, page protection
1046320	1052980	was kernel based. So when you had control of kernel, you could do literally anything. So if
1052980	1057000	you had a virtual, if you had a virtual read write, you could literally locate the digi
1057000	1062380	options for example, that is the global variable and like managing the driver signal
1062380	1067200	reinforcement and you could just override it. You could nullify it, load your unsigned code
1067200	1073320	and then restore it of course because even though it was possible to modify it, it was still
1073320	1082020	protected by kernel patch guard. Um, KPP, kernel page, yeah, patch guard. Um, but now, now
1082020	1089820	it's different because now the enforcement is done in a hypervisor level. Now HVCI does two
1089820	1096660	things and in together with KDP, that's a lot of problems. Like HVCI enforces that any page
1096660	1104740	is either writable or executable. Can be both. So this is designed to um, to avoid you from
1104740	1110820	writing your own code in kernel memory and then execute it. So and now this protection is
1110820	1115580	enforced on hypervisor level. Meaning that you, even if you have your fantastic read write
1115580	1120700	primitive, uh, you can't change the protection of a page because even though you are
1120700	1125900	changing the protection of the page on the first level address translation, this memory
1125900	1131740	protection does not propagate to the second level address translation and it's there that the
1131740	1135680	protection is enforced. So if you have read write, it's going to be read write even if you
1135680	1140860	change the protection on VTL zero. And if it's read execute, it's going to be read execute
1140860	1146500	even if you try to change the protection on VTL zero. And with KDP, you have another
1146500	1153340	problem because certain area of memory, data section of memory are protected by this KDP
1153340	1159480	that enforces that the page is read only. So for example, G option is protected that way. So
1159480	1163880	now even if you have an arbitrary read write and the page should be read write, it's actually
1163880	1169960	read only so even if you have it, you can't change G options to zero anymore. So what is the
1169960	1175820	strategy around this? Well, luckily someone very smart, smarter than me of course,
1175820	1180440	developed a technique which is called page remapping. And page remapping attack
1180440	1187700	exploited, it's not a bug, it's like a limitation of KDP. KDP doesn't enforce how pages on the
1187700	1195560	guest are translated to pages on the host system. Meaning that not enforcing that, what I can
1195560	1202320	do, one possible thing I can do is I can copy over my, the content I want to modify to
1202320	1211740	another page, I can modify the page structures on VTL zero to make it point to a read write page
1211740	1218900	on the hypervisor level. And this will effectively make my page read write. And I can modify
1218900	1227180	then the content. So Satoshi Sanda developed a proof of concept and used a null byte page to
1227700	1237420	nullify DSC in exact this way. Now this is also usable for executing arbitrary code. And we
1237420	1243960	have two main strategies for executing arbitrary code. Even if HBCI is enabled. So this
1243960	1255100	depends a lot on the Intel CPU level. So if you have any CPU that is before Tiger Lake, before
1255100	1261400	11th generation, you can still use ROP because this kind of CPU does not support chat. So you
1261400	1265880	can use kernel forge. Kernel forge is a technique implemented firstly by Crash and also
1265880	1276020	discussed by Conor McGar in a blog post. And it uses a thread and a dummy event to modify the
1276020	1284420	thread kernel stack at run time. Meaning that it will replace frame on kernel side of a
1284420	1290960	thread to make it execute a ROP chain on return. Executing arbitrary code. And on, if you
1290960	1297620	instead you have a CPU that is before 12th generation, you can use the page remapping attack
1297620	1304700	as I said, uh, that abuses MULK. Now why before 12th generation? I can say, actually I
1304700	1310060	should say a CPU before 12th generation and before Windows, and a version of Windows before
1310060	1320260	24H2. Because as I said, Windows 11 24H2 and supports Intel VTRP that is a killer exactly for
1320260	1325700	this kind of attack, for page remapping attack. So it avoids any user from being able to
1325700	1334980	redirect a page from VTL zero to remap to another page in the OS system. Now, and what about
1334980	1341500	if we have something, what about if we have something, uh, more? Um, I actually, I'm
1341500	1346480	actually exploring some other technique for trying to bypass HVCI but currently these are the
1346480	1352440	only way. I thought that large pages could also be used for this kind of thing but apparently
1352440	1360960	it's not going to, it's not really working. So, but we still, even if we can do stuff, we still
1360960	1368940	need to load a vulnerable driver to execute any of these strategies. So if we want to load a
1368940	1372860	vulnerable driver we need to be aware that there is something called driver block list that
1372860	1377960	will probably prevent us from loading a known vulnerable driver on Windows. Now the
1377960	1383220	driver block list is a black list and of course it has some problems that were identified by
1383220	1389020	Will Dorman and Yarden Shafir, another researcher. The block list by itself is just a
1389020	1394520	collection of hashes and file names and file version that are supposed to be not loaded on
1394520	1400580	Windows and if the driver block is enabled it will prevent normal, uh, normal vulnerable
1400580	1409000	drivers to be loaded but it has a measure flow. The coverage is ridiculous. So I, I made a
1409000	1414040	bit of, a little script to check how many, uh, how many drivers were blocked from the load
1414040	1421620	driver projects. Uh, this just check the, um, the ashes but it's, it's, it's really, it's
1421620	1426580	really ridiculous. The coverage is really ridiculous. And also it can be disabled by admin.
1427460	1431320	Uh, of course when we bypass the block list we need to be aware that there is also the
1431320	1435980	serial, the serial. So even if a driver is not in the block list it doesn't mean that the
1435980	1440800	certificate is still valid. So there are other, there are other, there are, there are other
1440800	1448180	things that may prevent us from loading a, a vulnerable driver on Windows. And now to the
1448180	1452620	meat of this presentation, what can we do to load a malicious, a vulnerable driver on
1452620	1457860	Windows using this like unusual technique. So let's talk about, a bit about the anti-object
1457860	1463640	manager. So the anti-object manager is a subsystem on Windows that provide access to
1463640	1470620	resources, uh, using a name value approach. It's not entirely correct but it's the most,
1470620	1476960	it's the most accurate, the simplification. Uh, it provides access to these objects using a
1476960	1485280	unified API. And uh, it like every object is, is, is uh, it can be indexed by using a name.
1485280	1492240	Can be recovered using a name. And these names are uh, categorized in uh, in categories
1492240	1498500	that we call namespaces. Now, uh, you probably already seen the uh, object manager in
1498500	1503680	WinObject, sees internals. And you can see a graphical representation of the object
1503680	1510360	manager. So you have all these objects with the type associated. And uh, you have the name
1510360	1517260	categorized in namespaces. Now usually uh, when you, this is actually used um, this
1517260	1521900	categorization is used because any namespace has a certain accessibility. So if I want for
1521900	1529640	example to make uh, an object available in, to the Win32 layer, I usually use a sim link that
1529640	1536500	connect the global, which is the global um, namespace to the specific object I want to, I
1536500	1543040	want to connect it with. And this is what you usually do even with drivers uh, for example.
1544520	1552420	Now, the empty object manager uh, is in uh, of course uh, provides access to object to other
1552420	1558240	subsystem like the IOManager, the process manager, the memory manager, et cetera. And
1558240	1566300	whenever, whenever an object of type file is uh, is accessed by the IOManager, the IOManager
1566300	1572540	will immediately check the file object and will dispatch it to the relevant driver that is
1572540	1580540	meant to handle that specific file object. Now, the NTFS driver manage the NTFS file system.
1581060	1587060	What kind of file system is the NTFS file system? So the NTFS uh, NTFS is a complex file
1587060	1592300	system. Uh, it was always designed by Microsoft for extensibility and to support different
1592300	1598220	kind of other file systems like FAT32 et cetera. And the main thing that I want you to
1598220	1603640	memorize for now is that every file on Windows is a set of attributes of course and every file
1603640	1608220	has at least one stream associated. So every file on Windows is actually, can actually be
1608220	1617080	referred to as a triple. It's a triple, triple, triple. So um, so and um, and usually you
1617080	1622100	have, oh, I don't know what I'm seeing. So usually you have the file name, the stream type uh,
1622100	1625740	the stream name and the stream type. Every file has at least one stream. So if you
1625740	1630920	create a file with just the file name, you are immediately, it means that the other, the
1630920	1636040	stream name and the stream type are defaulting back to something. For files is the data
1636040	1641860	stream and for directories you have the index allocation stream. But they are usually
1641860	1648040	always a triple. Uh, now another thing I want you to memorize is the concept of reparse
1648040	1653880	points. Because this was meant for extensibility, uh, NTFS supports a lot of type of reparse
1653880	1659380	point. The main and common, the most common reparse points that you will see in NTFS are
1659380	1666740	three. Although there are like 20 or 30 different reparse tags. So reparse types. So
1666740	1671160	reparse point types. So the main, the most common are junction points that points
1671160	1676220	directory, that links directory to directories. Uh, mount points that links directories to
1676220	1682340	drives to, to mounted drives and symbolic links that link files to other files. So this is
1682340	1687940	not to be confused with link file. Link file are regular files. They have a data stream and
1687940	1693360	they are just regular files. They need to be parsed to access to another location on the
1693360	1701160	file system. Uh, indeed symbolic links are an NTFS features. Meaning that they are just,
1701160	1707400	they are just literally link on NTFS. They link directly on NTFS uh, to another file. And
1707400	1712860	usually a reparse point is always a reparse tag which in this case is symbolic link and
1712860	1723100	reparse data that will actually point to the real file that it's pointed to. Now about CDFS. CDFS
1723100	1730120	is a way more um, is a way simpler file system. It's, it just, it just comprises uh, root
1730120	1735480	directory and then it has directory and then it has directory entries and file entries that
1735480	1742280	are associated and are always parsed from the root directory. Is um, is an implementation of
1742280	1754620	the ISO 9667s and 960 and um, the important thing is that the CDFS file system, the CDFS file
1754620	1761720	system uh, is also, also apply, applies to optical disk as much as applies to ISO files. So ISO
1761720	1767500	files are a virtual implementation of the CDFS file system. Now just to give a bit of
1767500	1772920	difference to the NTFS, of course CDFS does not support a reparse point, does not support a lot
1772920	1777280	of things that are supported by NTFS but also it has a completely different threat model. So
1777280	1784960	NTFS supports rich permissions. So it has an ACL and the ACL is associated with different ACL
1784960	1790560	entries, access control entries which define what, what can be done on each file by each user
1790560	1797360	in the system. For CD file system, this is not a problem because the content on a CD is supposed
1797360	1802960	to be, is supposed to be immutable. So everyone has access to a file system. If you mount a
1802960	1809800	drive, anyone, an admin, a regular user, anyone has access to the mounted files. To the files on
1809800	1818560	the mounted drive. And yeah, as I said before, the CDFS driver as much as NTFS driver
1818560	1825840	communicates with the IOM manager, the IOM manager has a request to access a file and after
1825840	1832820	passing through the filter manager, it provides access to the required NTFS or CDFS driver
1834020	1840260	accordingly to what is the device driver associated with the file object. Now when you load
1840260	1847080	an ISO on Windows, what it, what it, the CDFS driver will automatically load the content of this
1847080	1854480	ISO file using the CD common read. Now one thing that I want to stress out here is that an ISO
1854480	1862180	file in comparison with a CD, with an optical CD, an ISO file is mapped in physical memory
1862180	1869800	somewhere. So somewhere this ISO file is mapped in memory. So this creates some problems and we'll
1869800	1875860	see what exactly. So when you try to access a file, what you end up doing is you end up
1875860	1884740	calling the NTCC copy read. Now this points to a file object. We will describe the file object
1885320	1892420	and just exploring a bit with where this file object were located, we started noticing that the
1892420	1899260	physical address associated with this file object were always the same. So if you remap one of
1899260	1905700	this file object in a read write page and you override the content of this file object, the file
1905700	1913660	object will be, will flush the content of the modified file back to the physical memory where the
1913660	1922120	ISO was loaded. This means that it's not read only at all. And so we developed this IOCDFS lib
1922120	1930980	that you can use to just modify any content on any ISO file that was mounted in the system. I
1931400	1938340	want to, I want to specify this doesn't work for CD, real CD drive. It just works for ISO files
1938340	1945660	and the reason is potentially that it's because they are mapped on physical memory when they are
1945660	1953400	loaded the first time. Of course for caching. Indeed they are more, it's easier to get a file on
1953740	1961200	an ISO in comparison with a CD. Now I'm not going to go through this, but there are some
1961200	1968380	limitation on what you can change on the file. So if you overwrite over the file sides, the
1968380	1974140	real file sides, not the file sides on disk, but the virtual sides, it's the change is not
1974140	1979580	going to, it's not going to appear. So you can, you can, you can change less, but you can
1979580	1986180	change more. And if you write, you try to write over the file on, over the file sides on disk,
1986180	1992940	you end up actually breaking some stuff. So your program will crash probably. And you're
1992940	1996780	going to have problems. So these are the margin tolerance where, where you can actually
1996780	2004420	replace the file. Now, but this is cool, but it's abusable. Now yeah, it's abusable. There are
2004420	2009840	some use case scenario where we can actually abuse it uh, for a lot of different means. But
2009840	2015420	one of the means is hide the fact that we have a driver on an ISO. For example, we can load
2015420	2024680	an encrypted blob on an ISO and then we can just modify it after the ISO was emulated. So we
2024680	2030100	found another thing that we could abuse and this is um, I don't know how much it's, this is
2030100	2038420	known, but like if we had a file on disk and we try to link, we try to use the same name to, to
2038420	2043960	create a link, of course the file is going to say, no, I'm not going to use this name because
2043960	2051720	it's already here. But for some reason, if we specify the link name with a stream name
2051720	2057120	associated to it, it will create a reparse point for the file. So this will create a reparse
2057120	2063380	point for the file that will overshadow the data stream that is present on the file on disk. Now
2063380	2069180	this means that at this, at this time, after I created the reparse point, the file, the original
2069180	2075620	file, the original ATXT is still there, but it's not going to be, no one is going to be able to
2075620	2082400	find it unless I delete the reparse point. And this is abusable. Why? Because well, I can
2082400	2089480	create an ISO and I can use this as trusted installer, I need to elevate my privilege to
2089480	2096440	trusted installer, and I can use this to redirect the, a file, a driver file on C, Windows
2096440	2105740	system 32 to something that is on the ISO, for example. But this has a problem, the driver, of
2105740	2110060	course the driver file, the driver location, the image loaded is going to be, is going to show
2110060	2118040	that I'm loading something bad. So I be a bit more smart, a bit smarter, I create another ISO and
2118040	2127700	this point I will use a current directory structure. So now I, and I, I place W, of course I
2127700	2134880	can place whatever driver I want here, here for example there is WinIO. And I do the same
2134880	2141840	thing, but still, I have a problem, because when I load the driver, it still say, okay, this
2141840	2147240	sounds correct, but there is still, I mean, it's still saying, listen, you are loading from an
2147240	2152560	ISO file. You're not loading from the system blue directory, you're loading from just an
2152560	2160680	external drive. You're trying to fool me, you didn't manage to though. Then, this is just to
2160680	2166020	show that the file is still there. So if I, if you delete the reparse point, the original file is
2166020	2173340	still there. Okay, just to, just to prove the point. But then we notice another thing. So a
2173340	2178860	direct NTFS link is not enough to bypass, to fool the, the load driver event. But then we
2178860	2184300	notice another thing. If we go to the empty object manager, we notice that every driver is
2184300	2191220	actually loaded, not using C Windows system 32, but is loaded using system root. System 32
2191220	2199600	driver and the name of the driver. What is this system 32? The system 32 is a symbolic link, and
2199600	2205660	not an, not an NTFS symbolic link, it's an NT symbolic link, uh, that is pointing to the device
2205660	2212720	that I use for booting. In my case, it's device RDS volume 3. But it's pointed to by the boot
2212720	2219300	device, right? But this means, and if I inspect the boot device, I notice that I can actually
2219300	2226360	delete this symlink. So this is actually a permanent symlink, meaning that it's been
2226360	2232400	artificially created to have a ref count of one, but I can make it, I can, as system, I can make
2232400	2238400	it temporary, load, like artificially lowering the ref count to zero again, and then I can
2238400	2243880	delete it. So what can I, what can I do with this? I, I can obtain system privileges, I can
2243880	2250200	back up the original boot device, I can replace the boot device symlink with the ISO, and
2250200	2256220	then I can restart the service and see what happens. And what happens is that it works. But
2256220	2263520	the driver load event still shows that I'm loading from an ISO. So still I wasn't able to
2263520	2273870	fool it. And another problem is that if I inspect the driver in system informer or a
2273870	2279230	similar tool, I've noticed that the driver is showing, for example, a missing description.
2279230	2287330	It's showing stuff that indicates that I loaded another driver. What if we swap the drive
2287870	2292850	letters? What if I do a drive swap for, this is something that nobody will ever think of
2292850	2298330	doing, and there is a reason for that. Because if you try to swap the drive letters, your
2298330	2303430	program, your, your system will probably crash at a certain point. There is nothing, but if
2303430	2310450	you do it for just a second and you keep everything consistent so you don't just remove
2310450	2316750	the letters, but you swap into other letters, it actually might work. So the, I'm not
2316750	2321610	showing the screen shot because I'm showing you a video afterward, but the, the technique
2321610	2328530	is this. We mount an ISO with an encrypted blob, we just respect the directory structure, we
2328530	2332970	change the boot device to CD-ROM, we swap drive letters, we load the driver, we restore
2332970	2337990	immediately the drive letters, we restore the boot device, and then we can at that point, we
2337990	2343770	can use, we can abuse the driver that has loaded in memory even if we unmount the ISO file.
2346570	2352650	Now what about using other techniques? Well, I, I can use other techniques uh to, to load
2352650	2358690	the malicious driver uh but in this case, for example, I can use uh all the partition that
2358690	2365410	is assigned to the transactional file system. It's not supposed to be accessible by any
2365410	2372290	user. It's not supposed to be writable, but we discovered that if you access this kind of
2372290	2377590	location with the additional, with, with the, with uh, with the required permissions, in
2377590	2383090	this case, backup intent, say restore, say backup privilege, a maximum file, maximum
2383090	2389630	allowed as uh, as uh, as access right, you can actually override this. You can actually
2389630	2394970	access these locations and you can actually write files on them. So, and this is a proof, of
2394970	2400670	course, where I actually am writing, I'm writing on uh the transactional file system uh
2400670	2407210	locations. Is there any benefit? I don't see any benefit in doing it. Uh, it can just give
2407210	2412750	you an additional way of exploiting the same vulnerability in, in other ways, not using an
2412750	2420210	ISO. So, let's demo it. So, Windows 11, HVCI is enabled. Uh, I have a simple load of a
2420210	2435280	driver and I hope, uh, I hope it actually, because this doesn't actually, oops, oops, I did
2435360	2445280	a mistake. Okay. So, it doesn't show, I don't know how to make play. Uh, it doesn't show the
2445280	2457420	right, uh huh. Okay. That seems it works. Yeah. So, okay, here we are seeing that we are
2457420	2465860	targeting the AALP SSI GPO is uh an Intel driver. And we are loading our driver. We are
2465860	2470740	switching everything and we're loading the driver. Now, the driver has been loaded. The name is
2470740	2475920	that and if you can see, honestly, I would, I would challenge to spot the difference. The
2475920	2481860	description is the right one. But, and if you try to point to the what, what file was loaded, it
2481860	2489220	will actually open the right directory. But indeed, we loaded another. You can, you can
2489220	2499400	actually spot it from the sides. From the sides. It's 28 kilobyte which is the size of WinIO. And
2499400	2504180	you can see also from the hash, that is the same hash of WinIO, which is a vulnerable driver
2504180	2509680	that is not currently blocked by Microsoft block list. We can do another attempt, this time on
2509680	2517440	Windows. I don't know if there is anything I'm showing. Yeah. I'm, I'm proving that it's WinIO
2517440	2527320	here. So you will see that there is the WinIO handle uh showing up in devices and when I, we
2527320	2538240	get there, bit of faith. So we have WinIO loaded. Now, when I unload the driver, that is not
2538240	2549820	unloadable usually, WinIO disappears. So it was WinIO all along. But it doesn't show up
2549820	2555840	anywhere practically. And we fooled the driver loader into thinking that we actually loaded a
2555840	2566440	driver on C Windows system 32 as, as, as it was normal. Now, on Windows 10 or when HDCI is not
2566440	2574280	enabled, we can just strictly integrate it with KDU for example. Same technique, same driver as base
2574280	2592100	for exploitation. I still need to, no. Come on. Yes. So still driver jack is executing, arrives. It
2592100	2598800	overwrites the content in memory because the driver is encrypted as I said on the ISO. And then
2598800	2604320	it just loads the drive and straight executes KDU. The vulnerable driver was already loaded
2604320	2609620	because we loaded to the driver, with the driver jack technique. The name is WinIO and we can
2609620	2618840	execute our unsigned code on Windows. Now, of course, if you want to execute with HDCI enabled,
2618840	2624700	you need to use one of the other thing that I showed before. CandleForge, uh, Malk, or
2624700	2633440	unless, if, if, or, or you can use, or you can just disable HDCI altogether. So, the full chain
2633440	2641680	that we used was, we weaponized the step 7 installation media. Um, in, in this way initially, we
2641680	2648220	used the trial process immediately because as I said, uh, the set up of the step 7
2648220	2654800	installation media uses multiple process to install. So we could blend in with an additional
2654800	2661200	process. We rewrite and execute an additional file so we, there was no malware on the ISO except
2661200	2667260	of a minimal DLL used for site loading. And then what we do is we use driver jack, we, we
2667260	2673760	execute, uh, we install the full candle rootkit. Uh, we were targeting Windows 10. HVCI was not
2673860	2678700	a problem in this case. And, and then we just keep going with additional, with additional
2678700	2688760	compromise step. So, portability, we have integration with KDU, uh, if HVCI is disabled. If it's
2688760	2693940	enabled and you have, uh, inter-K chat not supported, you can use CandleForge as I said. If
2693940	2702980	it's, um, if HVCI is, HVCI is, HVCI is, oh my gosh, is, is hypervisor protected coding,
2702980	2708360	enforce code, code integrity is enabled and you don't have Intel DT but you have inter-K chat
2708360	2717180	can use mark. Otherwise, well, the, the best chance so far, uh, is to just, uh, disable code
2717180	2724380	integrity and ask for a reboot. Um, because there is no currently, there is not currently a
2724380	2729580	technique. As I said, I, I mistakenly believe that you could actually abuse large pages for
2729580	2735380	it. I'm still trying to check it if, if it's possible, but it doesn't look like it's working
2735380	2743440	fine. And as key takeaways, I mean, you can download the box, uh, the, the, for driver jack
2743440	2750200	is, is already, is already public. You can, you can go and take a look. Um, for like
2750200	2756820	detection, as detection advice, I would always try to detect if, uh, someone is escalating
2756820	2762200	privileges to system or trusted installer using no means. Uh, monitor for drive letter change
2762200	2769820	to just prevent this trick from, uh, bypassing detection. Uh, of course, monitor for changes
2769820	2775600	in the anti-object manager, especially for global links. Uh, keep your hardware up to date is
2775600	2781700	very important because as we've seen, the more we go to modern CPUs, et cetera, the, the
2781700	2787860	more difficulties to exploit this kind of bugs. And then, and then there is the, one of the
2787860	2792440	detection opportunity, which is the probably best, is when there is a drove, a driver load
2792440	2798740	event, implement an hash cross check. So there is an hash present on the driver load event.
2798780	2803260	The only thing you need to do is going on the file list, on the file path that is, was, that
2803260	2809540	was loaded, perform, like calculate the check at run time and then compare the, the hashes.
2809540	2814740	The hashes is, are not possible to fool. So, uh, if the hashes are not matching, it means
2814740	2820520	that something happened that was bad. So another driver was loaded in place of the original
2820520	2826140	one. And that's it. Thanks a lot for, for attending.
