[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKV065FEBBFFWBA7CB3T1Y":3,"skill-same:01M7EKV065FEBBFFWBA7CB3T1Y":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M7EKV065FEBBFFWBA7CB3T1Y","hunting-bootkits-in-efi-system-partition",null,"Baseline the EFI System Partition and hunt malicious EFI binaries such as ESPecter, BlackLotus, Bootkitty, and Glupteba by mounting the ESP, hashing and verifying boot loaders, scanning with YARA, and flagging anomalous non-EFI files or out-of-band bootloader changes. Use during proactive threat hunts for firmware\u002Fbootkit persistence (MITRE ATT&CK T1542.003) or when investigating suspected UEFI-level compromise that survives OS reinstall.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunting-bootkits-in-efi-system-partition\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: hunting-bootkits-in-efi-system-partition\ndescription: Baseline the EFI System Partition and hunt malicious EFI binaries such as ESPecter, BlackLotus, Bootkitty, and Glupteba by mounting the ESP, hashing and verifying boot loaders, scanning with YARA, and flagging anomalous non-EFI files or out-of-band bootloader changes. Use during proactive threat hunts for firmware\u002Fbootkit persistence (MITRE ATT&CK T1542.003) or when investigating suspected UEFI-level compromise that survives OS reinstall.\ndomain: cybersecurity\nsubdomain: hardware-firmware-security\ntags:\n- bootkit\n- uefi\n- efi-system-partition\n- secure-boot\n- firmware-forensics\n- threat-hunting\n- yara\n- measured-boot\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- DE.CM-01\nmitre_attack:\n- T1542.003\n---\n# Hunting Bootkits in the EFI System Partition\n\n## Overview\n\nThe EFI System Partition (ESP) is a small FAT32-formatted partition that the platform firmware reads at power-on to locate and execute the operating system's boot loader. Because it executes *before* the operating system, kernel, and any EDR agent, the ESP is one of the most coveted persistence locations for advanced adversaries. UEFI bootkits that live on the ESP survive OS reinstallation, disk reformatting of the OS partition, and most endpoint defenses.\n\nThis skill follows the detection research published by **Eclypsium** (\"Enhanced Threat Detection: Bootloaders, Bootkits, and Secure Boot\", and the *Bootkitty* and *Glupteba* analyses) and aligns with the ESP-hunting methodology Rapid7 documented for Velociraptor (`Windows.Forensics.UEFI`, `Windows.Detection.Yara.UEFI`). The threat context is concrete and current:\n\n- **ESPecter** (ESET, 2021) — a UEFI bootkit that persists on the ESP as a patched Windows Boot Manager (`bootmgfw.efi`) plus malicious kernel-mode drivers. It marked the move of UEFI threats *from SPI flash to the ESP*, where they are far easier to deploy.\n- **BlackLotus** (2023) — the first in-the-wild UEFI bootkit able to bypass Secure Boot on fully patched Windows 11 by exploiting CVE-2022-21894 (\"baton drop\") and staging a vulnerable signed `bootmgfw.efi` on the ESP.\n- **Bootkitty** (2024) — the first UEFI bootkit targeting Linux, dropped onto the ESP.\n- **Glupteba** — commodity malware whose UEFI variant replaces software on the EFI partition.\n\nThe core detection insight from Eclypsium and Rapid7 is that the bootloader normally changes **only** during a vendor or OS update; an out-of-band change to ESP binaries, an unsigned or untrusted-signed boot loader, or any file in the ESP root that is *not* under the `EFI\u002F` directory is a high-fidelity indicator of compromise. This skill builds that baseline and hunts deviations from it.\n\n## When to Use\n\n- During proactive threat hunts for firmware\u002Fbootkit persistence (MITRE ATT&CK T1542.003 — Pre-OS Boot: Bootkit)\n- After an incident where an adversary achieved SYSTEM\u002Froot and may have established below-OS persistence\n- When validating Secure Boot posture across a fleet and confirming boot-chain integrity\n- As a periodic integrity check, comparing the current ESP contents against a trusted golden baseline\n- When triaging hosts that show measured-boot (TPM PCR) mismatches\n\n## Prerequisites\n\n- Administrative\u002Froot access to the target host (mounting and reading the ESP requires elevation)\n- Linux analysis tooling — install on Debian\u002FUbuntu:\n  ```bash\n  sudo apt-get update\n  sudo apt-get install -y sbsigntool pesign efitools efibootmgr binwalk yara\n  pip install pefile\n  ```\n- `UEFITool` for inspecting firmware\u002Fbinaries (download from https:\u002F\u002Fgithub.com\u002FLongSoft\u002FUEFITool\u002Freleases)\n- A trusted **golden baseline** of EFI binary hashes for the OS\u002Fvendor versions in scope (build it once on a known-clean, freshly imaged host)\n- For Windows targets: WinPE or a forensic boot environment, or Velociraptor with the `Windows.Forensics.UEFI` artifact\n\n## Objectives\n\n- Mount and enumerate the ESP read-only without altering evidence\n- Inventory every EFI binary and compute cryptographic hashes\n- Verify Secure Boot signatures on each boot loader against trusted keys\n- Compare contents against a golden baseline to surface out-of-band changes\n- YARA-scan ESP binaries for known bootkit signatures\n- Flag anomalies: files outside `EFI\u002F`, unsigned loaders, modified `bootmgfw.efi`\u002F`grubx64.efi`, and tampered boot entries\n- Confirm measured-boot (TPM PCR 0\u002F2\u002F4) integrity where TPM is present\n\n## MITRE ATT&CK Mapping\n\n| ID | Name | Relevance |\n|----|------|-----------|\n| T1542.003 | Pre-OS Boot: Bootkit | Adversaries place malicious boot loaders on the ESP to execute before the OS and EDR, achieving stealthy, resilient persistence. This skill hunts exactly that artifact. |\n\n## Workflow\n\n### Step 1: Identify and mount the ESP read-only\nThe ESP is a FAT32 partition, usually flagged `EF00` (GPT) or `esp,boot`. Locate it and mount read-only to preserve evidence.\n```bash\n# Identify the ESP (type code EF00 \u002F \"EFI System\")\nsudo lsblk -o NAME,FSTYPE,PARTTYPENAME,MOUNTPOINT\nsudo fdisk -l | grep -i \"EFI System\"\n\n# Mount the ESP read-only (replace \u002Fdev\u002Fsda1 with the identified partition)\nsudo mkdir -p \u002Fmnt\u002Fesp\nsudo mount -o ro,umask=077 \u002Fdev\u002Fsda1 \u002Fmnt\u002Fesp\n\n# Confirm the canonical layout: EFI\u002F should be the only top-level dir\nls -la \u002Fmnt\u002Fesp\n```\n\n### Step 2: Detect anomalous top-level entries (high-fidelity hunt)\nPer Rapid7\u002FVelociraptor guidance, the ESP root should contain **only** the `EFI\u002F` directory (and possibly a vendor `System Volume Information`). Anything else is suspicious.\n```bash\n# Any path in the ESP root NOT under EFI\u002F is a red flag\nfind \u002Fmnt\u002Fesp -maxdepth 1 -mindepth 1 ! -name 'EFI' ! -iname 'System Volume Information'\n\n# Hunt for boot binaries dropped outside expected vendor folders\nfind \u002Fmnt\u002Fesp -type f \\( -iname '*.efi' -o -iname '*.sys' -o -iname '*.dll' \\) -printf '%p\\t%s bytes\\t%TY-%Tm-%Td\\n'\n```\n\n### Step 3: Inventory and hash every EFI binary\nCompute SHA-256 of all boot binaries for baseline comparison and threat-intel lookup.\n```bash\n# Recursively hash all EFI\u002FPE binaries on the ESP\nfind \u002Fmnt\u002Fesp -type f \\( -iname '*.efi' -o -iname '*.sys' \\) -print0 \\\n  | xargs -0 sha256sum | tee \u002Ftmp\u002Fesp_hashes.txt\n\n# Quick triage on the primary loaders\nsha256sum \u002Fmnt\u002Fesp\u002FEFI\u002FMicrosoft\u002FBoot\u002Fbootmgfw.efi 2>\u002Fdev\u002Fnull\nsha256sum \u002Fmnt\u002Fesp\u002FEFI\u002FBoot\u002Fbootx64.efi 2>\u002Fdev\u002Fnull\nsha256sum \u002Fmnt\u002Fesp\u002FEFI\u002F*\u002Fgrubx64.efi \u002Fmnt\u002Fesp\u002FEFI\u002F*\u002Fshimx64.efi 2>\u002Fdev\u002Fnull\n```\nSubmit unknown hashes to VirusTotal \u002F the LOLDrivers and Binarly catalogs to identify known-vulnerable or malicious loaders (e.g., the BlackLotus-abused `bootmgfw.efi` builds).\n\n### Step 4: Verify Secure Boot signatures on each loader\nA legitimate loader is signed by Microsoft UEFI CA (Windows\u002Fshim) or the distro vendor. Use `sbverify` to list\u002Fverify signatures and `pesign` for the certificate chain.\n```bash\n# List embedded signatures on a loader\nsbverify --list \u002Fmnt\u002Fesp\u002FEFI\u002FMicrosoft\u002FBoot\u002Fbootmgfw.efi\n\n# Verify against the platform's db certificate (export it first)\nsudo efi-readvar -v db -o \u002Ftmp\u002Fdb.esl   # dump Secure Boot db\nsbverify --cert \u002Fpath\u002Fto\u002FMicrosoftUEFICA.pem \u002Fmnt\u002Fesp\u002FEFI\u002FBoot\u002Fbootx64.efi\n\n# Inspect the PE certificate chain\npesign -S -i \u002Fmnt\u002Fesp\u002FEFI\u002FMicrosoft\u002FBoot\u002Fbootmgfw.efi\n```\nAn **unsigned** loader, a loader signed by an unexpected\u002Fself-signed certificate, or a known-vulnerable signed binary staged by an attacker (BlackLotus technique) is a confirmed finding.\n\n### Step 5: Compare against the golden baseline\nDiff the live ESP hash inventory against a trusted baseline captured from a clean image of the same OS\u002Fvendor build.\n```bash\n# Sort both inventories on the hash column and diff\nawk '{print $1}' \u002Ftmp\u002Fesp_hashes.txt | sort > \u002Ftmp\u002Flive.sha256\nsort baseline_esp_hashes.sha256 > \u002Ftmp\u002Fbase.sha256\n\n# Hashes present live but absent from the baseline = unexpected\u002Fnew binaries\ncomm -23 \u002Ftmp\u002Flive.sha256 \u002Ftmp\u002Fbase.sha256\n```\nBecause the bootloader changes only during legitimate updates, any new hash that does not correspond to a known patch is an actionable lead.\n\n### Step 6: YARA-scan ESP binaries for bootkit signatures\nRun YARA rules for known bootkits (ESPecter, BlackLotus, Bootkitty, CosmicStrand) across the ESP — the same approach as Velociraptor's `Windows.Detection.Yara.UEFI`.\n```bash\n# Scan all ESP files recursively with a bootkit ruleset\nyara -r -w bootkit_rules.yar \u002Fmnt\u002Fesp\u002F\n\n# Example: scan only the binaries collected in Step 3\nyara -r bootkit_rules.yar \u002Fmnt\u002Fesp\u002FEFI\u002F\n```\nSource rules from the YARA-Rules project, Eclypsium\u002FBinarly publications, and ESET's bootkit reports.\n\n### Step 7: Inspect and validate UEFI boot entries\nESPecter-class bootkits manipulate the boot order\u002Fentries. Enumerate NVRAM boot variables and confirm each points to an expected, signed loader.\n```bash\n# List boot entries and the current order (Bootkitty\u002FESPecter tamper here)\nsudo efibootmgr -v\n\n# Confirm Secure Boot is enabled and look for revoked hashes in dbx\nmokutil --sb-state\nsudo efi-readvar -v dbx -o \u002Ftmp\u002Fdbx.esl\n```\nA boot entry referencing a file outside `\\EFI\\` or a loader whose hash appears in `dbx` (revoked) but is still present indicates tampering.\n\n### Step 8: Validate measured boot against TPM PCRs (where available)\nMeasured boot records the boot-chain components into TPM PCRs (notably PCR 0, 2, 4). A bootkit that alters loaders changes these measurements.\n```bash\n# Read PCRs that cover firmware and the boot loader\nsudo tpm2_pcrread sha256:0,2,4,7\n\n# Parse the TCG event log to see what was measured into each PCR\nsudo tpm2_eventlog \u002Fsys\u002Fkernel\u002Fsecurity\u002Ftpm0\u002Fbinary_bios_measurements\n```\nCompare measured values against the host's known-good attestation baseline; an unexplained PCR 4 change correlates with a modified boot loader.\n\n### Step 9: Document findings and preserve evidence\n```bash\n# Make a forensic image of the ESP for offline analysis before remediation\nsudo dd if=\u002Fdev\u002Fsda1 of=\u002Fevidence\u002Fesp_$(hostname)_$(date +%F).img bs=4M conv=noerror,sync\nsha256sum \u002Fevidence\u002Fesp_*.img > \u002Fevidence\u002Fesp_image.sha256\nsudo umount \u002Fmnt\u002Fesp\n```\nRecord every anomalous binary (path, hash, signature status, baseline diff result, YARA match) in the case file before any cleanup.\n\n## Tools and Resources\n\n| Tool | Purpose | Source |\n|------|---------|--------|\n| sbsigntool (`sbverify`) | List\u002Fverify Secure Boot signatures on EFI binaries | https:\u002F\u002Fgit.kernel.org\u002Fpub\u002Fscm\u002Flinux\u002Fkernel\u002Fgit\u002Fjejb\u002Fsbsigntools.git |\n| pesign | Inspect PE\u002FCOFF signatures and certificate chains | https:\u002F\u002Fgithub.com\u002Frhboot\u002Fpesign |\n| efitools (`efi-readvar`) | Dump Secure Boot variables (db\u002Fdbx\u002FKEK\u002FPK) | https:\u002F\u002Fgit.kernel.org\u002Fpub\u002Fscm\u002Flinux\u002Fkernel\u002Fgit\u002Fjejb\u002Fefitools.git |\n| efibootmgr \u002F mokutil | Enumerate boot entries and Secure Boot state | https:\u002F\u002Fgithub.com\u002Frhboot\u002Fefibootmgr |\n| UEFITool | Parse and inspect UEFI binaries\u002Ffirmware | https:\u002F\u002Fgithub.com\u002FLongSoft\u002FUEFITool |\n| YARA | Signature-scan ESP binaries for bootkits | https:\u002F\u002Fgithub.com\u002FVirusTotal\u002Fyara |\n| tpm2-tools | Read PCRs and TCG event log for measured boot | https:\u002F\u002Fgithub.com\u002Ftpm2-software\u002Ftpm2-tools |\n| Velociraptor `Windows.Forensics.UEFI` | Scale ESP hunting across a fleet | https:\u002F\u002Fdocs.velociraptor.app\u002F |\n| Eclypsium bootkit research | Threat context and detection methodology | https:\u002F\u002Feclypsium.com\u002Fblog\u002Fthreat-detection-bootloaders-bootkits-secureboot\u002F |\n| Rapid7 UEFI hunting blog | ESP hunting with Velociraptor artifacts | https:\u002F\u002Fwww.rapid7.com\u002Fblog\u002Fpost\u002F2024\u002F02\u002F29\u002Fhow-to-hunt-for-uefi-malware-using-velociraptor\u002F |\n\n## Known Bootkit Indicators\n\n| Bootkit | ESP Artifact \u002F Behavior | Reference |\n|---------|-------------------------|-----------|\n| ESPecter | Patched `bootmgfw.efi` + kernel drivers on ESP | ESET WeLiveSecurity 2021 |\n| BlackLotus | Vulnerable signed `bootmgfw.efi` staged to bypass Secure Boot (CVE-2022-21894) | ESET 2023 |\n| Bootkitty | Malicious EFI loader on ESP targeting Linux | ESET \u002F Eclypsium 2024 |\n| Glupteba (UEFI) | Replaces software on the EFI partition | Eclypsium |\n| CosmicStrand | UEFI firmware implant hooking the boot chain | Eclypsium \u002F Kaspersky |\n\n## Validation Criteria\n\n- [ ] ESP located and mounted read-only without modifying evidence\n- [ ] Top-level ESP contents enumerated; any non-`EFI\u002F` entries flagged\n- [ ] All EFI binaries inventoried with SHA-256 hashes\n- [ ] Secure Boot signatures verified on every boot loader\n- [ ] Live inventory diffed against a trusted golden baseline\n- [ ] YARA bootkit ruleset run across the ESP with no unexplained matches\n- [ ] Boot entries (`efibootmgr`) validated; no references outside `\\EFI\\`\n- [ ] Secure Boot confirmed enabled; no present binary matches a `dbx`-revoked hash\n- [ ] TPM PCR 0\u002F2\u002F4 measurements compared to baseline (where TPM present)\n- [ ] Forensic ESP image preserved and all findings documented\n","# Hunting Bootkits in the EFI System Partition\n\n## Overview\n\nThe EFI System Partition (ESP) is a small FAT32-formatted partition that the platform firmware reads at power-on to locate and execute the operating system's boot loader. Because it executes *before* the operating system, kernel, and any EDR agent, the ESP is one of the most coveted persistence locations for advanced adversaries. UEFI bootkits that live on the ESP survive OS reinstallation, disk reformatting of the OS partition, and most endpoint defenses.\n\nThis skill follows the detection research published by **Eclypsium** (\"Enhanced Threat Detection: Bootloaders, Bootkits, and Secure Boot\", and the *Bootkitty* and *Glupteba* analyses) and aligns with the ESP-hunting methodology Rapid7 documented for Velociraptor (`Windows.Forensics.UEFI`, `Windows.Detection.Yara.UEFI`). The threat context is concrete and current:\n\n- **ESPecter** (ESET, 2021) — a UEFI bootkit that persists on the ESP as a patched Windows Boot Manager (`bootmgfw.efi`) plus malicious kernel-mode drivers. It marked the move of UEFI threats *from SPI flash to the ESP*, where they are far easier to deploy.\n- **BlackLotus** (2023) — the first in-the-wild UEFI bootkit able to bypass Secure Boot on fully patched Windows 11 by exploiting CVE-2022-21894 (\"baton drop\") and staging a vulnerable signed `bootmgfw.efi` on the ESP.\n- **Bootkitty** (2024) — the first UEFI bootkit targeting Linux, dropped onto the ESP.\n- **Glupteba** — commodity malware whose UEFI variant replaces software on the EFI partition.\n\nThe core detection insight from Eclypsium and Rapid7 is that the bootloader normally changes **only** during a vendor or OS update; an out-of-band change to ESP binaries, an unsigned or untrusted-signed boot loader, or any file in the ESP root that is *not* under the `EFI\u002F` directory is a high-fidelity indicator of compromise. This skill builds that baseline and hunts deviations from it.\n\n## When to Use\n\n- During proactive threat hunts for firmware\u002Fbootkit persistence (MITRE ATT&CK T1542.003 — Pre-OS Boot: Bootkit)\n- After an incident where an adversary achieved SYSTEM\u002Froot and may have established below-OS persistence\n- When validating Secure Boot posture across a fleet and confirming boot-chain integrity\n- As a periodic integrity check, comparing the current ESP contents against a trusted golden baseline\n- When triaging hosts that show measured-boot (TPM PCR) mismatches\n\n## Prerequisites\n\n- Administrative\u002Froot access to the target host (mounting and reading the ESP requires elevation)\n- Linux analysis tooling — install on Debian\u002FUbuntu:\n  ```bash\n  sudo apt-get update\n  sudo apt-get install -y sbsigntool pesign efitools efibootmgr binwalk yara\n  pip install pefile\n  ```\n- `UEFITool` for inspecting firmware\u002Fbinaries (download from https:\u002F\u002Fgithub.com\u002FLongSoft\u002FUEFITool\u002Freleases)\n- A trusted **golden baseline** of EFI binary hashes for the OS\u002Fvendor versions in scope (build it once on a known-clean, freshly imaged host)\n- For Windows targets: WinPE or a forensic boot environment, or Velociraptor with the `Windows.Forensics.UEFI` artifact\n\n## Objectives\n\n- Mount and enumerate the ESP read-only without altering evidence\n- Inventory every EFI binary and compute cryptographic hashes\n- Verify Secure Boot signatures on each boot loader against trusted keys\n- Compare contents against a golden baseline to surface out-of-band changes\n- YARA-scan ESP binaries for known bootkit signatures\n- Flag anomalies: files outside `EFI\u002F`, unsigned loaders, modified `bootmgfw.efi`\u002F`grubx64.efi`, and tampered boot entries\n- Confirm measured-boot (TPM PCR 0\u002F2\u002F4) integrity where TPM is present\n\n## MITRE ATT&CK Mapping\n\n| ID | Name | Relevance |\n|----|------|-----------|\n| T1542.003 | Pre-OS Boot: Bootkit | Adversaries place malicious boot loaders on the ESP to execute before the OS and EDR, achieving stealthy, resilient persistence. This skill hunts exactly that artifact. |\n\n## Workflow\n\n### Step 1: Identify and mount the ESP read-only\nThe ESP is a FAT32 partition, usually flagged `EF00` (GPT) or `esp,boot`. Locate it and mount read-only to preserve evidence.\n```bash\n# Identify the ESP (type code EF00 \u002F \"EFI System\")\nsudo lsblk -o NAME,FSTYPE,PARTTYPENAME,MOUNTPOINT\nsudo fdisk -l | grep -i \"EFI System\"\n\n# Mount the ESP read-only (replace \u002Fdev\u002Fsda1 with the identified partition)\nsudo mkdir -p \u002Fmnt\u002Fesp\nsudo mount -o ro,umask=077 \u002Fdev\u002Fsda1 \u002Fmnt\u002Fesp\n\n# Confirm the canonical layout: EFI\u002F should be the only top-level dir\nls -la \u002Fmnt\u002Fesp\n```\n\n### Step 2: Detect anomalous top-level entries (high-fidelity hunt)\nPer Rapid7\u002FVelociraptor guidance, the ESP root should contain **only** the `EFI\u002F` directory (and possibly a vendor `System Volume Information`). Anything else is suspicious.\n```bash\n# Any path in the ESP root NOT under EFI\u002F is a red flag\nfind \u002Fmnt\u002Fesp -maxdepth 1 -mindepth 1 ! -name 'EFI' ! -iname 'System Volume Information'\n\n# Hunt for boot binaries dropped outside expected vendor folders\nfind \u002Fmnt\u002Fesp -type f \\( -iname '*.efi' -o -iname '*.sys' -o -iname '*.dll' \\) -printf '%p\\t%s bytes\\t%TY-%Tm-%Td\\n'\n```\n\n### Step 3: Inventory and hash every EFI binary\nCompute SHA-256 of all boot binaries for baseline comparison and threat-intel lookup.\n```bash\n# Recursively hash all EFI\u002FPE binaries on the ESP\nfind \u002Fmnt\u002Fesp -type f \\( -iname '*.efi' -o -iname '*.sys' \\) -print0 \\\n  | xargs -0 sha256sum | tee \u002Ftmp\u002Fesp_hashes.txt\n\n# Quick triage on the primary loaders\nsha256sum \u002Fmnt\u002Fesp\u002FEFI\u002FMicrosoft\u002FBoot\u002Fbootmgfw.efi 2>\u002Fdev\u002Fnull\nsha256sum \u002Fmnt\u002Fesp\u002FEFI\u002FBoot\u002Fbootx64.efi 2>\u002Fdev\u002Fnull\nsha256sum \u002Fmnt\u002Fesp\u002FEFI\u002F*\u002Fgrubx64.efi \u002Fmnt\u002Fesp\u002FEFI\u002F*\u002Fshimx64.efi 2>\u002Fdev\u002Fnull\n```\nSubmit unknown hashes to VirusTotal \u002F the LOLDrivers and Binarly catalogs to identify known-vulnerable or malicious loaders (e.g., the BlackLotus-abused `bootmgfw.efi` builds).\n\n### Step 4: Verify Secure Boot signatures on each loader\nA legitimate loader is signed by Microsoft UEFI CA (Windows\u002Fshim) or the distro vendor. Use `sbverify` to list\u002Fverify signatures and `pesign` for the certificate chain.\n```bash\n# List embedded signatures on a loader\nsbverify --list \u002Fmnt\u002Fesp\u002FEFI\u002FMicrosoft\u002FBoot\u002Fbootmgfw.efi\n\n# Verify against the platform's db certificate (export it first)\nsudo efi-readvar -v db -o \u002Ftmp\u002Fdb.esl   # dump Secure Boot db\nsbverify --cert \u002Fpath\u002Fto\u002FMicrosoftUEFICA.pem \u002Fmnt\u002Fesp\u002FEFI\u002FBoot\u002Fbootx64.efi\n\n# Inspect the PE certificate chain\npesign -S -i \u002Fmnt\u002Fesp\u002FEFI\u002FMicrosoft\u002FBoot\u002Fbootmgfw.efi\n```\nAn **unsigned** loader, a loader signed by an unexpected\u002Fself-signed certificate, or a known-vulnerable signed binary staged by an attacker (BlackLotus technique) is a confirmed finding.\n\n### Step 5: Compare against the golden baseline\nDiff the live ESP hash inventory against a trusted baseline captured from a clean image of the same OS\u002Fvendor build.\n```bash\n# Sort both inventories on the hash column and diff\nawk '{print $1}' \u002Ftmp\u002Fesp_hashes.txt | sort > \u002Ftmp\u002Flive.sha256\nsort baseline_esp_hashes.sha256 > \u002Ftmp\u002Fbase.sha256\n\n# Hashes present live but absent from the baseline = unexpected\u002Fnew binaries\ncomm -23 \u002Ftmp\u002Flive.sha256 \u002Ftmp\u002Fbase.sha256\n```\nBecause the bootloader changes only during legitimate updates, any new hash that does not correspond to a known patch is an actionable lead.\n\n### Step 6: YARA-scan ESP binaries for bootkit signatures\nRun YARA rules for known bootkits (ESPecter, BlackLotus, Bootkitty, CosmicStrand) across the ESP — the same approach as Velociraptor's `Windows.Detection.Yara.UEFI`.\n```bash\n# Scan all ESP files recursively with a bootkit ruleset\nyara -r -w bootkit_rules.yar \u002Fmnt\u002Fesp\u002F\n\n# Example: scan only the binaries collected in Step 3\nyara -r bootkit_rules.yar \u002Fmnt\u002Fesp\u002FEFI\u002F\n```\nSource rules from the YARA-Rules project, Eclypsium\u002FBinarly publications, and ESET's bootkit reports.\n\n### Step 7: Inspect and validate UEFI boot entries\nESPecter-class bootkits manipulate the boot order\u002Fentries. Enumerate NVRAM boot variables and confirm each points to an expected, signed loader.\n```bash\n# List boot entries and the current order (Bootkitty\u002FESPecter tamper here)\nsudo efibootmgr -v\n\n# Confirm Secure Boot is enabled and look for revoked hashes in dbx\nmokutil --sb-state\nsudo efi-readvar -v dbx -o \u002Ftmp\u002Fdbx.esl\n```\nA boot entry referencing a file outside `\\EFI\\` or a loader whose hash appears in `dbx` (revoked) but is still present indicates tampering.\n\n### Step 8: Validate measured boot against TPM PCRs (where available)\nMeasured boot records the boot-chain components into TPM PCRs (notably PCR 0, 2, 4). A bootkit that alters loaders changes these measurements.\n```bash\n# Read PCRs that cover firmware and the boot loader\nsudo tpm2_pcrread sha256:0,2,4,7\n\n# Parse the TCG event log to see what was measured into each PCR\nsudo tpm2_eventlog \u002Fsys\u002Fkernel\u002Fsecurity\u002Ftpm0\u002Fbinary_bios_measurements\n```\nCompare measured values against the host's known-good attestation baseline; an unexplained PCR 4 change correlates with a modified boot loader.\n\n### Step 9: Document findings and preserve evidence\n```bash\n# Make a forensic image of the ESP for offline analysis before remediation\nsudo dd if=\u002Fdev\u002Fsda1 of=\u002Fevidence\u002Fesp_$(hostname)_$(date +%F).img bs=4M conv=noerror,sync\nsha256sum \u002Fevidence\u002Fesp_*.img > \u002Fevidence\u002Fesp_image.sha256\nsudo umount \u002Fmnt\u002Fesp\n```\nRecord every anomalous binary (path, hash, signature status, baseline diff result, YARA match) in the case file before any cleanup.\n\n## Tools and Resources\n\n| Tool | Purpose | Source |\n|------|---------|--------|\n| sbsigntool (`sbverify`) | List\u002Fverify Secure Boot signatures on EFI binaries | https:\u002F\u002Fgit.kernel.org\u002Fpub\u002Fscm\u002Flinux\u002Fkernel\u002Fgit\u002Fjejb\u002Fsbsigntools.git |\n| pesign | Inspect PE\u002FCOFF signatures and certificate chains | https:\u002F\u002Fgithub.com\u002Frhboot\u002Fpesign |\n| efitools (`efi-readvar`) | Dump Secure Boot variables (db\u002Fdbx\u002FKEK\u002FPK) | https:\u002F\u002Fgit.kernel.org\u002Fpub\u002Fscm\u002Flinux\u002Fkernel\u002Fgit\u002Fjejb\u002Fefitools.git |\n| efibootmgr \u002F mokutil | Enumerate boot entries and Secure Boot state | https:\u002F\u002Fgithub.com\u002Frhboot\u002Fefibootmgr |\n| UEFITool | Parse and inspect UEFI binaries\u002Ffirmware | https:\u002F\u002Fgithub.com\u002FLongSoft\u002FUEFITool |\n| YARA | Signature-scan ESP binaries for bootkits | https:\u002F\u002Fgithub.com\u002FVirusTotal\u002Fyara |\n| tpm2-tools | Read PCRs and TCG event log for measured boot | https:\u002F\u002Fgithub.com\u002Ftpm2-software\u002Ftpm2-tools |\n| Velociraptor `Windows.Forensics.UEFI` | Scale ESP hunting across a fleet | https:\u002F\u002Fdocs.velociraptor.app\u002F |\n| Eclypsium bootkit research | Threat context and detection methodology | https:\u002F\u002Feclypsium.com\u002Fblog\u002Fthreat-detection-bootloaders-bootkits-secureboot\u002F |\n| Rapid7 UEFI hunting blog | ESP hunting with Velociraptor artifacts | https:\u002F\u002Fwww.rapid7.com\u002Fblog\u002Fpost\u002F2024\u002F02\u002F29\u002Fhow-to-hunt-for-uefi-malware-using-velociraptor\u002F |\n\n## Known Bootkit Indicators\n\n| Bootkit | ESP Artifact \u002F Behavior | Reference |\n|---------|-------------------------|-----------|\n| ESPecter | Patched `bootmgfw.efi` + kernel drivers on ESP | ESET WeLiveSecurity 2021 |\n| BlackLotus | Vulnerable signed `bootmgfw.efi` staged to bypass Secure Boot (CVE-2022-21894) | ESET 2023 |\n| Bootkitty | Malicious EFI loader on ESP targeting Linux | ESET \u002F Eclypsium 2024 |\n| Glupteba (UEFI) | Replaces software on the EFI partition | Eclypsium |\n| CosmicStrand | UEFI firmware implant hooking the boot chain | Eclypsium \u002F Kaspersky |\n\n## Validation Criteria\n\n- [ ] ESP located and mounted read-only without modifying evidence\n- [ ] Top-level ESP contents enumerated; any non-`EFI\u002F` entries flagged\n- [ ] All EFI binaries inventoried with SHA-256 hashes\n- [ ] Secure Boot signatures verified on every boot loader\n- [ ] Live inventory diffed against a trusted golden baseline\n- [ ] YARA bootkit ruleset run across the ESP with no unexplained matches\n- [ ] Boot entries (`efibootmgr`) validated; no references outside `\\EFI\\`\n- [ ] Secure Boot confirmed enabled; no present binary matches a `dbx`-revoked hash\n- [ ] TPM PCR 0\u002F2\u002F4 measurements compared to baseline (where TPM present)\n- [ ] Forensic ESP image preserved and all findings documented\n",{"name":5,"tags":24,"author":33,"domain":34,"license":15,"version":35,"nist_csf":36,"subdomain":38,"description":7,"mitre_attack":39},[25,26,27,28,29,30,31,32],"bootkit","uefi","efi-system-partition","secure-boot","firmware-forensics","threat-hunting","yara","measured-boot","mahipal","cybersecurity","1.0",[37],"DE.CM-01","hardware-firmware-security",[40],"T1542.003","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fhunting-bootkits-in-efi-system-partition",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill hunting-bootkits-in-efi-system-partition",{"tool":55,"command":56},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill hunting-bootkits-in-efi-system-partition",{"tool":58,"command":59},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill hunting-bootkits-in-efi-system-partition","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunting-bootkits-in-efi-system-partition\u002FSKILL.md",true,[63,69],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fapi-reference.md","REFERENCE","参考文档",2769,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunting-bootkits-in-efi-system-partition\u002Freferences\u002Fapi-reference.md",{"path":70,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fstandards.md",1445,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunting-bootkits-in-efi-system-partition\u002Freferences\u002Fstandards.md",[74,83,88,95,102,109],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":82},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":84,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":82},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":82},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":82},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":82},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":82},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]