跳到正文
cccskills
免费在 GitHub 公开

detecting-secure-boot-bypass

Audit Secure Boot settings, revoked boot components, and EFI startup files on Linux and Windows. The skill helps identify missing protections and signs of bootkits, malicious software that runs before the operating system.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Detect UEFI Secure Boot bypasses and bootkits such as BlackLotus and Bootkitty by verifying Secure Boot state, checking dbx revocation currency, and hashing EFI boot binaries against known-bad sets using mokutil, efi-readvar/dbxtool, CHIPSEC, sbverify/pesign, and Windows Confirm-SecureBootUEFI. Use when auditing fleet dbx rollout after a bootkit advisory or hunting for pre-OS persistence on a suspected-compromised endpoint.

查看安装方法

适用场景

  • Auditing Secure Boot after a bootkit advisory
  • Checking revocation updates across managed devices
  • Investigating suspected bootkit infections
  • Establishing a baseline for boot integrity checks

包含的文件(5)

  • SKILL.md10.0 KB
  • LICENSE11.0 KB
  • references/api-reference.md2.2 KB
  • references/standards.md1.5 KB
  • scripts/agent.py5.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

  • Root/administrator on the target (firmware reads require privilege).
  • Linux tooling:
    sudo apt install mokutil efitools sbsigntool dbxtool      # Debian/Ubuntu
    sudo dnf install mokutil efitools sbsigntools dbxtool     # Fedora/RHEL
    
  • CHIPSEC (run from a live USB or controlled host; loads a kernel driver):
    pip install chipsec        # or build from https://github.com/chipsec/chipsec
    
  • Windows tooling: PowerShell (built-in Confirm-SecureBootUEFI, Get-SecureBootUEFI), and optionally the UEFI dbx update package from Microsoft.
  • The current dbxupdate files from https://uefi.org/revocationlistfile to compare against.

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 IDTechnique NameRelevance
T1542.003Pre-OS Boot: BootkitCore technique — bootkit subverts the boot chain below the OS.
T1542Pre-OS BootParent technique covering firmware/boot-component tampering.
T1542.001Pre-OS Boot: System FirmwareAdjacent: firmware modification used to persist or weaken Secure Boot.
T1014RootkitBootkits provide rootkit-level concealment and persistence.
T1562.001Impair Defenses: Disable or Modify ToolsBlackLotus 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                       # "SecureBoot enabled" expected
bootctl status | grep -i "secure boot"   # systemd-boot view
# 6 = enabled+user mode on the EFI SecureBoot/SetupMode vars:
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                      # dumps PK, KEK, db, dbx
efi-readvar -v dbx -o dbx.esl    # export dbx to a file for offline analysis
mokutil --list-enrolled          # MOK (shim) enrolled keys
mokutil --db                     # platform db entries via shim

4. Assess dbx freshness and applied revocations

Compare on-system dbx to the current official UEFI revocation list.

dbxtool --list                                   # current dbx entries + count
# Download latest dbxupdate from uefi.org/revocationlistfile, then:
dbxtool --dbx ./DBXUpdate.bin --apply --dry-run  # show what WOULD be added (no write)

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.

# Verify Secure Boot is enabled and the SB variables are properly protected:
sudo chipsec_main -m common.secureboot.variables

# Check S3 resume boot-script protections (an SMM/firmware bypass vector):
sudo chipsec_main -m common.uefi.s3bootscript

# Dump SPI flash for offline firmware diffing:
sudo chipsec_util spi dump rom.bin

6. Hash ESP boot binaries and check signatures

Verify bootloaders are signed and not present in dbx.

# Locate and hash EFI boot binaries
find /boot/efi -iname '*.efi' -exec sha256sum {} \;
# Validate a binary's signature against the platform db
sbverify --list /boot/efi/EFI/BOOT/bootx64.efi
sbverify --cert /etc/secureboot/db.crt /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
# pesign equivalent on RHEL-family:
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).

# Example: confirm a binary's SHA-256 is NOT one of the revoked CVE-2022-21894 boot managers
sha256sum /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
# Compare against the hash list extracted from the latest dbxupdate / advisory.

8. Inspect for bootkit artifacts

Look for unauthorized ESP modifications and self-deployment markers.

# Unexpected files / recently modified binaries on the ESP
ls -laR /boot/efi/EFI/
find /boot/efi -newermt "-30 days" -iname '*.efi'
# On Windows, examine the EFI partition for rogue \EFI\Microsoft\Boot entries.

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        # Secure Boot policy PCR

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

ToolPurposeSource
mokutilSecure Boot state and enrolled keys (Linux)https://github.com/lcp/mokutil
efitools (efi-readvar)Dump PK/KEK/db/dbxhttps://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git
dbxtoolInspect and apply dbx updateshttps://github.com/rhboot/dbxtool
CHIPSECFirmware / Secure Boot variable assessmenthttps://github.com/chipsec/chipsec
sbsigntool / pesignEFI binary signature verificationhttps://github.com/jejb/sbsigntools
UEFI Revocation ListOfficial dbx update fileshttps://uefi.org/revocationlistfile
Microsoft KB CVE-2023-24932Secure Boot bypass guidancehttps://support.microsoft.com/topic/kb5025885
ESET BlackLotus analysisBootkit technical writeuphttps://www.welivesecurity.com/2023/03/01/blacklotus-uefi-bootkit-myth-confirmed/

Validation Criteria

  • Secure Boot confirmed enabled and in user mode on the target.
  • PK/KEK/db/dbx enumerated and exported for analysis.
  • dbx compared against the current official UEFI revocation list.
  • CVE-2022-21894 / CVE-2023-24932 revocations confirmed present (or gap flagged).
  • CHIPSEC secureboot.variables and s3bootscript modules run.
  • ESP boot binaries hashed and signature-verified.
  • Hashes cross-checked against known-bad / revoked sets.
  • ESP inspected for unauthorized or recently modified binaries.
  • Findings documented with remediation (dbx update / firmware update) per host.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Assess exposure of Windows secrets protected by DPAPI, the operating system’s data protection service, during authorized security tests. Guide examination and decryption of saved credentials and browser data using available user sessions, credentials, or backup keys.

中文简介正在准备中。当前显示英语简介。

  • Assessing saved credential exposure in authorized tests
  • Examining collected DPAPI files offline
  • Reviewing protected browser and RDP credentials
mukul975/Anthropic-Cybersecurity-Skills3.5万2026年8月31日 更新

Assess Shadow Credentials account takeover during authorized Active Directory testing. Examine permissions that allow public key registration, validate authentication without a password reset, and document credential cleanup, detection opportunities, and access control changes needed for remediation.

中文简介正在准备中。当前显示英语简介。

  • Assessing risky permissions identified in BloodHound
  • Validating account takeover without resetting a password
  • Generating directory change records during security exercises
mukul975/Anthropic-Cybersecurity-Skills3.5万2026年8月31日 更新

Prepare for CMMC Level 2, a cybersecurity certification for defense contractors. Define the systems handling controlled information, review security requirements, calculate the SPRS assessment score, and organize remediation plans and evidence into a readiness report.

中文简介正在准备中。当前显示英语简介。

  • Define the assessment scope for systems handling controlled information
  • Calculate an SPRS score and prioritize unmet security requirements
  • Prepare security plans, remediation milestones, and assessment evidence
mukul975/Anthropic-Cybersecurity-Skills3.5万2026年8月31日 更新

Create disk images for investigations using dd or dcfldd on Linux. The workflow covers write protection, bit-for-bit copying, hash checks to verify integrity, and documentation of the acquisition process.

中文简介正在准备中。当前显示英语简介。

  • Preserving a suspect drive before investigation
  • Creating evidence copies of USB devices or memory cards
  • Verifying that a disk image matches its source
mukul975/Anthropic-Cybersecurity-Skills3.5万2026年8月31日 更新

Review Active Directory permissions with ldap3, a Python library for directory queries. Identify excessive access granted to non-administrative accounts, explain potential privilege escalation paths, and produce a JSON report with affected objects and remediation recommendations.

中文简介正在准备中。当前显示英语简介。

  • Auditing excessive Active Directory permissions
  • Investigating privilege escalation paths from ordinary accounts
  • Reporting affected objects and permission remediation recommendations
mukul975/Anthropic-Cybersecurity-Skills3.5万2026年8月31日 更新

Inspect suspicious Android APK files without running them. Analyze permissions, app components, suspicious code patterns, and network indicators, then produce a JSON risk report to support malware triage and detection rule development.

中文简介正在准备中。当前显示英语简介。

  • Triage suspicious APK files without running them
  • Inspect dangerous permission combinations and suspicious API calls
  • Extract network indicators for malware detection rules
mukul975/Anthropic-Cybersecurity-Skills3.5万2026年8月31日 更新

查看 mukul975 的全部技能

报告此技能的问题