WEBVTT

00:00.000 --> 00:01.680
Okay, so hello everyone.

00:01.680 --> 00:02.800
Thank you for joining us today.

00:02.800 --> 00:07.600
Welcome to our talk, Bit Unlocker Leveraging Windows Recovery to Extract BitLocker Secrets.

00:13.880 --> 00:15.220
Can you hear me?

00:15.400 --> 00:16.400
Let's go.

00:17.240 --> 00:20.820
Today we'll take you inside our journey of attacking and securing BitLocker.

00:20.820 --> 00:29.160
We show you how we found and exploited and fixed new vulnerabilities in the Windows recovery environment that allowed extracting all the BitLocker protected secrets.

00:29.400 --> 00:31.960
But just before we dive in, a quick introduction.

00:32.820 --> 00:35.920
So my name is Alon and here with me on stage is Nathaniel.

00:35.920 --> 00:42.240
We're both security researchers working with a security testing and offensive research team at Microsoft, also known as STORM.

00:42.360 --> 00:50.400
Our expertise is in vulnerability research focused on everything that happens before the operating system fully loads, covering the various boot stages and its security features.

00:50.400 --> 00:52.960
So a secure boot, BitLocker and others.

00:52.980 --> 00:55.860
But enough about us and let's dive into our agenda.

00:57.400 --> 01:01.480
So we'll start with the research background and give an overview of BitLocker and WinRE.

01:01.620 --> 01:05.600
Then we'll dive into the vulnerabilities that we discovered, how we exploited them.

01:05.600 --> 01:12.100
And finally we'll wrap up with the research results, the fixes and actionable BitLocker countermeasures that you can apply today.

01:13.420 --> 01:15.680
So starting with the research background.

01:16.600 --> 01:21.400
Today we'll explore a security feature that is designed to protect your sensitive data at rest.

01:21.400 --> 01:30.300
It aims to defend against theft scenarios where an attacker steals your laptop, aiming to extract your sensitive information, compromise your machine and even backdoor it.

01:30.480 --> 01:37.940
You're here at DEF CON surrounded by some of the brightest minds in cyber security and let's be honest, some of the juiciest targets for hackers.

01:38.900 --> 01:44.100
Now picture this, you step away for a quick coffee break and when you come back your laptop is gone.

01:44.100 --> 01:49.360
Stolen by a thief that is after your research, internal tools, credentials and personal data.

01:50.200 --> 02:01.220
Without data at rest protection, the thief can directly access the contents of the hard disk, extract sensitive data and even modify system files to install a backdoor, then even return the computer without detection.

02:01.920 --> 02:09.880
Data at rest protection ensures that even if your laptop is stolen, your data remains encrypted and inaccessible and your system remains untampered.

02:11.680 --> 02:18.720
Now I know what you're thinking, the odds of your device getting stolen are so low that you're probably wondering if you should even bother worrying.

02:19.020 --> 02:20.420
So consider this.

02:20.860 --> 02:24.200
Studies show that the laptop is stolen every 53 seconds.

02:24.520 --> 02:30.640
The odds of a laptop being stolen are 1 in 10 and the average cost of a stolen laptop around $49,000.

02:31.020 --> 02:40.120
This figure reflects replacement costs, productivity loss, legal expenses but most importantly, the loss of sensitive data and intellectual property.

02:40.360 --> 02:49.880
These numbers emphasize the criticality of data at rest protection features and with that, let's dive into our journey of attacking and securing BitLocker which is Windows' data at rest protection feature.

02:51.220 --> 02:57.160
So BitLocker is a full volume encryption technology that is designed to protect individual disk volumes.

02:57.260 --> 03:01.340
Once enabled, it encrypts the target disk volume protecting all data stored in it.

03:01.600 --> 03:13.560
Users have the flexibility to choose which volumes to encrypt based on their specific needs and by default, BitLocker targets the OS volume ensuring that all data stored within the OS environment is protected and encrypted.

03:13.760 --> 03:20.680
So with BitLocker encryption in place, even if your laptop is stolen, the protected data remains unreadable because it's encrypted.

03:22.860 --> 03:34.020
Now the BitLocker threat model assumes an attacker similar to a common thief which means someone with full physical access to the device but without advanced credentials such as user names or passwords.

03:35.500 --> 03:42.100
Not only the BitLocker attack surfaces are shaped by the interfaces accessible to an attacker fitting within this threat model.

03:42.720 --> 03:48.400
And as we examined the different attack surfaces and interfaces, a surface, one surface stood out.

03:48.400 --> 03:54.540
A surface with significant vulnerability potential that surprisingly has received very little attention in period research.

03:54.840 --> 03:58.560
This surface is the Windows recovery environment also known as WinRE.

03:59.500 --> 04:08.620
Any BitLocker attacker can directly boot into WinRE by holding the shift key while selecting restart from logon UI rendering it a potential candidate for deeper inspection.

04:09.940 --> 04:26.740
Given WinRE's fit within the BitLocker threat model , the lack of period research and its high vulnerability potential, we decided to conduct a security review that is dedicated towards finding new vulnerabilities, exploiting them, fixing them and then hardening WinRE while reducing its exposed attack surfaces.

04:26.840 --> 04:32.460
The end goal of our review was to make both WinRE and BitLocker more secure and resilient.

04:34.040 --> 04:42.300
So let's take a closer look at WinRE, what it is, how it functions and which areas present the most promising opportunities for vulnerability research.

04:44.140 --> 04:53.860
So WinRE is Windows' recovery platform and it's designed to address critical system issues such as startup failures, persistent crashes, BitLocker errors and more.

04:54.280 --> 05:03.060
For instance, if your machine crashes, WinRE is the component responsible for analyzing the crash, identifying corruptions and resolving it by using its recovery tools.

05:03.260 --> 05:08.460
Now if you use Windows, the chances are that you have encountered WinRE at least a few times in your lifetime.

05:10.400 --> 05:16.180
Architecturally, WinRE operates with its own standalone operating system known as the recovery OS.

05:16.400 --> 05:21.460
This recovery OS is a lean version of Windows with recovery specific customizations.

05:23.140 --> 05:29.500
These customizations include a unique set of recovery tools that are all integrated to the known blue screen recovery UI.

05:29.500 --> 05:36.140
Among the exposed tools are familiar options such as startup repair, system reset, system restore and others.

05:37.260 --> 05:49.400
For storage, this entire recovery OS including all of the DLLs, executables, drivers, they're all compressed into a single WIM file named WinRE.WIM and this WIM file is then stored on disk.

05:50.940 --> 06:01.140
Then when WinRE boots up, the entire WIM is decompressed from disk into RAM creating a temporary RAM disk that hosts the entire recovery OS run time.

06:01.340 --> 06:10.760
Any changes made within this environment within the RAM disk are not saved back to the original WinRE WIM file making the recovery OS inherently volatile.

06:11.180 --> 06:14.580
So modifications to the RAM disk are discarded upon reboot.

06:17.140 --> 06:22.920
Now when BitLocker was first introduced, WinRE had to evolve to support recovery from BitLocker related failures.

06:22.920 --> 06:27.860
And this led to several architectural and design level changes to enable that recovery functionality.

06:28.060 --> 06:32.220
We wondered what impact these changes had so let's take a closer look at them.

06:33.640 --> 06:37.400
The first design change focused on the location of WinRE WIM.

06:37.800 --> 06:44.480
It was moved from residing in the OS volume which is now encrypted by BitLocker to a dedicated recovery volume which is not encrypted.

06:44.760 --> 06:50.680
This change was necessary because WinRE must be able to recover from BitLocker related failures.

06:50.680 --> 07:00.600
And if the OS volume is encrypted by BitLocker and becomes inaccessible for example because of a decryption failure, storing WinRE in that location would prevent future recovery.

07:01.440 --> 07:10.700
Since WinRE is a critical component that must always be available, it was moved to a separate recovery volume and this ensures that it can function even if the OS volume is not accessible.

07:11.760 --> 07:16.640
The second design change focused on the integrity of the WinRE WIM file itself.

07:16.640 --> 07:21.920
So to support integrity validation of WinRE, a feature called trusted WIM boot was introduced.

07:22.040 --> 07:28.180
It verifies the integrity of WinRE WIM by comparing its hash to a known trusted hash.

07:28.180 --> 07:30.060
So a simple hash comparison here.

07:30.060 --> 07:36.840
If the hashes match, the OS volume is automatically unlocked and if the hashes don't match, the OS remains locked.

07:38.740 --> 07:44.860
Now these two states, auto-unlocked and locked, define the level of access that WinRE has to the main OS.

07:44.860 --> 07:48.020
So in the auto-unlocked state, WinRE has full access to the OS.

07:48.020 --> 07:51.120
It can perform recovery operations without any user intervention.

07:51.160 --> 07:55.480
While in the locked state, WinRE has no access at all to the encrypted OS volume.

07:56.140 --> 08:02.760
Now this change was necessary because WinRE now resides on an unprotected recovery volume and it can no longer be blindly trusted, right?

08:02.760 --> 08:07.020
Because physical users can mount this recovery volume, change WinRE WIM and boot.

08:07.020 --> 08:08.760
And we want to prevent it of course.

08:08.920 --> 08:15.320
So with trusted WIM boot, any unauthorized modification to the WIM file breaks its trust effectively blocking any tampering.

08:16.900 --> 08:22.660
The third design change and the last one focused on limiting recovery tools that are inherently risky to BitLocker.

08:22.660 --> 08:26.720
So for example, among the exposed recovery tools is the command prompt.

08:27.000 --> 08:34.360
To prevent a scenario where an attacker abuses a command prompt to access the BitLocker protected data, a volume re-lock functionality was added into WinRE.

08:34.540 --> 08:40.900
This functionality is triggered every time that a risky recovery tool is selected and it basically re-locks the OS volume.

08:41.600 --> 08:46.420
Then to regain access to the OS, the user must manually insert the BitLocker recovery key.

08:46.680 --> 08:49.340
Otherwise all contents remain completely inaccessible.

08:51.000 --> 08:53.020
So this is how it looks like in practice.

08:53.020 --> 08:57.500
If an attacker launches the command prompt, WinRE WIM is trusted, auto-unlock occurred.

08:57.500 --> 09:04.960
But if it launches the command prompt without inserting the recovery key, access to the BitLocker encrypted volume will be denied resulting in the following lock error.

09:07.630 --> 09:20.550
So to summarize the impact of the design changes, as long as WinRE WIM is trusted and no risky recovery tools are triggered, the OS volume is unlocked allowing WinRE to recover it automatically without user intervention.

09:20.850 --> 09:31.750
In contrast, if WinRE WIM is modified without authorization by a physical attacker for example, or if a risky recovery tool is triggered, the OS volume is re-locked preventing WinRE from accessing it.

09:32.750 --> 09:39.110
So now the critical question arises, any attack surface is exposed because of these design adjustments?

09:39.810 --> 09:50.910
So as it turned out, the auto-unlock state, during the auto-unlock state, WinRE parses files from unprotected volumes, specifically the EFI volume and the recovery volume.

09:51.230 --> 09:57.550
This parsing presents a very interesting attack surface which wasn't valuable to explore before BitLocker's introduction.

09:58.290 --> 10:01.450
Because before BitLocker there was no security boundary here.

10:01.710 --> 10:08.830
So even with full code execution within WinRE and if a physical attacker didn't grab any new capabilities, but this is no longer the case.

10:08.830 --> 10:16.430
With BitLocker, any code execution within WinRE in the auto-unlock state can be utilized to bypass BitLocker and extract all the protected secrets.

10:16.930 --> 10:26.550
So we decided to take a look at this parsing of WinRE during auto-unlock and to see if we can attack the parsers, maybe find memory corruptions or logical vulnerabilities and potentially bypass BitLocker.

10:27.550 --> 10:34.230
So we decided to dig deeper into these files and their parsing and specifically the files that we will be focusing on today.

10:34.410 --> 10:43.570
Or the RA agent XML and boot SDI files residing in the recovery volume and the boot configuration data store, the BCD store, residing in the EFI volume.

10:44.790 --> 10:51.270
So without further ado, I'm going to pass it on to Nathaniel who will walk us through the research process of the parsed external files.

10:57.060 --> 10:58.280
Thank you.

10:59.980 --> 11:02.600
So let's begin with the boot SDI file.

11:03.500 --> 11:10.440
The SDI stands for system deployment image format and it is optionally used for booting from virtual disk into RAM disk.

11:10.440 --> 11:17.480
This format consists of multiple binary blobs with certain blobs being essential for the RAM disk boot process.

11:18.660 --> 11:25.680
Below you can see the layout of RAM disk in memory which contains the OS disk image and more.

11:25.760 --> 11:31.860
When an SDI file is specified, it gets prepended to the virtual disk within the allocated RAM disk memory region.

11:33.460 --> 11:37.160
In our scenario, we are trying to boot Windows recovery from a WIM file.

11:37.320 --> 11:42.320
The boot SDI will contain a WIM blob which contain an offset to the appended trusted WIM.

11:43.120 --> 11:47.840
Additionally, the boot SDI must contain an empty NTFS volume.

11:49.160 --> 11:58.000
This empty volume enables the in-memory WIM to be presented as NTFS volume, ensuring compatibility with other Windows components.

11:58.860 --> 12:01.940
Now let's briefly examine a pseudocode that demonstrates this process.

12:02.360 --> 12:07.740
The code retrieves the sizes of both the SDI and the WIM files, then allocates buffer large enough for both.

12:08.880 --> 12:13.380
Next, the SDI data is copied to the beginning of the RAM disk image buffer.

12:14.320 --> 12:18.440
Then the WIM data is loaded and positioned immediately after the SDI data.

12:18.660 --> 12:22.760
During this process, the loading API computes the WIM hash for validation.

12:23.360 --> 12:28.060
If the hash validation fails, the main OS volume gets re-locked.

12:29.040 --> 12:35.720
Finally, the WIM address is determined by adding the WIM offset stored in the SDI to the RAM disk buffer address.

12:35.900 --> 12:45.020
Notably, there is no verification linking between the WIM being used to the one that was hashed earlier, allowing the offset to be set arbitrarily.

12:45.200 --> 12:47.920
With that in mind, let's dive into our first vulnerability.

12:49.960 --> 12:54.580
We know that WinRE WIM must pass hash validation when loaded immediately after the SDI.

12:54.760 --> 12:58.440
However, the boot SDI itself undergoes no validation whatsoever.

12:58.620 --> 13:08.320
And since we can manipulate the WIM offset to point to an arbitrary location, we could append an untrusted WIM to the SDI and adjust the offset to point to it.

13:08.480 --> 13:13.840
The hash validation for the trusted WIM will succeed, but the untrusted WIM will be executed in its place.

13:14.060 --> 13:19.800
This allows us to load and execute any WIM we choose while keeping the main OS volume still unlocked.

13:20.100 --> 13:22.100
Now let's see a demo for the first vulnerability.

13:23.800 --> 13:26.820
Here is a locked machine which we don't have the password for it.

13:27.600 --> 13:30.960
We press on shift restart to reboot into WinRE.

13:32.360 --> 13:35.900
Once we are in WinRE, we will execute the exploit we prepared beforehand.

13:35.940 --> 13:40.320
Now during boot, the main OS volume gets automatically unlocked by BitLocker.

13:42.360 --> 13:46.600
We reach WinRE UI actions, we select troubleshoot, then we select advanced options.

13:47.740 --> 13:49.100
Then we select command prompt.

13:49.100 --> 13:51.340
Now the main OS volume got relocked.

13:51.360 --> 13:53.820
We don't have the key, so we skip this drive.

13:55.320 --> 13:57.960
Now if we try to access C drive, we can't access it.

13:57.960 --> 13:59.760
It's locked by BitLocker.

14:00.060 --> 14:04.200
If we check the BitLocker status, you can see it is locked.

14:05.560 --> 14:10.420
So we change path to the D drive which is the recovery volume, the unprotected volume.

14:10.740 --> 14:13.400
We execute the exploit we prepared beforehand.

14:14.260 --> 14:19.720
It adds the custom WIM to the boot SDI and then adjusts the offset to it.

14:20.100 --> 14:23.840
And once the exploit completed, reboot the machine back to WinRE.

14:27.240 --> 14:34.140
Now instead of the WinRE UI actions you've seen before, we expect our custom WIM to be loaded and we set it to launch CMD.

14:34.340 --> 14:35.660
So here is the CMD.

14:35.780 --> 14:37.820
We can change path to C drive.

14:37.840 --> 14:42.900
If we check now the BitLocker status, you can see it says unlocked.

14:43.120 --> 14:48.320
And if we list all the files under the C drive, here are the secrets.

14:56.210 --> 14:57.090
Thanks.

15:04.200 --> 15:09.000
After we completed our review for the boot SDI, we shifted our attention to the ARIA agent XML.

15:10.920 --> 15:16.780
The ARIA agent XML file contains the current recovery state and other configuration settings for WinRE.

15:16.780 --> 15:21.720
Upon WinRE startup, it immediately consumes and parses this XML file.

15:22.700 --> 15:31.120
When WinRE state is configured to execute a scheduled operation, it will run the designated recovery operation such as startup repair or other tasks.

15:31.280 --> 15:35.060
All of this occurs prior to reaching the UI actions you've seen before.

15:35.820 --> 15:43.600
Today, we will talk about two scheduled recovery operations that can get arbitrarily executed by modifying the state in ARIA agent XML.

15:43.600 --> 15:46.280
First offline scanning and then WinRE applications.

15:47.200 --> 15:49.640
Starting with offline scanning operation.

15:50.080 --> 15:56.820
These operations allow AV run, allow running AV scan from within WinRE against the main OS.

15:56.980 --> 16:00.620
It is mainly used against malware that does not run inside WinRE.

16:02.620 --> 16:08.260
We found we can control which app performs the scanning, though there are a couple of limitations.

16:08.420 --> 16:14.820
First, the offline scanning is performed only by executing applications from within the main OS volume.

16:15.520 --> 16:19.880
Second, this application must be digitally signed by Microsoft or WHQL.

16:20.520 --> 16:24.540
Third, the signatures must be embedded within the binary itself.

16:26.580 --> 16:32.260
We search for all different applications that satisfy these requirements and we discover approximately 30.

16:32.320 --> 16:34.280
No CMD is not among them.

16:34.440 --> 16:39.000
And we could not execute all the applications on that list mainly due to compatibility reasons.

16:43.860 --> 16:47.840
We reviewed them one by one until we got to an application named TT Tracer.

16:48.320 --> 16:55.160
This application is a time travel debugger utility that allows tracing and arbitrary executable.

16:55.540 --> 17:00.820
Okay, so if we can trace any binary we want, let's trace CMD then, right?

17:03.640 --> 17:05.800
Now let's go over the complete flow.

17:06.920 --> 17:12.840
Before starting the machine, we set the recovery state in our agent XML to schedule offline scanning operation.

17:12.880 --> 17:15.320
The XML is then parsed by WinRE.

17:19.410 --> 17:24.690
Then according to the state we just set, WinRE performs the scheduled operation, which is offline scanning.

17:25.650 --> 17:29.270
It will execute TT Tracer, which will trace any binary we set.

17:29.750 --> 17:33.470
We specified CMD, so in our case it will launch and trace CMD.

17:34.570 --> 17:39.910
And at this point, while still in auto unlock state, we have a full shell access with the main OS volume unencrypted.

17:41.110 --> 17:42.990
Now let's see a demo for the second vulnerability.

17:45.270 --> 17:47.830
Again, here's a locked machine which we don't have the password.

17:48.250 --> 17:50.410
We shift restart again to reboot to WinRE.

17:50.410 --> 17:52.950
We will execute an exploit we prepared beforehand.

18:00.020 --> 18:06.080
Now once we reach WinRE, we select troubleshoot, then advanced options, then command prompt.

18:08.240 --> 18:10.720
It prompts to ask for the BitLocker key.

18:10.720 --> 18:12.380
We don't have it, so we skip this drive.

18:15.940 --> 18:20.620
Again, if we check the, if we try to access C drive, you can see it says locked by BitLocker.

18:23.120 --> 18:26.400
If we check the BitLocker status again, it will say it's locked.

18:29.770 --> 18:33.530
Now we change path to the D drive, which is the recovery volume, unprotected volume.

18:33.530 --> 18:35.890
We execute the exploit we prepared beforehand.

18:35.890 --> 18:40.070
It sets TT Tracer to the scheduled offline operation.

18:40.730 --> 18:44.990
And once the exploit completed, we just reboot the machine back to WinRE.

18:45.250 --> 18:47.910
Remember, this is the recovery volume unprotected volume.

18:47.910 --> 18:49.450
We can do anything we want in it.

18:49.970 --> 18:54.850
Now instead of UI actions, we expect an application to spawn.

18:55.130 --> 18:56.530
So here is TT Tracer.

18:57.570 --> 18:59.450
And it asks us to accept the ULA.

18:59.450 --> 19:00.450
We accept it.

19:01.510 --> 19:03.790
And CMD is launching, as you can see.

19:03.790 --> 19:05.670
Now we can change path to C drive.

19:06.950 --> 19:12.070
And if we check the BitLocker status, you can see it says protection on and unlocked.

19:12.630 --> 19:16.510
If we list the files under the C drive, we can see again the secrets.

19:16.510 --> 19:17.230
There are.

19:26.320 --> 19:29.400
Okay, so we completely go and offer the offline scanning.

19:29.560 --> 19:31.560
Let's proceed with WinRE applications.

19:33.680 --> 19:40.320
Another scheduled operation we can configure is WinRE apps, which allows us to run applications within WinRE.

19:40.340 --> 19:46.020
If these applications are trusted, they get executed while the system remains in auto unlock state.

19:46.020 --> 19:50.240
Otherwise, they run after the main OS volume has been re-locked.

19:51.760 --> 20:02.400
We went looking for the hash validation process, and we found that trusted applications are registered within the WinRE registry using their executable name and the file hash.

20:02.560 --> 20:07.680
The registry resides within the WIM file, and a physical attacker cannot modify it.

20:07.680 --> 20:15.940
Any alterations to the WIM would change its hash, causing the main OS volume to be re-locked during the boot hash validation.

20:18.380 --> 20:26.780
Now when WinRE is scheduled to run a trusted application, it first calculates the hash of the target application, then searches for a match in the registry.

20:26.940 --> 20:29.000
If a match is found, the application is marked as trusted.

20:29.000 --> 20:32.460
If no match exists, the application is marked as untrusted.

20:32.520 --> 20:38.440
The main OS volume gets re-locked, and then later the application still gets executed, but with the main OS locked.

20:40.240 --> 20:45.940
So overall, that sound as WinRE trusted apps validation is solid and works properly, right?

20:46.220 --> 20:53.260
Well, we wondered if an already registered application can expose an attack surface, so we went hunting for registered applications.

20:55.600 --> 21:01.140
We found a legitimate usage of this feature by a program named setup platform.

21:01.240 --> 21:08.380
This program is, this application is registered as trusted app and used during Windows upgrade.

21:08.820 --> 21:14.380
Only once the upgrade completes, the trusted app entry remains in the registry, and it is not removed.

21:15.680 --> 21:19.840
So we can execute setup platform, but what else can we do with it?

21:21.140 --> 21:25.320
We found that it registered shift plus F10 hotkey to launch CMD.

21:26.000 --> 21:27.340
Convenient, right?

21:28.620 --> 21:34.940
Well, we tried that, but it fails to execute due to missing configuration file on the main OS volume.

21:35.140 --> 21:41.120
Since this configuration file resides on the bit locker protected main OS volume, it cannot be created or edited.

21:42.400 --> 21:49.620
This configuration requirement caused setup platform to terminate early due to this file being absent.

21:51.240 --> 21:56.120
Now, the time window between the hotkey registration and the process exit is very short.

21:56.120 --> 21:59.640
It's quite impossible to trigger this hotkey manually.

22:00.180 --> 22:03.360
So we wanted to find another way to trigger CMD.

22:03.760 --> 22:06.240
We went back to analyze setup platform.

22:08.220 --> 22:10.700
That is when we discovered something really interesting.

22:10.960 --> 22:21.240
Immediately after registering the CMD hotkey, the application searches for a file named setup platform INI on the recovery volume, which is the unprotected volume.

22:22.120 --> 22:24.680
And we can fully control it.

22:25.080 --> 22:33.560
Now, by configuring this file properly, setup platform will trigger a message box, which prevents applications from continuing the execution.

22:33.560 --> 22:37.380
Essentially, blocking the application from early termination.

22:37.620 --> 22:43.280
That will open an infinite time window to spawn CMD and type any thing we want in it.

22:46.120 --> 22:49.560
Now, let's see the complete flow.

22:49.860 --> 22:53.360
We modify the XML and set the state for scheduled and trusted app.

22:53.360 --> 22:56.260
More specifically, we set setup platform to get executed.

22:57.420 --> 22:59.640
We validate this app can be trusted.

22:59.640 --> 23:03.400
The validation succeeds and the main OS volume remains unlocked.

23:05.000 --> 23:07.080
Next, setup platform gets executed.

23:08.080 --> 23:12.720
It registers the hotkey for CMD, which is shift plus F10.

23:13.760 --> 23:20.220
It then looks for setup platform INI file and loads it, which will trigger a message box.

23:20.420 --> 23:24.460
This way, the process got blocked and won't continue until we press okay.

23:25.440 --> 23:29.820
Now, we can simply press on shift plus F10 to trigger the CMD.

23:35.890 --> 23:39.710
And we got a shell up and running while the main OS volume is still unlocked.

23:40.390 --> 23:42.270
Now, let's see a demo for deferred vulnerability.

23:44.150 --> 23:45.550
So, again, here's a locked machine.

23:45.550 --> 23:46.430
We don't have the password.

23:46.430 --> 23:49.150
We shift restart to reboot into WinRE.

23:55.850 --> 23:59.530
In the action, select troubleshoot, advanced options, command prompt.

24:00.790 --> 24:02.850
We don't have the key, so we skip this drive.

24:04.790 --> 24:06.990
Now, we will try to access again the C drive.

24:06.990 --> 24:08.250
You can see it says locked.

24:09.110 --> 24:11.130
We'll check BitLocker status again.

24:11.790 --> 24:12.470
It says locked.

24:12.470 --> 24:13.630
Protection is on.

24:16.620 --> 24:20.280
Now, we change back to the D drive, the unprotected volume.

24:20.280 --> 24:22.660
We execute the exploit we prepared beforehand.

24:22.660 --> 24:24.540
We set a platform to get executed.

24:24.700 --> 24:27.280
We write down the setup platform INI file.

24:27.420 --> 24:28.820
And next, we reboot the machine.

24:28.820 --> 24:33.660
Now, instead of DUI actions this time, we expect our setup platform to get executed.

24:33.660 --> 24:35.040
And we set setup platform INI.

24:35.040 --> 24:36.940
So, we expect a message box.

24:39.160 --> 24:40.880
And here's the message box.

24:40.880 --> 24:44.740
Now, we can simply press on shift F10, we spawn the CMD.

24:44.840 --> 24:48.500
If we change path to C, we can change it.

24:49.100 --> 24:52.120
If we check the BitLocker status, it says protection on.

24:52.360 --> 24:55.800
And the BitLocker status is still unlocked.

24:57.440 --> 25:01.620
Now, we can just list the files under the G drive, get the secrets.

25:01.700 --> 25:02.640
Here it is.

25:10.640 --> 25:20.500
Now, we'll continue to talk about the BCD.

25:20.560 --> 25:23.780
So, let's move on to attacking the BCD parsing.

25:25.240 --> 25:31.600
So, first things first, for those of you who are unfamiliar with BCD and what it stands for, BCD stands for Boot Configuration Data.

25:31.720 --> 25:34.360
And it's basically the file that defines how Windows boots.

25:34.720 --> 25:40.120
It stores the boot entries, controls the boot parameters, recovery settings, and many more boot related configurations.

25:42.660 --> 25:47.000
Now, in the context of WinRE, the usage of BCD is considerably minimal.

25:47.220 --> 25:55.460
WinRE uses the BCD mainly to determine the location of the target OS volume on the disk so that WinRE knows which volume to end the recovery operations to, right?

25:55.460 --> 26:00.460
Because we have multiple volumes on the disk, WinRE must know which volume is the OS volume to recover.

26:00.600 --> 26:09.400
So, when WinRE starts, it reads the BCD store, queries the target OS volume location from that store, and then ends the recovery operations to this volume.

26:10.980 --> 26:18.260
So, the first question that came into our minds when we investigated WinRE BCD usage is what can we potentially gain from targeting it?

26:19.000 --> 26:25.140
As it turned out, WinRE places full trust in the target OS, assuming it's out of attacker's reach.

26:25.620 --> 26:34.200
Now, generally speaking, this assumption is solid from a design perspective because with BitLocker enabled, the target OS is encrypted and the attacker has no access whatsoever.

26:34.220 --> 26:42.660
So, it's safe to store the configurations, query these configurations, and not further validate them because again, a physical attacker can't change anything in the main OS.

26:42.660 --> 26:43.680
It's encrypted.

26:44.280 --> 26:52.380
Having said that, since the target OS location is defined in the BCD, which we could modify, we began to question this trust assumption.

26:53.020 --> 26:56.260
Could BCD manipulations allow us to undermine it?

26:57.960 --> 27:05.700
So, what if we could trick WinRE into thinking that an attacker controlled volume is actually the trusted BitLocker encrypted one?

27:06.000 --> 27:12.000
Our focus has shifted towards identifying a primitive that allows impersonating the target OS location.

27:12.140 --> 27:20.560
The goal is to manipulate the target OS volume to point to an attacker volume, such as the recovery volume, instead of pointing to the trusted BitLocker encrypted one.

27:21.620 --> 27:31.260
So, any time that WinRE then, if we gain this primitive, if WinRE queries configuration assuming it's out of attacker's reach, the attacker can modify it because it will be in the recovery volume and not in the encrypted volume.

27:31.260 --> 27:34.480
So, this primitive if gained would break the trust assumption.

27:36.580 --> 27:42.880
So, we already know that the target OS location is controlled in the BCD, as we just mentioned, which we can directly modify.

27:42.880 --> 27:46.600
So, what happens if we change the location directly in the BCD?

27:47.460 --> 27:50.400
Well, theoretically it's possible, but it isn't valuable.

27:50.440 --> 27:51.580
Let me explain.

27:52.060 --> 28:01.500
The target OS location isn't used only by WinRE, but also by the boot manager which uses it to know which volume it should auto unlock for WinRE so that WinRE is able to access the OS.

28:01.820 --> 28:06.800
So, any change to the BCD store would affect both the boot phase and the OS phase.

28:07.060 --> 28:16.000
In this specific scenario, if we modify the target OS to point to the recovery volume, it would prevent the boot manager from auto unlocking the BitLocker encrypted OS volume.

28:16.000 --> 28:19.180
And this encrypted volume contains the secrets that we are after.

28:20.040 --> 28:26.480
So, in this state, even it breaks the trust assumption, but even with full code execution within WinRE, we are not able to access the secrets.

28:26.480 --> 28:27.860
And that's why it's not valuable.

28:28.320 --> 28:31.980
Our primitive must not interfere with the boot procedure and the auto unlock functionality.

28:31.980 --> 28:33.420
We must go deeper.

28:35.060 --> 28:38.900
So, we decided to dig deeper into the way that WinRE searches for the BCD store.

28:38.900 --> 28:44.180
Any potential flaws at this stage would not interfere with the auto unlock functionality because it executes afterwards.

28:45.060 --> 28:50.480
So, to locate the BCD store, WinRE iterates over these volumes and searches each one for the store.

28:50.480 --> 28:54.680
The first store that is found is the one used to further calculate the target OS location.

28:54.720 --> 28:57.040
So, a simple volume iteration logic.

28:57.820 --> 29:05.380
Now, this iteration logic is actually an interesting point to further inspect because if you think about it, only the EFI volume contained the BCD store.

29:05.380 --> 29:12.640
So, any attempt to locate the store on other volumes, especially if they are not protected, could potentially be abused.

29:14.440 --> 29:19.480
Internally, the functions that are used to iterate over the volumes are find first volume and find next volume.

29:19.480 --> 29:26.020
These are two standard Windows APIs and notably, the remark section highlights a very interesting point.

29:26.020 --> 29:34.000
It says that one should not assume any correlation between the order of the volumes that are returned by these functions and the order of the volumes that are on the computer.

29:34.260 --> 29:40.620
So, under the hood, these two functions perform further filtering and sorting which causes an inconsistency in the returned volume order.

29:41.700 --> 29:46.880
So, for example, on the monitor, you can see the typical volume order returned by the disk part list command.

29:47.380 --> 29:51.520
The order is first the OS, then EFI and only then the recovery volume.

29:53.340 --> 29:57.260
However, the volume iteration functions would return a different order.

29:57.380 --> 30:01.880
It would return first the OS volume, then the recovery and only then the EFI volume.

30:02.000 --> 30:03.740
Can you spot the inconsistency?

30:04.760 --> 30:11.400
With this iteration logic, the recovery volume is iterated over and checked for a BCD store before the EFI volume.

30:12.600 --> 30:20.220
By placing a custom attacker control store in the recovery volume, we can trick WinRAR into using it instead of using the EFI BCD store.

30:20.300 --> 30:26.740
So, with this setup, WinRAR doesn't even reach the point of querying the EFI volume which contains the real store used to boot the machine.

30:26.840 --> 30:33.220
So, any modification or corruption we make to that custom store will only impact WinRAR and will not disrupt the boot procedure at all.

30:34.740 --> 30:37.560
This flow allows us to achieve the desired primitive.

30:37.560 --> 30:44.180
During the boot phase, the boot manager locates and uses the legitimate store from the EFI volume to unlock the encrypted OS.

30:44.200 --> 30:45.860
And this OS contains the secrets.

30:45.860 --> 30:47.740
So, during the boot, it's unlocked.

30:47.920 --> 30:55.460
However, during the OS phase, WinRAR instead locates and uses the attacker control BCD store due to the iteration logic that we just explored.

30:55.620 --> 31:01.680
And it uses this attacker store, leading it to consider an attacker volume as the BitLocker encrypted one.

31:01.680 --> 31:01.960
Right?

31:01.960 --> 31:10.840
Because once we control the store, instead of pointing the volume location to the main OS volume, the encrypted one, we just point it to a different volume that we control.

31:12.340 --> 31:22.040
So, with this primitive, any configuration that WinRAR retrieves from the target OS, previously assumed to be beyond an attacker's reach, is now entirely under the attacker's control.

31:22.160 --> 31:27.420
So, any sensitive configuration it queries, which we weren't be able to modify, now we're able to modify.

31:29.140 --> 31:35.720
To further exploit this powerful primitive for bypassing BitLocker, we need to find a WinRAR flow with three characteristics.

31:35.900 --> 31:43.300
First, a flow that can be triggered either from the WinRAR UI or from RE-agent XML schedule operations , so that we're able to trigger this flow freely.

31:43.800 --> 31:48.280
Second, a flow that doesn't trigger the wheel of functionality so that we won't lose access to the secrets.

31:48.280 --> 31:54.000
Because we don't want a flow that when we trigger it, relocks the volumes and we lose access to the secrets.

31:54.300 --> 32:00.240
Third characteristic is a flow that queries configuration from the target OS to perform sensitive operations.

32:00.240 --> 32:02.440
And this is actually the interesting part here.

32:02.440 --> 32:08.900
The idea is to chain this flow with the gained impersonation primitive to trigger sensitive operations in the auto-unlock state.

32:08.900 --> 32:11.760
Such operations that we wouldn't be able to trigger beforehand.

32:13.640 --> 32:17.860
So, after exploring different WinRAR behaviors, we found a potential candidate.

32:17.940 --> 32:21.240
This is the push button reset feature, also known as PBR.

32:21.960 --> 32:26.080
PBR is Windows assistant reset tool and it provides various reset functionalities.

32:27.640 --> 32:35.240
It supports multiple trigger modes with one of its modes known as online PBR meeting the characteristics that we defined for the exploit.

32:35.440 --> 32:40.820
So, first, only PBR can be triggered freely as a scheduled operation in RE-agent XML.

32:41.060 --> 32:45.700
Second, this flow doesn't trigger the wheel of functionality thereby benefiting auto-unlock.

32:45.700 --> 32:47.460
We won't lose access to the secrets.

32:47.460 --> 32:54.880
And third, it queries configuration from the target OS to perform sensitive operations, thereby can be controlled with the impersonation primitive.

32:56.320 --> 33:05.280
Specifically, the sensitive configuration that we identified was an XML file named reset session dot XML which defines all the operations executed by PBR.

33:05.680 --> 33:13.000
Notably, it included the decrypt volume directive which instructs PBR to decrypt any arbitrary BitLocker encrypted volume.

33:15.140 --> 33:21.380
So we now have all the pieces that are required for the full BitLocker bypass exploit chain.

33:21.840 --> 33:24.460
The exploit required modifying a few files on the recovery volume.

33:24.460 --> 33:27.900
So first, the XML file with online PBR scheduled operation.

33:27.960 --> 33:33.220
Second, the BCD store with the OS device element pointing to the recovery volume instead of the encrypted OS.

33:33.220 --> 33:41.480
And third, the PBR configuration with the decrypt volume directive specifying the target OS volume to decrypt as the OS volume, the encrypted one.

33:42.620 --> 33:48.720
With this setup, what will happen is that in the next WinRAR reboot, WinRAR will go through the online PBR flow.

33:48.800 --> 33:55.960
During the BCD store look up, PBR locates the attacker BCD store and mistakenly identifies its target volume as a recovery volume.

33:57.200 --> 34:03.880
Then PBR loads its configuration from that recovery volume which instructs it to decrypt the BitLocker encrypted OS volume.

34:03.880 --> 34:11.400
Once this entire process completes, BitLocker secrets become freely accessible as BitLocker was essentially disabled by PBR.

34:11.520 --> 34:19.000
So we went from a considerably scoped OS impersonation primitive to an arbitrary BitLocker decryption primitive .

34:20.140 --> 34:25.280
With that, let's see the demo, the last demo of the day of the full exploitation chain .

34:27.120 --> 34:30.840
So we have here a locked machine which we don't have the password to this machine.

34:30.840 --> 34:35.940
So we select shift and restart into WinRE in order to execute the exploit.

34:39.230 --> 34:44.230
Inside WinRE, we select troubleshoot advanced options and then command prompt.

34:44.890 --> 34:46.770
Here the recovery key is requested.

34:46.790 --> 34:47.630
We don't have this key.

34:47.630 --> 34:48.670
We skip this drive.

34:48.670 --> 34:53.050
Now you will see that we don't have access to the C drive that contains all the BitLocker secrets.

34:55.430 --> 34:58.670
So now what we need to do is to change drive to the D drive.

34:58.670 --> 35:00.790
That's the mounted recovery volume which we control.

35:00.790 --> 35:03.230
We placed our exploit in that volume.

35:03.830 --> 35:05.550
So we now execute this exploit.

35:07.710 --> 35:11.090
And once the exploit finishes, we will reboot into WinRE.

35:12.230 --> 35:16.250
Now you will see during the reboot that PBR gets executed.

35:16.290 --> 35:18.010
This process takes a few minutes.

35:18.810 --> 35:21.870
This is what you will see now on the screen so we fast forward a bit .

35:21.890 --> 35:23.790
In the meantime, let me tell you what the exploit did.

35:23.790 --> 35:27.910
So it placed this XML file with online PBR and the recovery volume.

35:28.470 --> 35:34.970
It then created the BCD store on that recovery volume as well so that the iteration logic considered this store.

35:35.170 --> 35:40.110
And the volume, the target volume on that BCD store pointed to the recovery volume instead of the encrypted volume.

35:40.110 --> 35:45.390
So now when PBR looks for its configuration, it queries it from the recovery volume instead of from the encrypted volume.

35:45.390 --> 35:50.690
This configuration tells PBR to decrypt the OS volume that we are after its secrets.

35:50.750 --> 35:56.790
So what happens now under the hood, what you see on the screen is actually PBR decrypting the OS volume.

35:56.810 --> 35:59.450
Essentially disabling BeatLocker on that volume.

36:00.070 --> 36:05.830
So once PBR completes, we'll go back into the main OS.

36:07.610 --> 36:10.150
You see now the logon screen.

36:12.650 --> 36:17.430
And of course we still don't have the password right so we'll restart into WinRE.

36:17.790 --> 36:21.750
And once we're in WinRE, we'll check what is the current status of BeatLocker.

36:24.190 --> 36:27.410
So select troubleshoot, advanced options, command prompt.

36:27.410 --> 36:30.350
At this point you will see that the recovery key is not requested.

36:30.450 --> 36:32.190
We change drive to the C drive.

36:32.550 --> 36:38.190
List the files and you can see that we have full access to the C drive that contains all of the secrets.

36:38.190 --> 36:46.270
Now if you wonder why this is possible, if we check the status of BeatLocker, you will see that the protection is off and the drive is fully decrypted.

36:46.270 --> 36:50.630
So we bypass BeatLocker by disabling it, able to extract all of the secrets.

36:53.950 --> 36:55.290
Thank you.

36:58.000 --> 37:00.000
So closing remarks.

37:00.580 --> 37:02.200
Starting with the vulnerability fixes.

37:02.200 --> 37:06.880
So all the discovered vulnerabilities and exploitation techniques were fixed in July's Pitch Tuesday.

37:07.040 --> 37:10.960
The CVs for the vulnerabilities that we presented today are displayed on the screen.

37:12.660 --> 37:18.520
To further enhance the security of BeatLocker, we recommend enabling TPM plus PIN for pre-boot authentication.

37:18.560 --> 37:24.200
This significantly reduces the attack surfaces and limiting the services only to the TPM.

37:24.200 --> 37:32.780
So if TPM plus PIN is already enabled in your machine, you are protected from BeatLocker bypasses that originate from WinRE, the boot components, logon screen and other attack surfaces.

37:33.120 --> 37:35.980
Because to get the BeatLocker key, you have to insert a PIN .

37:36.540 --> 37:41.460
So to mitigate BeatLocker downgrade attacks, we advise enabling the revised mitigation.

37:41.540 --> 37:49.780
This mechanism enforces secure versioning across critical boot components, preventing downgrades that could reintroduce known vulnerabilities in BeatLocker and secure boot.

37:50.180 --> 37:54.100
For the full article on BeatLocker countermeasures, please scan the QR code on the screen.

37:56.000 --> 37:58.720
Lastly, we want to emphasize that our journey never ends.

37:58.720 --> 38:05.660
We continue to proactively research BeatLocker, WinRE and the related components with a never ending goal of increasing their security and resiliency.

38:07.840 --> 38:13.000
It was a pleasure for us to share with you our research project and the security work that we do on WinRE and BeatLocker.

38:13.020 --> 38:17.600
If you have any questions, please catch us in the hallway and also feel free to reach out on social media.

38:18.220 --> 38:22.520
And with that, we would like to thank you all for joining us today and we wish you a great rest of your day.

38:23.240 --> 38:24.060
Thank you.

