1 00:00:01,220 --> 00:00:02,120 Good? 2 00:00:03,260 --> 00:00:04,460 Alright. 3 00:00:04,480 --> 00:00:06,840 Hello everyone and welcome to my talk. 4 00:00:06,840 --> 00:00:14,580 Today I'm going to share with you my journey of researching downgrade attacks on Windows and their severe implications on Windows' platform security. 5 00:00:15,340 --> 00:00:19,140 My name is Alon and I'm a security researcher at SafeBridge. 6 00:00:19,240 --> 00:00:21,700 I'm 22 years old and mainly self-taught. 7 00:00:21,700 --> 00:00:32,980 My focus reside in operating system internals, reverse engineering and vulnerability research and before joining the security field I was a professional Brazilian G2 athlete where I won several world and European titles. 8 00:00:34,260 --> 00:00:36,360 This is what I will be talking about today. 9 00:00:36,360 --> 00:00:39,840 We have a lot of interesting topics to cover so let's jump right in. 10 00:00:40,940 --> 00:00:42,920 Starting with the research background. 11 00:00:43,440 --> 00:00:46,260 So first things first, what are downgrade attacks? 12 00:00:46,480 --> 00:00:53,820 Downgrade, downgrade attack is the act of downgrading immune and fully up to date software to uh, to uh, an old and vulnerable software. 13 00:00:53,820 --> 00:01:00,380 And this act allows to expose past vulnerabilities in updated software and then exploit such vulnerabilities. 14 00:01:01,540 --> 00:01:13,620 My research started from, from studying the Black Lotus UEFI bootkit and what caught mine and everyone else's attention with Black Lotus was the fact that it was able to bypass secure boot on a fully updated Windows 11. 15 00:01:13,620 --> 00:01:17,420 But in fact, Black Lotus did not exploit a new zero level vulnerability. 16 00:01:17,420 --> 00:01:21,020 Instead it exploited an already known and patch vulnerability. 17 00:01:21,620 --> 00:01:25,020 And that was of course done by employing a downgrade attack. 18 00:01:26,440 --> 00:01:33,340 To give you a better understanding of how Black Lotus' downgrade was formed to bypass secure boot, you first need to know what is secure boot. 19 00:01:33,460 --> 00:01:40,360 So simply put, secure boot is a security feature which is responsible to verify that each component in the boot chain is digitally signed. 20 00:01:40,540 --> 00:01:41,440 It is very simple. 21 00:01:41,440 --> 00:01:43,300 If you are not signed, you are not loaded. 22 00:01:43,440 --> 00:01:47,720 And so the days of floating a custom bootkit by replacing the boot manager are gone. 23 00:01:49,500 --> 00:01:55,500 Instead, what Black Lotus did was to downgrade the Windows boot manager to signed but vulnerable version of it. 24 00:01:55,560 --> 00:02:02,200 And this allowed to then exploit an old vulnerability sourced in the vulnerable boot manager to then bypass secure boot. 25 00:02:03,360 --> 00:02:11,480 Microsoft's mitigation against secure boot downgrades included multiple actions with the main one being revoking vulnerable boot managers and boot applications. 26 00:02:11,500 --> 00:02:14,980 And revoked images are of course not allowed to be loaded. 27 00:02:15,940 --> 00:02:18,720 But here comes the critical question. 28 00:02:18,720 --> 00:02:24,340 Are there any other components other than secure boot that may be vulnerable to downgrade attacks? 29 00:02:25,060 --> 00:02:34,600 My goal in this research was to evaluate the state of downgrade, downgrade attacks on Windows and to find if components other than secure boot may have been overlooked. 30 00:02:36,000 --> 00:02:41,480 Now I'm sure you're all familiar with bring your own vulnerable driver attacks targeting third party drivers. 31 00:02:41,480 --> 00:02:48,580 My vision was to target first party entities, not only drivers but even entities residing in a lower level than the kernel. 32 00:02:49,180 --> 00:02:53,700 My vision was to create a new category of bring your own vulnerable Windows. 33 00:02:55,020 --> 00:03:03,360 To kick off my research I've had to first form a reliable downgrade ability which led me to define what would be considered a perfect downgrade attack. 34 00:03:03,380 --> 00:03:08,460 So first the downgrade must be fully undetectable so that EDRs will not block the downgrade. 35 00:03:08,640 --> 00:03:12,440 Thus I aimed to perform the downgrade in the most legitimate way possible. 36 00:03:13,280 --> 00:03:24,480 Second, the downgrade must be invisible so that future updates, so that the downgraded components will not appear up to date even if they're technically downgraded. 37 00:03:24,960 --> 00:03:30,480 Third, the downgrade must be persistent so that future software updates are not overriding the downgrade. 38 00:03:30,780 --> 00:03:38,400 And then fourth, the downgrade must be irreversible so that scanning and repairing tools will not be able to detect or repair corruptions. 39 00:03:39,660 --> 00:03:44,020 Having the downgrade requirements defined I then looked for a suitable component. 40 00:03:44,060 --> 00:03:52,080 But before I expose the target component I want to ask you, what would be the least expected component to perform downgrades? 41 00:03:53,600 --> 00:03:56,740 That would be of course Windows updates. 42 00:03:57,400 --> 00:04:02,840 So let's talk about Windows updates and see if they can be abused to perform downgrades. 43 00:04:05,440 --> 00:04:07,600 The Windows update architecture is as follows. 44 00:04:07,600 --> 00:04:11,960 We have an update client and an update server and they communicate over com. 45 00:04:11,960 --> 00:04:19,220 For those of you who are unfamiliar with com, this is just an enterprise communication method in Windows and this is how the client and the server communicate. 46 00:04:20,300 --> 00:04:26,360 Administrator is usually forced on the client side and trusted installer is always enforced on the server side. 47 00:04:27,020 --> 00:04:36,160 And the last piece and the most important one is that system files once owned and updated by Windows updates are only accessible to trusted installer. 48 00:04:36,160 --> 00:04:42,380 So even administrators or anti-system cannot directly modify these system files. 49 00:04:44,160 --> 00:04:48,260 And this is where I found the first design problem in Windows updates. 50 00:04:48,260 --> 00:04:56,060 Administrator to trusted installer is not considered a security boundary and there are multiple working public proof of concepts of such elevation. 51 00:04:56,940 --> 00:05:02,940 So the Windows update team attempted to secure the update process by enforcing trusted installer. 52 00:05:03,260 --> 00:05:09,700 However, since updates are only accessible to administrators, trusted installer is rendered completely ineffective. 53 00:05:10,260 --> 00:05:23,000 The only issue though is that administrator to trusted installer elevations are considered malicious and are blocked by EDRs which of course contradicts my first downward principle which is being fully undetectable. 54 00:05:23,480 --> 00:05:32,820 Now I could of course try to bypass the elevation detection which may have been possible but then I would have to implement the update process myself which could still be seen as malicious. 55 00:05:32,820 --> 00:05:39,020 And so the best option for me was to find the flaw in the update process which solves all of those problems. 56 00:05:40,700 --> 00:05:44,460 So let's take a look on a simplified flaw of the Windows update process. 57 00:05:44,720 --> 00:05:49,380 First, the client asks the server to perform an update given an update folder. 58 00:05:49,860 --> 00:05:52,480 The update folder is supplied by the client. 59 00:05:53,600 --> 00:05:57,500 Second, the server validates the integrity of the update folder. 60 00:05:58,280 --> 00:06:08,960 Third, following the verification, the server operates on the update folder to finalize the update files and these are saved to a server control folder, one that is not accessible to the client. 61 00:06:08,960 --> 00:06:13,480 And so at that point the client cannot modify the finalized update files. 62 00:06:14,960 --> 00:06:21,400 Fourth, the server saves an action list to a server control folder as well, not accessible to the client. 63 00:06:21,400 --> 00:06:26,640 This action list is named pending.xml and it contains the update actions to perform. 64 00:06:26,640 --> 00:06:31,660 So for example it specifies the files to update, the source and destination files, et cetera. 65 00:06:32,940 --> 00:06:43,400 Lastly, when the operating system is rebooted, the action list is operated on and the actions uh and the update actions are performed during the update, during the reboot. 66 00:06:44,840 --> 00:06:55,140 Now the client only controls the initial update folder and so I decided to look at this folder first and see maybe I can modify it resulting in custom downgrading update files. 67 00:06:56,020 --> 00:07:04,100 And as we already know, integrity checks are performed on the update folder so let's see how well the integrity checks are performed. 68 00:07:05,940 --> 00:07:15,040 The update folder contains update components and each update component contain a manifest, mom, differential and catalog files. 69 00:07:16,520 --> 00:07:23,920 The mom files are Microsoft update metadata, they contain metadata information, so component dependencies, installation order, et cetera. 70 00:07:25,140 --> 00:07:33,780 The manifest files contain installation specific information such as file path, uh registry keys, which is sourced to execute as part of the installation and more. 71 00:07:35,180 --> 00:07:43,620 The differential files are delta files from the base files and so a base plus delta would result in the full final update file. 72 00:07:44,440 --> 00:07:50,940 And lastly we have the catalog files which are the digital signatures of the mom and manifest files. 73 00:07:51,180 --> 00:07:58,600 Catalogs allow signing multiple files at once instead of having the file that we want to sign embed its digital signature inside of it. 74 00:07:58,960 --> 00:08:07,200 In addition, the catalog files are digitally signed themselves which makes it impossible to modify them or any of the files that they protect. 75 00:08:07,200 --> 00:08:11,980 So we can't modify the catalogs and we can't modify the files that they protect, that they sign. 76 00:08:12,740 --> 00:08:16,820 To recap, only cat- only the catalog files are digitally signed. 77 00:08:16,820 --> 00:08:22,000 The manifest and mom files are not explicitly signed but they are signed in the catalog files. 78 00:08:22,000 --> 00:08:30,640 And the differential files are not signed at all and the differential files also control the final update file content which is very, very interesting. 79 00:08:31,760 --> 00:08:36,680 Is there any chance the differential files were left behind in terms of verification? 80 00:08:38,160 --> 00:08:48,080 No luck because the expected update file hash is hardcoded in the manifest and the manifest cannot be changed since it will break its signature in the, in the catalog. 81 00:08:49,680 --> 00:08:53,340 Now at that point I decided to look at the action list. 82 00:08:53,340 --> 00:09:08,820 I knew that it's con- it's, it's, it cannot be changed because it is trusted in folder enforced so I cannot change the action list directly but I also knew that the update up, that, that update process is performed over multiple reboots and so I assumed that the state of this list is saved somewhere. 83 00:09:08,820 --> 00:09:15,780 And if I could modify the state, maybe I was, I would be able to uh, create a custom downgrading action list. 84 00:09:16,940 --> 00:09:24,440 So I searched the action list path in the registry and then I found this very interesting key named POQXX CMD line. 85 00:09:24,440 --> 00:09:28,160 It holds the executable that parses the list and the list path. 86 00:09:28,420 --> 00:09:36,600 I then looked at the security attributes of this key and I was extremely surprised to find that this key is not trusted in solar enforced. 87 00:09:37,520 --> 00:09:41,100 And this allowed me to control all of the update actions. 88 00:09:42,020 --> 00:09:44,620 This is how the action list looks like in practice. 89 00:09:44,620 --> 00:09:54,960 It is an XML file that gives the functionality of creating files, deleting files, moving files, hard linking files, creating registry keys and values, deleting keys and values and much much more. 90 00:09:56,280 --> 00:10:02,140 In order to downgrade we can use the hard link file action and the source will replace the destination. 91 00:10:05,820 --> 00:10:15,260 To initiate an update all that is needed is to set the trusted in solar service as auto start and add the action list and its identifier in the registry. 92 00:10:15,340 --> 00:10:19,840 The identifier is a dynamic number which is compared with the action list identifier. 93 00:10:19,840 --> 00:10:32,840 So the identifier is needed for integrity purposes but since we control both the registry identifier and the identifier in the action list because we control the action list path then this is not a problem because we can adjust them accordingly. 94 00:10:33,900 --> 00:10:39,300 Now the most important thing is that none of these 3 actions is trusted in solar enforced. 95 00:10:40,140 --> 00:10:44,600 And this allowed me to update the system with a custom downgrading action list. 96 00:10:44,640 --> 00:10:51,260 All of the integrity verifications are bypassed since the action list is assumed verified as it is created post verification. 97 00:10:51,820 --> 00:10:55,280 There is no need to perform the malicious trusted in solar elevation. 98 00:10:55,280 --> 00:11:01,340 Instead Windows updates does all of the work for me and this is a complete Windows update takeover. 99 00:11:02,540 --> 00:11:07,320 Now revisiting the downgrade principles of course the downgrade is fully undetectable. 100 00:11:07,320 --> 00:11:10,180 There is no better way to downgrade Windows. 101 00:11:11,440 --> 00:11:18,840 In terms of invisibility the system will appear up to date as we basically updated the system and we didn't uninstall anything. 102 00:11:19,520 --> 00:11:28,160 In terms of persistency of the downgraded components I found that the action list sparser is not digitally signed and so I patched it to install empty updates. 103 00:11:28,160 --> 00:11:34,280 And as a result even after the downgrade when new updates are available they will be falsely installed. 104 00:11:35,400 --> 00:11:42,960 And in terms of recovery the integrity and repair utility is not digitally signed as well and so I patched it as well as part of the downgrade. 105 00:11:42,960 --> 00:11:46,740 And the patched version will no longer detect any corruptions. 106 00:11:47,880 --> 00:11:51,540 With that let's see the first demo of the day. 107 00:11:51,560 --> 00:11:59,600 This demo will demonstrate downgrading a kernel driver named afd.sys to an old and vulnerable version of it by using the Windows update cover. 108 00:12:00,540 --> 00:12:06,300 And then we'll see how the same kernel driver is exploited to achieve kernel code execution. 109 00:12:07,740 --> 00:12:14,860 So first we check the Windows version and then we will make sure that we are fully up to date and that we have no missing updates as you can see. 110 00:12:14,860 --> 00:12:22,020 We'll then uh use CMD and we'll use the seek check utility to see what is the current version of afd.sys, the driver that we are targeting. 111 00:12:22,100 --> 00:12:23,460 Is it fully up to date? 112 00:12:23,460 --> 00:12:28,880 You can see that the current version is 3672 which is patched to the vulnerability that I want to exploit. 113 00:12:28,880 --> 00:12:39,620 If we use task list to find the current process ID and then we try to actually exploit a vulnerability which the exploit gets a process ID and tries to elevate the system you can see the LP failed because the driver is patched. 114 00:12:39,740 --> 00:12:47,120 So we'll then use Windows downdate which gets a config file that says downgrade the afd.sys driver to an old and vulnerable version of it. 115 00:12:47,360 --> 00:12:48,940 You can see that that patch succeeded. 116 00:12:48,940 --> 00:12:52,800 We now need to restore the machine in order for the update to take place. 117 00:12:54,320 --> 00:12:57,960 You can see um we we fast forward a bit, we'll log back into the machine. 118 00:12:57,960 --> 00:13:03,600 After the update we'll launch CMD and let's see what is the current version of the driver that we are targeting. 119 00:13:03,980 --> 00:13:05,160 Was it updated? 120 00:13:08,110 --> 00:13:10,550 And you can see that the current version is the base version. 121 00:13:10,550 --> 00:13:14,610 Although the system was updated, what actually happened is that it downgraded. 122 00:13:14,730 --> 00:13:16,350 We can see that we are not currently system. 123 00:13:16,350 --> 00:13:23,150 If we try to exploit a vulnerability again, we get a process ID and then we execute the exploit again. 124 00:13:23,770 --> 00:13:27,370 You can see that it succeeded and we are now anti-authority system. 125 00:13:29,210 --> 00:13:30,410 Thank you. 126 00:13:31,730 --> 00:13:32,910 Thank you. 127 00:13:33,070 --> 00:13:35,070 We're just getting started guys. 128 00:13:36,130 --> 00:13:39,330 If we check for updates you can see that we are fully up to date. 129 00:13:41,790 --> 00:13:43,930 So what did we achieve so far? 130 00:13:43,990 --> 00:13:48,230 We gained a perfect downgrade ability and we gained kernel code execution. 131 00:13:48,450 --> 00:13:53,010 Our starting point was administrator so that was an administrator to kernel elevation. 132 00:13:53,170 --> 00:14:03,550 Now administrator to kernel is not considered a security boundary in Windows, but gaining kernel code execution is still a threat and of course it gives much more functionality than administrator functionality. 133 00:14:04,810 --> 00:14:09,350 Although it is not a boundary, admin to kernel is still a threat and a serious one. 134 00:14:09,350 --> 00:14:16,850 Because nowadays lots of users are still running as administrators and running as administrator is also the default on Windows. 135 00:14:17,250 --> 00:14:23,630 And as a result, many users could easily compromise the kernel and this is an issue that Microsoft aimed to solve. 136 00:14:25,130 --> 00:14:31,130 Microsoft's solution was to deprivilege the kernel to make kernel access less valuable than it previously was. 137 00:14:31,230 --> 00:14:39,970 And the way that this privileging, deprivileging was done is by introducing a feature called virtualization based security or VBS for short. 138 00:14:41,370 --> 00:14:47,610 VBS is a secure and isolated virtual environment powered by the IPV hypervisor for isolation. 139 00:14:49,030 --> 00:14:56,670 And again the reason that VBS was introduced is because the kernel is assumed compromised and can no longer be trusted. 140 00:14:56,670 --> 00:15:02,950 There was a need for a secure place to implement critical security features and store secret keys. 141 00:15:04,630 --> 00:15:15,030 VBS features include the famous credential guard, HVCI, system guard secure launch, um, shielded VMs and much more security features that really improved the security of Windows. 142 00:15:15,070 --> 00:15:20,530 And now that I've praised VBS so much, you may wonder how all of this works in practice. 143 00:15:21,910 --> 00:15:25,530 So before VBS, this is how Windows architecture looked like. 144 00:15:25,530 --> 00:15:33,050 We've had user mode in ring three, we've had kernel mode in ring zero and then we've had the hypervisor running in ring minus one. 145 00:15:34,450 --> 00:15:43,750 With VBS, the hypervisor introduces virtual trust levels or VTS and the way it works is that the higher the VTL, the more privileged it is. 146 00:15:43,830 --> 00:15:46,950 So simply put, VTLs are like virtual machines. 147 00:15:46,950 --> 00:15:51,670 Lower VTLs should not be able to access memory or compromise higher VTLs. 148 00:15:52,150 --> 00:15:55,590 Currently in Windows, only two VTLs exist. 149 00:15:55,810 --> 00:16:00,490 VTL zero known as normal mode and VTL one known as secure mode. 150 00:16:01,710 --> 00:16:10,830 Normal mode contains the original operating system and secure mode contains only the critical security features and mitigations as well as key isolation technologies. 151 00:16:10,830 --> 00:16:15,710 And everything that is implemented in the secure mode should not be compromised from normal mode. 152 00:16:15,710 --> 00:16:18,090 Even if we talk about normal mode's kernel. 153 00:16:20,800 --> 00:16:30,400 Now, when looking at security features and mitigations, the first thing to do is of course to check if the security features that we are targeting can be easily turned off. 154 00:16:30,400 --> 00:16:33,600 I wondered if VBS features could be easily turned off. 155 00:16:33,680 --> 00:16:43,760 Since they protect from administrators, configuration modifiable by administrators would be ineffective because an attacker would just turn off VBS instead of dealing with it. 156 00:16:44,520 --> 00:16:50,740 The way that VBS protects such disablements is by implementing a feature called a UEFI lock. 157 00:16:51,800 --> 00:16:56,600 The UEFI lock is a UEFI boot service variable that holds the VBS configuration. 158 00:16:56,780 --> 00:17:02,700 So if VBS is configured with a lock, the lock is a source of configuration instead of the Windows registry. 159 00:17:03,540 --> 00:17:07,180 Then changing the registry configuration will have no effect. 160 00:17:07,180 --> 00:17:09,760 The UEFI variable is a source of truth. 161 00:17:10,080 --> 00:17:18,300 And of course, the boot service variable that holds the configuration cannot be accessed in run time from the operating system but only during boot. 162 00:17:18,360 --> 00:17:21,300 So this is a very simple and reliable protection. 163 00:17:23,360 --> 00:17:32,560 If the user really wants to disable VBS, if it's configured with a UEFI lock, he must load a custom UEFI application signed by Microsoft. 164 00:17:32,760 --> 00:17:38,160 And this UEFI would then ask the user during boot to physically approve the disablement. 165 00:17:38,160 --> 00:17:41,520 And only if the user approves, VBS is disabled. 166 00:17:42,120 --> 00:17:50,880 Now the key element here is that all of this is performed during boot and the assumption is that only signed code is allowed to run because of secure boot. 167 00:17:51,040 --> 00:17:56,400 And the only signed code that touches the configuration, the variable, requires physical access. 168 00:17:56,620 --> 00:18:02,880 So without physical access to the target machine, it should not be possible to disable VBS. 169 00:18:04,360 --> 00:18:14,940 With the ability to control any file on the operating system, I wondered what would happen if I tried to replace the secure kernel or the hypervisor, hypervisor powering VBS with invalid files. 170 00:18:14,940 --> 00:18:19,920 For example, files that are not digitally signed, attacker controlled files. 171 00:18:20,380 --> 00:18:29,000 I believed that the result would be the machine booting into the recovery environment and that is because invalid files are a sign of compromise. 172 00:18:30,660 --> 00:18:41,280 Instead, I was extremely surprised to find out that if the operating system loader fails to validate one of VBS's files, it would just boot normally, abandoning VBS. 173 00:18:41,420 --> 00:18:46,920 I repeat, if the OS loader fails to validate one of VBS's files, it just boots normally. 174 00:18:47,460 --> 00:18:51,760 And this can be used to disable VBS by passing the UE file lock. 175 00:18:51,760 --> 00:18:57,600 And as far as I know, this is the first bypass of VBS's UE file locks and this is a very simple bypass. 176 00:18:57,600 --> 00:19:03,400 All we need to do is to replace the secure kernel, the hypervisor of any VBS's files with invalid files. 177 00:19:03,400 --> 00:19:04,480 Very simple. 178 00:19:05,340 --> 00:19:10,460 So now it's time for another demo of chaining all the capabilities gained so far together. 179 00:19:10,640 --> 00:19:15,260 In this demo I will show credential extraction against the most restrictive settings. 180 00:19:16,020 --> 00:19:22,020 Those settings will be PPL enabled for LSS with UE file lock protecting LSS dumps. 181 00:19:23,040 --> 00:19:29,740 Credential guard will be enabled with UE file lock protecting secrets in VTL1 and Windows Defender will be up and running. 182 00:19:30,180 --> 00:19:35,560 The way that all of these will be bypassed is by first reverting the PPL full patch to allow PPL bypass. 183 00:19:35,660 --> 00:19:38,940 Second, disabling credential guard by passing the UE file locks. 184 00:19:38,940 --> 00:19:44,940 And third, turning Windows Defender on functional by invalidating the main Defender executable MSMP engine. 185 00:19:46,000 --> 00:19:52,580 Now just before I show you the demo, it is important to understand that credential guard and PPL for LSS are complementary. 186 00:19:52,580 --> 00:19:56,300 So if only credential guard is bypassed, LSS cannot be dumped. 187 00:19:56,920 --> 00:20:01,060 And if only PPL is bypassed, credentials are encrypted and not usable. 188 00:20:01,060 --> 00:20:05,960 So this is what you will see if you try to dump credentials on a system with credential guard on. 189 00:20:06,380 --> 00:20:14,240 So let's see the demo of bypassing credential guard, PPL for LSS and Windows Defender all in once by utilizing downgrades and the UE file lock bypass. 190 00:20:15,940 --> 00:20:20,880 So first we check the Windows version and then we'll make sure that we are fully up to date. 191 00:20:20,880 --> 00:20:23,080 Which you can see we have no missing updates. 192 00:20:24,600 --> 00:20:30,900 We'll then use SKTool to see um, which is still supp- supplied by Microsoft to see what VBS features are running. 193 00:20:30,900 --> 00:20:34,920 You can see that the uh, the VBS is protected with UE file lock. 194 00:20:34,920 --> 00:20:38,080 It's locked in UE file and credential guard and key guard are currently running. 195 00:20:39,220 --> 00:20:42,920 We then use system informer to see what is the current state of LSS. 196 00:20:43,640 --> 00:20:48,420 You can see that it's run, it runs as PPL and then let's check the Windows Defender is up and running as well. 197 00:20:48,420 --> 00:20:51,440 We try to copy malicious files outside of the excluded directory. 198 00:20:51,440 --> 00:20:57,000 You can see that we can't use them and that Windows Defender detects them as malicious because it's up and running. 199 00:20:57,840 --> 00:21:00,160 Now it's time to execute the attack. 200 00:21:01,640 --> 00:21:03,660 We will use Windows downdate. 201 00:21:03,660 --> 00:21:18,760 We'll change directory to the Windows downdate directory and we will supply Windows downdate with a config file that will say, downgraded PPL fault patch, bypass the UE file to disable VBS and invalidate the main Defender executable to turn it on functional. 202 00:21:18,980 --> 00:21:21,000 You can see that the attack was successful. 203 00:21:21,000 --> 00:21:22,280 We finished the attack. 204 00:21:22,280 --> 00:21:26,640 These are the files that were updated and all we need to do is restore the machine. 205 00:21:27,080 --> 00:21:33,660 So you can see, you will see now that updates are underway but in practice what happens is that downgrades are underway. 206 00:21:34,740 --> 00:21:37,340 We fast forward, we log back into the machine. 207 00:21:37,900 --> 00:21:41,640 Now let's launch SK tool again to see what is the current state of VBS. 208 00:21:45,030 --> 00:21:50,150 Now you will see that the secure kernel is not currently running, credential guard is not currently running as well. 209 00:21:50,150 --> 00:21:54,430 So the UE file has been bypassed and credential guard is no longer protecting credentials. 210 00:21:54,750 --> 00:21:58,750 We'll then launch uh system informer and we will see what is the current state of others. 211 00:21:58,750 --> 00:22:00,310 You can see it runs as PPL. 212 00:22:00,310 --> 00:22:01,730 So we'll need to bypass it. 213 00:22:01,770 --> 00:22:04,190 And now let's check what is the state of Windows Defender. 214 00:22:04,830 --> 00:22:07,710 We'll copy malicious files outside of the excluded directory. 215 00:22:08,830 --> 00:22:10,730 And you can see that it worked successfully. 216 00:22:10,730 --> 00:22:12,610 So we defeated Windows Defender as well. 217 00:22:12,650 --> 00:22:16,050 We'll launch CMD again and now it's time to bypass PPL. 218 00:22:17,230 --> 00:22:23,410 We'll change directory, we'll get the process ID of others and then we'll try to execute PPL fault. 219 00:22:23,410 --> 00:22:29,350 And remember PPL fault should have been patched in the system and it is seemingly patched in the system. 220 00:22:29,810 --> 00:22:32,450 We'll execute the attack and let's see what happens. 221 00:22:35,240 --> 00:22:37,200 So PPL fault was successful. 222 00:22:37,200 --> 00:22:39,680 The dump file was created on the desktop as you can see. 223 00:22:39,680 --> 00:22:45,740 We'll now use Mimikatz to parse the dump file and extract credentials that should have been protected by credential guard. 224 00:22:45,820 --> 00:22:48,780 We'll load the dump file and extract credentials. 225 00:22:49,420 --> 00:22:55,540 You can see credentials are extracted and this credential should have been protected by credential guard. 226 00:22:56,360 --> 00:23:02,560 Now just to make sure that we are fully up to date and that everything looks correct, we'll check for updates. 227 00:23:04,500 --> 00:23:08,940 And you can see that we are fully up to date. 228 00:23:10,020 --> 00:23:11,380 Thank you. 229 00:23:12,180 --> 00:23:13,360 Thank you. 230 00:23:17,100 --> 00:23:21,540 Okay so we bypassed the UE file locks and defeated VBS. 231 00:23:21,540 --> 00:23:25,020 But now it's time to talk about real security boundaries. 232 00:23:25,240 --> 00:23:34,040 The security boundaries that VBS introduces are any VTL 0 to VTL 1 transition is considered a security boundary, an elevation of privilege. 233 00:23:34,080 --> 00:23:37,640 No VTL 0 code should be able to compromise VTL 1 code. 234 00:23:37,660 --> 00:23:47,140 And another boundary is ring 3 to ring 0, sorry any ring 3 to ring 0, sorry any ring 3 or ring 0 to ring minus 1. 235 00:23:47,400 --> 00:23:51,760 So user mode or kernel 2 hypervisor is considered an elevation of privilege. 236 00:23:51,840 --> 00:23:58,900 And due to the way that VBS is implemented, compromising the hypervisor gives complete control over all of the VTLs. 237 00:24:00,340 --> 00:24:09,980 Now when looking at VBS downgrades my main goal was to understand if there was a downgrade detection mitigation such as versioning checks or evocation mechanism. 238 00:24:10,000 --> 00:24:17,400 And if no downgrade mitigation was found regardless of how far I could go with the downgrade I considered this as a vulnerability. 239 00:24:17,740 --> 00:24:24,780 And that is because when new vulnerabilities will get patched in the target component it will make the exploitation much easier. 240 00:24:24,780 --> 00:24:29,500 So even if not immediately exploitable it is truly something that needs to get fixed. 241 00:24:31,500 --> 00:24:35,420 Firstly I targeted secure modes isolated user mode processes. 242 00:24:35,420 --> 00:24:39,340 And the most known isolated user mode process is credential guard. 243 00:24:39,340 --> 00:24:41,740 So I decided to target it first. 244 00:24:42,600 --> 00:24:49,300 Credential guard is implemented as an isolated user mode process named LSAISO which stands for LSA isolated. 245 00:24:49,480 --> 00:24:56,620 With credential guard running, secrets are stored in LSAISO in VTL1 instead of in the original LSAISO process. 246 00:24:56,620 --> 00:25:00,240 And this is why dumping LSAISO with credential guard is no longer valuable. 247 00:25:00,240 --> 00:25:12,240 Because LSAISO only contains the encrypted blobs and the real secrets ones that are, ones that the attacker is interested in are only accessible um to in VTL1 and not in VTL0. 248 00:25:13,980 --> 00:25:23,160 I decided to target a downgrade with CV202234709 which is a fixed elevation of privilege in credential guard. 249 00:25:23,160 --> 00:25:28,240 I found both the vulnerable module which is Kerpli insured and the vulnerable version. 250 00:25:28,860 --> 00:25:34,160 Downgrading the vulnerable module using the Windows update decoverer worked well on a fully patched machine. 251 00:25:34,160 --> 00:25:42,980 And this allowed escalating privileges from ring 3 VTL0 to ring 3 VTL1 compromising credential guard and all of the secrets that it protects. 252 00:25:43,120 --> 00:25:46,880 There was no downgrade detection on VTL1 isolated user mode. 253 00:25:47,860 --> 00:25:52,940 Now isolated user mode privileges are great but I wanted to gain even higher privileges. 254 00:25:52,940 --> 00:25:58,520 So I then moved on to target secure mode's kernel which is more privileged than isolated user mode. 255 00:25:59,500 --> 00:26:08,760 The kernel of secure mode is called secure kernel and it is a minimal kernel that only implements security features such as HVCI, hyper guard and more. 256 00:26:09,860 --> 00:26:17,980 I decided to target this downgrade with CV202127090 which is a fixed elevation of privilege in secure kernel. 257 00:26:18,360 --> 00:26:25,160 The only vulnerable module here could be secure kernel itself but in this case downgrading only the secure kernel did not work. 258 00:26:25,160 --> 00:26:26,680 It wasn't enough for me. 259 00:26:27,180 --> 00:26:33,500 I've had to downgrade dependency modules as well and only then it worked on a fully patched machine. 260 00:26:33,500 --> 00:26:46,260 And this allowed escalating privileges from ring 3 VTL0 to ring 0 VTL1 compromising the entire VTL1 and any of the mitigations including HVCI, hyper guard and more. 261 00:26:46,260 --> 00:26:50,920 There was no downgrade detection on the secure kernel and the secure mode either. 262 00:26:52,860 --> 00:26:56,900 Now secure kernel privileges are great but I wanted to gain even higher privileges. 263 00:26:56,900 --> 00:27:03,080 So I then moved on to target the most privileged entity of VBS which is the Hyper-V hypervisor. 264 00:27:04,280 --> 00:27:10,860 The hypervisor is HVIX on Intel systems and HVAX on AMD systems. 265 00:27:11,160 --> 00:27:17,100 The hypervisor is a standalone microkernel which makes it a valuable target for downgrades. 266 00:27:18,460 --> 00:27:23,240 With the hypervisor though it was more challenging to target a specific vulnerability. 267 00:27:23,500 --> 00:27:30,160 And that is because many vulnerabilities titled Hyper-V Elevation of Privileges were fixed over the last 2 years. 268 00:27:30,400 --> 00:27:32,840 But Hyper-V is a very large component. 269 00:27:32,840 --> 00:27:38,760 And in CV descriptions Microsoft do not share which component in the Hyper-V stack is the vulnerable one. 270 00:27:39,840 --> 00:27:49,780 So it could be an elevated user mode process, it could be a kernel driver or it could be the hypervisor itself which is the only component that I am targeting in the Hyper-V stack. 271 00:27:49,960 --> 00:27:53,680 And so I decided to go 2 years backward to prove the vulnerability. 272 00:27:53,680 --> 00:28:02,140 Because 2 years is old enough to be confident that there was at least one hypervisor elevation of privilege vulnerability unfixed in the old hypervisor. 273 00:28:03,020 --> 00:28:15,260 Downgrading the hypervisor and the hypervisor loader worked well on a fully patched machine and the cross security boundary here was ring 3 VTL 0 to ring minus 1 potentially compromising the entire visualization stack. 274 00:28:15,260 --> 00:28:20,060 And this rendered the entire visualization stack vulnerable to downgrade attacks. 275 00:28:21,220 --> 00:28:23,860 So let's see a demo of the hypervisor downgrade. 276 00:28:24,700 --> 00:28:32,360 First as usual we check the Windows version and then we make sure that it is fully updated and that we have no missing updates as you can see. 277 00:28:34,080 --> 00:28:39,540 We'll then launch SK tool again but this time we're interested to see what is the current state of the hypervisor. 278 00:28:39,720 --> 00:28:45,100 You can see the Microsoft hypervisor was detected and the current version is 22621 which is the base version. 279 00:28:45,460 --> 00:28:47,640 You can also see the VBS runs as usual. 280 00:28:47,720 --> 00:28:53,640 We'll then use Windows downdate with a config file that will say downgrade the hypervisor to a 2 years old hypervisor. 281 00:28:53,840 --> 00:28:56,420 The attack was succeeded, you can see the update files. 282 00:28:56,580 --> 00:28:59,500 We now restore the machine in order for the update to take place. 283 00:29:01,720 --> 00:29:04,520 We fast forward, Windows is updating. 284 00:29:04,760 --> 00:29:08,100 What happens under the hood is that the hypervisor is being downgraded. 285 00:29:09,160 --> 00:29:13,640 We log back into the machine and let's see what is the current state of the hypervisor. 286 00:29:15,060 --> 00:29:24,620 Run SK tool again and we can see that the hypervisor is still detected but its version is 22000 which is a 2 year old version. 287 00:29:24,620 --> 00:29:28,360 You can also see what's interesting here is that VBS is running as usual. 288 00:29:28,360 --> 00:29:31,560 So credential guard everything is running with an old hypervisor. 289 00:29:31,560 --> 00:29:35,020 And if we check that we are fully up to date, you can see that we are. 290 00:29:38,090 --> 00:29:41,390 Okay so overall I found no downgrade mitigation. 291 00:29:41,390 --> 00:29:44,150 In any component of the virtualization stack. 292 00:29:44,150 --> 00:29:48,510 The entire stack was found to be vulnerable to downgrade attacks. 293 00:29:50,090 --> 00:29:57,210 Now let's talk about one last vulnerability that exposed all of the attack vectors to unprivileged attackers in certain scenarios. 294 00:29:58,190 --> 00:30:11,490 So it all started with this Windows dot all folder which I came across in some of my machines and looking at it and Googling it, I found that this is the old Windows operating system and it is saved for restoration purposes after a quality update is installed. 295 00:30:11,490 --> 00:30:16,550 So when you install a quality update, Windows dot all is saved uh Windows is saved to Windows dot all. 296 00:30:18,370 --> 00:30:31,310 Of course the first thing I did was to try to modify files inside Windows all but I noticed that access lists are copied from the old operating system and so it was impossible to temper files that could not be previously tempered with. 297 00:30:32,410 --> 00:30:37,030 The next thing I did was to try to check access to Windows dot all folder itself. 298 00:30:37,030 --> 00:30:42,050 And I found that as an unprivileged user I have full access to this folder. 299 00:30:42,890 --> 00:30:45,630 The exploitation strategy is straight forward. 300 00:30:45,630 --> 00:30:56,930 First renaming the original Windows dot all folder to any name and then creating an attacker controlled Windows all folder and the attacker controlled operating system will be used in case of update restoration. 301 00:30:57,190 --> 00:31:04,930 So then in a restoration scenario triggered by administrator, the attacker controlled operating system will be used instead of the backup operating system. 302 00:31:04,930 --> 00:31:10,610 So this is another way to perform the same downgrades from an unprivileged user in a restoration scenario. 303 00:31:12,290 --> 00:31:13,630 Closing remarks. 304 00:31:13,630 --> 00:31:17,810 Let's talk about the disclosure process, next steps and takeaways. 305 00:31:19,250 --> 00:31:25,290 Starting from the disclosure process, we notified Microsoft of our research findings in February 2024. 306 00:31:25,290 --> 00:31:32,830 Microsoft issued CV 2024-21302 and CV 2024-38202. 307 00:31:33,510 --> 00:31:41,110 This is Microsoft's official response to the research and I would like to thank Microsoft here for the great cooperation and effort on these cases. 308 00:31:42,950 --> 00:31:51,090 For those of you who want to further research the topic that we explored today, here are some of the topics that I would recommend looking at. 309 00:31:51,570 --> 00:31:55,110 First and foremost, the critical question still arises. 310 00:31:55,110 --> 00:31:59,090 Are there additional Windows features vulnerable to downgrade attacks? 311 00:31:59,110 --> 00:32:04,150 So far, both secure boot and the virtualization stack was found vulnerable. 312 00:32:04,350 --> 00:32:09,150 Do you have in mind additional critical features that you think are vulnerable to downgrades? 313 00:32:10,250 --> 00:32:15,490 Another interesting feature introduced not too long ago is Linux virtualization based security. 314 00:32:15,850 --> 00:32:18,490 And this is a game changer for Linux security. 315 00:32:18,490 --> 00:32:22,030 Would the same design issues exist in the Linux implementation? 316 00:32:23,250 --> 00:32:29,890 Lastly, are there any other operating systems such as Mac OS or Linux that may be vulnerable to downgrade attacks? 317 00:32:30,550 --> 00:32:35,550 May the implications on those operating systems be similar to the Windows implications? 318 00:32:37,510 --> 00:32:39,590 What are the takeaways for this talk? 319 00:32:39,590 --> 00:32:46,230 First, the cyber security industry should raise its awareness of OS downgrade attacks and the danger that they pose. 320 00:32:46,230 --> 00:32:55,650 I found no mitigation preventing the downgrade of critical operating system components suggesting the downgrade attacks were not the focal point barrier to my research. 321 00:32:55,730 --> 00:33:02,370 The significant implications made um made by downgrade attacks emphasize the danger that they pose. 322 00:33:02,370 --> 00:33:06,310 And while Windows is currently affected, could Mac OS or Linux be next? 323 00:33:06,310 --> 00:33:09,910 We need to address these questions before real attackers do. 324 00:33:11,150 --> 00:33:15,930 Second, design should always be reviewed and regarded as a relevant attack surface. 325 00:33:16,030 --> 00:33:26,090 The downgrade attack on the virtualization stack was possible due to a design flow that permits less privileged VTLs or rings to update components residing in more privileged VTLs or rings. 326 00:33:26,990 --> 00:33:44,030 Even though virtualization based security has become more popular and makes security researchers in recent years with some great research papers papers on the subject, this attack surface, the downgrade attack surface has existed since the very beginning of VBS when Microsoft first announced it in 2015. 327 00:33:44,210 --> 00:33:48,050 And this indicates that the design was probably not thoroughly examined. 328 00:33:49,390 --> 00:33:55,330 Third, in the wild attacks should be thoroughly examined and expanded upon whenever possible. 329 00:33:55,390 --> 00:34:01,930 With the Black Labus UEFI boot kit employing downgrade attacks, we realize that the concept of downgrade attacks was right under our noses. 330 00:34:02,070 --> 00:34:09,150 Although a year has passed, it seems that this time we were able to study and expand upon downgrade attacks before attackers did. 331 00:34:09,150 --> 00:34:14,010 So we exp- we expanded uh secure boots downgrade to virtualization stack downgrades. 332 00:34:15,410 --> 00:34:17,230 This is not always guaranteed. 333 00:34:17,230 --> 00:34:27,010 And this emphasizes the importance of studying in the wild attacks and always considering what other components or areas may also be affected by an in- an in the wild attack. 334 00:34:28,190 --> 00:34:34,190 Now before we wrap everything up, I would like to credit these talented people for their work. 335 00:34:37,440 --> 00:34:45,220 It was a pleasure for me to share with you my journey of researching downgrade attacks on Windows and their severe implications on Windows as platform security. 336 00:34:45,420 --> 00:34:51,360 Using the findings that I revealed today, you can bring back to life thousands of old and fixed vulnerabilities. 337 00:34:51,800 --> 00:34:57,700 Windows downdate essentially makes the term fully patched meaningless across any Windows machine worldwide. 338 00:34:58,420 --> 00:35:11,160 If you have any question- questions, please catch me in the wrap up room or here and also feel free to reach out on social media and with that, I would like to thank you all for joining me today and have a great rest of your day. 339 00:35:11,160 --> 00:35:12,000 Thank you. 340 00:35:14,940 --> 00:35:16,940 We'll- we'll- we'll go back to our questions.