| name | detecting-secure-boot-bypass |
| description | Detect bootkits such as BlackLotus and Bootkitty and Secure Boot bypass via DBX and binary checks. |
| domain | cybersecurity |
| subdomain | hardware-firmware-security |
| tags | ["hardware-firmware-security","secure-boot","uefi","bootkit","dbx-revocation","blacklotus","chipsec","firmware-integrity"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
| nist_csf | ["DE.CM-01"] |
| mitre_attack | ["T1542.003"] |
Detecting Secure Boot Bypass
Legal Notice: Firmware and Secure Boot assessment must only be performed on systems you own or are explicitly authorized to test. CHIPSEC's write/modify modes and EFI variable manipulation can brick hardware. Run destructive checks only in a lab. This skill is for defensive verification and authorized assessment.
Overview
UEFI Secure Boot is the firmware-enforced trust chain that only permits boot components signed by keys in the platform's allow-list (db) and not present in the revocation list (dbx). Bootkits defeat this layer to gain pre-OS, persistent, kernel-level control that survives OS reinstalls and disk wipes. BlackLotus (2023) was the first publicly observed UEFI bootkit to bypass Secure Boot on fully patched Windows 11, abusing CVE-2022-21894 ("baton drop") in a vulnerable, signed Windows boot manager to neutralize Secure Boot and disable BitLocker, HVCI, and Defender. Bootkitty (2024) was the first PoC UEFI bootkit targeting Linux. Microsoft's CVE-2023-24932 addressed a related Secure Boot bypass that required a phased dbx (revocation) rollout because revoking the vulnerable boot managers can render systems unbootable if applied carelessly.
The core defensive insight is that patching the OS is not sufficient — the platform remains exploitable until the vulnerable, signed binaries are revoked in dbx. Detection therefore combines: (1) confirming Secure Boot is actually enabled, (2) verifying dbx is current and contains the relevant revocations, (3) checking the integrity and protection of Secure Boot EFI variables with CHIPSEC, (4) hashing on-disk EFI boot binaries and comparing them against the revocation list and known-bad sets, and (5) inspecting firmware/ESP for bootkit artifacts. This skill provides a cross-platform (Linux + Windows) workflow using mokutil, efi-readvar/dbxtool, chipsec, sbverify/pesign, and Windows Confirm-SecureBootUEFI / Get-SecureBootUEFI.
When to Use
- Verifying that an estate's Secure Boot configuration is enabled, locked, and current after the CVE-2023-24932 / BlackLotus advisories.
- Hunting for UEFI bootkit indicators on a suspected-compromised endpoint.
- Validating that dbx revocations (e.g., vulnerable Windows boot managers, Kaspersky/other vulnerable bootloaders) have actually applied across the fleet.
- Auditing firmware integrity and Secure Boot variable protections during a hardware security assessment.
- Building a recurring measured/baseline check for boot-chain tampering.
Prerequisites
Objectives
- Confirm Secure Boot is enabled and in user (not setup) mode.
- Enumerate db, dbx, KEK, and PK contents and assess freshness of dbx.
- Verify the relevant CVE revocations are present in dbx.
- Validate Secure Boot EFI variables are authenticated and protected (CHIPSEC).
- Hash ESP boot binaries and check them against dbx and known-bad hash sets.
- Identify bootkit artifacts and report exploitable gaps with remediation.
MITRE ATT&CK Mapping
| Technique ID | Technique Name | Relevance |
|---|
| T1542.003 | Pre-OS Boot: Bootkit | Core technique — bootkit subverts the boot chain below the OS. |
| T1542 | Pre-OS Boot | Parent technique covering firmware/boot-component tampering. |
| T1542.001 | Pre-OS Boot: System Firmware | Adjacent: firmware modification used to persist or weaken Secure Boot. |
| T1014 | Rootkit | Bootkits provide rootkit-level concealment and persistence. |
| T1562.001 | Impair Defenses: Disable or Modify Tools | BlackLotus disables BitLocker/HVCI/Defender after bypassing Secure Boot. |
Workflow
1. Confirm Secure Boot state (Linux)
A disabled or setup-mode platform offers no protection.
mokutil --sb-state
bootctl status | grep -i "secure boot"
od -An -t u1 /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c
2. Confirm Secure Boot state (Windows)
Confirm-SecureBootUEFI # $true if enabled
# Inspect the raw dbx variable from Windows:
[System.BitConverter]::ToString((Get-SecureBootUEFI dbx).bytes) | Out-File dbx.hex
3. Enumerate the Secure Boot databases
List db (allowed), dbx (revoked), KEK, and PK.
efi-readvar
efi-readvar -v dbx -o dbx.esl
mokutil --list-enrolled
mokutil --db
4. Assess dbx freshness and applied revocations
Compare on-system dbx to the current official UEFI revocation list.
dbxtool --list
dbxtool --dbx ./DBXUpdate.bin --apply --dry-run
A low dbx entry count or absence of recent revocations indicates the platform is behind and likely still vulnerable to known bypasses.
5. Check Secure Boot variable protection with CHIPSEC
Verify the SB key variables are authenticated and not freely writable.
sudo chipsec_main -m common.secureboot.variables
sudo chipsec_main -m common.uefi.s3bootscript
sudo chipsec_util spi dump rom.bin
6. Hash ESP boot binaries and check signatures
Verify bootloaders are signed and not present in dbx.
find /boot/efi -iname '*.efi' -exec sha256sum {} \;
sbverify --list /boot/efi/EFI/BOOT/bootx64.efi
sbverify --cert /etc/secureboot/db.crt /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
pesign -S -i /boot/efi/EFI/BOOT/bootx64.efi
7. Cross-check against known-bad bootkit hashes
Compare collected hashes to revocation/known-bad sets (e.g., LoFP / vendor advisories).
sha256sum /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
8. Inspect for bootkit artifacts
Look for unauthorized ESP modifications and self-deployment markers.
ls -laR /boot/efi/EFI/
find /boot/efi -newermt "-30 days" -iname '*.efi'
9. Validate measured-boot evidence (optional pivot)
If a TPM is present, current PCR[7] reflects Secure Boot policy; deviations corroborate tampering.
tpm2_pcrread sha256:7
10. Run the bundled assessment helper
agent.py collects SB state, dbx counts, ESP binary hashes, and CHIPSEC results into one report.
sudo python scripts/agent.py --check-chipsec --output secureboot_report.json
Tools and Resources
Validation Criteria