[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ESJ5BF42MVPTDAJ705DK9X":3,"skill-same:01M6ESJ5BF42MVPTDAJ705DK9X":118},{"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":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":65,"commitSha":66,"skillDirectory":67,"forksCount":14,"repositoryHtmlUrl":68,"repositoryHomepageUrl":69,"ownerHtmlUrl":70,"ownerBlogUrl":6,"ownerDescription":71,"updatedAt":72,"install":73,"resources":86},"01M6ESJ5BF42MVPTDAJ705DK9X","analyzing-bootkit-and-rootkit-samples",null,"Analyzes bootkit and advanced rootkit malware that infects the Master Boot Record (MBR), Volume Boot Record (VBR), or UEFI firmware to gain persistence below the operating system. Covers boot sector analysis, UEFI module inspection, and anti-rootkit detection techniques. Activates for requests involving bootkit analysis, MBR malware investigation, UEFI persistence analysis, or pre-OS malware detection.","henriquescastilho\u002Fmy-claude","henriquescastilho","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F153296945?v=4","01M6ESH7EXPXTH9CVQ4K16SRG8","Henrique Scheer","01M6ESH7JHEK2PTNNH4HEH787Z",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fanalyzing-bootkit-and-rootkit-samples\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"bootkit","rootkit","analyzing bootkit and rootkit samples","analyzing","analysis","de","operating","os","module","volume","malware detection","master","cm","system","cybersecurity","firmware","MBR-analysis","UEFI","malware","boot","2026-11-10 10:12:30",false,"---\nname: analyzing-bootkit-and-rootkit-samples\ndescription: 'Analyzes bootkit and advanced rootkit malware that infects the Master\n  Boot Record (MBR), Volume Boot Record (VBR), or UEFI firmware to gain persistence\n  below the operating system. Covers boot sector analysis, UEFI module inspection,\n  and anti-rootkit detection techniques. Activates for requests involving bootkit\n  analysis, MBR malware investigation, UEFI persistence analysis, or pre-OS malware\n  detection.\n\n  '\ndomain: cybersecurity\nsubdomain: malware-analysis\ntags:\n- malware\n- bootkit\n- rootkit\n- UEFI\n- MBR-analysis\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- DE.AE-02\n- RS.AN-03\n- ID.RA-01\n- DE.CM-01\nmitre_attack:\n- T1542.003\n- T1542.001\n- T1542.002\n- T1014\n- T1547.006\n---\n\n# Analyzing Bootkit and Rootkit Samples\n\n## When to Use\n\n- A system shows signs of compromise that persist through OS reinstallation\n- Antivirus and EDR are unable to detect malware despite clear evidence of compromise\n- UEFI Secure Boot has been disabled or shows integrity violations\n- Memory forensics reveals rootkit behavior (hidden processes, hooked system calls)\n- Investigating nation-state level threats known to deploy bootkits (APT28, APT41, Equation Group)\n\n**Do not use** for standard user-mode malware; bootkits and rootkits operate at a fundamentally different level requiring specialized analysis techniques.\n\n## Prerequisites\n\n- Disk imaging tools (dd, FTK Imager) for acquiring MBR\u002FVBR sectors\n- UEFITool for UEFI firmware volume analysis and module extraction\n- chipsec for hardware-level firmware security assessment\n- Ghidra with x86 real-mode and 16-bit support for MBR code analysis\n- Volatility 3 for kernel-level rootkit artifact detection\n- Bootable Linux live USB for offline system analysis\n\n## Workflow\n\n### Step 1: Acquire Boot Sectors and Firmware\n\nExtract MBR, VBR, and UEFI firmware for offline analysis:\n\n```bash\n# Acquire MBR (first 512 bytes of disk)\ndd if=\u002Fdev\u002Fsda of=mbr.bin bs=512 count=1\n\n# Acquire first track (usually contains bootkit code beyond MBR)\ndd if=\u002Fdev\u002Fsda of=first_track.bin bs=512 count=63\n\n# Acquire VBR (Volume Boot Record - first sector of partition)\ndd if=\u002Fdev\u002Fsda1 of=vbr.bin bs=512 count=1\n\n# Acquire UEFI System Partition\nmkdir \u002Fmnt\u002Fefi\nmount \u002Fdev\u002Fsda1 \u002Fmnt\u002Fefi\ncp -r \u002Fmnt\u002Fefi\u002FEFI \u002Fanalysis\u002Fefi_backup\u002F\n\n# Dump UEFI firmware (requires chipsec or flashrom)\n# Using chipsec:\npython chipsec_util.py spi dump firmware.rom\n\n# Using flashrom:\nflashrom -p internal -r firmware.rom\n\n# Verify firmware dump integrity\nsha256sum firmware.rom\n```\n\n### Step 2: Analyze MBR\u002FVBR for Bootkit Code\n\nExamine boot sector code for malicious modifications:\n\n```bash\n# Disassemble MBR code (16-bit real mode)\nndisasm -b16 mbr.bin > mbr_disasm.txt\n\n# Compare MBR with known-good Windows MBR\n# Standard Windows MBR begins with: EB 5A 90 (JMP 0x5C, NOP)\n# Standard Windows 10 MBR: 33 C0 8E D0 BC 00 7C (XOR AX,AX; MOV SS,AX; MOV SP,7C00h)\n\npython3 \u003C\u003C 'PYEOF'\nwith open(\"mbr.bin\", \"rb\") as f:\n    mbr = f.read()\n\n# Check MBR signature (bytes 510-511 should be 0x55AA)\nif mbr[510:512] == b'\\x55\\xAA':\n    print(\"[*] Valid MBR signature (0x55AA)\")\nelse:\n    print(\"[!] Invalid MBR signature\")\n\n# Check for known bootkit signatures\nbootkit_sigs = {\n    b'\\xE8\\x00\\x00\\x5E\\x81\\xEE': \"TDL4\u002FAlureon bootkit\",\n    b'\\xFA\\x33\\xC0\\x8E\\xD0\\xBC\\x00\\x7C\\x8B\\xF4\\x50\\x07': \"Standard Windows MBR (clean)\",\n    b'\\xEB\\x5A\\x90\\x4E\\x54\\x46\\x53': \"Standard NTFS VBR (clean)\",\n}\n\nfor sig, name in bootkit_sigs.items():\n    if sig in mbr:\n        print(f\"[{'!' if 'clean' not in name else '*'}] Signature match: {name}\")\n\n# Check partition table entries\nprint(\"\\nPartition Table:\")\nfor i in range(4):\n    offset = 446 + (i * 16)\n    entry = mbr[offset:offset+16]\n    if entry != b'\\x00' * 16:\n        boot_flag = \"Active\" if entry[0] == 0x80 else \"Inactive\"\n        part_type = entry[4]\n        start_lba = int.from_bytes(entry[8:12], 'little')\n        size_lba = int.from_bytes(entry[12:16], 'little')\n        print(f\"  Partition {i+1}: Type=0x{part_type:02X} {boot_flag} Start=LBA {start_lba} Size={size_lba} sectors\")\nPYEOF\n```\n\n### Step 3: Analyze UEFI Firmware for Implants\n\nInspect UEFI firmware volumes for unauthorized modules:\n\n```bash\n# Extract UEFI firmware components with UEFITool\n# GUI: Open firmware.rom -> Inspect firmware volumes\n# CLI:\nUEFIExtract firmware.rom all\n\n# List all DXE drivers (most common target for UEFI implants)\nfind firmware.rom.dump -name \"*.efi\" -exec file {} \\;\n\n# Compare against known-good firmware module list\n# Each UEFI module has a GUID - compare against vendor baseline\n\n# Verify Secure Boot configuration\npython chipsec_main.py -m common.secureboot.variables\n\n# Check SPI flash write protection\npython chipsec_main.py -m common.bios_wp\n\n# Check for known UEFI malware patterns\nyara -r uefi_malware.yar firmware.rom\n```\n\n```\nKnown UEFI Bootkit Detection Points:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nLoJax (APT28):\n  - Modified SPI flash\n  - Added DXE driver that drops agent to Windows\n  - Persists through OS reinstall and disk replacement\n\nBlackLotus:\n  - Exploits CVE-2022-21894 to bypass Secure Boot\n  - Modifies EFI System Partition bootloader\n  - Installs kernel driver during boot\n\nCosmicStrand:\n  - Modifies CORE_DXE firmware module\n  - Hooks kernel initialization during boot\n  - Drops shellcode into Windows kernel memory\n\nMoonBounce:\n  - SPI flash implant in CORE_DXE module\n  - Modified GetVariable() function\n  - Deploys user-mode implant through boot chain\n\nESPecter:\n  - Modifies Windows Boot Manager on ESP\n  - Patches winload.efi to disable DSE\n  - Loads unsigned kernel driver\n```\n\n### Step 4: Detect Kernel-Level Rootkit Behavior\n\nAnalyze the running system for rootkit artifacts:\n\n```bash\n# Memory forensics for rootkit detection\n# SSDT hook detection\nvol3 -f memory.dmp windows.ssdt | grep -v \"ntoskrnl\\|win32k\"\n\n# Hidden processes (DKOM)\nvol3 -f memory.dmp windows.psscan > psscan.txt\nvol3 -f memory.dmp windows.pslist > pslist.txt\n# Diff to find hidden processes\n\n# Kernel callback registration (rootkits register callbacks for filtering)\nvol3 -f memory.dmp windows.callbacks\n\n# Driver analysis\nvol3 -f memory.dmp windows.driverscan\nvol3 -f memory.dmp windows.modules\n\n# Check for unsigned drivers\nvol3 -f memory.dmp windows.driverscan | while read line; do\n    driver_path=$(echo \"$line\" | awk '{print $NF}')\n    if [ -f \"$driver_path\" ]; then\n        sigcheck -nobanner \"$driver_path\" 2>\u002Fdev\u002Fnull | grep \"Unsigned\"\n    fi\ndone\n\n# IDT hook detection\nvol3 -f memory.dmp windows.idt\n```\n\n### Step 5: Boot Process Integrity Verification\n\nVerify the integrity of the entire boot chain:\n\n```bash\n# Verify Windows Boot Manager signature\nsigcheck -a C:\\Windows\\Boot\\EFI\\bootmgfw.efi\n\n# Verify winload.efi\nsigcheck -a C:\\Windows\\System32\\winload.efi\n\n# Verify ntoskrnl.exe\nsigcheck -a C:\\Windows\\System32\\ntoskrnl.exe\n\n# Check Measured Boot logs (if TPM is available)\n# Windows: BCDEdit \u002Fenum firmware\nbcdedit \u002Fenum firmware\n\n# Verify Secure Boot state\nConfirm-SecureBootUEFI  # PowerShell cmdlet\n\n# Check boot configuration for tampering\nbcdedit \u002Fv\n\n# Look for boot configuration changes\n# testsigning: should be No\n# nointegritychecks: should be No\n# debug: should be No\nbcdedit | findstr \u002Fi \"testsigning nointegritychecks debug\"\n```\n\n### Step 6: Document Bootkit\u002FRootkit Analysis\n\nCompile comprehensive analysis findings:\n\n```\nAnalysis should document:\n- Boot sector (MBR\u002FVBR) integrity status with hex comparison\n- UEFI firmware module inventory and integrity verification\n- Secure Boot status and any bypass mechanisms detected\n- Kernel-level hooks (SSDT, IDT, IRP, inline) identified\n- Hidden processes, drivers, and files discovered\n- Persistence mechanism (SPI flash, ESP, MBR, kernel driver)\n- Boot chain integrity verification results\n- Attribution to known bootkit families if possible\n- Remediation steps (reflash firmware, rebuild MBR, replace hardware)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Bootkit** | Malware that infects the boot process (MBR, VBR, UEFI) to execute before the operating system loads, gaining persistent low-level control |\n| **MBR (Master Boot Record)** | First 512 bytes of a disk containing bootstrap code and partition table; MBR bootkits replace this code with malicious loaders |\n| **UEFI (Unified Extensible Firmware Interface)** | Modern firmware interface replacing BIOS; UEFI bootkits implant malicious modules in firmware volumes or modify the ESP |\n| **Secure Boot** | UEFI security feature verifying digital signatures of boot components; bootkits like BlackLotus exploit vulnerabilities to bypass it |\n| **SPI Flash** | Flash memory chip storing UEFI firmware; advanced bootkits like LoJax and MoonBounce modify SPI flash for firmware-level persistence |\n| **DKOM (Direct Kernel Object Manipulation)** | Rootkit technique modifying kernel structures to hide processes, files, and network connections without hooking functions |\n| **Driver Signature Enforcement (DSE)** | Windows security feature requiring kernel drivers to be digitally signed; bootkits disable DSE during boot to load unsigned rootkit drivers |\n\n## Tools & Systems\n\n- **UEFITool**: Open-source UEFI firmware image editor and parser for inspecting firmware volumes, drivers, and modules\n- **chipsec**: Intel hardware security assessment framework for verifying SPI flash protection, Secure Boot, and UEFI configuration\n- **Volatility**: Memory forensics framework with SSDT, IDT, callback, and driver analysis plugins for kernel rootkit detection\n- **GMER**: Windows rootkit detection tool scanning for SSDT hooks, IDT hooks, hidden processes, and modified kernel modules\n- **Bootkits Analyzer**: Specialized tool for analyzing MBR\u002FVBR code including disassembly and comparison against known-good baselines\n\n## Common Scenarios\n\n### Scenario: Investigating Persistent Compromise Surviving OS Reinstallation\n\n**Context**: An organization reimaged a compromised workstation, but the same C2 beaconing resumed within hours. Standard disk forensics finds no malware. UEFI bootkit is suspected.\n\n**Approach**:\n1. Boot from a Linux live USB to avoid executing any compromised OS components\n2. Dump the SPI flash firmware using chipsec or flashrom for offline analysis\n3. Dump the MBR and VBR sectors with dd for boot sector analysis\n4. Copy the EFI System Partition for bootloader integrity verification\n5. Open the SPI dump in UEFITool and compare module GUIDs against vendor-provided firmware\n6. Look for additional or modified DXE drivers that should not be present\n7. Analyze any suspicious modules with Ghidra (x86_64 UEFI module format)\n8. Verify Secure Boot configuration and check for exploit-based bypasses\n\n**Pitfalls**:\n- Analyzing the system while the compromised OS is running (rootkit may hide from live analysis)\n- Not checking SPI flash (only analyzing disk-based boot components misses firmware-level implants)\n- Assuming Secure Boot prevents all bootkits (known bypasses exist, e.g., CVE-2022-21894)\n- Not preserving the original firmware dump before reflashing (critical evidence for attribution)\n\n## Output Format\n\n```\nBOOTKIT \u002F ROOTKIT ANALYSIS REPORT\n====================================\nSystem:           Dell OptiPlex 7090 (UEFI, TPM 2.0)\nFirmware Version: 1.15.0 (Dell)\nSecure Boot:      ENABLED (but bypassed)\nCapture Method:   Linux Live USB + chipsec SPI dump\n\nMBR\u002FVBR ANALYSIS\nMBR Signature:    Valid (0x55AA)\nMBR Code:         MATCHES standard Windows 10 MBR (clean)\nVBR Code:         MATCHES standard NTFS VBR (clean)\n\nUEFI FIRMWARE ANALYSIS\nTotal Modules:    287\nVendor Expected:  285\nExtra Modules:    2 UNAUTHORIZED\n  [!] DXE Driver GUID: {ABCD1234-...} \"SmmAccessDxe_mod\" (MODIFIED)\n      Original Size: 12,288 bytes\n      Current Size:  45,056 bytes (32KB ADDED)\n      Entropy: 7.82 (HIGH - encrypted payload)\n\n  [!] DXE Driver GUID: {EFGH5678-...} \"UefiPayloadDxe\" (NEW - not in vendor firmware)\n      Size: 28,672 bytes\n      Function: Drops persistence agent during boot\n\nBOOT CHAIN INTEGRITY\nbootmgfw.efi:     MODIFIED (hash mismatch, Secure Boot bypass via CVE-2022-21894)\nwinload.efi:      MODIFIED (DSE disabled at load time)\nntoskrnl.exe:     CLEAN (but unsigned driver loaded after boot)\n\nKERNEL ROOTKIT COMPONENTS\nDriver:           C:\\Windows\\System32\\drivers\\null_mod.sys (unsigned, hidden)\nSSDT Hooks:       3 (NtQuerySystemInformation, NtQueryDirectoryFile, NtDeviceIoControlFile)\nHidden Processes: 2 (PID 6784: beacon.exe, PID 6812: keylog.exe)\nHidden Files:     C:\\Windows\\System32\\drivers\\null_mod.sys\n\nATTRIBUTION\nFamily:           BlackLotus variant\nConfidence:       HIGH (CVE-2022-21894 exploit, ESP modification pattern matches)\n\nREMEDIATION\n1. Reflash SPI firmware with clean vendor image via hardware programmer\n2. Rebuild EFI System Partition from clean Windows installation media\n3. Reinstall OS from verified media\n4. Enable all firmware write protections\n5. Update firmware to latest version (patches CVE-2022-21894)\n```\n","# Analyzing Bootkit and Rootkit Samples\n\n## When to Use\n\n- A system shows signs of compromise that persist through OS reinstallation\n- Antivirus and EDR are unable to detect malware despite clear evidence of compromise\n- UEFI Secure Boot has been disabled or shows integrity violations\n- Memory forensics reveals rootkit behavior (hidden processes, hooked system calls)\n- Investigating nation-state level threats known to deploy bootkits (APT28, APT41, Equation Group)\n\n**Do not use** for standard user-mode malware; bootkits and rootkits operate at a fundamentally different level requiring specialized analysis techniques.\n\n## Prerequisites\n\n- Disk imaging tools (dd, FTK Imager) for acquiring MBR\u002FVBR sectors\n- UEFITool for UEFI firmware volume analysis and module extraction\n- chipsec for hardware-level firmware security assessment\n- Ghidra with x86 real-mode and 16-bit support for MBR code analysis\n- Volatility 3 for kernel-level rootkit artifact detection\n- Bootable Linux live USB for offline system analysis\n\n## Workflow\n\n### Step 1: Acquire Boot Sectors and Firmware\n\nExtract MBR, VBR, and UEFI firmware for offline analysis:\n\n```bash\n# Acquire MBR (first 512 bytes of disk)\ndd if=\u002Fdev\u002Fsda of=mbr.bin bs=512 count=1\n\n# Acquire first track (usually contains bootkit code beyond MBR)\ndd if=\u002Fdev\u002Fsda of=first_track.bin bs=512 count=63\n\n# Acquire VBR (Volume Boot Record - first sector of partition)\ndd if=\u002Fdev\u002Fsda1 of=vbr.bin bs=512 count=1\n\n# Acquire UEFI System Partition\nmkdir \u002Fmnt\u002Fefi\nmount \u002Fdev\u002Fsda1 \u002Fmnt\u002Fefi\ncp -r \u002Fmnt\u002Fefi\u002FEFI \u002Fanalysis\u002Fefi_backup\u002F\n\n# Dump UEFI firmware (requires chipsec or flashrom)\n# Using chipsec:\npython chipsec_util.py spi dump firmware.rom\n\n# Using flashrom:\nflashrom -p internal -r firmware.rom\n\n# Verify firmware dump integrity\nsha256sum firmware.rom\n```\n\n### Step 2: Analyze MBR\u002FVBR for Bootkit Code\n\nExamine boot sector code for malicious modifications:\n\n```bash\n# Disassemble MBR code (16-bit real mode)\nndisasm -b16 mbr.bin > mbr_disasm.txt\n\n# Compare MBR with known-good Windows MBR\n# Standard Windows MBR begins with: EB 5A 90 (JMP 0x5C, NOP)\n# Standard Windows 10 MBR: 33 C0 8E D0 BC 00 7C (XOR AX,AX; MOV SS,AX; MOV SP,7C00h)\n\npython3 \u003C\u003C 'PYEOF'\nwith open(\"mbr.bin\", \"rb\") as f:\n    mbr = f.read()\n\n# Check MBR signature (bytes 510-511 should be 0x55AA)\nif mbr[510:512] == b'\\x55\\xAA':\n    print(\"[*] Valid MBR signature (0x55AA)\")\nelse:\n    print(\"[!] Invalid MBR signature\")\n\n# Check for known bootkit signatures\nbootkit_sigs = {\n    b'\\xE8\\x00\\x00\\x5E\\x81\\xEE': \"TDL4\u002FAlureon bootkit\",\n    b'\\xFA\\x33\\xC0\\x8E\\xD0\\xBC\\x00\\x7C\\x8B\\xF4\\x50\\x07': \"Standard Windows MBR (clean)\",\n    b'\\xEB\\x5A\\x90\\x4E\\x54\\x46\\x53': \"Standard NTFS VBR (clean)\",\n}\n\nfor sig, name in bootkit_sigs.items():\n    if sig in mbr:\n        print(f\"[{'!' if 'clean' not in name else '*'}] Signature match: {name}\")\n\n# Check partition table entries\nprint(\"\\nPartition Table:\")\nfor i in range(4):\n    offset = 446 + (i * 16)\n    entry = mbr[offset:offset+16]\n    if entry != b'\\x00' * 16:\n        boot_flag = \"Active\" if entry[0] == 0x80 else \"Inactive\"\n        part_type = entry[4]\n        start_lba = int.from_bytes(entry[8:12], 'little')\n        size_lba = int.from_bytes(entry[12:16], 'little')\n        print(f\"  Partition {i+1}: Type=0x{part_type:02X} {boot_flag} Start=LBA {start_lba} Size={size_lba} sectors\")\nPYEOF\n```\n\n### Step 3: Analyze UEFI Firmware for Implants\n\nInspect UEFI firmware volumes for unauthorized modules:\n\n```bash\n# Extract UEFI firmware components with UEFITool\n# GUI: Open firmware.rom -> Inspect firmware volumes\n# CLI:\nUEFIExtract firmware.rom all\n\n# List all DXE drivers (most common target for UEFI implants)\nfind firmware.rom.dump -name \"*.efi\" -exec file {} \\;\n\n# Compare against known-good firmware module list\n# Each UEFI module has a GUID - compare against vendor baseline\n\n# Verify Secure Boot configuration\npython chipsec_main.py -m common.secureboot.variables\n\n# Check SPI flash write protection\npython chipsec_main.py -m common.bios_wp\n\n# Check for known UEFI malware patterns\nyara -r uefi_malware.yar firmware.rom\n```\n\n```\nKnown UEFI Bootkit Detection Points:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nLoJax (APT28):\n  - Modified SPI flash\n  - Added DXE driver that drops agent to Windows\n  - Persists through OS reinstall and disk replacement\n\nBlackLotus:\n  - Exploits CVE-2022-21894 to bypass Secure Boot\n  - Modifies EFI System Partition bootloader\n  - Installs kernel driver during boot\n\nCosmicStrand:\n  - Modifies CORE_DXE firmware module\n  - Hooks kernel initialization during boot\n  - Drops shellcode into Windows kernel memory\n\nMoonBounce:\n  - SPI flash implant in CORE_DXE module\n  - Modified GetVariable() function\n  - Deploys user-mode implant through boot chain\n\nESPecter:\n  - Modifies Windows Boot Manager on ESP\n  - Patches winload.efi to disable DSE\n  - Loads unsigned kernel driver\n```\n\n### Step 4: Detect Kernel-Level Rootkit Behavior\n\nAnalyze the running system for rootkit artifacts:\n\n```bash\n# Memory forensics for rootkit detection\n# SSDT hook detection\nvol3 -f memory.dmp windows.ssdt | grep -v \"ntoskrnl\\|win32k\"\n\n# Hidden processes (DKOM)\nvol3 -f memory.dmp windows.psscan > psscan.txt\nvol3 -f memory.dmp windows.pslist > pslist.txt\n# Diff to find hidden processes\n\n# Kernel callback registration (rootkits register callbacks for filtering)\nvol3 -f memory.dmp windows.callbacks\n\n# Driver analysis\nvol3 -f memory.dmp windows.driverscan\nvol3 -f memory.dmp windows.modules\n\n# Check for unsigned drivers\nvol3 -f memory.dmp windows.driverscan | while read line; do\n    driver_path=$(echo \"$line\" | awk '{print $NF}')\n    if [ -f \"$driver_path\" ]; then\n        sigcheck -nobanner \"$driver_path\" 2>\u002Fdev\u002Fnull | grep \"Unsigned\"\n    fi\ndone\n\n# IDT hook detection\nvol3 -f memory.dmp windows.idt\n```\n\n### Step 5: Boot Process Integrity Verification\n\nVerify the integrity of the entire boot chain:\n\n```bash\n# Verify Windows Boot Manager signature\nsigcheck -a C:\\Windows\\Boot\\EFI\\bootmgfw.efi\n\n# Verify winload.efi\nsigcheck -a C:\\Windows\\System32\\winload.efi\n\n# Verify ntoskrnl.exe\nsigcheck -a C:\\Windows\\System32\\ntoskrnl.exe\n\n# Check Measured Boot logs (if TPM is available)\n# Windows: BCDEdit \u002Fenum firmware\nbcdedit \u002Fenum firmware\n\n# Verify Secure Boot state\nConfirm-SecureBootUEFI  # PowerShell cmdlet\n\n# Check boot configuration for tampering\nbcdedit \u002Fv\n\n# Look for boot configuration changes\n# testsigning: should be No\n# nointegritychecks: should be No\n# debug: should be No\nbcdedit | findstr \u002Fi \"testsigning nointegritychecks debug\"\n```\n\n### Step 6: Document Bootkit\u002FRootkit Analysis\n\nCompile comprehensive analysis findings:\n\n```\nAnalysis should document:\n- Boot sector (MBR\u002FVBR) integrity status with hex comparison\n- UEFI firmware module inventory and integrity verification\n- Secure Boot status and any bypass mechanisms detected\n- Kernel-level hooks (SSDT, IDT, IRP, inline) identified\n- Hidden processes, drivers, and files discovered\n- Persistence mechanism (SPI flash, ESP, MBR, kernel driver)\n- Boot chain integrity verification results\n- Attribution to known bootkit families if possible\n- Remediation steps (reflash firmware, rebuild MBR, replace hardware)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Bootkit** | Malware that infects the boot process (MBR, VBR, UEFI) to execute before the operating system loads, gaining persistent low-level control |\n| **MBR (Master Boot Record)** | First 512 bytes of a disk containing bootstrap code and partition table; MBR bootkits replace this code with malicious loaders |\n| **UEFI (Unified Extensible Firmware Interface)** | Modern firmware interface replacing BIOS; UEFI bootkits implant malicious modules in firmware volumes or modify the ESP |\n| **Secure Boot** | UEFI security feature verifying digital signatures of boot components; bootkits like BlackLotus exploit vulnerabilities to bypass it |\n| **SPI Flash** | Flash memory chip storing UEFI firmware; advanced bootkits like LoJax and MoonBounce modify SPI flash for firmware-level persistence |\n| **DKOM (Direct Kernel Object Manipulation)** | Rootkit technique modifying kernel structures to hide processes, files, and network connections without hooking functions |\n| **Driver Signature Enforcement (DSE)** | Windows security feature requiring kernel drivers to be digitally signed; bootkits disable DSE during boot to load unsigned rootkit drivers |\n\n## Tools & Systems\n\n- **UEFITool**: Open-source UEFI firmware image editor and parser for inspecting firmware volumes, drivers, and modules\n- **chipsec**: Intel hardware security assessment framework for verifying SPI flash protection, Secure Boot, and UEFI configuration\n- **Volatility**: Memory forensics framework with SSDT, IDT, callback, and driver analysis plugins for kernel rootkit detection\n- **GMER**: Windows rootkit detection tool scanning for SSDT hooks, IDT hooks, hidden processes, and modified kernel modules\n- **Bootkits Analyzer**: Specialized tool for analyzing MBR\u002FVBR code including disassembly and comparison against known-good baselines\n\n## Common Scenarios\n\n### Scenario: Investigating Persistent Compromise Surviving OS Reinstallation\n\n**Context**: An organization reimaged a compromised workstation, but the same C2 beaconing resumed within hours. Standard disk forensics finds no malware. UEFI bootkit is suspected.\n\n**Approach**:\n1. Boot from a Linux live USB to avoid executing any compromised OS components\n2. Dump the SPI flash firmware using chipsec or flashrom for offline analysis\n3. Dump the MBR and VBR sectors with dd for boot sector analysis\n4. Copy the EFI System Partition for bootloader integrity verification\n5. Open the SPI dump in UEFITool and compare module GUIDs against vendor-provided firmware\n6. Look for additional or modified DXE drivers that should not be present\n7. Analyze any suspicious modules with Ghidra (x86_64 UEFI module format)\n8. Verify Secure Boot configuration and check for exploit-based bypasses\n\n**Pitfalls**:\n- Analyzing the system while the compromised OS is running (rootkit may hide from live analysis)\n- Not checking SPI flash (only analyzing disk-based boot components misses firmware-level implants)\n- Assuming Secure Boot prevents all bootkits (known bypasses exist, e.g., CVE-2022-21894)\n- Not preserving the original firmware dump before reflashing (critical evidence for attribution)\n\n## Output Format\n\n```\nBOOTKIT \u002F ROOTKIT ANALYSIS REPORT\n====================================\nSystem:           Dell OptiPlex 7090 (UEFI, TPM 2.0)\nFirmware Version: 1.15.0 (Dell)\nSecure Boot:      ENABLED (but bypassed)\nCapture Method:   Linux Live USB + chipsec SPI dump\n\nMBR\u002FVBR ANALYSIS\nMBR Signature:    Valid (0x55AA)\nMBR Code:         MATCHES standard Windows 10 MBR (clean)\nVBR Code:         MATCHES standard NTFS VBR (clean)\n\nUEFI FIRMWARE ANALYSIS\nTotal Modules:    287\nVendor Expected:  285\nExtra Modules:    2 UNAUTHORIZED\n  [!] DXE Driver GUID: {ABCD1234-...} \"SmmAccessDxe_mod\" (MODIFIED)\n      Original Size: 12,288 bytes\n      Current Size:  45,056 bytes (32KB ADDED)\n      Entropy: 7.82 (HIGH - encrypted payload)\n\n  [!] DXE Driver GUID: {EFGH5678-...} \"UefiPayloadDxe\" (NEW - not in vendor firmware)\n      Size: 28,672 bytes\n      Function: Drops persistence agent during boot\n\nBOOT CHAIN INTEGRITY\nbootmgfw.efi:     MODIFIED (hash mismatch, Secure Boot bypass via CVE-2022-21894)\nwinload.efi:      MODIFIED (DSE disabled at load time)\nntoskrnl.exe:     CLEAN (but unsigned driver loaded after boot)\n\nKERNEL ROOTKIT COMPONENTS\nDriver:           C:\\Windows\\System32\\drivers\\null_mod.sys (unsigned, hidden)\nSSDT Hooks:       3 (NtQuerySystemInformation, NtQueryDirectoryFile, NtDeviceIoControlFile)\nHidden Processes: 2 (PID 6784: beacon.exe, PID 6812: keylog.exe)\nHidden Files:     C:\\Windows\\System32\\drivers\\null_mod.sys\n\nATTRIBUTION\nFamily:           BlackLotus variant\nConfidence:       HIGH (CVE-2022-21894 exploit, ESP modification pattern matches)\n\nREMEDIATION\n1. Reflash SPI firmware with clean vendor image via hardware programmer\n2. Rebuild EFI System Partition from clean Windows installation media\n3. Reinstall OS from verified media\n4. Enable all firmware write protections\n5. Update firmware to latest version (patches CVE-2022-21894)\n```\n",{"name":5,"tags":49,"author":50,"domain":38,"license":15,"version":51,"nist_csf":52,"subdomain":57,"description":58,"mitre_attack":59},[42,24,25,41,40],"mahipal","1.0.0",[53,54,55,56],"DE.AE-02","RS.AN-03","ID.RA-01","DE.CM-01","malware-analysis","Analyzes bootkit and advanced rootkit malware that infects the Master Boot Record (MBR), Volume Boot Record (VBR), or UEFI firmware to gain persistence below the operating system. Covers boot sector analysis, UEFI module inspection, and anti-rootkit detection techniques. Activates for requests involving bootkit analysis, MBR malware investigation, UEFI persistence analysis, or pre-OS malware detection.\n",[60,61,62,63,64],"T1542.003","T1542.001","T1542.002","T1014","T1547.006","main","7925716f065257435fdb12e97f7e52842147d5ad",".claude\u002Fskills\u002Fanalyzing-bootkit-and-rootkit-samples","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude","https:\u002F\u002Fclaude.com\u002Fclaude-code","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho","Software · Applied AI · Quantitative Modeling · Building with Claude.","2026-06-10 12:24:46",{"source":8,"skillName":5,"commands":74,"prompt":84,"zipAvailable":85},[75,78,81],{"tool":76,"command":77},"npx","npx skills add henriquescastilho\u002Fmy-claude --skill analyzing-bootkit-and-rootkit-samples",{"tool":79,"command":80},"bunx","bunx skills add henriquescastilho\u002Fmy-claude --skill analyzing-bootkit-and-rootkit-samples",{"tool":82,"command":83},"pnpm","pnpm dlx skills add henriquescastilho\u002Fmy-claude --skill analyzing-bootkit-and-rootkit-samples","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fanalyzing-bootkit-and-rootkit-samples\u002FSKILL.md",true,[87,93,98,102,108,112],{"path":88,"resourceType":89,"resourceTypeDesc":90,"sizeBytes":91,"sourceHtmlUrl":92},"assets\u002Fpreview.png","ASSET","资产文件",1193637,"https:\u002F\u002Fgithub.com\u002Faqm857886159\u002FNomi\u002Fblob\u002Fmain\u002Fskills\u002Fcurated-restore-image\u002Fassets\u002Fpreview.png",{"path":94,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":96,"sourceHtmlUrl":97},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fanalyzing-bootkit-and-rootkit-samples\u002FLICENSE",{"path":99,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":100,"sourceHtmlUrl":101},"LICENSE.txt",11357,"https:\u002F\u002Fgithub.com\u002Faqm857886159\u002FNomi\u002Fblob\u002Fmain\u002Fskills\u002Fcurated-restore-image\u002FLICENSE.txt",{"path":103,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":106,"sourceHtmlUrl":107},"references-license.md","REFERENCE","参考文档",381,"https:\u002F\u002Fgithub.com\u002Faqm857886159\u002FNomi\u002Fblob\u002Fmain\u002Fskills\u002Fcurated-restore-image\u002Freferences-license.md",{"path":109,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":110,"sourceHtmlUrl":111},"references\u002Fapi-reference.md",2798,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fanalyzing-bootkit-and-rootkit-samples\u002Freferences\u002Fapi-reference.md",{"path":113,"resourceType":114,"resourceTypeDesc":115,"sizeBytes":116,"sourceHtmlUrl":117},"scripts\u002Fagent.py","SCRIPT","脚本",7136,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fanalyzing-bootkit-and-rootkit-samples\u002Fscripts\u002Fagent.py",[119,160,169,178,200,225],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":140,"publishedAt":44},"01M6F0B6XPQ65AX2X0DWK8KT3E","markitdown","Convert files and office documents to Markdown. Supports PDF, DOCX, PPTX, XLSX, images (with OCR), audio (with transcription), HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs and more.","MIT","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[126,129,132,135],{"categoryNo":127,"categoryName":128,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":130,"categoryName":131,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":133,"categoryName":134,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000004","电子表格",{"categoryNo":136,"categoryName":137,"taxonomyType":138,"taxonomyTypeDesc":139},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[121,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159],"docx","PDF","pptx","xlsx","documents","csv","ocr","Audio","Bash","markdown","convert","read","write","edit","html","images","files","youtube","with",{"skillNo":161,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":168,"publishedAt":44},"01M6F06SBHR9F0SDWE282Y8075","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002Fscientific_writer\u002F.claude\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[164,165,166,167],{"categoryNo":127,"categoryName":128,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":130,"categoryName":131,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":133,"categoryName":134,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":136,"categoryName":137,"taxonomyType":138,"taxonomyTypeDesc":139},[121,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159],{"skillNo":170,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":177,"publishedAt":44},"01M6F02D4R14EJAPBWVDF9J9VQ","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002F.claude\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[173,174,175,176],{"categoryNo":127,"categoryName":128,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":130,"categoryName":131,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":133,"categoryName":134,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":136,"categoryName":137,"taxonomyType":138,"taxonomyTypeDesc":139},[121,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159],{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":184,"publishedAt":44},"01M6F000KS6YB4MKS774G4R8ND","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fzarr-python\u002FSKILL.md",[],[185,186,187,188,189,190,191,192,193,194,195,196,197,198,199],"python","zarr python","storage","integration","s3","gcs","cloud","dask","parallel","pipelines","arrays","numpy","scientific computing","scale","scientific",{"skillNo":201,"name":202,"nameZh":6,"description":203,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":6,"sourceHtmlUrl":204,"categories":205,"keywords":207,"publishedAt":44},"01M6EZZJWFXM1GR78KTW6J0DN8","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fwhat-if-oracle\u002FSKILL.md",[206],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[208,209,210,211,212,213,28,214,215,216,217,152,153,218,219,220,221,222,223,224],"oracle","what if oracle","go","run","ux","futures","explore","decision","branch","question","idea","exploration","options","stress-test","strategies","scenario","stress",{"skillNo":226,"name":227,"nameZh":6,"description":228,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":6,"sourceHtmlUrl":229,"categories":230,"keywords":241,"publishedAt":44},"01M6EZZCXAEB49RXGQCJX5E8GB","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fvenue-templates\u002FSKILL.md",[231,234,237,238],{"categoryNo":232,"categoryName":233,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":235,"categoryName":236,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":239,"categoryName":240,"taxonomyType":138,"taxonomyTypeDesc":139},"01JBSEEDCAT000000000000036","内容创作者",[242,243,244,245,246,247,248,249,149,250,152,153,154,251,252,253,254,255,199,256],"templates","venue templates","research","guidelines","NeurIPS","ICML","LaTeX","science","access","proposals","Academic","requirements","formatting","journal","chi"]