WEBVTT

00:01.220 --> 00:02.120
Good?

00:03.260 --> 00:04.460
Alright.

00:04.480 --> 00:06.840
Hello everyone and welcome to my talk.

00:06.840 --> 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.

00:15.340 --> 00:19.140
My name is Alon and I'm a security researcher at SafeBridge.

00:19.240 --> 00:21.700
I'm 22 years old and mainly self-taught.

00:21.700 --> 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.

00:34.260 --> 00:36.360
This is what I will be talking about today.

00:36.360 --> 00:39.840
We have a lot of interesting topics to cover so let's jump right in.

00:40.940 --> 00:42.920
Starting with the research background.

00:43.440 --> 00:46.260
So first things first, what are downgrade attacks?

00:46.480 --> 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.

00:53.820 --> 01:00.380
And this act allows to expose past vulnerabilities in updated software and then exploit such vulnerabilities.

01:01.540 --> 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.

01:13.620 --> 01:17.420
But in fact, Black Lotus did not exploit a new zero level vulnerability.

01:17.420 --> 01:21.020
Instead it exploited an already known and patch vulnerability.

01:21.620 --> 01:25.020
And that was of course done by employing a downgrade attack.

01:26.440 --> 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.

01:33.460 --> 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.

01:40.540 --> 01:41.440
It is very simple.

01:41.440 --> 01:43.300
If you are not signed, you are not loaded.

01:43.440 --> 01:47.720
And so the days of floating a custom bootkit by replacing the boot manager are gone.

01:49.500 --> 01:55.500
Instead, what Black Lotus did was to downgrade the Windows boot manager to signed but vulnerable version of it.

01:55.560 --> 02:02.200
And this allowed to then exploit an old vulnerability sourced in the vulnerable boot manager to then bypass secure boot.

02:03.360 --> 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.

02:11.500 --> 02:14.980
And revoked images are of course not allowed to be loaded.

02:15.940 --> 02:18.720
But here comes the critical question.

02:18.720 --> 02:24.340
Are there any other components other than secure boot that may be vulnerable to downgrade attacks?

02:25.060 --> 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.

02:36.000 --> 02:41.480
Now I'm sure you're all familiar with bring your own vulnerable driver attacks targeting third party drivers.

02:41.480 --> 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.

02:49.180 --> 02:53.700
My vision was to create a new category of bring your own vulnerable Windows.

02:55.020 --> 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.

03:03.380 --> 03:08.460
So first the downgrade must be fully undetectable so that EDRs will not block the downgrade.

03:08.640 --> 03:12.440
Thus I aimed to perform the downgrade in the most legitimate way possible.

03:13.280 --> 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.

03:24.960 --> 03:30.480
Third, the downgrade must be persistent so that future software updates are not overriding the downgrade.

03:30.780 --> 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.

03:39.660 --> 03:44.020
Having the downgrade requirements defined I then looked for a suitable component.

03:44.060 --> 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?

03:53.600 --> 03:56.740
That would be of course Windows updates.

03:57.400 --> 04:02.840
So let's talk about Windows updates and see if they can be abused to perform downgrades.

04:05.440 --> 04:07.600
The Windows update architecture is as follows.

04:07.600 --> 04:11.960
We have an update client and an update server and they communicate over com.

04:11.960 --> 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.

04:20.300 --> 04:26.360
Administrator is usually forced on the client side and trusted installer is always enforced on the server side.

04:27.020 --> 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.

04:36.160 --> 04:42.380
So even administrators or anti-system cannot directly modify these system files.

04:44.160 --> 04:48.260
And this is where I found the first design problem in Windows updates.

04:48.260 --> 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.

04:56.940 --> 05:02.940
So the Windows update team attempted to secure the update process by enforcing trusted installer.

05:03.260 --> 05:09.700
However, since updates are only accessible to administrators, trusted installer is rendered completely ineffective.

05:10.260 --> 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.

05:23.480 --> 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.

05:32.820 --> 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.

05:40.700 --> 05:44.460
So let's take a look on a simplified flaw of the Windows update process.

05:44.720 --> 05:49.380
First, the client asks the server to perform an update given an update folder.

05:49.860 --> 05:52.480
The update folder is supplied by the client.

05:53.600 --> 05:57.500
Second, the server validates the integrity of the update folder.

05:58.280 --> 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.

06:08.960 --> 06:13.480
And so at that point the client cannot modify the finalized update files.

06:14.960 --> 06:21.400
Fourth, the server saves an action list to a server control folder as well, not accessible to the client.

06:21.400 --> 06:26.640
This action list is named pending.xml and it contains the update actions to perform.

06:26.640 --> 06:31.660
So for example it specifies the files to update, the source and destination files, et cetera.

06:32.940 --> 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.

06:44.840 --> 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.

06:56.020 --> 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.

07:05.940 --> 07:15.040
The update folder contains update components and each update component contain a manifest, mom, differential and catalog files.

07:16.520 --> 07:23.920
The mom files are Microsoft update metadata, they contain metadata information, so component dependencies, installation order, et cetera.

07:25.140 --> 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.

07:35.180 --> 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.

07:44.440 --> 07:50.940
And lastly we have the catalog files which are the digital signatures of the mom and manifest files.

07:51.180 --> 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.

07:58.960 --> 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.

08:07.200 --> 08:11.980
So we can't modify the catalogs and we can't modify the files that they protect, that they sign.

08:12.740 --> 08:16.820
To recap, only cat- only the catalog files are digitally signed.

08:16.820 --> 08:22.000
The manifest and mom files are not explicitly signed but they are signed in the catalog files.

08:22.000 --> 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.

08:31.760 --> 08:36.680
Is there any chance the differential files were left behind in terms of verification?

08:38.160 --> 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.

08:49.680 --> 08:53.340
Now at that point I decided to look at the action list.

08:53.340 --> 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.

09:08.820 --> 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.

09:16.940 --> 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.

09:24.440 --> 09:28.160
It holds the executable that parses the list and the list path.

09:28.420 --> 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.

09:37.520 --> 09:41.100
And this allowed me to control all of the update actions.

09:42.020 --> 09:44.620
This is how the action list looks like in practice.

09:44.620 --> 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.

09:56.280 --> 10:02.140
In order to downgrade we can use the hard link file action and the source will replace the destination.

10:05.820 --> 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.

10:15.340 --> 10:19.840
The identifier is a dynamic number which is compared with the action list identifier.

10:19.840 --> 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.

10:33.900 --> 10:39.300
Now the most important thing is that none of these 3 actions is trusted in solar enforced.

10:40.140 --> 10:44.600
And this allowed me to update the system with a custom downgrading action list.

10:44.640 --> 10:51.260
All of the integrity verifications are bypassed since the action list is assumed verified as it is created post verification.

10:51.820 --> 10:55.280
There is no need to perform the malicious trusted in solar elevation.

10:55.280 --> 11:01.340
Instead Windows updates does all of the work for me and this is a complete Windows update takeover.

11:02.540 --> 11:07.320
Now revisiting the downgrade principles of course the downgrade is fully undetectable.

11:07.320 --> 11:10.180
There is no better way to downgrade Windows.

11:11.440 --> 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.

11:19.520 --> 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.

11:28.160 --> 11:34.280
And as a result even after the downgrade when new updates are available they will be falsely installed.

11:35.400 --> 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.

11:42.960 --> 11:46.740
And the patched version will no longer detect any corruptions.

11:47.880 --> 11:51.540
With that let's see the first demo of the day.

11:51.560 --> 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.

12:00.540 --> 12:06.300
And then we'll see how the same kernel driver is exploited to achieve kernel code execution.

12:07.740 --> 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.

12:14.860 --> 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.

12:22.100 --> 12:23.460
Is it fully up to date?

12:23.460 --> 12:28.880
You can see that the current version is 3672 which is patched to the vulnerability that I want to exploit.

12:28.880 --> 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.

12:39.740 --> 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.

12:47.360 --> 12:48.940
You can see that that patch succeeded.

12:48.940 --> 12:52.800
We now need to restore the machine in order for the update to take place.

12:54.320 --> 12:57.960
You can see um we we fast forward a bit, we'll log back into the machine.

12:57.960 --> 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.

13:03.980 --> 13:05.160
Was it updated?

13:08.110 --> 13:10.550
And you can see that the current version is the base version.

13:10.550 --> 13:14.610
Although the system was updated, what actually happened is that it downgraded.

13:14.730 --> 13:16.350
We can see that we are not currently system.

13:16.350 --> 13:23.150
If we try to exploit a vulnerability again, we get a process ID and then we execute the exploit again.

13:23.770 --> 13:27.370
You can see that it succeeded and we are now anti-authority system.

13:29.210 --> 13:30.410
Thank you.

13:31.730 --> 13:32.910
Thank you.

13:33.070 --> 13:35.070
We're just getting started guys.

13:36.130 --> 13:39.330
If we check for updates you can see that we are fully up to date.

13:41.790 --> 13:43.930
So what did we achieve so far?

13:43.990 --> 13:48.230
We gained a perfect downgrade ability and we gained kernel code execution.

13:48.450 --> 13:53.010
Our starting point was administrator so that was an administrator to kernel elevation.

13:53.170 --> 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.

14:04.810 --> 14:09.350
Although it is not a boundary, admin to kernel is still a threat and a serious one.

14:09.350 --> 14:16.850
Because nowadays lots of users are still running as administrators and running as administrator is also the default on Windows.

14:17.250 --> 14:23.630
And as a result, many users could easily compromise the kernel and this is an issue that Microsoft aimed to solve.

14:25.130 --> 14:31.130
Microsoft's solution was to deprivilege the kernel to make kernel access less valuable than it previously was.

14:31.230 --> 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.

14:41.370 --> 14:47.610
VBS is a secure and isolated virtual environment powered by the IPV hypervisor for isolation.

14:49.030 --> 14:56.670
And again the reason that VBS was introduced is because the kernel is assumed compromised and can no longer be trusted.

14:56.670 --> 15:02.950
There was a need for a secure place to implement critical security features and store secret keys.

15:04.630 --> 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.

15:15.070 --> 15:20.530
And now that I've praised VBS so much, you may wonder how all of this works in practice.

15:21.910 --> 15:25.530
So before VBS, this is how Windows architecture looked like.

15:25.530 --> 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.

15:34.450 --> 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.

15:43.830 --> 15:46.950
So simply put, VTLs are like virtual machines.

15:46.950 --> 15:51.670
Lower VTLs should not be able to access memory or compromise higher VTLs.

15:52.150 --> 15:55.590
Currently in Windows, only two VTLs exist.

15:55.810 --> 16:00.490
VTL zero known as normal mode and VTL one known as secure mode.

16:01.710 --> 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.

16:10.830 --> 16:15.710
And everything that is implemented in the secure mode should not be compromised from normal mode.

16:15.710 --> 16:18.090
Even if we talk about normal mode's kernel.

16:20.800 --> 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.

16:30.400 --> 16:33.600
I wondered if VBS features could be easily turned off.

16:33.680 --> 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.

16:44.520 --> 16:50.740
The way that VBS protects such disablements is by implementing a feature called a UEFI lock.

16:51.800 --> 16:56.600
The UEFI lock is a UEFI boot service variable that holds the VBS configuration.

16:56.780 --> 17:02.700
So if VBS is configured with a lock, the lock is a source of configuration instead of the Windows registry.

17:03.540 --> 17:07.180
Then changing the registry configuration will have no effect.

17:07.180 --> 17:09.760
The UEFI variable is a source of truth.

17:10.080 --> 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.

17:18.360 --> 17:21.300
So this is a very simple and reliable protection.

17:23.360 --> 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.

17:32.760 --> 17:38.160
And this UEFI would then ask the user during boot to physically approve the disablement.

17:38.160 --> 17:41.520
And only if the user approves, VBS is disabled.

17:42.120 --> 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.

17:51.040 --> 17:56.400
And the only signed code that touches the configuration, the variable, requires physical access.

17:56.620 --> 18:02.880
So without physical access to the target machine, it should not be possible to disable VBS.

18:04.360 --> 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.

18:14.940 --> 18:19.920
For example, files that are not digitally signed, attacker controlled files.

18:20.380 --> 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.

18:30.660 --> 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.

18:41.420 --> 18:46.920
I repeat, if the OS loader fails to validate one of VBS's files, it just boots normally.

18:47.460 --> 18:51.760
And this can be used to disable VBS by passing the UE file lock.

18:51.760 --> 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.

18:57.600 --> 19:03.400
All we need to do is to replace the secure kernel, the hypervisor of any VBS's files with invalid files.

19:03.400 --> 19:04.480
Very simple.

19:05.340 --> 19:10.460
So now it's time for another demo of chaining all the capabilities gained so far together.

19:10.640 --> 19:15.260
In this demo I will show credential extraction against the most restrictive settings.

19:16.020 --> 19:22.020
Those settings will be PPL enabled for LSS with UE file lock protecting LSS dumps.

19:23.040 --> 19:29.740
Credential guard will be enabled with UE file lock protecting secrets in VTL1 and Windows Defender will be up and running.

19:30.180 --> 19:35.560
The way that all of these will be bypassed is by first reverting the PPL full patch to allow PPL bypass.

19:35.660 --> 19:38.940
Second, disabling credential guard by passing the UE file locks.

19:38.940 --> 19:44.940
And third, turning Windows Defender on functional by invalidating the main Defender executable MSMP engine.

19:46.000 --> 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.

19:52.580 --> 19:56.300
So if only credential guard is bypassed, LSS cannot be dumped.

19:56.920 --> 20:01.060
And if only PPL is bypassed, credentials are encrypted and not usable.

20:01.060 --> 20:05.960
So this is what you will see if you try to dump credentials on a system with credential guard on.

20:06.380 --> 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.

20:15.940 --> 20:20.880
So first we check the Windows version and then we'll make sure that we are fully up to date.

20:20.880 --> 20:23.080
Which you can see we have no missing updates.

20:24.600 --> 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.

20:30.900 --> 20:34.920
You can see that the uh, the VBS is protected with UE file lock.

20:34.920 --> 20:38.080
It's locked in UE file and credential guard and key guard are currently running.

20:39.220 --> 20:42.920
We then use system informer to see what is the current state of LSS.

20:43.640 --> 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.

20:48.420 --> 20:51.440
We try to copy malicious files outside of the excluded directory.

20:51.440 --> 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.

20:57.840 --> 21:00.160
Now it's time to execute the attack.

21:01.640 --> 21:03.660
We will use Windows downdate.

21:03.660 --> 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.

21:18.980 --> 21:21.000
You can see that the attack was successful.

21:21.000 --> 21:22.280
We finished the attack.

21:22.280 --> 21:26.640
These are the files that were updated and all we need to do is restore the machine.

21:27.080 --> 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.

21:34.740 --> 21:37.340
We fast forward, we log back into the machine.

21:37.900 --> 21:41.640
Now let's launch SK tool again to see what is the current state of VBS.

21:45.030 --> 21:50.150
Now you will see that the secure kernel is not currently running, credential guard is not currently running as well.

21:50.150 --> 21:54.430
So the UE file has been bypassed and credential guard is no longer protecting credentials.

21:54.750 --> 21:58.750
We'll then launch uh system informer and we will see what is the current state of others.

21:58.750 --> 22:00.310
You can see it runs as PPL.

22:00.310 --> 22:01.730
So we'll need to bypass it.

22:01.770 --> 22:04.190
And now let's check what is the state of Windows Defender.

22:04.830 --> 22:07.710
We'll copy malicious files outside of the excluded directory.

22:08.830 --> 22:10.730
And you can see that it worked successfully.

22:10.730 --> 22:12.610
So we defeated Windows Defender as well.

22:12.650 --> 22:16.050
We'll launch CMD again and now it's time to bypass PPL.

22:17.230 --> 22:23.410
We'll change directory, we'll get the process ID of others and then we'll try to execute PPL fault.

22:23.410 --> 22:29.350
And remember PPL fault should have been patched in the system and it is seemingly patched in the system.

22:29.810 --> 22:32.450
We'll execute the attack and let's see what happens.

22:35.240 --> 22:37.200
So PPL fault was successful.

22:37.200 --> 22:39.680
The dump file was created on the desktop as you can see.

22:39.680 --> 22:45.740
We'll now use Mimikatz to parse the dump file and extract credentials that should have been protected by credential guard.

22:45.820 --> 22:48.780
We'll load the dump file and extract credentials.

22:49.420 --> 22:55.540
You can see credentials are extracted and this credential should have been protected by credential guard.

22:56.360 --> 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.

23:04.500 --> 23:08.940
And you can see that we are fully up to date.

23:10.020 --> 23:11.380
Thank you.

23:12.180 --> 23:13.360
Thank you.

23:17.100 --> 23:21.540
Okay so we bypassed the UE file locks and defeated VBS.

23:21.540 --> 23:25.020
But now it's time to talk about real security boundaries.

23:25.240 --> 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.

23:34.080 --> 23:37.640
No VTL 0 code should be able to compromise VTL 1 code.

23:37.660 --> 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.

23:47.400 --> 23:51.760
So user mode or kernel 2 hypervisor is considered an elevation of privilege.

23:51.840 --> 23:58.900
And due to the way that VBS is implemented, compromising the hypervisor gives complete control over all of the VTLs.

24:00.340 --> 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.

24:10.000 --> 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.

24:17.740 --> 24:24.780
And that is because when new vulnerabilities will get patched in the target component it will make the exploitation much easier.

24:24.780 --> 24:29.500
So even if not immediately exploitable it is truly something that needs to get fixed.

24:31.500 --> 24:35.420
Firstly I targeted secure modes isolated user mode processes.

24:35.420 --> 24:39.340
And the most known isolated user mode process is credential guard.

24:39.340 --> 24:41.740
So I decided to target it first.

24:42.600 --> 24:49.300
Credential guard is implemented as an isolated user mode process named LSAISO which stands for LSA isolated.

24:49.480 --> 24:56.620
With credential guard running, secrets are stored in LSAISO in VTL1 instead of in the original LSAISO process.

24:56.620 --> 25:00.240
And this is why dumping LSAISO with credential guard is no longer valuable.

25:00.240 --> 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.

25:13.980 --> 25:23.160
I decided to target a downgrade with CV202234709 which is a fixed elevation of privilege in credential guard.

25:23.160 --> 25:28.240
I found both the vulnerable module which is Kerpli insured and the vulnerable version.

25:28.860 --> 25:34.160
Downgrading the vulnerable module using the Windows update decoverer worked well on a fully patched machine.

25:34.160 --> 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.

25:43.120 --> 25:46.880
There was no downgrade detection on VTL1 isolated user mode.

25:47.860 --> 25:52.940
Now isolated user mode privileges are great but I wanted to gain even higher privileges.

25:52.940 --> 25:58.520
So I then moved on to target secure mode's kernel which is more privileged than isolated user mode.

25:59.500 --> 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.

26:09.860 --> 26:17.980
I decided to target this downgrade with CV202127090 which is a fixed elevation of privilege in secure kernel.

26:18.360 --> 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.

26:25.160 --> 26:26.680
It wasn't enough for me.

26:27.180 --> 26:33.500
I've had to downgrade dependency modules as well and only then it worked on a fully patched machine.

26:33.500 --> 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.

26:46.260 --> 26:50.920
There was no downgrade detection on the secure kernel and the secure mode either.

26:52.860 --> 26:56.900
Now secure kernel privileges are great but I wanted to gain even higher privileges.

26:56.900 --> 27:03.080
So I then moved on to target the most privileged entity of VBS which is the Hyper-V hypervisor.

27:04.280 --> 27:10.860
The hypervisor is HVIX on Intel systems and HVAX on AMD systems.

27:11.160 --> 27:17.100
The hypervisor is a standalone microkernel which makes it a valuable target for downgrades.

27:18.460 --> 27:23.240
With the hypervisor though it was more challenging to target a specific vulnerability.

27:23.500 --> 27:30.160
And that is because many vulnerabilities titled Hyper-V Elevation of Privileges were fixed over the last 2 years.

27:30.400 --> 27:32.840
But Hyper-V is a very large component.

27:32.840 --> 27:38.760
And in CV descriptions Microsoft do not share which component in the Hyper-V stack is the vulnerable one.

27:39.840 --> 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.

27:49.960 --> 27:53.680
And so I decided to go 2 years backward to prove the vulnerability.

27:53.680 --> 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.

28:03.020 --> 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.

28:15.260 --> 28:20.060
And this rendered the entire visualization stack vulnerable to downgrade attacks.

28:21.220 --> 28:23.860
So let's see a demo of the hypervisor downgrade.

28:24.700 --> 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.

28:34.080 --> 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.

28:39.720 --> 28:45.100
You can see the Microsoft hypervisor was detected and the current version is 22621 which is the base version.

28:45.460 --> 28:47.640
You can also see the VBS runs as usual.

28:47.720 --> 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.

28:53.840 --> 28:56.420
The attack was succeeded, you can see the update files.

28:56.580 --> 28:59.500
We now restore the machine in order for the update to take place.

29:01.720 --> 29:04.520
We fast forward, Windows is updating.

29:04.760 --> 29:08.100
What happens under the hood is that the hypervisor is being downgraded.

29:09.160 --> 29:13.640
We log back into the machine and let's see what is the current state of the hypervisor.

29:15.060 --> 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.

29:24.620 --> 29:28.360
You can also see what's interesting here is that VBS is running as usual.

29:28.360 --> 29:31.560
So credential guard everything is running with an old hypervisor.

29:31.560 --> 29:35.020
And if we check that we are fully up to date, you can see that we are.

29:38.090 --> 29:41.390
Okay so overall I found no downgrade mitigation.

29:41.390 --> 29:44.150
In any component of the virtualization stack.

29:44.150 --> 29:48.510
The entire stack was found to be vulnerable to downgrade attacks.

29:50.090 --> 29:57.210
Now let's talk about one last vulnerability that exposed all of the attack vectors to unprivileged attackers in certain scenarios.

29:58.190 --> 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.

30:11.490 --> 30:16.550
So when you install a quality update, Windows dot all is saved uh Windows is saved to Windows dot all.

30:18.370 --> 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.

30:32.410 --> 30:37.030
The next thing I did was to try to check access to Windows dot all folder itself.

30:37.030 --> 30:42.050
And I found that as an unprivileged user I have full access to this folder.

30:42.890 --> 30:45.630
The exploitation strategy is straight forward.

30:45.630 --> 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.

30:57.190 --> 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.

31:04.930 --> 31:10.610
So this is another way to perform the same downgrades from an unprivileged user in a restoration scenario.

31:12.290 --> 31:13.630
Closing remarks.

31:13.630 --> 31:17.810
Let's talk about the disclosure process, next steps and takeaways.

31:19.250 --> 31:25.290
Starting from the disclosure process, we notified Microsoft of our research findings in February 2024.

31:25.290 --> 31:32.830
Microsoft issued CV 2024-21302 and CV 2024-38202.

31:33.510 --> 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.

31:42.950 --> 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.

31:51.570 --> 31:55.110
First and foremost, the critical question still arises.

31:55.110 --> 31:59.090
Are there additional Windows features vulnerable to downgrade attacks?

31:59.110 --> 32:04.150
So far, both secure boot and the virtualization stack was found vulnerable.

32:04.350 --> 32:09.150
Do you have in mind additional critical features that you think are vulnerable to downgrades?

32:10.250 --> 32:15.490
Another interesting feature introduced not too long ago is Linux virtualization based security.

32:15.850 --> 32:18.490
And this is a game changer for Linux security.

32:18.490 --> 32:22.030
Would the same design issues exist in the Linux implementation?

32:23.250 --> 32:29.890
Lastly, are there any other operating systems such as Mac OS or Linux that may be vulnerable to downgrade attacks?

32:30.550 --> 32:35.550
May the implications on those operating systems be similar to the Windows implications?

32:37.510 --> 32:39.590
What are the takeaways for this talk?

32:39.590 --> 32:46.230
First, the cyber security industry should raise its awareness of OS downgrade attacks and the danger that they pose.

32:46.230 --> 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.

32:55.730 --> 33:02.370
The significant implications made um made by downgrade attacks emphasize the danger that they pose.

33:02.370 --> 33:06.310
And while Windows is currently affected, could Mac OS or Linux be next?

33:06.310 --> 33:09.910
We need to address these questions before real attackers do.

33:11.150 --> 33:15.930
Second, design should always be reviewed and regarded as a relevant attack surface.

33:16.030 --> 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.

33:26.990 --> 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.

33:44.210 --> 33:48.050
And this indicates that the design was probably not thoroughly examined.

33:49.390 --> 33:55.330
Third, in the wild attacks should be thoroughly examined and expanded upon whenever possible.

33:55.390 --> 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.

34:02.070 --> 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.

34:09.150 --> 34:14.010
So we exp- we expanded uh secure boots downgrade to virtualization stack downgrades.

34:15.410 --> 34:17.230
This is not always guaranteed.

34:17.230 --> 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.

34:28.190 --> 34:34.190
Now before we wrap everything up, I would like to credit these talented people for their work.

34:37.440 --> 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.

34:45.420 --> 34:51.360
Using the findings that I revealed today, you can bring back to life thousands of old and fixed vulnerabilities.

34:51.800 --> 34:57.700
Windows downdate essentially makes the term fully patched meaningless across any Windows machine worldwide.

34:58.420 --> 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.

35:11.160 --> 35:12.000
Thank you.

35:14.940 --> 35:16.940
We'll- we'll- we'll go back to our questions.

