acquiring-disk-image-w…
Create forensically sound bit-for-bit disk images using dd and dcfldd while preserving evidence integrity through
Analyzes UEFI bootkit persistence mechanisms including firmware implants in SPI flash, EFI System Partition
$ npx -y skills add Mikaru0Mystic/sectinel --skill analyzing-uefi-bootkit-persistence --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/analyzing-uefi-bootkit-persistenceContext preview
The summary Claude sees to decide when to auto-load this skill.
Analyzes UEFI bootkit persistence mechanisms including firmware implants in SPI flash, EFI System Partition
name: analyzing-uefi-bootkit-persistence description: 'Analyzes UEFI bootkit persistence mechanisms including firmware implants in SPI flash, EFI System Partition (ESP) modifications, Secure Boot bypass techniques, and UEFI variable manipulation. Covers detection of known bootkit families (BlackLotus, LoJax, MosaicRegressor, MoonBounce, CosmicStrand), ESP partition forensic inspection, chipsec-based firmware integrity verification, and Secure Boot configuration auditing. Activates for requests involving UEFI malware analysis, firmware persistence investigation, boot chain integrity verification, or Secure Boot bypass detection. ' domain: cybersecurity subdomain: firmware-security tags: - UEFI - bootkit - firmware - Secure-Boot - chipsec - ESP - persistence version: 1.0.0 author: mukul975 license: Apache-2.0 d3fend_techniques: - Platform Hardening - Restore Object - Platform Monitoring - Firmware Verification - Firmware Embedded Monitoring Code nist_csf: - ID.RA-01 - PR.PS-01 - PR.PS-02
**Do not use** for standard MBR-based bootkits on legacy BIOS systems without UEFI; use MBR/VBR bootkit analysis instead.
Acquire the UEFI firmware from the SPI flash chip for offline analysis:
# Using chipsec to dump SPI flash contents python chipsec_util.py spi dump firmware_dump.rom # Using flashrom as an alternative flashrom -p internal -r firmware_dump.rom # Verify dump integrity sha256sum firmware_dump.rom # Read SPI flash descriptor information python chipsec_util.py spi info # Check SPI flash region access permissions python chipsec_main.py -m common.spi_access # Verify BIOS write protection is enabled python chipsec_main.py -m common.bios_wp # Check SPI flash controller lock python chipsec_main.py -m common.spi_lock
Enumerate and analyze UEFI variables for unauthorized modifications:
# List all UEFI variables on a live system python chipsec_util.py uefi var-list # List UEFI variables from a SPI flash dump python chipsec_util.py uefi var-list-spi firmware_dump.rom # Read specific Secure Boot variables python chipsec_util.py uefi var-read SecureBoot 8BE4DF61-93CA-11D2-AA0D-00E098032B8C python chipsec_util.py uefi var-read SetupMode 8BE4DF61-93CA-11D2-AA0D-00E098032B8C python chipsec_util.py uefi var-read PK 8BE4DF61-93CA-11D2-AA0D-00E098032B8C python chipsec_util.py uefi var-read KEK 8BE4DF61-93CA-11D2-AA0D-00E098032B8C python chipsec_util.py uefi var-read db D719B2CB-3D3A-4596-A3BC-DAD00E67656F # Dump UEFI key databases for analysis python chipsec_util.py uefi keys # Check Secure Boot configuration module python chipsec_main.py -m common.secureboot.variables
Inspect the ESP for unauthorized or modified boot components:
# Mount ESP (typically the first FAT32 partition, ~100-500MB)
mkdir /mnt/esp
mount /dev/sda1 /mnt/esp
# List all files on ESP with timestamps
find /mnt/esp -type f -exec ls -la {} \;
# Check for BlackLotus indicators - custom directory under ESP:/system32/
ls -la /mnt/esp/system32/ 2>/dev/null
# Verify Windows Boot Manager signature
sigcheck -a /mnt/esp/EFI/Microsoft/Boot/bootmgfw.efi
# Hash all EFI binaries for comparison against known-good values
find /mnt/esp -name "*.efi" -exec sha256sum {} \;
# Check for unauthorized .efi files outside standard directories
find /mnt/esp -name "*.efi" | grep -v "Microsoft\|Boot\|ubuntu\|grub"
# Look for grubx64.efi planted by BlackLotus
find /mnt/esp -name "grubx64.efi" -exec sha256sum {} \;
# Examine MeasuredBoot logs for anomalies (Windows)
# Logs located at C:\Windows\Logs\MeasuredBoot\Analyze the firmware dump for known UEFI malware patterns:
# Extract all firmware modules with UEFIExtract
UEFIExtract firmware_dump.rom all
# Generate firmware module whitelist from vendor baseline
python chipsec_main.py -m tools.uefi.whitelist -a generate,baseline.json,firmware_vendor.rom
# Compare current firmware against whitelist
python chipsec_main.py -m tools.uefi.whitelist -a check,baseline.json,firmware_dump.rom
# Scan firmware with UEFI-specific YARA rules
yara -r uefi_bootkits.yar firmware_dump.rom
# Scan extracted modules individually
find firmware_dump.rom.dump -name "*.efi" -exec yara -r uefi_bootkits.yar {} \;
# Check for modified CORE_DXE module (targeted by MoonBounce, CosmicStrand)
# Compare GUID and hash against vendor baselineCheck for known Secure Boot bypass techniques:
# Check if Secure Boot is enabled python chipsec_main.py -m common.secureboot.variables # Verify SMM (System Management Mode) protections python chipsec_main.py -m common.smm # Check SMM BIOS write protection python chipsec_main.py -m common.bios_smi # On W
Open-source security arsenal for AI coding agents: 784 cybersecurity skills, scanner integrations, and a security MCP for Claude Code, Cursor, opencode, Gemini CLI, Cline, and any agentskills.io agent. Mapped to OWASP, MITRE ATT&CK, NIST CSF, D3FEND, ATLAS.
Repo: Mikaru0Mystic/sectinel
Create forensically sound bit-for-bit disk images using dd and dcfldd while preserving evidence integrity through
Detect dangerous ACL misconfigurations in Active Directory using ldap3 to identify GenericAll, WriteDACL, and
Perform static analysis of Android APK malware samples using apktool for decompilation, jadx for Java source
Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect BOLA/IDOR attacks, rate limit bypass,
Analyze advanced persistent threat (APT) group techniques using MITRE ATT&CK Navigator to create layered heatmaps
Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query to detect suspicious administrative