Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PowerShell scripts to check the UEFI KEK, DB and DBX Secure Boot variables as well as scripts for other Secure Boot related items.

NotificationsYou must be signed in to change notification settings

cjee21/Check-UEFISecureBootVariables

Repository files navigation

PowerShell scripts to check the UEFI KEK, DB and DBX Secure Boot variables as well as scripts for other Secure Boot related items.

Important

The DBX checking inCheck UEFI PK, KEK, DB and DBX is UEFI architecture dependent. The script attempts to detect the installed Windows architecture and assumes that the UEFI architecture matches (this should be the case on officially supported systems[*]). If this is not the case or the detection fails, the DBX check results will be invalid.

Warning

Disabling Secure Boot should be avoided. If Windows is booted when Secure Boot is turned off, all the Secure Boot and UEFI-related configurations are reset[*]. This may include the deletion of UEFI variables for LSA protection[*], SkuSiPolicy.p7b[*] and SBAT[*], requiring them to be set/updated again.

Before using

Obtain a copy of the contents of this repository fromhttps://github.com/cjee21/Check-UEFISecureBootVariables/archive/refs/heads/main.zip and extract all contents from the ZIP file.

Alternatively, using Git, clone this repository with the following command:

git clone https://github.com/cjee21/Check-UEFISecureBootVariables.git

If using Git, the cloned copy can be updated by running the following commands while inCheck-UEFISecureBootVariables folder.

git fetchgit reset --hard origin/main

Checking the KEK, DB and DBX variables

Right-clickCheck UEFI PK, KEK, DB and DBX.cmd andRun as administrator.

Example output:

Screenshot

Re-applying the Secure Boot DBX updates

If the Secure Boot variables were accidentally reset to default in the UEFI/BIOS settings for example, it is possible to make Windows re-apply the DBX updates that Windows had previously applied. Right-clickApply DBX update.cmd andRun as administrator. Wait for awhile. The DBX updates should be applied after that.

Deploying all the 2023 certificates as well updating to the 2023 CA signed Boot Manager

Note

There should be no need to do this manually as Windows Update will automatically do it from January 2026 onwards. Many manufacturers have also included 2023 certs in the latest UEFI updates and Windows will install 2023 CA signed Boot Manager if 2023 cert is present in the DB.

Right-clickApply 2023 KEK, DB and bootmgfw update.cmd andRun as administrator. Wait for a while. The Windows UEFI CA 2023 cert and Microsoft Corporation KEK 2K CA 2023 cert will be applied to DB and KEK respectively. The Microsoft Option ROM UEFI CA 2023 and Microsoft UEFI CA 2023 certs will also be applied to the DB if the Microsoft Corporation UEFI CA 2011 cert is present there. It may be needed to restart Windows and runStart-ScheduledTask -TaskName "\Microsoft\Windows\PI\Secure-Boot-Update" to complete the Boot Manager update.

Revoking Windows Production PCA 2011 as well as updating the DBX, SVN and SBAT

Right-clickApply revocations.cmd andRun as administrator. Wait for awhile. The DBX should be updated and the Windows Production PCA 2011 cert added to it. The latest SVN will be written to the DBX as well. The SBAT will be written to the 605DAB50-E046-4300-ABB6-3DD810DD8B23:SbatLevel UEFI variable when Windows is restarted. SbatLevel is a Boot Services variable that cannot be checked from within Windows.

Important

Make sure you know what you are doing before attempting this. It may cause some things to be no longer bootable on your system.

Registry bits for applying Secure Boot updates

The bits inHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecureBoot\AvailableUpdates DWORD control what updates are to be applied by Windows. The updates are applied withStart-ScheduledTask -TaskName "\Microsoft\Windows\PI\Secure-Boot-Update" which normally also automatically runs every 12 hours.

The following are the possible bit values that are currently known.

BitUsage
0x0002Apply DBX updates.
0x0004Apply the Microsoft Corporation KEK 2K CA 2023 to the KEK.
0x0020Apply Microsoft-signed revocation policy (SkuSiPolicy.p7b)
0x0040Apply the Windows UEFI CA 2023 to the DB.
0x0080Apply the Windows Production PCA 2011 to the DBX.
0x0100Apply the boot manager, signed by the Windows UEFI CA 2023, to the boot partition.
0x0200Apply Secure Version Number (SVN) update to the firmware.
0x0400Apply Secure Boot Advanced Targeting (SBAT) update to the firmware.
0x0800Apply the Microsoft Option ROM UEFI CA 2023 to the DB.
0x1000Apply the Microsoft UEFI CA 2023 to the DB.
0x4000This bit modifies the behavior of the 0x0800 and 0x1000 bits to only apply the Microsoft UEFI CA 2023 and Microsoft Option ROM UEFI CA 2023 if the DB already has the Microsoft Corporation UEFI CA 2011.

Important

Please carefully read and understandHow to manage the Windows Boot Manager revocations for Secure Boot changes associated with CVE-2023-24932,Secure Boot Certificate updates: Guidance for IT professionals and organizations as well asRegistry key updates for Secure Boot: Windows devices with IT-managed updates before attempting to manually modify the registry to apply updates. It is also recommended to read the other resources listed above these in the references section.

Viewing Secure Boot DB and DBX variable update events

Double-clickShow Secure Boot update events.cmd to display all the Secure Boot DB and DBX variable update events. Refer toKB5016061 for details on interpreting the events.

Viewing Windows Secure Boot state

To view the current Windows Secure Boot state, right-clickCheck Windows state.cmd andRun as administrator. The output will be similar to the following:

Checking for Administrator permission...Running as administrator - continuing execution...Windows version: 25H2 (Build 26200.7462)UEFISecureBootEnabled    : 1AvailableUpdates         : 0x0000UEFICA2023Status         : NotStartedWindowsUEFICA2023Capable : Windows UEFI CA 2023 cert is in DB, system is starting from 2023 signed boot managerbootmgfw version         : 10.0.26100.30227 (WinBuild.160101.0800)bootmgfw signature CA    : Windows UEFI CA 2023bootmgfw SVN             : 7.0bootmgr version          : 10.0.26100.30227 (WinBuild.160101.0800)bootmgr signature CA     : Microsoft Windows Production PCA 2011bootmgr SVN              : 7.0memtest version          : 10.0.26100.1 (WinBuild.160101.0800)memtest signature CA     : Microsoft Windows Production PCA 2011Press any key to continue . . .

Viewing all the UEFI Secure Boot variables

To display all the UEFI Secure Boot variables in readable format, right-clickShow UEFI PK, KEK, DB and DBX.cmd andRun as administrator. All certificates in the PK, KEK and DB variables as well as all hashes in the DBX variable will be displayed.

Checking EFI files

Check EFI file info.cmd can be used to check and display various information of EFI and EXE files. A file path can be passed to it via CLI, a file can be dropped on it or a path may be provided to it when prompted. It can be used to check bootable media for example. Various information will be displayed as in the example below:

Path to EFI file: D:\efi\boot\bootx64.efiFilePath         : D:\efi\boot\bootx64.efiMachine          : x64Subsystem        : EFI ApplicationSubsystemVersion : 1.0File Information:OriginalFilename  : bootmgr.exeFileDescription   : Boot ManagerProductName       : Microsoft® Windows® Operating SystemComments          :CompanyName       : Microsoft CorporationFileName          : D:\efi\boot\bootx64.efiFileVersion       : 10.0.26100.30227 (WinBuild.160101.0800)ProductVersion    : 10.0.26100.30227IsDebug           : FalseIsPatched         : FalseIsPreRelease      : FalseIsPrivateBuild    : FalseIsSpecialBuild    : FalseLanguage          : English (United States)LegalCopyright    : © Microsoft Corporation. All rights reserved.LegalTrademarks   :PrivateBuild      :SpecialBuild      :FileVersionRaw    : 10.0.26100.30227ProductVersionRaw : 10.0.26100.30227Signature Certificate:Subject      : CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=USIssuer       : CN=Microsoft Windows Production PCA 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=USThumbprint   : FACDE3D80E99AFCC15E08AC5A69BD22785287F79FriendlyName :NotBefore    : 20/6/2025 2:11:43 AMNotAfter     : 18/6/2026 2:11:43 AMExtensions   : {System.Security.Cryptography.Oid, System.Security.Cryptography.Oid, System.Security.Cryptography.Oid,               System.Security.Cryptography.Oid...}BOOTMGRSECURITYVERSIONNUMBER: 7.0Press any key to continue . . .

References

About

PowerShell scripts to check the UEFI KEK, DB and DBX Secure Boot variables as well as scripts for other Secure Boot related items.

Topics

Resources

Stars

Watchers

Forks


[8]ページ先頭

©2009-2026 Movatter.jp