[00:01.220 --> 00:08.560] Good? Alright. Hello everyone and welcome to my talk. Today I'm going to share with you my [00:08.560 --> 00:12.800] journey of researching downgrade attacks on Windows and their severe implications on [00:12.800 --> 00:19.240] Windows' platform security. My name is Alon and I'm a security researcher at SafeBridge. I'm [00:19.240 --> 00:24.540] 22 years old and mainly self-taught. My focus reside in operating system internals, reverse [00:24.540 --> 00:28.580] engineering and vulnerability research and before joining the security field I was a [00:28.580 --> 00:34.920] professional Brazilian G2 athlete where I won several world and European titles. This is [00:34.920 --> 00:38.600] what I will be talking about today. We have a lot of interesting topics to cover so let's [00:38.600 --> 00:45.100] jump right in. Starting with the research background. So first things first, what are [00:45.100 --> 00:49.760] downgrade attacks? Downgrade, downgrade attack is the act of downgrading immune and fully [00:49.760 --> 00:55.340] up to date software to uh, to uh, an old and vulnerable software. And this act allows to [00:55.340 --> 01:02.140] expose past vulnerabilities in updated software and then exploit such vulnerabilities. My [01:02.140 --> 01:06.500] research started from, from studying the Black Lotus UEFI bootkit and what caught mine and [01:06.500 --> 01:11.120] everyone else's attention with Black Lotus was the fact that it was able to bypass secure [01:11.120 --> 01:16.280] boot on a fully updated Windows 11. But in fact, Black Lotus did not exploit a new zero [01:16.280 --> 01:22.500] level vulnerability. Instead it exploited an already known and patch vulnerability. And that [01:22.500 --> 01:28.020] was of course done by employing a downgrade attack. To give you a better understanding of [01:28.020 --> 01:32.220] how Black Lotus' downgrade was formed to bypass secure boot, you first need to know what [01:32.220 --> 01:37.180] is secure boot. So simply put, secure boot is a security feature which is responsible to [01:37.180 --> 01:41.640] verify that each component in the boot chain is digitally signed. It is very simple. If you [01:41.640 --> 01:45.680] are not signed, you are not loaded. And so the days of floating a custom bootkit by [01:45.680 --> 01:52.060] replacing the boot manager are gone. Instead, what Black Lotus did was to downgrade the [01:52.060 --> 01:56.640] Windows boot manager to signed but vulnerable version of it. And this allowed to then [01:56.640 --> 02:00.840] exploit an old vulnerability sourced in the vulnerable boot manager to then bypass [02:00.840 --> 02:06.980] secure boot. Microsoft's mitigation against secure boot downgrades included multiple [02:06.980 --> 02:11.720] actions with the main one being revoking vulnerable boot managers and boot applications. And [02:11.720 --> 02:17.680] revoked images are of course not allowed to be loaded. But here comes the critical [02:17.680 --> 02:22.980] question. Are there any other components other than secure boot that may be vulnerable to [02:22.980 --> 02:28.480] downgrade attacks? My goal in this research was to evaluate the state of downgrade, [02:28.480 --> 02:33.480] downgrade attacks on Windows and to find if components other than secure boot may have been [02:33.480 --> 02:39.640] overlooked. Now I'm sure you're all familiar with bring your own vulnerable driver attacks [02:39.640 --> 02:44.580] targeting third party drivers. My vision was to target first party entities, not only [02:44.580 --> 02:50.360] drivers but even entities residing in a lower level than the kernel. My vision was to [02:50.360 --> 02:56.860] create a new category of bring your own vulnerable Windows. To kick off my research I've [02:56.860 --> 03:01.000] had to first form a reliable downgrade ability which led me to define what would be [03:01.000 --> 03:05.260] considered a perfect downgrade attack. So first the downgrade must be fully [03:05.260 --> 03:10.080] undetectable so that EDRs will not block the downgrade. Thus I aimed to perform the [03:10.080 --> 03:16.860] downgrade in the most legitimate way possible. Second, the downgrade must be invisible so [03:16.860 --> 03:22.660] that future updates, so that the downgraded components will not appear up to date even if [03:22.660 --> 03:27.660] they're technically downgraded. Third, the downgrade must be persistent so that future [03:27.660 --> 03:32.200] software updates are not overriding the downgrade. And then fourth, the downgrade must [03:32.200 --> 03:37.100] be irreversible so that scanning and repairing tools will not be able to detect or repair [03:37.100 --> 03:42.900] corruptions. Having the downgrade requirements defined I then looked for a suitable [03:42.900 --> 03:48.880] component. But before I expose the target component I want to ask you, what would be the [03:48.880 --> 03:57.780] least expected component to perform downgrades? That would be of course Windows updates. So [03:57.780 --> 04:05.800] let's talk about Windows updates and see if they can be abused to perform downgrades. The [04:05.800 --> 04:10.380] Windows update architecture is as follows. We have an update client and an update server and [04:10.380 --> 04:14.760] they communicate over com. For those of you who are unfamiliar with com, this is just an [04:14.760 --> 04:18.120] enterprise communication method in Windows and this is how the client and the server [04:18.120 --> 04:24.100] communicate. Administrator is usually forced on the client side and trusted installer is [04:24.100 --> 04:29.640] always enforced on the server side. And the last piece and the most important one is that [04:29.640 --> 04:35.280] system files once owned and updated by Windows updates are only accessible to trusted [04:35.280 --> 04:42.380] installer. So even administrators or anti-system cannot directly modify these system files. [04:44.160 --> 04:49.160] And this is where I found the first design problem in Windows updates. Administrator to [04:49.160 --> 04:53.680] trusted installer is not considered a security boundary and there are multiple working public [04:53.680 --> 05:00.000] proof of concepts of such elevation. So the Windows update team attempted to secure the update [05:00.000 --> 05:05.600] process by enforcing trusted installer. However, since updates are only accessible to [05:05.600 --> 05:11.380] administrators, trusted installer is rendered completely ineffective. The only issue though [05:11.380 --> 05:16.400] is that administrator to trusted installer elevations are considered malicious and are [05:16.400 --> 05:21.600] blocked by EDRs which of course contradicts my first downward principle which is being fully [05:21.600 --> 05:27.060] undetectable. Now I could of course try to bypass the elevation detection which may have [05:27.060 --> 05:31.260] been possible but then I would have to implement the update process myself which could [05:31.260 --> 05:36.140] still be seen as malicious. And so the best option for me was to find the flaw in the update [05:36.140 --> 05:43.000] process which solves all of those problems. So let's take a look on a simplified flaw of the [05:43.000 --> 05:48.500] Windows update process. First, the client asks the server to perform an update given an update [05:48.500 --> 05:55.360] folder. The update folder is supplied by the client. Second, the server validates the [05:55.360 --> 06:01.920] integrity of the update folder. Third, following the verification, the server operates on the [06:01.920 --> 06:07.220] update folder to finalize the update files and these are saved to a server control folder, one [06:07.220 --> 06:11.740] that is not accessible to the client. And so at that point the client cannot modify the [06:11.740 --> 06:19.240] finalized update files. Fourth, the server saves an action list to a server control folder as [06:19.240 --> 06:25.220] well, not accessible to the client. This action list is named pending.xml and it contains [06:25.220 --> 06:29.760] the update actions to perform. So for example it specifies the files to update, the source [06:29.760 --> 06:36.100] and destination files, et cetera. Lastly, when the operating system is rebooted, the action [06:36.100 --> 06:41.300] list is operated on and the actions uh and the update actions are performed during the [06:41.300 --> 06:48.460] update, during the reboot. Now the client only controls the initial update folder and so I [06:48.460 --> 06:53.240] decided to look at this folder first and see maybe I can modify it resulting in custom [06:53.240 --> 06:59.820] downgrading update files. And as we already know, integrity checks are performed on the [06:59.820 --> 07:07.360] update folder so let's see how well the integrity checks are performed. The update folder [07:07.360 --> 07:13.100] contains update components and each update component contain a manifest, mom, differential [07:13.100 --> 07:19.760] and catalog files. The mom files are Microsoft update metadata, they contain metadata [07:19.760 --> 07:25.740] information, so component dependencies, installation order, et cetera. The manifest [07:25.740 --> 07:30.740] files contain installation specific information such as file path, uh registry keys, which [07:30.740 --> 07:36.720] is sourced to execute as part of the installation and more. The differential files are [07:36.720 --> 07:42.660] delta files from the base files and so a base plus delta would result in the full final update [07:42.660 --> 07:49.680] file. And lastly we have the catalog files which are the digital signatures of the mom and [07:49.680 --> 07:54.960] manifest files. Catalogs allow signing multiple files at once instead of having the file [07:54.960 --> 08:00.560] that we want to sign embed its digital signature inside of it. In addition, the catalog [08:00.560 --> 08:06.120] files are digitally signed themselves which makes it impossible to modify them or any of the [08:06.120 --> 08:10.160] files that they protect. So we can't modify the catalogs and we can't modify the files that [08:10.160 --> 08:16.200] they protect, that they sign. To recap, only cat- only the catalog files are digitally [08:16.200 --> 08:20.920] signed. The manifest and mom files are not explicitly signed but they are signed in the [08:20.920 --> 08:25.980] catalog files. And the differential files are not signed at all and the differential files [08:25.980 --> 08:32.580] also control the final update file content which is very, very interesting. Is there any [08:32.580 --> 08:39.700] chance the differential files were left behind in terms of verification? No luck because the [08:39.700 --> 08:44.740] expected update file hash is hardcoded in the manifest and the manifest cannot be changed [08:44.740 --> 08:52.020] since it will break its signature in the, in the catalog. Now at that point I decided to look [08:52.020 --> 08:56.980] at the action list. I knew that it's con- it's, it's, it cannot be changed because it is [08:56.980 --> 09:01.720] trusted in folder enforced so I cannot change the action list directly but I also knew that [09:01.720 --> 09:05.760] the update up, that, that update process is performed over multiple reboots and so I [09:05.760 --> 09:10.520] assumed that the state of this list is saved somewhere. And if I could modify the state, [09:10.520 --> 09:17.940] maybe I was, I would be able to uh, create a custom downgrading action list. So I searched [09:17.940 --> 09:23.700] the action list path in the registry and then I found this very interesting key named POQXX [09:23.700 --> 09:29.160] CMD line. It holds the executable that parses the list and the list path. I then looked at [09:29.160 --> 09:34.100] the security attributes of this key and I was extremely surprised to find that this key is [09:34.100 --> 09:42.520] not trusted in solar enforced. And this allowed me to control all of the update actions. This [09:42.520 --> 09:47.000] is how the action list looks like in practice. It is an XML file that gives the functionality [09:47.000 --> 09:51.700] of creating files, deleting files, moving files, hard linking files, creating registry keys [09:51.700 --> 09:58.300] and values, deleting keys and values and much much more. In order to downgrade we can use [09:58.300 --> 10:06.640] the hard link file action and the source will replace the destination. To initiate [10:06.640 --> 10:12.120] an update all that is needed is to set the trusted in solar service as auto start and add the [10:12.120 --> 10:17.300] action list and its identifier in the registry. The identifier is a dynamic number which [10:17.300 --> 10:21.680] is compared with the action list identifier. So the identifier is needed for integrity [10:21.680 --> 10:27.080] purposes but since we control both the registry identifier and the identifier in the [10:27.080 --> 10:31.240] action list because we control the action list path then this is not a problem because we [10:31.240 --> 10:36.240] can adjust them accordingly. Now the most important thing is that none of these 3 [10:36.240 --> 10:42.820] actions is trusted in solar enforced. And this allowed me to update the system with a [10:42.820 --> 10:47.960] custom downgrading action list. All of the integrity verifications are bypassed since the [10:47.960 --> 10:53.100] action list is assumed verified as it is created post verification. There is no need to [10:53.100 --> 10:57.680] perform the malicious trusted in solar elevation. Instead Windows updates does all of the [10:57.680 --> 11:03.960] work for me and this is a complete Windows update takeover. Now revisiting the [11:03.960 --> 11:08.660] downgrade principles of course the downgrade is fully undetectable. There is no better way [11:08.660 --> 11:15.400] to downgrade Windows. In terms of invisibility the system will appear up to date as we [11:15.400 --> 11:21.400] basically updated the system and we didn't uninstall anything. In terms of persistency of [11:21.400 --> 11:25.660] the downgraded components I found that the action list sparser is not digitally signed and [11:25.660 --> 11:30.660] so I patched it to install empty updates. And as a result even after the downgrade when new [11:30.660 --> 11:37.580] updates are available they will be falsely installed. And in terms of recovery the [11:37.580 --> 11:41.920] integrity and repair utility is not digitally signed as well and so I patched it as well as [11:41.920 --> 11:48.420] part of the downgrade. And the patched version will no longer detect any corruptions. With [11:48.420 --> 11:53.680] that let's see the first demo of the day. This demo will demonstrate downgrading a kernel [11:53.680 --> 11:58.820] driver named afd.sys to an old and vulnerable version of it by using the Windows update [11:58.820 --> 12:05.300] cover. And then we'll see how the same kernel driver is exploited to achieve kernel code [12:05.300 --> 12:11.340] execution. So first we check the Windows version and then we will make sure that we are [12:11.340 --> 12:15.960] fully up to date and that we have no missing updates as you can see. We'll then uh use [12:15.960 --> 12:20.660] CMD and we'll use the seek check utility to see what is the current version of afd.sys, the [12:20.660 --> 12:24.500] driver that we are targeting. Is it fully up to date? You can see that the current version [12:24.500 --> 12:29.960] is 3672 which is patched to the vulnerability that I want to exploit. If we use task list to [12:29.960 --> 12:34.480] find the current process ID and then we try to actually exploit a vulnerability which the [12:34.480 --> 12:38.220] exploit gets a process ID and tries to elevate the system you can see the LP failed because [12:38.220 --> 12:42.560] the driver is patched. So we'll then use Windows downdate which gets a config file that [12:42.560 --> 12:47.860] says downgrade the afd.sys driver to an old and vulnerable version of it. You can see that [12:47.860 --> 12:52.040] that patch succeeded. We now need to restore the machine in order for the update to take [12:52.040 --> 12:58.300] place. You can see um we we fast forward a bit, we'll log back into the machine. After the [12:58.300 --> 13:02.860] update we'll launch CMD and let's see what is the current version of the driver that we are [13:02.860 --> 13:10.550] targeting. Was it updated? And you can see that the current version is the base version. [13:10.550 --> 13:15.150] Although the system was updated, what actually happened is that it downgraded. We can see [13:15.150 --> 13:19.610] that we are not currently system. If we try to exploit a vulnerability again, we get a [13:19.610 --> 13:25.570] process ID and then we execute the exploit again. You can see that it succeeded and we are [13:25.570 --> 13:37.070] now anti-authority system. Thank you. Thank you. We're just getting started guys. If we check for [13:37.070 --> 13:44.930] updates you can see that we are fully up to date. So what did we achieve so far? We gained a [13:44.930 --> 13:49.530] perfect downgrade ability and we gained kernel code execution. Our starting point was [13:49.530 --> 13:54.230] administrator so that was an administrator to kernel elevation. Now administrator to kernel [13:54.230 --> 13:58.370] is not considered a security boundary in Windows, but gaining kernel code execution is [13:58.370 --> 14:02.310] still a threat and of course it gives much more functionality than administrator [14:02.310 --> 14:08.750] functionality. Although it is not a boundary, admin to kernel is still a threat and a serious [14:08.750 --> 14:13.990] one. Because nowadays lots of users are still running as administrators and running as [14:13.990 --> 14:19.510] administrator is also the default on Windows. And as a result, many users could easily [14:19.510 --> 14:25.730] compromise the kernel and this is an issue that Microsoft aimed to solve. Microsoft's [14:25.730 --> 14:29.870] solution was to deprivilege the kernel to make kernel access less valuable than it [14:29.870 --> 14:35.110] previously was. And the way that this privileging, deprivileging was done is by introducing [14:35.370 --> 14:43.490] a feature called virtualization based security or VBS for short. VBS is a secure and isolated [14:43.490 --> 14:50.690] virtual environment powered by the IPV hypervisor for isolation. And again the reason that [14:50.690 --> 14:55.750] VBS was introduced is because the kernel is assumed compromised and can no longer be [14:55.750 --> 15:01.550] trusted. There was a need for a secure place to implement critical security features and store [15:01.550 --> 15:08.870] secret keys. VBS features include the famous credential guard, HVCI, system guard secure [15:08.870 --> 15:13.870] launch, um, shielded VMs and much more security features that really improved the security [15:13.870 --> 15:19.610] of Windows. And now that I've praised VBS so much, you may wonder how all of this works in [15:19.610 --> 15:26.430] practice. So before VBS, this is how Windows architecture looked like. We've had user [15:26.430 --> 15:31.010] mode in ring three, we've had kernel mode in ring zero and then we've had the hypervisor [15:31.010 --> 15:38.850] running in ring minus one. With VBS, the hypervisor introduces virtual trust levels or VTS [15:38.870 --> 15:44.810] and the way it works is that the higher the VTL, the more privileged it is. So simply put, [15:44.810 --> 15:49.470] VTLs are like virtual machines. Lower VTLs should not be able to access memory or [15:49.470 --> 15:56.910] compromise higher VTLs. Currently in Windows, only two VTLs exist. VTL zero known as [15:56.910 --> 16:03.770] normal mode and VTL one known as secure mode. Normal mode contains the original operating [16:03.770 --> 16:08.930] system and secure mode contains only the critical security features and mitigations as [16:08.930 --> 16:13.230] well as key isolation technologies. And everything that is implemented in the secure mode [16:13.230 --> 16:18.090] should not be compromised from normal mode. Even if we talk about normal mode's kernel. [16:20.800 --> 16:25.660] Now, when looking at security features and mitigations, the first thing to do is of [16:25.660 --> 16:30.580] course to check if the security features that we are targeting can be easily turned off. I [16:30.580 --> 16:36.300] wondered if VBS features could be easily turned off. Since they protect from administrators, [16:36.300 --> 16:40.580] configuration modifiable by administrators would be ineffective because an attacker would [16:40.580 --> 16:47.460] just turn off VBS instead of dealing with it. The way that VBS protects such disablements [16:47.460 --> 16:54.100] is by implementing a feature called a UEFI lock. The UEFI lock is a UEFI boot service [16:54.100 --> 16:59.560] variable that holds the VBS configuration. So if VBS is configured with a lock, the lock is [16:59.700 --> 17:04.800] a source of configuration instead of the Windows registry. Then changing the registry [17:04.800 --> 17:11.260] configuration will have no effect. The UEFI variable is a source of truth. And of course, the [17:11.260 --> 17:15.700] boot service variable that holds the configuration cannot be accessed in run time from the [17:15.700 --> 17:23.920] operating system but only during boot. So this is a very simple and reliable protection. If [17:23.920 --> 17:28.940] the user really wants to disable VBS, if it's configured with a UEFI lock, he must load a [17:28.940 --> 17:35.160] custom UEFI application signed by Microsoft. And this UEFI would then ask the user during [17:35.160 --> 17:40.540] boot to physically approve the disablement. And only if the user approves, VBS is [17:40.540 --> 17:46.600] disabled. Now the key element here is that all of this is performed during boot and the [17:46.600 --> 17:51.560] assumption is that only signed code is allowed to run because of secure boot. And the only [17:51.560 --> 17:57.200] signed code that touches the configuration, the variable, requires physical access. So without [17:57.200 --> 18:05.140] physical access to the target machine, it should not be possible to disable VBS. With the [18:05.140 --> 18:09.020] ability to control any file on the operating system, I wondered what would happen if I [18:09.020 --> 18:14.000] tried to replace the secure kernel or the hypervisor, hypervisor powering VBS with [18:14.000 --> 18:20.540] invalid files. For example, files that are not digitally signed, attacker controlled files. I [18:20.540 --> 18:24.820] believed that the result would be the machine booting into the recovery environment and [18:24.820 --> 18:32.760] that is because invalid files are a sign of compromise. Instead, I was extremely surprised [18:32.760 --> 18:38.140] to find out that if the operating system loader fails to validate one of VBS's files, it [18:38.140 --> 18:43.880] would just boot normally, abandoning VBS. I repeat, if the OS loader fails to validate one of [18:43.880 --> 18:50.840] VBS's files, it just boots normally. And this can be used to disable VBS by passing the [18:50.840 --> 18:56.420] UE file lock. And as far as I know, this is the first bypass of VBS's UE file locks and this [18:56.420 --> 19:00.460] is a very simple bypass. All we need to do is to replace the secure kernel, the hypervisor [19:00.460 --> 19:07.380] of any VBS's files with invalid files. Very simple. So now it's time for another demo of [19:07.380 --> 19:12.280] chaining all the capabilities gained so far together. In this demo I will show credential [19:12.280 --> 19:18.120] extraction against the most restrictive settings. Those settings will be PPL enabled for [19:18.120 --> 19:25.320] LSS with UE file lock protecting LSS dumps. Credential guard will be enabled with UE file lock [19:25.320 --> 19:30.860] protecting secrets in VTL1 and Windows Defender will be up and running. The way that all [19:30.860 --> 19:35.560] of these will be bypassed is by first reverting the PPL full patch to allow PPL bypass. [19:35.660 --> 19:39.940] Second, disabling credential guard by passing the UE file locks. And third, turning Windows [19:39.940 --> 19:46.640] Defender on functional by invalidating the main Defender executable MSMP engine. Now just [19:46.640 --> 19:50.860] before I show you the demo, it is important to understand that credential guard and PPL [19:50.860 --> 19:57.260] for LSS are complementary. So if only credential guard is bypassed, LSS cannot be dumped. And [19:57.260 --> 20:01.880] if only PPL is bypassed, credentials are encrypted and not usable. So this is what you will [20:01.880 --> 20:07.000] see if you try to dump credentials on a system with credential guard on. So let's see the [20:07.000 --> 20:11.740] demo of bypassing credential guard, PPL for LSS and Windows Defender all in once by [20:11.740 --> 20:18.300] utilizing downgrades and the UE file lock bypass. So first we check the Windows version and [20:18.300 --> 20:22.280] then we'll make sure that we are fully up to date. Which you can see we have no missing [20:22.280 --> 20:29.300] updates. We'll then use SKTool to see um, which is still supp- supplied by Microsoft to see [20:29.300 --> 20:34.400] what VBS features are running. You can see that the uh, the VBS is protected with UE file [20:34.400 --> 20:39.500] lock. It's locked in UE file and credential guard and key guard are currently running. We [20:39.500 --> 20:44.640] then use system informer to see what is the current state of LSS. You can see that it's run, [20:44.640 --> 20:48.560] it runs as PPL and then let's check the Windows Defender is up and running as well. We try [20:48.560 --> 20:52.460] to copy malicious files outside of the excluded directory. You can see that we can't use [20:52.460 --> 20:58.280] them and that Windows Defender detects them as malicious because it's up and running. Now [20:58.280 --> 21:04.860] it's time to execute the attack. We will use Windows downdate. We'll change directory to the [21:04.860 --> 21:09.180] Windows downdate directory and we will supply Windows downdate with a config file that [21:09.180 --> 21:16.080] will say, downgraded PPL fault patch, bypass the UE file to disable VBS and invalidate the [21:16.080 --> 21:20.100] main Defender executable to turn it on functional. You can see that the attack was [21:20.100 --> 21:25.300] successful. We finished the attack. These are the files that were updated and all we need to [21:25.300 --> 21:30.460] do is restore the machine. So you can see, you will see now that updates are underway but [21:30.460 --> 21:36.300] in practice what happens is that downgrades are underway. We fast forward, we log back [21:36.300 --> 21:45.410] into the machine. Now let's launch SK tool again to see what is the current state of VBS. Now [21:45.410 --> 21:48.890] you will see that the secure kernel is not currently running, credential guard is not [21:48.890 --> 21:52.810] currently running as well. So the UE file has been bypassed and credential guard is no [21:52.810 --> 21:57.890] longer protecting credentials. We'll then launch uh system informer and we will see what is [21:57.890 --> 22:02.050] the current state of others. You can see it runs as PPL. So we'll need to bypass it. And now [22:02.050 --> 22:06.490] let's check what is the state of Windows Defender. We'll copy malicious files outside of [22:06.490 --> 22:11.510] the excluded directory. And you can see that it worked successfully. So we defeated Windows [22:11.510 --> 22:17.890] Defender as well. We'll launch CMD again and now it's time to bypass PPL. We'll change [22:17.890 --> 22:23.550] directory, we'll get the process ID of others and then we'll try to execute PPL fault. And [22:23.550 --> 22:28.450] remember PPL fault should have been patched in the system and it is seemingly patched in [22:28.450 --> 22:36.540] the system. We'll execute the attack and let's see what happens. So PPL fault was [22:36.540 --> 22:40.920] successful. The dump file was created on the desktop as you can see. We'll now use Mimikatz to [22:40.920 --> 22:44.960] parse the dump file and extract credentials that should have been protected by credential [22:44.960 --> 22:50.300] guard. We'll load the dump file and extract credentials. You can see credentials are [22:50.300 --> 22:56.960] extracted and this credential should have been protected by credential guard. Now [22:56.960 --> 23:01.280] just to make sure that we are fully up to date and that everything looks correct, we'll [23:01.280 --> 23:13.360] check for updates. And you can see that we are fully up to date. Thank you. Thank you. [23:17.100 --> 23:23.480] Okay so we bypassed the UE file locks and defeated VBS. But now it's time to talk about real [23:23.480 --> 23:29.500] security boundaries. The security boundaries that VBS introduces are any VTL 0 to VTL 1 [23:29.500 --> 23:35.080] transition is considered a security boundary, an elevation of privilege. No VTL 0 code [23:35.080 --> 23:41.940] should be able to compromise VTL 1 code. And another boundary is ring 3 to ring 0, sorry any [23:41.940 --> 23:49.060] ring 3 to ring 0, sorry any ring 3 or ring 0 to ring minus 1. So user mode or kernel 2 [23:49.060 --> 23:53.360] hypervisor is considered an elevation of privilege. And due to the way that VBS is [23:53.360 --> 24:00.840] implemented, compromising the hypervisor gives complete control over all of the VTLs. Now [24:00.840 --> 24:05.040] when looking at VBS downgrades my main goal was to understand if there was a downgrade [24:05.040 --> 24:10.900] detection mitigation such as versioning checks or evocation mechanism. And if no downgrade [24:10.900 --> 24:16.340] mitigation was found regardless of how far I could go with the downgrade I considered this as [24:16.420 --> 24:21.400] a vulnerability. And that is because when new vulnerabilities will get patched in the target [24:21.400 --> 24:26.500] component it will make the exploitation much easier. So even if not immediately exploitable [24:26.840 --> 24:33.960] it is truly something that needs to get fixed. Firstly I targeted secure modes isolated [24:33.960 --> 24:39.680] user mode processes. And the most known isolated user mode process is credential guard. So I [24:39.680 --> 24:45.060] decided to target it first. Credential guard is implemented as an isolated user mode [24:45.060 --> 24:51.540] process named LSAISO which stands for LSA isolated. With credential guard running, secrets are [24:51.540 --> 24:57.440] stored in LSAISO in VTL1 instead of in the original LSAISO process. And this is why dumping [24:57.440 --> 25:01.820] LSAISO with credential guard is no longer valuable. Because LSAISO only contains the [25:01.820 --> 25:07.640] encrypted blobs and the real secrets ones that are, ones that the attacker is interested in [25:07.640 --> 25:19.580] are only accessible um to in VTL1 and not in VTL0. I decided to target a downgrade with CV202234709 [25:19.580 --> 25:24.580] which is a fixed elevation of privilege in credential guard. I found both the vulnerable [25:24.580 --> 25:29.660] module which is Kerpli insured and the vulnerable version. Downgrading the vulnerable [25:29.660 --> 25:34.500] module using the Windows update decoverer worked well on a fully patched machine. And this [25:34.500 --> 25:40.160] allowed escalating privileges from ring 3 VTL0 to ring 3 VTL1 compromising credential [25:40.160 --> 25:45.300] guard and all of the secrets that it protects. There was no downgrade detection on VTL1 [25:45.300 --> 25:51.800] isolated user mode. Now isolated user mode privileges are great but I wanted to gain even [25:51.800 --> 25:55.900] higher privileges. So I then moved on to target secure mode's kernel which is more [25:55.900 --> 26:02.700] privileged than isolated user mode. The kernel of secure mode is called secure kernel and [26:02.700 --> 26:07.800] it is a minimal kernel that only implements security features such as HVCI, hyper guard [26:07.800 --> 26:15.620] and more. I decided to target this downgrade with CV202127090 which is a fixed elevation [26:15.620 --> 26:20.660] of privilege in secure kernel. The only vulnerable module here could be secure kernel [26:20.660 --> 26:25.800] itself but in this case downgrading only the secure kernel did not work. It wasn't enough [26:25.800 --> 26:32.080] for me. I've had to downgrade dependency modules as well and only then it worked on a [26:32.080 --> 26:37.940] fully patched machine. And this allowed escalating privileges from ring 3 VTL0 to ring 0 [26:37.940 --> 26:45.160] VTL1 compromising the entire VTL1 and any of the mitigations including HVCI, hyper guard [26:45.160 --> 26:50.920] and more. There was no downgrade detection on the secure kernel and the secure mode either. [26:52.860 --> 26:57.260] Now secure kernel privileges are great but I wanted to gain even higher privileges. So I [26:57.260 --> 27:03.080] then moved on to target the most privileged entity of VBS which is the Hyper-V hypervisor. [27:04.280 --> 27:12.580] The hypervisor is HVIX on Intel systems and HVAX on AMD systems. The hypervisor is a [27:12.580 --> 27:19.700] standalone microkernel which makes it a valuable target for downgrades. With the hypervisor [27:19.700 --> 27:24.620] though it was more challenging to target a specific vulnerability. And that is because many [27:24.620 --> 27:30.540] vulnerabilities titled Hyper-V Elevation of Privileges were fixed over the last 2 years. But [27:30.540 --> 27:35.600] Hyper-V is a very large component. And in CV descriptions Microsoft do not share which [27:35.600 --> 27:42.580] component in the Hyper-V stack is the vulnerable one. So it could be an elevated user mode [27:42.580 --> 27:46.840] process, it could be a kernel driver or it could be the hypervisor itself which is the only [27:46.840 --> 27:51.700] component that I am targeting in the Hyper-V stack. And so I decided to go 2 years [27:51.700 --> 27:56.520] backward to prove the vulnerability. Because 2 years is old enough to be confident that there [27:56.520 --> 28:00.980] was at least one hypervisor elevation of privilege vulnerability unfixed in the old [28:00.980 --> 28:06.500] hypervisor. Downgrading the hypervisor and the hypervisor loader worked well on a fully [28:06.500 --> 28:11.820] patched machine and the cross security boundary here was ring 3 VTL 0 to ring minus 1 [28:11.820 --> 28:16.840] potentially compromising the entire visualization stack. And this rendered the entire [28:16.840 --> 28:22.540] visualization stack vulnerable to downgrade attacks. So let's see a demo of the [28:22.540 --> 28:28.120] hypervisor downgrade. First as usual we check the Windows version and then we make sure [28:28.120 --> 28:34.640] that it is fully updated and that we have no missing updates as you can see. We'll then [28:34.640 --> 28:38.600] launch SK tool again but this time we're interested to see what is the current state of the [28:38.600 --> 28:42.860] hypervisor. You can see the Microsoft hypervisor was detected and the current version is [28:42.860 --> 28:48.140] 22621 which is the base version. You can also see the VBS runs as usual. We'll then use [28:48.140 --> 28:52.780] Windows downdate with a config file that will say downgrade the hypervisor to a 2 years old [28:52.780 --> 28:57.220] hypervisor. The attack was succeeded, you can see the update files. We now restore the [28:57.220 --> 29:05.000] machine in order for the update to take place. We fast forward, Windows is updating. What [29:05.000 --> 29:09.980] happens under the hood is that the hypervisor is being downgraded. We log back into the [29:09.980 --> 29:17.720] machine and let's see what is the current state of the hypervisor. Run SK tool again and we [29:17.720 --> 29:23.880] can see that the hypervisor is still detected but its version is 22000 which is a 2 year old [29:23.880 --> 29:28.480] version. You can also see what's interesting here is that VBS is running as usual. So [29:28.480 --> 29:32.260] credential guard everything is running with an old hypervisor. And if we check that we are [29:32.260 --> 29:41.610] fully up to date, you can see that we are. Okay so overall I found no downgrade mitigation. In [29:41.610 --> 29:47.210] any component of the virtualization stack. The entire stack was found to be vulnerable to [29:47.210 --> 29:53.550] downgrade attacks. Now let's talk about one last vulnerability that exposed all of the [29:53.550 --> 29:59.650] attack vectors to unprivileged attackers in certain scenarios. So it all started with this [29:59.650 --> 30:03.910] Windows dot all folder which I came across in some of my machines and looking at it and [30:03.910 --> 30:08.370] Googling it, I found that this is the old Windows operating system and it is saved for [30:08.370 --> 30:12.410] restoration purposes after a quality update is installed. So when you install a quality [30:12.410 --> 30:19.210] update, Windows dot all is saved uh Windows is saved to Windows dot all. Of course the [30:19.210 --> 30:24.670] first thing I did was to try to modify files inside Windows all but I noticed that access [30:24.670 --> 30:29.170] lists are copied from the old operating system and so it was impossible to temper files that [30:29.170 --> 30:34.930] could not be previously tempered with. The next thing I did was to try to check access to [30:34.930 --> 30:40.610] Windows dot all folder itself. And I found that as an unprivileged user I have full access [30:40.610 --> 30:47.070] to this folder. The exploitation strategy is straight forward. First renaming the original [30:47.070 --> 30:51.530] Windows dot all folder to any name and then creating an attacker controlled Windows all [30:51.530 --> 30:55.930] folder and the attacker controlled operating system will be used in case of update [30:55.930 --> 31:00.850] restoration. So then in a restoration scenario triggered by administrator, the attacker [31:00.850 --> 31:05.350] controlled operating system will be used instead of the backup operating system. So this is [31:05.350 --> 31:09.410] another way to perform the same downgrades from an unprivileged user in a restoration [31:09.410 --> 31:16.730] scenario. Closing remarks. Let's talk about the disclosure process, next steps and [31:16.730 --> 31:22.890] takeaways. Starting from the disclosure process, we notified Microsoft of our research [31:22.890 --> 31:34.230] findings in February 2024. Microsoft issued CV 2024-21302 and CV 2024-38202. This is [31:34.230 --> 31:38.430] Microsoft's official response to the research and I would like to thank Microsoft here for [31:38.430 --> 31:44.930] the great cooperation and effort on these cases. For those of you who want to further [31:44.930 --> 31:49.410] research the topic that we explored today, here are some of the topics that I would [31:49.410 --> 31:55.430] recommend looking at. First and foremost, the critical question still arises. Are there [31:55.430 --> 32:01.610] additional Windows features vulnerable to downgrade attacks? So far, both secure boot and [32:01.610 --> 32:06.130] the virtualization stack was found vulnerable. Do you have in mind additional critical [32:06.130 --> 32:11.510] features that you think are vulnerable to downgrades? Another interesting feature [32:11.510 --> 32:16.810] introduced not too long ago is Linux virtualization based security. And this is a game [32:16.810 --> 32:22.030] changer for Linux security. Would the same design issues exist in the Linux implementation? [32:23.250 --> 32:28.150] Lastly, are there any other operating systems such as Mac OS or Linux that may be [32:28.150 --> 32:33.490] vulnerable to downgrade attacks? May the implications on those operating systems be [32:33.490 --> 32:40.690] similar to the Windows implications? What are the takeaways for this talk? First, the [32:40.690 --> 32:44.810] cyber security industry should raise its awareness of OS downgrade attacks and the [32:44.810 --> 32:49.030] danger that they pose. I found no mitigation preventing the downgrade of critical [32:49.030 --> 32:53.670] operating system components suggesting the downgrade attacks were not the focal point [32:53.670 --> 32:59.930] barrier to my research. The significant implications made um made by downgrade attacks [32:59.930 --> 33:04.530] emphasize the danger that they pose. And while Windows is currently affected, could Mac [33:04.530 --> 33:12.110] OS or Linux be next? We need to address these questions before real attackers do. Second, [33:12.110 --> 33:16.170] design should always be reviewed and regarded as a relevant attack surface. The [33:16.170 --> 33:20.030] downgrade attack on the virtualization stack was possible due to a design flow that [33:20.030 --> 33:24.450] permits less privileged VTLs or rings to update components residing in more privileged [33:24.450 --> 33:30.750] VTLs or rings. Even though virtualization based security has become more popular and [33:30.750 --> 33:35.150] makes security researchers in recent years with some great research papers papers on the [33:35.150 --> 33:39.810] subject, this attack surface, the downgrade attack surface has existed since the very [33:39.810 --> 33:45.350] beginning of VBS when Microsoft first announced it in 2015. And this indicates that the [33:45.350 --> 33:51.990] design was probably not thoroughly examined. Third, in the wild attacks should be [33:51.990 --> 33:56.490] thoroughly examined and expanded upon whenever possible. With the Black Labus UEFI [33:56.490 --> 34:00.310] boot kit employing downgrade attacks, we realize that the concept of downgrade attacks was [34:00.310 --> 34:05.790] right under our noses. Although a year has passed, it seems that this time we were able to [34:05.790 --> 34:11.050] study and expand upon downgrade attacks before attackers did. So we exp- we expanded uh [34:11.050 --> 34:16.570] secure boots downgrade to virtualization stack downgrades. This is not always [34:16.570 --> 34:20.590] guaranteed. And this emphasizes the importance of studying in the wild attacks and always [34:20.590 --> 34:26.050] considering what other components or areas may also be affected by an in- an in the wild [34:26.050 --> 34:33.170] attack. Now before we wrap everything up, I would like to credit these talented people for [34:33.170 --> 34:41.000] their work. It was a pleasure for me to share with you my journey of researching downgrade [34:41.000 --> 34:45.880] attacks on Windows and their severe implications on Windows as platform security. Using the [34:45.880 --> 34:50.400] findings that I revealed today, you can bring back to life thousands of old and fixed [34:50.400 --> 34:55.340] vulnerabilities. Windows downdate essentially makes the term fully patched meaningless [34:55.340 --> 35:01.420] across any Windows machine worldwide. If you have any question- questions, please catch me [35:01.420 --> 35:07.320] in the wrap up room or here and also feel free to reach out on social media and with that, I [35:07.320 --> 35:12.000] would like to thank you all for joining me today and have a great rest of your day. Thank you. [35:14.940 --> 35:16.940] We'll- we'll- we'll go back to our questions.