Skip to content

Ramleak Secure Boot #6

Open
Open

Description

@chickenjudo68

Ramleak works when I disable Secure Boot and then Bitlocker the device. However, I can not get Win PE to boot with the modified BCD file if Secure Boot is already enabled.

Activity

  1. Wack0 commented on Jun 5, 2026

    @Wack0
    Owner

    what error do you get? you might need to use the bootmgfw.efi file from the device, the PoC provides the latest version of bootmgfw_ex.

  2. chickenjudo68 commented on Jun 7, 2026

    @chickenjudo68
    Author

    Actually, I should make a correction. I got past Secure Boot but then I get the Windows Bitlocker pre-boot screen. However, it's not the typical display and looks more like what you see below.

    Image

    I only got to this point by doing the following:

    • Obtained from the Windows debugging tools the files symchk.exe, symsrv.dll, symsrv.yes, symstore.exe and copied those into my Windows\System32 folder (because I was receiving an error about missing symbols)
    • Installed Microsoft Visual C++ 2015-2022 Redistributable
    • Replaced in iso\EFI\boot the bootx64.efi with one that worked with Secure Boot
    • Ran the scripts, rebuilt the ISO file, and copied everything to my USB flash drive

    Thanks.

  3. Wack0 commented on Jun 7, 2026

    @Wack0
    Owner

    you might need to use the exact bootmgfw.efi from your target system here, it depends how bitlocker was set up.

  4. Quaelopec commented on Jun 15, 2026

    @Quaelopec

    I was able to get this working with Secure Boot BitLocker validation, but had the same results described with BitLocker without Secure Boot. I haven't had much success yet playing around with this PoC or trying other methods (PXE soft reboot), but I'm guessing the issue is that legacy integrity validation doesn't work with the PoC even when using the target bootmgfw.efi. Do correct me if I'm wrong, though. I am very much interested in seeing if this vulnerability works consistently under legacy validation.

  5. Wack0 commented on Jun 15, 2026

    @Wack0
    Owner

    For legacy integrity validation, you have to use the exact same bootmgfw.efi from your target system's EFIESP, as the hash of that gets extended into a PCR used for unsealing the VMK from TPM in that scenario.

    The rest of the legacy validation checks are effectively skipped, as they're only performed after successful boot application load. The code flow is as follows:

    • default boot application launch, VMK is derived at this point
      • it tries to load "\" as a file, this fails and returns failure with VMK derived
    • recovery boot application launch, ramdisks are created which reads the file to leak into memory
      • second stage boot application is loaded, validation checks are performed which wipes the derived VMK from memory and caps PCR11 to lock out VMK unsealing until reset
      • second stage boot application loads with leaked file in memory.

    For pre-UEFI legacy BIOS boot (including CSM), you need to boot from a drive where the MBR and NTFS partition boot sector and bootmgr file is identical to your target system's, as the code flow here is: BIOS extends hash of MBR sector into TPM PCR, MBR extends hash of NTFS partition boot sector into TPM PCR, NTFS partition boot sector extends hash of bootmgr into TPM PCR, that TPM PCR is used as part of VMK unsealing from TPM. The PoC doesn't do this and supports only EFI boot.

  6. Quaelopec commented on Jun 21, 2026

    @Quaelopec

    Sticking strictly with the PoC, I made sure I was on legacy integrity validation with TPM only, used the appropriate rawdevice GUIDs from the original BCD as instructed in the readme, successfully created the new BCD with no errors from the .bat, copied all the files from \ramleak\iso to a USB with the target system's original bootmgfw.efi and tried booting from the USB, but I still get the same error screen shown earlier. For bootmgfw.efi, I tried renamed it to bootx64.efi and replacing that with the one in the USB's \EFI\boot, as well as just using bootmgfw.efi and editing the new BCD's {bootmgr} path parameter to use it at \EFI\Microsoft\Boot\bootmgfw.efi like normal, both both produced the same error.

    BitLocker with Secure Boot validation works without issue using the PoC as instructed on the same VM I am testing with if I switch back to enabling Secure Boot and using 7 and 11 protectors.

  7. Wack0 commented on Jun 21, 2026

    @Wack0
    Owner

    so you still get an error when copying target system EFIESP \EFI\Microsoft\Boot\bootmgfw.efi to USB \efi\boot\bootx64.efi ?

    Does EFIESP \efi\boot\bootx64.efi exist? If so, and it's different from EFIESP \EFI\Microsoft\Boot\bootmgfw.efi, try using that.

    If that doesn't work, then try copying the PoC data (move BCD out of the way, copy BCD, copy everything that isn't the \EFI\ directory) directly to EFIESP and booting from EFIESP. The PoC data is ~40MB so should fit on EFIESP partition.

  8. wayne4321-bit commented on Jul 9, 2026

    @wayne4321-bit

    Why does the command line output the following when I run build_bcd.bat?
    1 file(s) copied.
    Ensuring symbols are present...done
    The entry {bootmgr} was successfully created.
    Ensuring symbols are present...done
    The entry {00000000-0000-0000-0000-000000000001} was successfully created.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The specified device is invalid.
    Run "bcdedit /?" for command line help.
    Parameter error.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The entry {00000000-0000-0000-0000-000000000002} was successfully created.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The operation completed successfully.
    Ensuring symbols are present...done
    The specified device is invalid.
    Run "bcdedit /?" for command line help.
    Parameter error.

    I ran bcdedit /store Z:\EFI\Microsoft\Boot\BCD /enum /raw within WinRE,
    retrieved the partex and hd gpt sig for the device in the Windows boot loader, and configured build_config.bat by placing the hd gpt sig into the part2[hd[gpt position and the partex into the gptsig position.

  9. Wack0 commented on Jul 9, 2026

    @Wack0
    Owner

    I ran bcdedit /store Z:\EFI\Microsoft\Boot\BCD /enum /raw within WinRE, retrieved the partex and hd gpt sig for the device in the Windows boot loader, and configured build_config.bat by placing the hd gpt sig into the part2[hd[gpt position and the partex into the gptsig position.

    what does your build_config.bat look like?

  10. wayne4321-bit commented on Jul 10, 2026

    @wayne4321-bit

    I ran bcdedit /store Z:\EFI\Microsoft\Boot\BCD /enum /raw within WinRE, retrieved the partex and hd gpt sig for the device in the Windows boot loader, and configured build_config.bat by placing the hd gpt sig into the part2[hd[gpt position and the partex into the gptsig position.

    what does your build_config.bat look like?

    @echo off
    set RAWDEVICE=part2[hd[gpt[{18F10914-AD50-5BB9-94CC-0FD5D808AA47}]],gptsig[{78DA17C3-4E7F-5D22-805D-A6CC080607B1}]]
    set FILETOLEAK=\windows\system32\config\SYSTEM
    set BEM=bcdeditmod\bcdeditmod /store iso\efi\microsoft\boot\bcd /offline

  11. Wack0 commented on Jul 10, 2026

    @Wack0
    Owner

    The correct config filename is bcd_config.bat, not build_config.bat.

    Your RAWDEVICE works for me.

  12. wayne4321-bit commented on Jul 10, 2026

    @wayne4321-bit

    The correct config filename is bcd_config.bat, not build_config.bat.

    Your RAWDEVICE works for me.

    What is your runtime environment? I'm working on Windows 11 25H2; why can't I get it to run successfully on my computer? My filename is exactly bcd_config.bat.

  13. Wack0 commented on Jul 10, 2026

    @Wack0
    Owner

    I'm running on win10 IoTEnterpriseS (1904x).

    I'm not sure why it doesn't work for you, everything looks good to me. The errors specifically are related to bad RAWDEVICE...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions