Solved garlin's PowerShell scripts for updating Secure Boot CA 2023


(y)

All my disk drives are listed as DVD, but I know they aren't ;-)

My bad. There was supposed to be a "-not" conditional, except it got copied as "-"
Code:
<     if (-not (Test-Path $Boot_WIM) -and -not ((Get-ChildItem -Path "$Drive\sources\install.*" -ErrorAction SilentlyContinue) | where { $_.Name -notmatch 'wim|esd|swm' })) {
---
>     if (-not (Test-Path $Boot_WIM) -and -((Get-ChildItem -Path "$Drive\sources\install.*" -ErrorAction SilentlyContinue) | where { $_.Name -notmatch 'wim|esd|swm' })) {
 

Attachments

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
hi garlin, could you share the latest version of BlockedOrNot.ps1?
Why don't directly embed it into your zip folder?
 

My Computer My Computer

At a glance

11 25H2
OS
11 25H2
could you share the latest version of BlockedOrNot.ps1?

 

My Computers My Computers

  • At a glance

    Win 11 Pro 25H2 26200.9168Intel® Core™ i7-14700KG.SKILL Ripjaws S5 Series 64GB (2 x 32GB) DDR5ASUS GeForce RTX 4070 Super 12GB
    OS
    Win 11 Pro 25H2 26200.9168
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self Built
    CPU
    Intel® Core™ i7-14700K
    Motherboard
    ASUS TUF Z690-PLUS WIFI (BIOS 4505)
    Memory
    G.SKILL Ripjaws S5 Series 64GB (2 x 32GB) DDR5
    Graphics Card(s)
    ASUS GeForce RTX 4070 Super 12GB
    Sound Card
    Sound Blaster AE-5 Plus
    Monitor(s) Displays
    ASUS TUF Gaming 27" 2K HDR Gaming
    Screen Resolution
    2560 x 1440
    Hard Drives
    Samsung 990 Pro 1TB NVMe (Win 11 25H2)
    SK hynix P41 500GB NVMe
    SK hynix P41 2TB NVMe (x3)
    Crucial P3 Plus 4TB
    PSU
    Corsair RM850x Shift
    Case
    Antec Dark Phantom DP502 FLUX
    Cooling
    Corsair Nautilus 360 RS AIO
    Keyboard
    Logitech MK 320
    Mouse
    Razer Basilisk V3
    Internet Speed
    750Mbs
    Browser
    Firefox
    Antivirus
    Winows Security
    Other Info
    MR 8.1 Home
  • At a glance

    Win 11 Pro 25H2 26200.9168Intel Core i5-1140064 GB DDR4MSI GeForce RTX 3060 Ventus 2X 12GB
    Operating System
    Win 11 Pro 25H2 26200.9168
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self Built
    CPU
    Intel Core i5-11400
    Motherboard
    Asus TUF Gaming Z590 Plus WiFi (BIOS 2803)
    Memory
    64 GB DDR4
    Graphics card(s)
    MSI GeForce RTX 3060 Ventus 2X 12GB
    Sound Card
    SoundBlaster Audigy Fx V2
    Monitor(s) Displays
    Samsung F27T350
    Screen Resolution
    1920x1080
    Hard Drives
    Samsung 980 Pro 1TB
    Samsung 970 EVO Plus 2TB
    Samsung 870 EVO 500GB SSD
    PSU
    Corsair HX750
    Case
    Cougar MX330-G Window
    Cooling
    Thermalright Frozen Edge 240 Black AIO
    Internet Speed
    350Mbps
    Browser
    Firefox
    Antivirus
    Windows Security
  • System Three
    Win 11 Pro 25H2 26200.9168
    ASUS PRIME Z370-P II BIOS 3004 7/12/21
    Intel Core i7-8700 CPU @ 3.20GHz
    32GB DDR4 RAM (4x8)
    iGPU Intel UHD Graphics 630
    Cooler Master Hyper 212
    Mid-Tower Desktop
  • Helpful
Reactions: x_1
hi garlin, could you share the latest version of BlockedOrNot.ps1?
Why don't directly embed it into your zip folder?
I agree why not put it in the zip file...
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
  • Like
Reactions: x_1
Good morning. I was still having trouble with the USB rescue drive not booting. This morning I deleted all the files , differential backups, rescue file and created a new Rescue file. Good news - it now boots. I passes the blockornot script where last night I was getting a file error.
However: even with the new check_bootmedia file above I still get this error when I run the check
PowerShell 7.6.4
PS C:\Windows\System32> powershell -nop -ep bypass -f C:\temp18\check_bootmedia.ps1 -verbose -audit
Windows 11 25H2 (26200.9168)

Secure Boot: ON
Virtualization Based Security: ON

UEFI KEK Certs
--------------
Microsoft Corporation KEK CA 2011
Microsoft Corporation KEK 2K CA 2023

UEFI DB Certs
-------------
Microsoft Corporation UEFI CA 2011
Microsoft Windows Production PCA 2011
Microsoft Option ROM UEFI CA 2023
Microsoft UEFI CA 2023
Windows UEFI CA 2023

UEFI DBX Certs
--------------
Microsoft Windows Production PCA 2011
Windows BootMgr SVN 9.0

EFI Files
---------
SkuSiPolicy.p7b is CURRENT.
\\.\HarddiskVolume1\EFI\Microsoft\Boot\SkuSiPolicy.p7b
Version: 3.0.0.17

FileRule MinimumFileVersion MaximumFileVersion
-------- ------------------ ------------------
ID_FILEATTRIB_F_0044 0.0.0.0 10.0.14393.9399
ID_FILEATTRIB_F_0042 10.0.14400.0 10.0.17763.9099
ID_FILEATTRIB_F_0040 10.0.18000.0 10.0.19041.7639
ID_FILEATTRIB_F_0041 10.0.19100.0 10.0.20348.5479
ID_FILEATTRIB_F_0046 10.0.20400.0 10.0.22621.7494
ID_FILEATTRIB_F_0049 10.0.23000.0 10.0.26100.9140
ID_FILEATTRIB_F_0045 10.0.26100.32000 10.0.26100.33249
ID_FILEATTRIB_F_0048 10.0.26172.0 10.0.26172.33249
ID_FILEATTRIB_F_0047 10.0.27000.0 10.0.28000.2684
ID_FILEATTRIB_F_0043 10.0.29426.0 65535.65535.65535.65535



Hasleo 5.9.2.1
--------------
WinPE Boot Manager [Windows UEFI CA 2023] is BANNED.
C:\Program Files\Hasleo\Hasleo Backup Suite\bin\WADK\Boot\EFI_EX\bootmgfw.efi
File Version: 26100.30227, SVN 7.0
You cannot call a method on a null-valued expression.
At C:\temp18\check_bootmedia.ps1:2399 char:9
+ $RemovableDrives = @(
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull


If I run an older vesion the check_bootmedia I passes without error.
 

My Computer My Computer

At a glance

Windows 11 Intel i5 10400 HD630 graphics chipi5-1040012 gbHD630 chipset
OS
Windows 11 Intel i5 10400 HD630 graphics chip
Computer type
PC/Desktop
Manufacturer/Model
HP
CPU
i5-10400
Memory
12 gb
Graphics Card(s)
HD630 chipset
Monitor(s) Displays
LG 24inch
Hard Drives
SSD, external usb drive 1tb for files/backups
Keyboard
wireless Logi
Mouse
ms 4000 wireless mouse
Internet Speed
10meg
Browser
Firefox
Antivirus
Defender
Other Info
Win11 Home 25h2 26200.9168 08/11/2026
Hi Garlin, can you explain in simple terms the meaning of "FileRule"?
What does mean in the end a different SVN from the current one?
 

My Computer My Computer

At a glance

11 25H2
OS
11 25H2
Check_BootMedia.ps1

Works well for me. Thanks for the script @garlin
 

My Computer My Computer

At a glance

Windows 11 Pro build 25H2 x64Intel i9-13900K64GBNvidia GeForce RTX-3090 Ti
OS
Windows 11 Pro build 25H2 x64
Computer type
PC/Desktop
Manufacturer/Model
ASUS Custom build
CPU
Intel i9-13900K
Motherboard
Asus ROG STRIX Z790 E GAMING WIFI 11
Memory
64GB
Graphics Card(s)
Nvidia GeForce RTX-3090 Ti
Internet Speed
1 Gbps
Browser
Firefox
Antivirus
Malwarebytes
hi garlin, could you share the latest version of BlockedOrNot.ps1?
Why don't directly embed it into your zip folder?
Hi Garlin, can you explain in simple terms the meaning of "FileRule"?
What does mean in the end a different SVN from the current one?
When I was writing the older builds of Check_UEFI-CA2023.ps1, I realized that SkuSiPolicy's frequent updates (several times a year?) was going to force users to pay more attention. Unfortunately, unlike the boot manager it's a real pain to figure out if your winload.efi is banned or not.

For the boot manager (or boot file), the check is fairly straightforward. You extract the file's signing cert and compare it against Windows UEFI CA 2023. Next, you extract the file's SVN and compare it against the DBX's highest known version.

But the SkuSiPolicy contains a set of File Rules, which define a set of allow and disallow rules based on the file version. What we care about is the osloader.exe (winload.efi) rules which block specific ranges of file versions. You can run any winload.efi, except for versions falling into these blocked ranges. Using this method, MS can ban all the older versions of winload.efi for W10, W11, etc.

SVN applies to the boot manager
File Rules apply to the winload.efi

Both security mechanisms can run in parallel, are unrelated to each other.

Code:
PS C:\Users\GARLIN\Downloads> .\BlockedOrNot.ps1 -verbose
Windows 11 25H2 (26200.9168)
VBS: OFF

Policy File: "\\.\HarddiskVolume1\EFI\Microsoft\Boot\SkuSiPolicy.p7b" is NOT ENFORCED
Version: 3.0.0.16

RULE ID            MinimumVersion MaximumVersion
-------            -------------- --------------
FILEATTRIB_F_0042  0.0            14393.9309
FILEATTRIB_F_0044  14400.0        17763.8979  <-- ban any winload.efi which is between 14400.0 and 17763.8979
FILEATTRIB_F_0040  18000.0        19041.7519
FILEATTRIB_F_0049  19100.0        20348.5359
FILEATTRIB_F_0047  20400.0        22621.7349
FILEATTRIB_F_0041  23000.0        26100.8835
FILEATTRIB_F_0043  26100.32000    26100.33099
FILEATTRIB_F_0048  26172.0        26172.33099
FILEATTRIB_F_0046  27000.0        28000.2489
FILEATTRIB_F_0045  29426.0        65535.65535  <-- 65536.65536 is "infinity" or the highest possible version


VolumeName              Filename                                           FileVersion Status
----------              --------                                           ----------- ------
CCCOMA_X64FRE_EN-US_DV9 E:\sources\boot.wim                                19041.2965  FLAGGED BY 'FILEATTRIB_F_0040'  <-- 19041.2965 is less than 19041.7519
                        C:\Windows\System32\winload.efi                    26100.9168  ALLOWED
                        \harddisk0\partition5\Recovery\WindowsRE\Winre.wim 26100.9168  ALLOWED
NEW VOLUME              D:\sources\boot.wim                                22621.1702  FLAGGED BY 'FILEATTRIB_F_0047'
MACRIUM_PE              F:\sources\boot.wim                                22621.1702  FLAGGED BY 'FILEATTRIB_F_0047'


Why don't I include BlockedOrNot.ps1 in the normal ZIP?

Because it started life as a testbed, to try different ideas without having to worry about breaking the normal scripts. I posted the original version on a VIP thread in order to limit the feedback (because it was an early and broken script). Most of core functions have been copied into Check_BootMedia.ps1.

The major difference is BlockedOrNot.ps1 was designed to check a multi-boot setup. So it's very nosy and checks all of your disks and Recovery partitions looking for winload.efi candidates. BlockedOrNot.ps1 might get cleaned up and get a proper release. But the end goal was always to add SkuSiPolicy compliance checking to boot media.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
In the end, we suggest, you explain and decide (y)
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
  • Like
Reactions: x_1
great support and very informative.

PS: if u can, don't miss to fix BlockedOrNot script to forces (user) to run as Admin.

 

My Computer My Computer

At a glance

11 25H2
OS
11 25H2
Back
Top Bottom