Tag Archives: wdsmgfw_EX.efi

KB5025885 (Black Lotus) – Making Everything Work After It Breaks

The rumours about Microsoft’s enforcement of the Black Lotus boot kit mitigations have been around since May 2023 but so far Microsoft have (sensibly) held back enforcement. And with good reason – the mitigations, once applied, are known to cause all sorts of problems with booting, PXE boot, USB boot, CD, even SecureBoot. As you can imagine, this could become a support headache, especially when applied at enterprise level customers.

I have recently had the dubious pleasure of investigating this and assessing what impact this might have when it’s forcibly imposed in some future KB (incidentally, no concrete date set from what I have heard so far, but possibly Q1 2025 although this date keeps getting shunted forward).

In any case, I thought I’d share the benefit of my knowledge for those struggling to get stuff working, particularly PXE booting via WDS. In all likelihood, any machines you’re preparing for have already got the ‘payload’ in place – that is, it’s already present on your machines but just needs activation. This is achieved via several registry updates and reboots, the process of which can take the best part of half an hour. Quite a pain, but as I say, I would expect this to be taken care of in a more streamlined way in a future KB. Once the mitigations have been applied, there shouldn’t be any immediately noticeable issues with the machine, although there are reports by some of being unable to boot into the OS. If this happens, you may wish to temporarily disable SecureBoot or alternatively, apply a workaround in the linked article above. However I wouldn’t expect this to happen and I haven’t personally come across it yet.

However, you will start to notice problems when you attempt to PXE boot or boot off some other media. The reason for this is that the certificates in the UEFI BIOS have now been updated to 2023 from 2011 and fail the integrity check when booting using binaries with unmatched certs. There are three areas we have to update:

  • The Boot Image
  • The WDS/Native SCCM PXE Binaries
  • The OS Media

Boot Image

This should be the first port of call. When creating the image, make sure you have installed the ADK 10.1.26100.1 (May 2024) and in particular, the WinPE Add-On. This version contains all the latest certificates within the winpe.wim file and will ensure compatibility/bootability(!).

Windows Deployment Server

  1. Ensure the server has a recent (at least June 2024) KB update. This will ensure it has a copy of the binaries required to PXEboot containing the new certs available.
  2. Copy C:\Windows\System32\RemInst\boot_EX\x64\wdsmgfw_EX.efi E:\RemoteInstall\Boot\x64\wdsmgfw.efi
  3. Copy C:\Windows\System32\RemInst\boot_EX\x64\en-US\wdsmgfw_EX.efi.mui E:\RemoteInstall\Boot\x64\en-US\wdsmgfw.efi.mui
  4. Copy C:\Windows\System32\RemInst\boot_EX\x64\en-US\bootmgfw_EX.efi.mui E:\RemoteInstall\Boot\x64\en-US\bootmgfw.efi.mui
  5. Copy C:\Windows\System32\RemInst\boot_EX\x64\bootmgfw_EX.efi E:\RemoteInstall\Boot\x64\bootmgfw.efi

Strictly speaking, the mui’s aren’t necessary but…belt and braces. What we’re doing here is replacing the old binaries with the new 2023 binaries which were supplied in the latest KB. If you have more than one WDS server, obviously ensure all are updated appropriately. In our environment, we also had one or two hard-coded boot paths which caused further confusion but I wouldn’t expect that normally.

PXE via Native SCCM

If you use the native PXE responder in SCCM rather than WDS, follow the steps below:

  1. Download the Windows 11 24H2 Enterprise ISO and mount it. This contains the new binaries we need.
  2. Browse to <MOUNTPOINT>\sources and copy boot.wim to a new folder (D:\Updates).
  3. Mount the boot image, eg Dism /mount-wim /wimfile:D:\Updates\boot.wim /index:1 /mountdir:D:\Updates\MOUNT
  4. Copy the following files to your update directory: D:\Updates\MOUNT\Windows\Boot\EFI_EX\bootmgfw_EX.efi D:\Updates\MOUNT\Windows\Boot\PXE_EX\wdsmgfw_EX.efi
  5. Rename bootmgfw_EX.efi to bootmgfw.efi and wdsmgfw_EX.efi to wdsmgfw.efi
  6. Copy the renamed files to D:\SMS_DP$\sms\bin\SMSBoot\<PkgID\>\x64 on your PXE server (substitute for C: if necessary)
  7. You should be able to boot an updated machine now.

NOTE: wdsmgfw_EX.efi and bootmgfw_EX.efi can also be found on the boot image in the May 24 ADK. I had no luck trying the get the versions included there working correctly even though the certificates stated 2023, so it’s recommended you stick with the versions in the latest 24H2 ISO.

OS Media (Task Sequence)

So….we should now be working, right? Not so fast. You should now be in a position to be able to boot from WDS. However, if your OS media is out of date you will also be in trouble. If this is the case, you’ll find your task sequence failing once the OS has been laid down with bcdboot.exe failing to find the appropriate files it needs. From an OS media perspective you will need a minimum of the following:

  1. Windows 11 23H2 OS 22621.3737
  2. Windows 10 22H2 OS 19044.4529

If you ensure these or later versions are part of your task sequence, everything should be rosy.

OS Media (ISO Image)

Sometimes we need an ISO image to boot off. The instructions below should help when updating an ISO with the mitigations:

On SCCM – Upgrade to latest ADK and create a bootable ISO

Pre-Requisites On client machine ( eg win 11 )
Install Windows latest ADK (ADK 10.1.26100.1 (May 2024)) on your system, ensuring you include Deployment Tools.
Obtain the most recent Windows 11 23H2/24H2 installation media through your preferred distribution channel, such as the Volume Licensing portal.
This latest installation media contains the UEFI 2023 CA signed boot managers within the boot.wim file.

Once you have installed ADK, open Deployment and Imaging Tools Environment with administrative privileges.
Create the following directories:
mkdir C:\UpdateWinMedia\DVD
mkdir C:\UpdateWinMedia\Boot
mkdir C:\UpdateWinMedia\Mount

Mount the Windows installation ISO media on your system. In this example, the drive letter is F:

Copy the contents of the Windows installation media (F:) to C:\UpdateWinMedia\DVD
xcopy /s /h F:\ C:\UpdateWinMedia\DVD

Mount the Boot.wim file to extract updated boot files
Dism /mount-wim /wimfile:C:\UpdateWinMedia\DVD\sources\boot.wim /index:1 /mountdir:C:\UpdateWinMedia\Mount

xcopy /s /h C:\UpdateWinMedia\Mount\Windows\Boot C:\UpdateWinMedia\Boot
Dism /unmount-wim /discard /mountdir:C:\UpdateWinMedia\Mount

Create bootable DVD using oscdimg tool with the UEFI 2023 CA signed efisys.bin
oscdimg -m -o -u2 -udfver102 -pEF -b”C:\UpdateWinMedia\Boot\DVD_EX\EFI\en-US\efisys_EX.bin” C:\UpdateWinMedia\DVD C:\UpdateWinMedia\Windows11_UEFI2023.iso

Boot using the updated ISO and install Windows 11.

Hope the above is useful to someone, certainly cost me a good few hours of my life!