start	end	text
0	1680	Okay, so hello everyone.
1680	2800	Thank you for joining us today.
2800	7600	Welcome to our talk, Bit Unlocker Leveraging Windows Recovery to Extract BitLocker Secrets.
13880	15220	Can you hear me?
15400	16400	Let's go.
17240	20820	Today we'll take you inside our journey of attacking and securing BitLocker.
20820	29160	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.
29400	31960	But just before we dive in, a quick introduction.
32820	35920	So my name is Alon and here with me on stage is Nathaniel.
35920	42240	We're both security researchers working with a security testing and offensive research team at Microsoft, also known as STORM.
42360	50400	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.
50400	52960	So a secure boot, BitLocker and others.
52980	55860	But enough about us and let's dive into our agenda.
57400	61480	So we'll start with the research background and give an overview of BitLocker and WinRE.
61620	65600	Then we'll dive into the vulnerabilities that we discovered, how we exploited them.
65600	72100	And finally we'll wrap up with the research results, the fixes and actionable BitLocker countermeasures that you can apply today.
73420	75680	So starting with the research background.
76600	81400	Today we'll explore a security feature that is designed to protect your sensitive data at rest.
81400	90300	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.
90480	97940	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.
98900	104100	Now picture this, you step away for a quick coffee break and when you come back your laptop is gone.
104100	109360	Stolen by a thief that is after your research, internal tools, credentials and personal data.
110200	121220	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.
121920	129880	Data at rest protection ensures that even if your laptop is stolen, your data remains encrypted and inaccessible and your system remains untampered.
131680	138720	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.
139020	140420	So consider this.
140860	144200	Studies show that the laptop is stolen every 53 seconds.
144520	150640	The odds of a laptop being stolen are 1 in 10 and the average cost of a stolen laptop around $49,000.
151020	160120	This figure reflects replacement costs, productivity loss, legal expenses but most importantly, the loss of sensitive data and intellectual property.
160360	169880	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.
171220	177160	So BitLocker is a full volume encryption technology that is designed to protect individual disk volumes.
177260	181340	Once enabled, it encrypts the target disk volume protecting all data stored in it.
181600	193560	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.
193760	200680	So with BitLocker encryption in place, even if your laptop is stolen, the protected data remains unreadable because it's encrypted.
202860	214020	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.
215500	222100	Not only the BitLocker attack surfaces are shaped by the interfaces accessible to an attacker fitting within this threat model.
222720	228400	And as we examined the different attack surfaces and interfaces, a surface, one surface stood out.
228400	234540	A surface with significant vulnerability potential that surprisingly has received very little attention in period research.
234840	238560	This surface is the Windows recovery environment also known as WinRE.
239500	248620	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.
249940	266740	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.
266840	272460	The end goal of our review was to make both WinRE and BitLocker more secure and resilient.
274040	282300	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.
284140	293860	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.
294280	303060	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.
303260	308460	Now if you use Windows, the chances are that you have encountered WinRE at least a few times in your lifetime.
310400	316180	Architecturally, WinRE operates with its own standalone operating system known as the recovery OS.
316400	321460	This recovery OS is a lean version of Windows with recovery specific customizations.
323140	329500	These customizations include a unique set of recovery tools that are all integrated to the known blue screen recovery UI.
329500	336140	Among the exposed tools are familiar options such as startup repair, system reset, system restore and others.
337260	349400	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.
350940	361140	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.
361340	370760	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.
371180	374580	So modifications to the RAM disk are discarded upon reboot.
377140	382920	Now when BitLocker was first introduced, WinRE had to evolve to support recovery from BitLocker related failures.
382920	387860	And this led to several architectural and design level changes to enable that recovery functionality.
388060	392220	We wondered what impact these changes had so let's take a closer look at them.
393640	397400	The first design change focused on the location of WinRE WIM.
397800	404480	It was moved from residing in the OS volume which is now encrypted by BitLocker to a dedicated recovery volume which is not encrypted.
404760	410680	This change was necessary because WinRE must be able to recover from BitLocker related failures.
410680	420600	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.
421440	430700	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.
431760	436640	The second design change focused on the integrity of the WinRE WIM file itself.
436640	441920	So to support integrity validation of WinRE, a feature called trusted WIM boot was introduced.
442040	448180	It verifies the integrity of WinRE WIM by comparing its hash to a known trusted hash.
448180	450060	So a simple hash comparison here.
450060	456840	If the hashes match, the OS volume is automatically unlocked and if the hashes don't match, the OS remains locked.
458740	464860	Now these two states, auto-unlocked and locked, define the level of access that WinRE has to the main OS.
464860	468020	So in the auto-unlocked state, WinRE has full access to the OS.
468020	471120	It can perform recovery operations without any user intervention.
471160	475480	While in the locked state, WinRE has no access at all to the encrypted OS volume.
476140	482760	Now this change was necessary because WinRE now resides on an unprotected recovery volume and it can no longer be blindly trusted, right?
482760	487020	Because physical users can mount this recovery volume, change WinRE WIM and boot.
487020	488760	And we want to prevent it of course.
488920	495320	So with trusted WIM boot, any unauthorized modification to the WIM file breaks its trust effectively blocking any tampering.
496900	502660	The third design change and the last one focused on limiting recovery tools that are inherently risky to BitLocker.
502660	506720	So for example, among the exposed recovery tools is the command prompt.
507000	514360	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.
514540	520900	This functionality is triggered every time that a risky recovery tool is selected and it basically re-locks the OS volume.
521600	526420	Then to regain access to the OS, the user must manually insert the BitLocker recovery key.
526680	529340	Otherwise all contents remain completely inaccessible.
531000	533020	So this is how it looks like in practice.
533020	537500	If an attacker launches the command prompt, WinRE WIM is trusted, auto-unlock occurred.
537500	544960	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.
547630	560550	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.
560850	571750	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.
572750	579110	So now the critical question arises, any attack surface is exposed because of these design adjustments?
579810	590910	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.
591230	597550	This parsing presents a very interesting attack surface which wasn't valuable to explore before BitLocker's introduction.
598290	601450	Because before BitLocker there was no security boundary here.
601710	608830	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.
608830	616430	With BitLocker, any code execution within WinRE in the auto-unlock state can be utilized to bypass BitLocker and extract all the protected secrets.
616930	626550	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.
627550	634230	So we decided to dig deeper into these files and their parsing and specifically the files that we will be focusing on today.
634410	643570	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.
644790	651270	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.
657060	658280	Thank you.
659980	662600	So let's begin with the boot SDI file.
663500	670440	The SDI stands for system deployment image format and it is optionally used for booting from virtual disk into RAM disk.
670440	677480	This format consists of multiple binary blobs with certain blobs being essential for the RAM disk boot process.
678660	685680	Below you can see the layout of RAM disk in memory which contains the OS disk image and more.
685760	691860	When an SDI file is specified, it gets prepended to the virtual disk within the allocated RAM disk memory region.
693460	697160	In our scenario, we are trying to boot Windows recovery from a WIM file.
697320	702320	The boot SDI will contain a WIM blob which contain an offset to the appended trusted WIM.
703120	707840	Additionally, the boot SDI must contain an empty NTFS volume.
709160	718000	This empty volume enables the in-memory WIM to be presented as NTFS volume, ensuring compatibility with other Windows components.
718860	721940	Now let's briefly examine a pseudocode that demonstrates this process.
722360	727740	The code retrieves the sizes of both the SDI and the WIM files, then allocates buffer large enough for both.
728880	733380	Next, the SDI data is copied to the beginning of the RAM disk image buffer.
734320	738440	Then the WIM data is loaded and positioned immediately after the SDI data.
738660	742760	During this process, the loading API computes the WIM hash for validation.
743360	748060	If the hash validation fails, the main OS volume gets re-locked.
749040	755720	Finally, the WIM address is determined by adding the WIM offset stored in the SDI to the RAM disk buffer address.
755900	765020	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.
765200	767920	With that in mind, let's dive into our first vulnerability.
769960	774580	We know that WinRE WIM must pass hash validation when loaded immediately after the SDI.
774760	778440	However, the boot SDI itself undergoes no validation whatsoever.
778620	788320	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.
788480	793840	The hash validation for the trusted WIM will succeed, but the untrusted WIM will be executed in its place.
794060	799800	This allows us to load and execute any WIM we choose while keeping the main OS volume still unlocked.
800100	802100	Now let's see a demo for the first vulnerability.
803800	806820	Here is a locked machine which we don't have the password for it.
807600	810960	We press on shift restart to reboot into WinRE.
812360	815900	Once we are in WinRE, we will execute the exploit we prepared beforehand.
815940	820320	Now during boot, the main OS volume gets automatically unlocked by BitLocker.
822360	826600	We reach WinRE UI actions, we select troubleshoot, then we select advanced options.
827740	829100	Then we select command prompt.
829100	831340	Now the main OS volume got relocked.
831360	833820	We don't have the key, so we skip this drive.
835320	837960	Now if we try to access C drive, we can't access it.
837960	839760	It's locked by BitLocker.
840060	844200	If we check the BitLocker status, you can see it is locked.
845560	850420	So we change path to the D drive which is the recovery volume, the unprotected volume.
850740	853400	We execute the exploit we prepared beforehand.
854260	859720	It adds the custom WIM to the boot SDI and then adjusts the offset to it.
860100	863840	And once the exploit completed, reboot the machine back to WinRE.
867240	874140	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.
874340	875660	So here is the CMD.
875780	877820	We can change path to C drive.
877840	882900	If we check now the BitLocker status, you can see it says unlocked.
883120	888320	And if we list all the files under the C drive, here are the secrets.
896210	897090	Thanks.
904200	909000	After we completed our review for the boot SDI, we shifted our attention to the ARIA agent XML.
910920	916780	The ARIA agent XML file contains the current recovery state and other configuration settings for WinRE.
916780	921720	Upon WinRE startup, it immediately consumes and parses this XML file.
922700	931120	When WinRE state is configured to execute a scheduled operation, it will run the designated recovery operation such as startup repair or other tasks.
931280	935060	All of this occurs prior to reaching the UI actions you've seen before.
935820	943600	Today, we will talk about two scheduled recovery operations that can get arbitrarily executed by modifying the state in ARIA agent XML.
943600	946280	First offline scanning and then WinRE applications.
947200	949640	Starting with offline scanning operation.
950080	956820	These operations allow AV run, allow running AV scan from within WinRE against the main OS.
956980	960620	It is mainly used against malware that does not run inside WinRE.
962620	968260	We found we can control which app performs the scanning, though there are a couple of limitations.
968420	974820	First, the offline scanning is performed only by executing applications from within the main OS volume.
975520	979880	Second, this application must be digitally signed by Microsoft or WHQL.
980520	984540	Third, the signatures must be embedded within the binary itself.
986580	992260	We search for all different applications that satisfy these requirements and we discover approximately 30.
992320	994280	No CMD is not among them.
994440	999000	And we could not execute all the applications on that list mainly due to compatibility reasons.
1003860	1007840	We reviewed them one by one until we got to an application named TT Tracer.
1008320	1015160	This application is a time travel debugger utility that allows tracing and arbitrary executable.
1015540	1020820	Okay, so if we can trace any binary we want, let's trace CMD then, right?
1023640	1025800	Now let's go over the complete flow.
1026920	1032840	Before starting the machine, we set the recovery state in our agent XML to schedule offline scanning operation.
1032880	1035320	The XML is then parsed by WinRE.
1039410	1044690	Then according to the state we just set, WinRE performs the scheduled operation, which is offline scanning.
1045650	1049270	It will execute TT Tracer, which will trace any binary we set.
1049750	1053470	We specified CMD, so in our case it will launch and trace CMD.
1054570	1059910	And at this point, while still in auto unlock state, we have a full shell access with the main OS volume unencrypted.
1061110	1062990	Now let's see a demo for the second vulnerability.
1065270	1067830	Again, here's a locked machine which we don't have the password.
1068250	1070410	We shift restart again to reboot to WinRE.
1070410	1072950	We will execute an exploit we prepared beforehand.
1080020	1086080	Now once we reach WinRE, we select troubleshoot, then advanced options, then command prompt.
1088240	1090720	It prompts to ask for the BitLocker key.
1090720	1092380	We don't have it, so we skip this drive.
1095940	1100620	Again, if we check the, if we try to access C drive, you can see it says locked by BitLocker.
1103120	1106400	If we check the BitLocker status again, it will say it's locked.
1109770	1113530	Now we change path to the D drive, which is the recovery volume, unprotected volume.
1113530	1115890	We execute the exploit we prepared beforehand.
1115890	1120070	It sets TT Tracer to the scheduled offline operation.
1120730	1124990	And once the exploit completed, we just reboot the machine back to WinRE.
1125250	1127910	Remember, this is the recovery volume unprotected volume.
1127910	1129450	We can do anything we want in it.
1129970	1134850	Now instead of UI actions, we expect an application to spawn.
1135130	1136530	So here is TT Tracer.
1137570	1139450	And it asks us to accept the ULA.
1139450	1140450	We accept it.
1141510	1143790	And CMD is launching, as you can see.
1143790	1145670	Now we can change path to C drive.
1146950	1152070	And if we check the BitLocker status, you can see it says protection on and unlocked.
1152630	1156510	If we list the files under the C drive, we can see again the secrets.
1156510	1157230	There are.
1166320	1169400	Okay, so we completely go and offer the offline scanning.
1169560	1171560	Let's proceed with WinRE applications.
1173680	1180320	Another scheduled operation we can configure is WinRE apps, which allows us to run applications within WinRE.
1180340	1186020	If these applications are trusted, they get executed while the system remains in auto unlock state.
1186020	1190240	Otherwise, they run after the main OS volume has been re-locked.
1191760	1202400	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.
1202560	1207680	The registry resides within the WIM file, and a physical attacker cannot modify it.
1207680	1215940	Any alterations to the WIM would change its hash, causing the main OS volume to be re-locked during the boot hash validation.
1218380	1226780	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.
1226940	1229000	If a match is found, the application is marked as trusted.
1229000	1232460	If no match exists, the application is marked as untrusted.
1232520	1238440	The main OS volume gets re-locked, and then later the application still gets executed, but with the main OS locked.
1240240	1245940	So overall, that sound as WinRE trusted apps validation is solid and works properly, right?
1246220	1253260	Well, we wondered if an already registered application can expose an attack surface, so we went hunting for registered applications.
1255600	1261140	We found a legitimate usage of this feature by a program named setup platform.
1261240	1268380	This program is, this application is registered as trusted app and used during Windows upgrade.
1268820	1274380	Only once the upgrade completes, the trusted app entry remains in the registry, and it is not removed.
1275680	1279840	So we can execute setup platform, but what else can we do with it?
1281140	1285320	We found that it registered shift plus F10 hotkey to launch CMD.
1286000	1287340	Convenient, right?
1288620	1294940	Well, we tried that, but it fails to execute due to missing configuration file on the main OS volume.
1295140	1301120	Since this configuration file resides on the bit locker protected main OS volume, it cannot be created or edited.
1302400	1309620	This configuration requirement caused setup platform to terminate early due to this file being absent.
1311240	1316120	Now, the time window between the hotkey registration and the process exit is very short.
1316120	1319640	It's quite impossible to trigger this hotkey manually.
1320180	1323360	So we wanted to find another way to trigger CMD.
1323760	1326240	We went back to analyze setup platform.
1328220	1330700	That is when we discovered something really interesting.
1330960	1341240	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.
1342120	1344680	And we can fully control it.
1345080	1353560	Now, by configuring this file properly, setup platform will trigger a message box, which prevents applications from continuing the execution.
1353560	1357380	Essentially, blocking the application from early termination.
1357620	1363280	That will open an infinite time window to spawn CMD and type any thing we want in it.
1366120	1369560	Now, let's see the complete flow.
1369860	1373360	We modify the XML and set the state for scheduled and trusted app.
1373360	1376260	More specifically, we set setup platform to get executed.
1377420	1379640	We validate this app can be trusted.
1379640	1383400	The validation succeeds and the main OS volume remains unlocked.
1385000	1387080	Next, setup platform gets executed.
1388080	1392720	It registers the hotkey for CMD, which is shift plus F10.
1393760	1400220	It then looks for setup platform INI file and loads it, which will trigger a message box.
1400420	1404460	This way, the process got blocked and won't continue until we press okay.
1405440	1409820	Now, we can simply press on shift plus F10 to trigger the CMD.
1415890	1419710	And we got a shell up and running while the main OS volume is still unlocked.
1420390	1422270	Now, let's see a demo for deferred vulnerability.
1424150	1425550	So, again, here's a locked machine.
1425550	1426430	We don't have the password.
1426430	1429150	We shift restart to reboot into WinRE.
1435850	1439530	In the action, select troubleshoot, advanced options, command prompt.
1440790	1442850	We don't have the key, so we skip this drive.
1444790	1446990	Now, we will try to access again the C drive.
1446990	1448250	You can see it says locked.
1449110	1451130	We'll check BitLocker status again.
1451790	1452470	It says locked.
1452470	1453630	Protection is on.
1456620	1460280	Now, we change back to the D drive, the unprotected volume.
1460280	1462660	We execute the exploit we prepared beforehand.
1462660	1464540	We set a platform to get executed.
1464700	1467280	We write down the setup platform INI file.
1467420	1468820	And next, we reboot the machine.
1468820	1473660	Now, instead of DUI actions this time, we expect our setup platform to get executed.
1473660	1475040	And we set setup platform INI.
1475040	1476940	So, we expect a message box.
1479160	1480880	And here's the message box.
1480880	1484740	Now, we can simply press on shift F10, we spawn the CMD.
1484840	1488500	If we change path to C, we can change it.
1489100	1492120	If we check the BitLocker status, it says protection on.
1492360	1495800	And the BitLocker status is still unlocked.
1497440	1501620	Now, we can just list the files under the G drive, get the secrets.
1501700	1502640	Here it is.
1510640	1520500	Now, we'll continue to talk about the BCD.
1520560	1523780	So, let's move on to attacking the BCD parsing.
1525240	1531600	So, first things first, for those of you who are unfamiliar with BCD and what it stands for, BCD stands for Boot Configuration Data.
1531720	1534360	And it's basically the file that defines how Windows boots.
1534720	1540120	It stores the boot entries, controls the boot parameters, recovery settings, and many more boot related configurations.
1542660	1547000	Now, in the context of WinRE, the usage of BCD is considerably minimal.
1547220	1555460	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?
1555460	1560460	Because we have multiple volumes on the disk, WinRE must know which volume is the OS volume to recover.
1560600	1569400	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.
1570980	1578260	So, the first question that came into our minds when we investigated WinRE BCD usage is what can we potentially gain from targeting it?
1579000	1585140	As it turned out, WinRE places full trust in the target OS, assuming it's out of attacker's reach.
1585620	1594200	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.
1594220	1602660	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.
1602660	1603680	It's encrypted.
1604280	1612380	Having said that, since the target OS location is defined in the BCD, which we could modify, we began to question this trust assumption.
1613020	1616260	Could BCD manipulations allow us to undermine it?
1617960	1625700	So, what if we could trick WinRE into thinking that an attacker controlled volume is actually the trusted BitLocker encrypted one?
1626000	1632000	Our focus has shifted towards identifying a primitive that allows impersonating the target OS location.
1632140	1640560	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.
1641620	1651260	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.
1651260	1654480	So, this primitive if gained would break the trust assumption.
1656580	1662880	So, we already know that the target OS location is controlled in the BCD, as we just mentioned, which we can directly modify.
1662880	1666600	So, what happens if we change the location directly in the BCD?
1667460	1670400	Well, theoretically it's possible, but it isn't valuable.
1670440	1671580	Let me explain.
1672060	1681500	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.
1681820	1686800	So, any change to the BCD store would affect both the boot phase and the OS phase.
1687060	1696000	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.
1696000	1699180	And this encrypted volume contains the secrets that we are after.
1700040	1706480	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.
1706480	1707860	And that's why it's not valuable.
1708320	1711980	Our primitive must not interfere with the boot procedure and the auto unlock functionality.
1711980	1713420	We must go deeper.
1715060	1718900	So, we decided to dig deeper into the way that WinRE searches for the BCD store.
1718900	1724180	Any potential flaws at this stage would not interfere with the auto unlock functionality because it executes afterwards.
1725060	1730480	So, to locate the BCD store, WinRE iterates over these volumes and searches each one for the store.
1730480	1734680	The first store that is found is the one used to further calculate the target OS location.
1734720	1737040	So, a simple volume iteration logic.
1737820	1745380	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.
1745380	1752640	So, any attempt to locate the store on other volumes, especially if they are not protected, could potentially be abused.
1754440	1759480	Internally, the functions that are used to iterate over the volumes are find first volume and find next volume.
1759480	1766020	These are two standard Windows APIs and notably, the remark section highlights a very interesting point.
1766020	1774000	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.
1774260	1780620	So, under the hood, these two functions perform further filtering and sorting which causes an inconsistency in the returned volume order.
1781700	1786880	So, for example, on the monitor, you can see the typical volume order returned by the disk part list command.
1787380	1791520	The order is first the OS, then EFI and only then the recovery volume.
1793340	1797260	However, the volume iteration functions would return a different order.
1797380	1801880	It would return first the OS volume, then the recovery and only then the EFI volume.
1802000	1803740	Can you spot the inconsistency?
1804760	1811400	With this iteration logic, the recovery volume is iterated over and checked for a BCD store before the EFI volume.
1812600	1820220	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.
1820300	1826740	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.
1826840	1833220	So, any modification or corruption we make to that custom store will only impact WinRAR and will not disrupt the boot procedure at all.
1834740	1837560	This flow allows us to achieve the desired primitive.
1837560	1844180	During the boot phase, the boot manager locates and uses the legitimate store from the EFI volume to unlock the encrypted OS.
1844200	1845860	And this OS contains the secrets.
1845860	1847740	So, during the boot, it's unlocked.
1847920	1855460	However, during the OS phase, WinRAR instead locates and uses the attacker control BCD store due to the iteration logic that we just explored.
1855620	1861680	And it uses this attacker store, leading it to consider an attacker volume as the BitLocker encrypted one.
1861680	1861960	Right?
1861960	1870840	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.
1872340	1882040	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.
1882160	1887420	So, any sensitive configuration it queries, which we weren't be able to modify, now we're able to modify.
1889140	1895720	To further exploit this powerful primitive for bypassing BitLocker, we need to find a WinRAR flow with three characteristics.
1895900	1903300	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.
1903800	1908280	Second, a flow that doesn't trigger the wheel of functionality so that we won't lose access to the secrets.
1908280	1914000	Because we don't want a flow that when we trigger it, relocks the volumes and we lose access to the secrets.
1914300	1920240	Third characteristic is a flow that queries configuration from the target OS to perform sensitive operations.
1920240	1922440	And this is actually the interesting part here.
1922440	1928900	The idea is to chain this flow with the gained impersonation primitive to trigger sensitive operations in the auto-unlock state.
1928900	1931760	Such operations that we wouldn't be able to trigger beforehand.
1933640	1937860	So, after exploring different WinRAR behaviors, we found a potential candidate.
1937940	1941240	This is the push button reset feature, also known as PBR.
1941960	1946080	PBR is Windows assistant reset tool and it provides various reset functionalities.
1947640	1955240	It supports multiple trigger modes with one of its modes known as online PBR meeting the characteristics that we defined for the exploit.
1955440	1960820	So, first, only PBR can be triggered freely as a scheduled operation in RE-agent XML.
1961060	1965700	Second, this flow doesn't trigger the wheel of functionality thereby benefiting auto-unlock.
1965700	1967460	We won't lose access to the secrets.
1967460	1974880	And third, it queries configuration from the target OS to perform sensitive operations, thereby can be controlled with the impersonation primitive.
1976320	1985280	Specifically, the sensitive configuration that we identified was an XML file named reset session dot XML which defines all the operations executed by PBR.
1985680	1993000	Notably, it included the decrypt volume directive which instructs PBR to decrypt any arbitrary BitLocker encrypted volume.
1995140	2001380	So we now have all the pieces that are required for the full BitLocker bypass exploit chain.
2001840	2004460	The exploit required modifying a few files on the recovery volume.
2004460	2007900	So first, the XML file with online PBR scheduled operation.
2007960	2013220	Second, the BCD store with the OS device element pointing to the recovery volume instead of the encrypted OS.
2013220	2021480	And third, the PBR configuration with the decrypt volume directive specifying the target OS volume to decrypt as the OS volume, the encrypted one.
2022620	2028720	With this setup, what will happen is that in the next WinRAR reboot, WinRAR will go through the online PBR flow.
2028800	2035960	During the BCD store look up, PBR locates the attacker BCD store and mistakenly identifies its target volume as a recovery volume.
2037200	2043880	Then PBR loads its configuration from that recovery volume which instructs it to decrypt the BitLocker encrypted OS volume.
2043880	2051400	Once this entire process completes, BitLocker secrets become freely accessible as BitLocker was essentially disabled by PBR.
2051520	2059000	So we went from a considerably scoped OS impersonation primitive to an arbitrary BitLocker decryption primitive .
2060140	2065280	With that, let's see the demo, the last demo of the day of the full exploitation chain .
2067120	2070840	So we have here a locked machine which we don't have the password to this machine.
2070840	2075940	So we select shift and restart into WinRE in order to execute the exploit.
2079230	2084230	Inside WinRE, we select troubleshoot advanced options and then command prompt.
2084890	2086770	Here the recovery key is requested.
2086790	2087630	We don't have this key.
2087630	2088670	We skip this drive.
2088670	2093050	Now you will see that we don't have access to the C drive that contains all the BitLocker secrets.
2095430	2098670	So now what we need to do is to change drive to the D drive.
2098670	2100790	That's the mounted recovery volume which we control.
2100790	2103230	We placed our exploit in that volume.
2103830	2105550	So we now execute this exploit.
2107710	2111090	And once the exploit finishes, we will reboot into WinRE.
2112230	2116250	Now you will see during the reboot that PBR gets executed.
2116290	2118010	This process takes a few minutes.
2118810	2121870	This is what you will see now on the screen so we fast forward a bit .
2121890	2123790	In the meantime, let me tell you what the exploit did.
2123790	2127910	So it placed this XML file with online PBR and the recovery volume.
2128470	2134970	It then created the BCD store on that recovery volume as well so that the iteration logic considered this store.
2135170	2140110	And the volume, the target volume on that BCD store pointed to the recovery volume instead of the encrypted volume.
2140110	2145390	So now when PBR looks for its configuration, it queries it from the recovery volume instead of from the encrypted volume.
2145390	2150690	This configuration tells PBR to decrypt the OS volume that we are after its secrets.
2150750	2156790	So what happens now under the hood, what you see on the screen is actually PBR decrypting the OS volume.
2156810	2159450	Essentially disabling BeatLocker on that volume.
2160070	2165830	So once PBR completes, we'll go back into the main OS.
2167610	2170150	You see now the logon screen.
2172650	2177430	And of course we still don't have the password right so we'll restart into WinRE.
2177790	2181750	And once we're in WinRE, we'll check what is the current status of BeatLocker.
2184190	2187410	So select troubleshoot, advanced options, command prompt.
2187410	2190350	At this point you will see that the recovery key is not requested.
2190450	2192190	We change drive to the C drive.
2192550	2198190	List the files and you can see that we have full access to the C drive that contains all of the secrets.
2198190	2206270	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.
2206270	2210630	So we bypass BeatLocker by disabling it, able to extract all of the secrets.
2213950	2215290	Thank you.
2218000	2220000	So closing remarks.
2220580	2222200	Starting with the vulnerability fixes.
2222200	2226880	So all the discovered vulnerabilities and exploitation techniques were fixed in July's Pitch Tuesday.
2227040	2230960	The CVs for the vulnerabilities that we presented today are displayed on the screen.
2232660	2238520	To further enhance the security of BeatLocker, we recommend enabling TPM plus PIN for pre-boot authentication.
2238560	2244200	This significantly reduces the attack surfaces and limiting the services only to the TPM.
2244200	2252780	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.
2253120	2255980	Because to get the BeatLocker key, you have to insert a PIN .
2256540	2261460	So to mitigate BeatLocker downgrade attacks, we advise enabling the revised mitigation.
2261540	2269780	This mechanism enforces secure versioning across critical boot components, preventing downgrades that could reintroduce known vulnerabilities in BeatLocker and secure boot.
2270180	2274100	For the full article on BeatLocker countermeasures, please scan the QR code on the screen.
2276000	2278720	Lastly, we want to emphasize that our journey never ends.
2278720	2285660	We continue to proactively research BeatLocker, WinRE and the related components with a never ending goal of increasing their security and resiliency.
2287840	2293000	It was a pleasure for us to share with you our research project and the security work that we do on WinRE and BeatLocker.
2293020	2297600	If you have any questions, please catch us in the hallway and also feel free to reach out on social media.
2298220	2302520	And with that, we would like to thank you all for joining us today and we wish you a great rest of your day.
2303240	2304060	Thank you.
