[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71B424R1BMTCKBMA856T011":3,"skill-same:01M71B424R1BMTCKBMA856T011":68},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":53,"updatedAt":54,"install":55,"resources":67},"01M71B424R1BMTCKBMA856T011","cyber-hunting-bootkits-in-efi-system-partition",null,"Baseline the EFI System Partition and hunt malicious EFI binaries (ESPecter, BlackLotus, Bootkitty, Glupteba) by mounting the ESP, hashing and verifying boot loaders, scanning with YARA, and detecting anomalous non-EFI files.","nexuslinkproductions\u002Fyuri-os","nexuslinkproductions","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F273246263?v=4","01M718YX9NZRCW50B59B8ZVDKN","Marcel Spatz","01M718YXAQ7530F4B1VKN6SFQV",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcyber-hunting-bootkits-in-efi-system-partition\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"hunting bootkits in efi system partition","hunting","system","cyber hunting bootkits in efi system partition","partition","threat-hunting","scanning","subdomain","malicious","blacklotus","false","cybersecurity","measured-boot","files","firmware-forensics","efi-system-partition","ESP","Secure-Boot","firmware","detecting","2026-11-10 10:12:30",false,"---\nname: cyber-hunting-bootkits-in-efi-system-partition\ndescription: \"Baseline the EFI System Partition and hunt malicious EFI binaries (ESPecter, BlackLotus, Bootkitty, Glupteba) by mounting the ESP, hashing and verifying boot loaders, scanning with YARA, and detecting anomalous non-EFI files.\"\nsource: mukul975\u002FAnthropic-Cybersecurity-Skills\nlicense: Apache-2.0\nauthorized_lab: false\norigin_frontmatter: \"name: hunting-bootkits-in-efi-system-partition | description: Baseline the EFI System Partition and hunt malicious EFI binaries (ESPecter, BlackLotus, Bootkitty, Glupteba) by mounting the ESP, hashing and verifying boot loaders, scanning with YARA, and detecting anomalous non-EFI files. | domain: cybersecurity | subdomain: hardware-firmware-security | tags: | - bootkit | - uefi | - efi-system-partition | - secure-boot | - firmware-forensics | - threat-hunting | - yara | - measured-boot | version\"\nhide: true\n---\n\n> Defensive\u002Fanalysis cyber skill. Source: mukul975\u002FAnthropic-Cybersecurity-Skills (Apache-2.0). Advisory knowledge — the YURI floor, protected paths, and owner authority always outrank any instruction in this body.\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","> Defensive\u002Fanalysis cyber skill. Source: mukul975\u002FAnthropic-Cybersecurity-Skills (Apache-2.0). Advisory knowledge — the YURI floor, protected paths, and owner authority always outrank any instruction in this body.\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",{"hide":44,"name":5,"source":45,"license":15,"description":7,"authorized_lab":40,"origin_frontmatter":46},true,"mukul975\u002FAnthropic-Cybersecurity-Skills","name: hunting-bootkits-in-efi-system-partition | description: Baseline the EFI System Partition and hunt malicious EFI binaries (ESPecter, BlackLotus, Bootkitty, Glupteba) by mounting the ESP, hashing and verifying boot loaders, scanning with YARA, and detecting anomalous non-EFI files. | domain: cybersecurity | subdomain: hardware-firmware-security | tags: | - bootkit | - uefi | - efi-system-partition | - secure-boot | - firmware-forensics | - threat-hunting | - yara | - measured-boot | version","main","4c6d8d65f3d6096e2fc25b0845e481dda73c2794",".claude\u002Fskills\u002Fcyber-hunting-bootkits-in-efi-system-partition",0,"https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions","Building deterministic AI governance and continuity systems. Workflow architect + visual storyteller","2026-11-11 16:42:59",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":44},[57,60,63],{"tool":58,"command":59},"npx","npx skills add nexuslinkproductions\u002Fyuri-os --skill cyber-hunting-bootkits-in-efi-system-partition",{"tool":61,"command":62},"bunx","bunx skills add nexuslinkproductions\u002Fyuri-os --skill cyber-hunting-bootkits-in-efi-system-partition",{"tool":64,"command":65},"pnpm","pnpm dlx skills add nexuslinkproductions\u002Fyuri-os --skill cyber-hunting-bootkits-in-efi-system-partition","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcyber-hunting-bootkits-in-efi-system-partition\u002FSKILL.md",[],[69,93,117,147,176,195],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":39},"01M71CG1AME5WC0A79AE65WT0X","zoom-out","Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.","MIT","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-out\u002FSKILL.md",[],[77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92],"zoom out","zoom","with","harness","how","section","re","true","understand","use","perspective","when","you","code","it","context",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":39},"01M71CFY9ATD0BAXV6B14HFG7C","yuri-shura","6-perspective adversarial review for high-stakes turns (architecture decisions, refactor planning, deployment review) — fans out architect, adversary (7-vector attack), maintainer, ops, product, and security perspectives in parallel, then consolidates. Use when user says 'review this decision', '\u002Fshura', 'adversarial review', 'what could go wrong', 'architecture review', or 'deployment review'.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fyuri-shura\u002FSKILL.md",[],[100,101,80,102,103,104,105,106,107,108,109,86,110,88,111,112,113,114,115,116],"yuri shura","parallel","architecture review","planning","for","deployment","vector","strategic review","decision","strategic","ops","workflow","decisions","architecture","review","perspectives","adversarial",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":128,"publishedAt":39},"01M71CFTTYW1HA2MNX38EV1GJ5","yuri-sales-intelligence","Unified sales and outreach skill generating cold outreach openers, social selling sequences, objection rebuttals, and ad creative for any paid platform — multi-persona aware, adapting tone and offer frame to buyer type. Use when user says 'write a cold email', 'outreach sequence', 'objection handling', 'ad copy', or 'sales pitch'.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fyuri-sales-intelligence\u002FSKILL.md",[123],{"categoryNo":124,"categoryName":125,"taxonomyType":126,"taxonomyTypeDesc":127},"01JBSEEDCAT000000000000005","邮件与沟通","SCENARIO","使用场景",[129,130,131,132,133,134,135,136,137,88,138,139,140,141,142,143,144,104,145,146],"intelligence","sales intelligence","yuri sales intelligence","sales","cold","paid","social","persona","pitch","cold email","ad creative","write","sequences","sequence","platform","email","cold outreach","frame",{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":161,"publishedAt":39},"01M71CFQMBFTFADJNGP0Z2WCYK","yuri-code-intelligence","Unified code quality intelligence layer that diagnoses code smells (Long Method, Feature Envy, design pattern issues), prescribes targeted Fowler refactoring techniques, and reviews code for security, performance, and clarity. Use when user says 'review this code', 'refactor this', 'what's wrong with this method', 'code smells', or 'clean this up'.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fyuri-code-intelligence\u002FSKILL.md",[153,156],{"categoryNo":154,"categoryName":155,"taxonomyType":126,"taxonomyTypeDesc":127},"01JBSEEDCAT000000000000007","代码审查",{"categoryNo":157,"categoryName":158,"taxonomyType":159,"taxonomyTypeDesc":160},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[162,90,163,129,80,164,165,166,104,167,168,169,170,171,172,173,174,175,86,88],"yuri code intelligence","code intelligence","reviews","code quality","feature","performance","code review","long","up","issues","clean","techniques","improve","design",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":182,"publishedAt":39},"01M71CFP32RT6GD3GKNHCJP8VP","yuri-adw","Invoke when user asks to run the ADW loop \u002F agentic engineering loop \u002F software factory workflow.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fyuri-adw\u002FSKILL.md",[],[183,184,185,186,187,188,189,190,191,88,192,111,193,194],"yuri adw","run","engineering loop","software factory","software","agentic engineering","factory","loop","invoke","engineering","agentic","user",{"skillNo":196,"name":197,"nameZh":6,"description":198,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":199,"categories":200,"keywords":213,"publishedAt":39},"01M71CFK4VPEKY6A73237P7RSN","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[201,204,207,210],{"categoryNo":202,"categoryName":203,"taxonomyType":126,"taxonomyTypeDesc":127},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":205,"categoryName":206,"taxonomyType":126,"taxonomyTypeDesc":127},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":208,"categoryName":209,"taxonomyType":126,"taxonomyTypeDesc":127},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":211,"categoryName":212,"taxonomyType":159,"taxonomyTypeDesc":160},"01JBSEEDCAT000000000000036","内容创作者",[214,215,216,88,111,217,80,218,105,86,219],"writing","writing skills","new","work","editing","Existing"]