[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DGDSX4M4KSNJFGFZB6A8AC":3,"skill-same:01M7DGDSX4M4KSNJFGFZB6A8AC":50},{"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":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7DGDSX4M4KSNJFGFZB6A8AC","reverser-rootkit-analysis",null,"Rootkit detection and analysis — UEFI rootkits, kernel-level rootkits, bootkits, DKOM techniques, SSDT\u002FIDT\u002FIRP hooking, hypervisor rootkits, and firmware implant detection using GMER, Volatility, chipsec, and UEFITool.","Akapi895\u002Fraptix","Akapi895","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F83953516?v=4","01M7DEGNDGERR4F4YETDFVA512","Phạm Anh Tuấn","01M7DEGNEHYZNA920AYM5EH7H8",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Freverser\u002Frootkit-analysis\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: reverser-rootkit-analysis\ndescription: \"Rootkit detection and analysis — UEFI rootkits, kernel-level rootkits, bootkits, DKOM techniques, SSDT\u002FIDT\u002FIRP hooking, hypervisor rootkits, and firmware implant detection using GMER, Volatility, chipsec, and UEFITool.\"\nallowed-tools: Bash Read Write\nmetadata:\n  when_to_use: \"rootkit bootkit uefi firmware kernel driver ssdt hook dkom hidden process hypervisor mbr vbr implant bios spi flash ring0 ring-1\"\n  subdomain: reverser\n  tags: \"rootkit, UEFI, bootkit, kernel, firmware, Volatility, chipsec\"\n  mitre_attack: \"T1542.001, T1542.003, T1014\"\n---\n\n# Rootkit Analysis\n\nDetect and analyze rootkits operating at kernel, boot, and firmware levels — from user-mode hiding techniques through UEFI implants and hypervisor-based rootkits.\n\n## Quick Reference\n\n```bash\n# Quick kernel rootkit scan (Windows, run as admin)\ngmer.exe \u002Fscan\n\n# System-wide hidden process \u002F driver detection\nvolatility3 -f memory.raw windows.pslist vs windows.psscan\n# Processes in psscan but NOT in pslist → hidden by DKOM\n\n# UEFI firmware extraction and analysis\nchipsec_util.py spi dump firmware.bin\nUEFIExtract firmware.bin\n\n# Check for unsigned kernel drivers\nsigcheck -u -e C:\\Windows\\System32\\drivers\\*.sys\n\n# Scan for SSDT hooks\nvolatility3 -f memory.raw windows.ssdt\n```\n\n## MITRE ATT&CK Mapping\n\n| Technique | ID | How It Appears |\n|---|---|---|\n| System Firmware | T1542.001 | UEFI rootkit implanted in SPI flash (LoJax, MosaicRegressor, CosmicStrand) |\n| Bootkit | T1542.003 | MBR\u002FVBR modification to load malicious code before OS (TDL4, Rovnix, ESPecter) |\n| Rootkit | T1014 | Kernel object manipulation to hide processes, files, registry keys |\n| Boot or Logon Autostart: Kernel Modules | T1547.006 | Malicious kernel driver loaded at boot via service registry key |\n| Exploitation for Defense Evasion | T1211 | Vulnerable driver exploit (BYOVD) to load unsigned kernel code |\n| Virtualization\u002FSandbox Evasion | T1497 | Hypervisor rootkit detecting\u002Fevading analysis environment |\n\n## 1. User-Mode Rootkit Detection\n\nDetect rootkits that hook user-mode APIs to hide artifacts.\n\n```bash\n# Compare API hook status — IAT\u002FEAT\u002Finline hooks\n# Use API Monitor or manually check ntdll.dll integrity\n\n# Volatility: detect IAT hooks in processes\nvol3 -f memory.raw windows.iat --pid \u003CPID>\n\n# Check for LD_PRELOAD \u002F dylib injection (Linux\u002FmacOS)\n# Linux:\ncat \u002Fproc\u002F\u003CPID>\u002Fmaps | grep -v \"$(ls \u002Flib\u002F \u002Fusr\u002Flib\u002F 2>\u002Fdev\u002Fnull | tr '\\n' '|')\"\necho $LD_PRELOAD\ncat \u002Fetc\u002Fld.so.preload\n\n# Windows: compare loaded DLLs against known-good baseline\nvol3 -f memory.raw windows.dlllist --pid \u003CPID>\n# Look for: DLLs loaded from temp dirs, DLLs not on disk, unknown publishers\n\n# Cross-view detection: compare user-mode API results vs kernel data\n# If FindFirstFile misses files that raw NTFS parsing finds → user-mode hook\npython3 \u003C\u003C 'EOF'\nimport os, subprocess\n# User-mode listing\nuser_files = set(os.listdir(\"C:\\\\Windows\\\\System32\\\\drivers\"))\n# Raw NTFS listing (bypasses API hooks)\nraw = subprocess.check_output([\"rawcopy\", \"\u002Flistdir\", \"C:\\\\Windows\\\\System32\\\\drivers\"])\nraw_files = set(raw.decode().strip().split('\\n'))\nhidden = raw_files - user_files\nif hidden:\n    print(f\"[!] Hidden files detected: {hidden}\")\nEOF\n```\n\n## 2. Kernel Rootkit Detection\n\nDetect DKOM, SSDT hooks, and malicious drivers.\n\n```bash\n# GMER scan (Windows — gold standard for kernel rootkit detection)\n# Run gmer.exe as Administrator\n# Checks: SSDT hooks, IDT hooks, IRP hooks, inline hooks,\n#          hidden processes, hidden drivers, hidden files, hidden registry\n\n# Volatility cross-view process detection\nvol3 -f memory.raw windows.pslist > pslist.txt\nvol3 -f memory.raw windows.psscan > psscan.txt\n# Diff: processes in psscan but not pslist are DKOM-hidden\ncomm -23 \u003C(sort psscan.txt) \u003C(sort pslist.txt)\n\n# SSDT hook detection\nvol3 -f memory.raw windows.ssdt\n# All entries should point to ntoskrnl.exe or win32k.sys\n# Entries pointing elsewhere → hooked\n\n# Driver analysis\nvol3 -f memory.raw windows.drvscan\nvol3 -f memory.raw windows.modules\n# Look for:\n# - Drivers not on disk (loaded from memory only)\n# - Drivers loaded from unusual paths (temp, appdata)\n# - Drivers with no digital signature\n\n# IRP hook detection — malicious drivers hooking filesystem IRPs\nvol3 -f memory.raw windows.driverirp\n# NTFS driver IRP_MJ_DIRECTORY_CONTROL hooked → file hiding\n# NTFS driver IRP_MJ_CREATE hooked → file access interception\n\n# Linux kernel rootkit detection\n# Check loaded kernel modules\nlsmod\ncat \u002Fproc\u002Fmodules\n# Verify module signature\nmodinfo \u003CMODULE_NAME> | grep sig\n\n# Check syscall table integrity (requires kernel symbol access)\ncat \u002Fproc\u002Fkallsyms | grep sys_call_table\n# Compare function addresses against known-good System.map\n\n# chkrootkit \u002F rkhunter (automated Linux rootkit scanners)\nchkrootkit\nrkhunter --check --skip-keypress\n```\n\n## 3. BYOVD (Bring Your Own Vulnerable Driver) Analysis\n\n```bash\n# Attackers load a signed-but-vulnerable driver to gain kernel access\n# Then use the driver's read\u002Fwrite primitives to disable security\n\n# Known vulnerable drivers database: loldrivers.io\n# Common BYOVD targets:\n# - RTCore64.sys (MSI Afterburner) — arbitrary physical memory R\u002FW\n# - dbutil_2_3.sys (Dell) — arbitrary memory R\u002FW\n# - gdrv.sys (GIGABYTE) — physical memory R\u002FW\n# - capcom.sys — disables SMEP, executes user-mode code in ring 0\n\n# Detect BYOVD: check for known vulnerable driver hashes\npython3 \u003C\u003C 'EOF'\nimport hashlib, os, json\n\n# LOLDrivers hash list (download from loldrivers.io)\nvuln_hashes = set()  # Populate from loldrivers.io API or CSV\n\ndrivers_dir = r\"C:\\Windows\\System32\\drivers\"\nfor f in os.listdir(drivers_dir):\n    path = os.path.join(drivers_dir, f)\n    if os.path.isfile(path) and f.endswith('.sys'):\n        h = hashlib.sha256(open(path, 'rb').read()).hexdigest()\n        if h in vuln_hashes:\n            print(f\"[!] VULNERABLE DRIVER: {f} — {h}\")\nEOF\n\n# Check driver signature status\nsigcheck.exe -u -e C:\\Windows\\System32\\drivers\\*.sys\n# -u shows unsigned drivers; -e scans executables only\n\n# Volatility: find recently loaded drivers\nvol3 -f memory.raw windows.drvscan | sort -k3 -t'|'\n```\n\n## 4. Bootkit Analysis\n\nDetect and analyze MBR\u002FVBR\u002FESP modifications.\n\n```bash\n# Dump MBR (first 512 bytes of disk)\ndd if=\u002Fdev\u002Fsda bs=512 count=1 of=mbr.bin 2>\u002Fdev\u002Fnull\n# On Windows: use FTK Imager or dd for Windows\n\n# Analyze MBR\npython3 \u003C\u003C 'EOF'\ndata = open(\"mbr.bin\", \"rb\").read()\n# Check boot signature\nif data[510:512] != b'\\x55\\xAA':\n    print(\"[!] Invalid MBR signature — corrupted or wiped\")\nelse:\n    print(\"[+] MBR signature valid\")\n\n# Check for known bootkit signatures\nknown_sigs = {\n    b'\\xEB\\x5A\\x90': \"Standard Windows MBR\",\n    b'\\xEB\\x63\\x90': \"GRUB MBR\",\n}\nsig = data[:3]\nprint(f\"Boot code signature: {sig.hex()}\")\nprint(f\"Identified: {known_sigs.get(sig, 'UNKNOWN — possible bootkit')}\")\n\n# Dump partition table\nimport struct\nfor i in range(4):\n    entry = data[446 + i*16 : 446 + (i+1)*16]\n    status, ptype = entry[0], entry[4]\n    lba = struct.unpack('\u003CI', entry[8:12])[0]\n    size = struct.unpack('\u003CI', entry[12:16])[0]\n    if ptype != 0:\n        print(f\"  Partition {i}: type=0x{ptype:02x} status=0x{status:02x} LBA={lba} sectors={size}\")\nEOF\n\n# Dump VBR (Volume Boot Record — first sector of each partition)\ndd if=\u002Fdev\u002Fsda1 bs=512 count=1 of=vbr.bin 2>\u002Fdev\u002Fnull\n\n# UEFI boot analysis — check ESP (EFI System Partition)\n# Mount ESP and inspect bootloaders\nmountvol S: \u002Fs\ndir S:\\EFI\\\n# Verify bootloader integrity\nsigcheck.exe S:\\EFI\\Microsoft\\Boot\\bootmgfw.efi\nsigcheck.exe S:\\EFI\\Boot\\bootx64.efi\n# ESPecter bootkit replaces bootmgfw.efi with a patched version\n\n# Compare against known-good bootloader hash\nsha256sum S:\\EFI\\Microsoft\\Boot\\bootmgfw.efi\n# Cross-reference with Microsoft's signed bootloader hashes\n```\n\n## 5. UEFI Firmware Analysis\n\nDetect firmware-level implants that survive OS reinstallation.\n\n```bash\n# Dump SPI flash firmware using chipsec\npython chipsec_util.py spi dump firmware.bin\n# Alternative: use hardware programmer (CH341A) for offline dump\n\n# Check UEFI write protection\npython chipsec_main.py -m common.bios_wp\n# BIOS Write Protect (BIOSWE) should be LOCKED\n# If unlocked → firmware can be modified from OS (implant vector)\n\n# Check SPI flash lock\npython chipsec_main.py -m common.spi_lock\n# SPI Protected Ranges should cover full flash region\n\n# Check Secure Boot status\npython chipsec_main.py -m common.secureboot.variables\n# Secure Boot should be ENABLED with valid PK\u002FKEK\u002Fdb\n\n# Extract and analyze firmware volumes\nUEFIExtract firmware.bin\n# Inspect extracted DXE drivers and runtime services\n\n# Search for known UEFI rootkit indicators\npython3 \u003C\u003C 'EOF'\nimport os\nextracted_dir = \"firmware.bin.dump\"\nsuspicious = []\nfor root, dirs, files in os.walk(extracted_dir):\n    for f in files:\n        path = os.path.join(root, f)\n        try:\n            data = open(path, 'rb').read()\n            # Known UEFI implant indicators\n            if b'LoJax' in data or b'SedUploader' in data:\n                suspicious.append((path, \"LoJax indicator\"))\n            if b'MosaicRegressor' in data or b'IntelUpdate' in data:\n                suspicious.append((path, \"MosaicRegressor indicator\"))\n            if b'CosmicStrand' in data:\n                suspicious.append((path, \"CosmicStrand indicator\"))\n            # Generic: look for HTTP URLs in firmware modules (unusual)\n            import re\n            urls = re.findall(rb'https?:\u002F\u002F[^\\x00\\s]{8,}', data)\n            if urls:\n                suspicious.append((path, f\"URLs found: {urls[:3]}\"))\n        except: pass\nfor path, reason in suspicious:\n    print(f\"[!] {reason}: {path}\")\nEOF\n\n# Firmware integrity verification against vendor baseline\n# Download original firmware from vendor site → binary diff\npython3 -c \"\na=open('firmware_original.bin','rb').read()\nb=open('firmware.bin','rb').read()\ndiffs=[(i,a[i],b[i]) for i in range(min(len(a),len(b))) if a[i]!=b[i]]\nprint(f'Differences: {len(diffs)} bytes')\nfor off,orig,mod in diffs[:20]:\n    print(f'  0x{off:08x}: {orig:02x} → {mod:02x}')\n\"\n```\n\n## 6. Hypervisor \u002F Ring -1 Rootkit Detection\n\n```bash\n# Hypervisor rootkits (Blue Pill concept) run below the OS\n# Detection is inherently difficult — timing-based side channels\n\n# Check if running under unexpected hypervisor\n# CPUID leaf 0x1: ECX bit 31 = hypervisor present\npython3 \u003C\u003C 'EOF'\nimport struct, ctypes\n# Check CPUID for hypervisor bit\n# This requires native code execution or WMI\nimport subprocess\nresult = subprocess.check_output(\n    [\"powershell\", \"-c\",\n     \"Get-WmiObject -Class Win32_ComputerSystem | Select-Object HypervisorPresent,Model\"],\n    text=True\n)\nprint(result)\n# If HypervisorPresent=True but no known hypervisor installed → suspicious\nEOF\n\n# Timing-based detection (RDTSC anomalies)\n# Hypervisor causes VM exits that add measurable latency\n# CPUID instruction under hypervisor takes ~1000+ cycles vs ~100 native\n\n# Check for known hypervisor rootkit artifacts\nvol3 -f memory.raw windows.modules | grep -iE \"vbox\\|vmware\\|hv\\|hyperv\"\n# But a true ring-1 rootkit may not appear in module lists\n\n# Physical memory access test (blocked by hypervisor)\n# chipsec can detect unexpected EPT (Extended Page Tables)\npython chipsec_main.py -m common.cpu.cpu_info\n```\n\n## 7. Linux Kernel Rootkit Analysis\n\n```bash\n# Check for LKM (Loadable Kernel Module) rootkits\nlsmod | sort\ncat \u002Fproc\u002Fmodules | sort\n# Compare: hidden modules appear in \u002Fproc but not lsmod, or vice versa\n\n# Verify syscall table integrity\ncat \u002Fproc\u002Fkallsyms | grep -E \"sys_(read|write|open|getdents|kill)\"\n# Compare addresses against clean System.map\n\n# Check for \u002Fdev anomalies (rootkits often create hidden devices)\nls -la \u002Fdev\u002F | grep -vE \"^[bcdlps]\"\n\n# Detect hidden files via direct inode enumeration\ndebugfs -R \"ls -l \u002F\" \u002Fdev\u002Fsda1 2>\u002Fdev\u002Fnull\n\n# Check for process hiding\nls \u002Fproc\u002F | grep -E \"^[0-9]+$\" | sort -n > proc_pids.txt\nps -eo pid --no-headers | sort -n > ps_pids.txt\ncomm -23 proc_pids.txt ps_pids.txt   # In \u002Fproc but not ps → suspicious\ncomm -13 proc_pids.txt ps_pids.txt   # In ps but not \u002Fproc → rootkit hiding\n\n# Network socket hiding detection\nss -tulnp > ss_output.txt\ncat \u002Fproc\u002Fnet\u002Ftcp \u002Fproc\u002Fnet\u002Ftcp6 > proc_net.txt\n# Compare: hidden connections appear in \u002Fproc\u002Fnet but not ss\n\n# Volatility for Linux memory images\nvol3 -f memory.lime linux.bash\nvol3 -f memory.lime linux.check_modules\nvol3 -f memory.lime linux.hidden_modules\nvol3 -f memory.lime linux.check_syscall\n```\n\n## Tools & Resources\n\n| Tool | Purpose | Install |\n|---|---|---|\n| GMER | Windows kernel rootkit scanner (GUI) | gmer.net |\n| Volatility 3 | Memory forensics framework | github.com\u002Fvolatilityfoundation\u002Fvolatility3 |\n| chipsec | UEFI\u002Ffirmware security assessment | github.com\u002Fchipsec\u002Fchipsec |\n| UEFITool | UEFI firmware image parser\u002Feditor | github.com\u002FLongSoft\u002FUEFITool |\n| UEFIExtract | CLI firmware volume extractor | github.com\u002FLongSoft\u002FUEFITool |\n| Sigcheck | Authenticode signature verification | Sysinternals |\n| rkhunter | Linux rootkit scanner | rkhunter.sourceforge.net |\n| chkrootkit | Linux rootkit checker | chkrootkit.org |\n| LOLDrivers | Vulnerable driver database | loldrivers.io |\n| ESET UEFI scanner | UEFI module whitelist checker | eset.com |\n\n## Detection Signatures\n\n| Indicator | Description | Detection |\n|---|---|---|\n| SSDT entry pointing outside ntoskrnl | Kernel function hook | Volatility windows.ssdt |\n| Process in psscan but not pslist | DKOM process hiding | Volatility cross-view comparison |\n| Driver loaded from \\Temp or \\AppData | Suspicious kernel driver | Volatility windows.drvscan + path check |\n| BIOSWE bit unlocked | Firmware writable from OS | chipsec common.bios_wp |\n| SPI region not locked | Flash can be modified | chipsec common.spi_lock |\n| ESP bootloader hash mismatch | Modified bootloader (bootkit) | Hash comparison with vendor baseline |\n| Unsigned .sys file in drivers directory | Potentially malicious driver | Sigcheck -u scan |\n| Known BYOVD driver hash | Vulnerable driver exploitation | LOLDrivers hash comparison |\n\n## Error Handling & Edge Cases\n\n| Issue | Resolution |\n|---|---|\n| GMER crashes or hangs | Rootkit actively fighting scanner; try from WinPE\u002Fsafe mode boot |\n| chipsec requires kernel driver | Run on Linux live USB; Windows needs admin + test signing |\n| Firmware dump size mismatch | SPI flash layout varies; use `chipsec_util spi info` for correct regions |\n| Hypervisor rootkit undetectable | Physical hardware analysis required; use JTAG\u002FSPI programmer for firmware dump |\n| UEFI Secure Boot prevents chipsec | Boot Linux with Secure Boot disabled or MOK-signed chipsec driver |\n| Memory image too large | Use targeted Volatility plugins; filter by PID or address range |\n| Rootkit patches Volatility output | Use multiple analysis tools; cross-reference with raw memory search |\n| Anti-forensics: cleared event logs | Carve deleted entries from raw disk; check alternate log locations |\n\n## Decision Gate\n\n```\nIF suspicious hidden processes\u002Ffiles\u002Fnetwork connections:\n  → Capture full memory dump\n  → Run Volatility cross-view detection (pslist vs psscan)\n  → Check SSDT\u002FIDT\u002FIRP hooks\n  → Scan for known vulnerable drivers (BYOVD)\nIF boot-level persistence suspected:\n  → Dump and verify MBR\u002FVBR integrity\n  → Mount ESP and hash-verify bootloaders\n  → Check Secure Boot configuration\nIF firmware implant suspected:\n  → Dump SPI flash with chipsec\n  → Extract and analyze UEFI volumes\n  → Compare against vendor baseline firmware\n  → Check BIOS write protect and SPI lock status\nIF Linux system:\n  → Run chkrootkit + rkhunter\n  → Compare \u002Fproc PIDs vs ps output\n  → Verify syscall table addresses\n  → Check for hidden kernel modules\nELSE:\n  → Start with GMER quick scan (Windows) or rkhunter (Linux)\n  → Escalate to memory forensics if scanner detects anomalies\n```\n","# Rootkit Analysis\n\nDetect and analyze rootkits operating at kernel, boot, and firmware levels — from user-mode hiding techniques through UEFI implants and hypervisor-based rootkits.\n\n## Quick Reference\n\n```bash\n# Quick kernel rootkit scan (Windows, run as admin)\ngmer.exe \u002Fscan\n\n# System-wide hidden process \u002F driver detection\nvolatility3 -f memory.raw windows.pslist vs windows.psscan\n# Processes in psscan but NOT in pslist → hidden by DKOM\n\n# UEFI firmware extraction and analysis\nchipsec_util.py spi dump firmware.bin\nUEFIExtract firmware.bin\n\n# Check for unsigned kernel drivers\nsigcheck -u -e C:\\Windows\\System32\\drivers\\*.sys\n\n# Scan for SSDT hooks\nvolatility3 -f memory.raw windows.ssdt\n```\n\n## MITRE ATT&CK Mapping\n\n| Technique | ID | How It Appears |\n|---|---|---|\n| System Firmware | T1542.001 | UEFI rootkit implanted in SPI flash (LoJax, MosaicRegressor, CosmicStrand) |\n| Bootkit | T1542.003 | MBR\u002FVBR modification to load malicious code before OS (TDL4, Rovnix, ESPecter) |\n| Rootkit | T1014 | Kernel object manipulation to hide processes, files, registry keys |\n| Boot or Logon Autostart: Kernel Modules | T1547.006 | Malicious kernel driver loaded at boot via service registry key |\n| Exploitation for Defense Evasion | T1211 | Vulnerable driver exploit (BYOVD) to load unsigned kernel code |\n| Virtualization\u002FSandbox Evasion | T1497 | Hypervisor rootkit detecting\u002Fevading analysis environment |\n\n## 1. User-Mode Rootkit Detection\n\nDetect rootkits that hook user-mode APIs to hide artifacts.\n\n```bash\n# Compare API hook status — IAT\u002FEAT\u002Finline hooks\n# Use API Monitor or manually check ntdll.dll integrity\n\n# Volatility: detect IAT hooks in processes\nvol3 -f memory.raw windows.iat --pid \u003CPID>\n\n# Check for LD_PRELOAD \u002F dylib injection (Linux\u002FmacOS)\n# Linux:\ncat \u002Fproc\u002F\u003CPID>\u002Fmaps | grep -v \"$(ls \u002Flib\u002F \u002Fusr\u002Flib\u002F 2>\u002Fdev\u002Fnull | tr '\\n' '|')\"\necho $LD_PRELOAD\ncat \u002Fetc\u002Fld.so.preload\n\n# Windows: compare loaded DLLs against known-good baseline\nvol3 -f memory.raw windows.dlllist --pid \u003CPID>\n# Look for: DLLs loaded from temp dirs, DLLs not on disk, unknown publishers\n\n# Cross-view detection: compare user-mode API results vs kernel data\n# If FindFirstFile misses files that raw NTFS parsing finds → user-mode hook\npython3 \u003C\u003C 'EOF'\nimport os, subprocess\n# User-mode listing\nuser_files = set(os.listdir(\"C:\\\\Windows\\\\System32\\\\drivers\"))\n# Raw NTFS listing (bypasses API hooks)\nraw = subprocess.check_output([\"rawcopy\", \"\u002Flistdir\", \"C:\\\\Windows\\\\System32\\\\drivers\"])\nraw_files = set(raw.decode().strip().split('\\n'))\nhidden = raw_files - user_files\nif hidden:\n    print(f\"[!] Hidden files detected: {hidden}\")\nEOF\n```\n\n## 2. Kernel Rootkit Detection\n\nDetect DKOM, SSDT hooks, and malicious drivers.\n\n```bash\n# GMER scan (Windows — gold standard for kernel rootkit detection)\n# Run gmer.exe as Administrator\n# Checks: SSDT hooks, IDT hooks, IRP hooks, inline hooks,\n#          hidden processes, hidden drivers, hidden files, hidden registry\n\n# Volatility cross-view process detection\nvol3 -f memory.raw windows.pslist > pslist.txt\nvol3 -f memory.raw windows.psscan > psscan.txt\n# Diff: processes in psscan but not pslist are DKOM-hidden\ncomm -23 \u003C(sort psscan.txt) \u003C(sort pslist.txt)\n\n# SSDT hook detection\nvol3 -f memory.raw windows.ssdt\n# All entries should point to ntoskrnl.exe or win32k.sys\n# Entries pointing elsewhere → hooked\n\n# Driver analysis\nvol3 -f memory.raw windows.drvscan\nvol3 -f memory.raw windows.modules\n# Look for:\n# - Drivers not on disk (loaded from memory only)\n# - Drivers loaded from unusual paths (temp, appdata)\n# - Drivers with no digital signature\n\n# IRP hook detection — malicious drivers hooking filesystem IRPs\nvol3 -f memory.raw windows.driverirp\n# NTFS driver IRP_MJ_DIRECTORY_CONTROL hooked → file hiding\n# NTFS driver IRP_MJ_CREATE hooked → file access interception\n\n# Linux kernel rootkit detection\n# Check loaded kernel modules\nlsmod\ncat \u002Fproc\u002Fmodules\n# Verify module signature\nmodinfo \u003CMODULE_NAME> | grep sig\n\n# Check syscall table integrity (requires kernel symbol access)\ncat \u002Fproc\u002Fkallsyms | grep sys_call_table\n# Compare function addresses against known-good System.map\n\n# chkrootkit \u002F rkhunter (automated Linux rootkit scanners)\nchkrootkit\nrkhunter --check --skip-keypress\n```\n\n## 3. BYOVD (Bring Your Own Vulnerable Driver) Analysis\n\n```bash\n# Attackers load a signed-but-vulnerable driver to gain kernel access\n# Then use the driver's read\u002Fwrite primitives to disable security\n\n# Known vulnerable drivers database: loldrivers.io\n# Common BYOVD targets:\n# - RTCore64.sys (MSI Afterburner) — arbitrary physical memory R\u002FW\n# - dbutil_2_3.sys (Dell) — arbitrary memory R\u002FW\n# - gdrv.sys (GIGABYTE) — physical memory R\u002FW\n# - capcom.sys — disables SMEP, executes user-mode code in ring 0\n\n# Detect BYOVD: check for known vulnerable driver hashes\npython3 \u003C\u003C 'EOF'\nimport hashlib, os, json\n\n# LOLDrivers hash list (download from loldrivers.io)\nvuln_hashes = set()  # Populate from loldrivers.io API or CSV\n\ndrivers_dir = r\"C:\\Windows\\System32\\drivers\"\nfor f in os.listdir(drivers_dir):\n    path = os.path.join(drivers_dir, f)\n    if os.path.isfile(path) and f.endswith('.sys'):\n        h = hashlib.sha256(open(path, 'rb').read()).hexdigest()\n        if h in vuln_hashes:\n            print(f\"[!] VULNERABLE DRIVER: {f} — {h}\")\nEOF\n\n# Check driver signature status\nsigcheck.exe -u -e C:\\Windows\\System32\\drivers\\*.sys\n# -u shows unsigned drivers; -e scans executables only\n\n# Volatility: find recently loaded drivers\nvol3 -f memory.raw windows.drvscan | sort -k3 -t'|'\n```\n\n## 4. Bootkit Analysis\n\nDetect and analyze MBR\u002FVBR\u002FESP modifications.\n\n```bash\n# Dump MBR (first 512 bytes of disk)\ndd if=\u002Fdev\u002Fsda bs=512 count=1 of=mbr.bin 2>\u002Fdev\u002Fnull\n# On Windows: use FTK Imager or dd for Windows\n\n# Analyze MBR\npython3 \u003C\u003C 'EOF'\ndata = open(\"mbr.bin\", \"rb\").read()\n# Check boot signature\nif data[510:512] != b'\\x55\\xAA':\n    print(\"[!] Invalid MBR signature — corrupted or wiped\")\nelse:\n    print(\"[+] MBR signature valid\")\n\n# Check for known bootkit signatures\nknown_sigs = {\n    b'\\xEB\\x5A\\x90': \"Standard Windows MBR\",\n    b'\\xEB\\x63\\x90': \"GRUB MBR\",\n}\nsig = data[:3]\nprint(f\"Boot code signature: {sig.hex()}\")\nprint(f\"Identified: {known_sigs.get(sig, 'UNKNOWN — possible bootkit')}\")\n\n# Dump partition table\nimport struct\nfor i in range(4):\n    entry = data[446 + i*16 : 446 + (i+1)*16]\n    status, ptype = entry[0], entry[4]\n    lba = struct.unpack('\u003CI', entry[8:12])[0]\n    size = struct.unpack('\u003CI', entry[12:16])[0]\n    if ptype != 0:\n        print(f\"  Partition {i}: type=0x{ptype:02x} status=0x{status:02x} LBA={lba} sectors={size}\")\nEOF\n\n# Dump VBR (Volume Boot Record — first sector of each partition)\ndd if=\u002Fdev\u002Fsda1 bs=512 count=1 of=vbr.bin 2>\u002Fdev\u002Fnull\n\n# UEFI boot analysis — check ESP (EFI System Partition)\n# Mount ESP and inspect bootloaders\nmountvol S: \u002Fs\ndir S:\\EFI\\\n# Verify bootloader integrity\nsigcheck.exe S:\\EFI\\Microsoft\\Boot\\bootmgfw.efi\nsigcheck.exe S:\\EFI\\Boot\\bootx64.efi\n# ESPecter bootkit replaces bootmgfw.efi with a patched version\n\n# Compare against known-good bootloader hash\nsha256sum S:\\EFI\\Microsoft\\Boot\\bootmgfw.efi\n# Cross-reference with Microsoft's signed bootloader hashes\n```\n\n## 5. UEFI Firmware Analysis\n\nDetect firmware-level implants that survive OS reinstallation.\n\n```bash\n# Dump SPI flash firmware using chipsec\npython chipsec_util.py spi dump firmware.bin\n# Alternative: use hardware programmer (CH341A) for offline dump\n\n# Check UEFI write protection\npython chipsec_main.py -m common.bios_wp\n# BIOS Write Protect (BIOSWE) should be LOCKED\n# If unlocked → firmware can be modified from OS (implant vector)\n\n# Check SPI flash lock\npython chipsec_main.py -m common.spi_lock\n# SPI Protected Ranges should cover full flash region\n\n# Check Secure Boot status\npython chipsec_main.py -m common.secureboot.variables\n# Secure Boot should be ENABLED with valid PK\u002FKEK\u002Fdb\n\n# Extract and analyze firmware volumes\nUEFIExtract firmware.bin\n# Inspect extracted DXE drivers and runtime services\n\n# Search for known UEFI rootkit indicators\npython3 \u003C\u003C 'EOF'\nimport os\nextracted_dir = \"firmware.bin.dump\"\nsuspicious = []\nfor root, dirs, files in os.walk(extracted_dir):\n    for f in files:\n        path = os.path.join(root, f)\n        try:\n            data = open(path, 'rb').read()\n            # Known UEFI implant indicators\n            if b'LoJax' in data or b'SedUploader' in data:\n                suspicious.append((path, \"LoJax indicator\"))\n            if b'MosaicRegressor' in data or b'IntelUpdate' in data:\n                suspicious.append((path, \"MosaicRegressor indicator\"))\n            if b'CosmicStrand' in data:\n                suspicious.append((path, \"CosmicStrand indicator\"))\n            # Generic: look for HTTP URLs in firmware modules (unusual)\n            import re\n            urls = re.findall(rb'https?:\u002F\u002F[^\\x00\\s]{8,}', data)\n            if urls:\n                suspicious.append((path, f\"URLs found: {urls[:3]}\"))\n        except: pass\nfor path, reason in suspicious:\n    print(f\"[!] {reason}: {path}\")\nEOF\n\n# Firmware integrity verification against vendor baseline\n# Download original firmware from vendor site → binary diff\npython3 -c \"\na=open('firmware_original.bin','rb').read()\nb=open('firmware.bin','rb').read()\ndiffs=[(i,a[i],b[i]) for i in range(min(len(a),len(b))) if a[i]!=b[i]]\nprint(f'Differences: {len(diffs)} bytes')\nfor off,orig,mod in diffs[:20]:\n    print(f'  0x{off:08x}: {orig:02x} → {mod:02x}')\n\"\n```\n\n## 6. Hypervisor \u002F Ring -1 Rootkit Detection\n\n```bash\n# Hypervisor rootkits (Blue Pill concept) run below the OS\n# Detection is inherently difficult — timing-based side channels\n\n# Check if running under unexpected hypervisor\n# CPUID leaf 0x1: ECX bit 31 = hypervisor present\npython3 \u003C\u003C 'EOF'\nimport struct, ctypes\n# Check CPUID for hypervisor bit\n# This requires native code execution or WMI\nimport subprocess\nresult = subprocess.check_output(\n    [\"powershell\", \"-c\",\n     \"Get-WmiObject -Class Win32_ComputerSystem | Select-Object HypervisorPresent,Model\"],\n    text=True\n)\nprint(result)\n# If HypervisorPresent=True but no known hypervisor installed → suspicious\nEOF\n\n# Timing-based detection (RDTSC anomalies)\n# Hypervisor causes VM exits that add measurable latency\n# CPUID instruction under hypervisor takes ~1000+ cycles vs ~100 native\n\n# Check for known hypervisor rootkit artifacts\nvol3 -f memory.raw windows.modules | grep -iE \"vbox\\|vmware\\|hv\\|hyperv\"\n# But a true ring-1 rootkit may not appear in module lists\n\n# Physical memory access test (blocked by hypervisor)\n# chipsec can detect unexpected EPT (Extended Page Tables)\npython chipsec_main.py -m common.cpu.cpu_info\n```\n\n## 7. Linux Kernel Rootkit Analysis\n\n```bash\n# Check for LKM (Loadable Kernel Module) rootkits\nlsmod | sort\ncat \u002Fproc\u002Fmodules | sort\n# Compare: hidden modules appear in \u002Fproc but not lsmod, or vice versa\n\n# Verify syscall table integrity\ncat \u002Fproc\u002Fkallsyms | grep -E \"sys_(read|write|open|getdents|kill)\"\n# Compare addresses against clean System.map\n\n# Check for \u002Fdev anomalies (rootkits often create hidden devices)\nls -la \u002Fdev\u002F | grep -vE \"^[bcdlps]\"\n\n# Detect hidden files via direct inode enumeration\ndebugfs -R \"ls -l \u002F\" \u002Fdev\u002Fsda1 2>\u002Fdev\u002Fnull\n\n# Check for process hiding\nls \u002Fproc\u002F | grep -E \"^[0-9]+$\" | sort -n > proc_pids.txt\nps -eo pid --no-headers | sort -n > ps_pids.txt\ncomm -23 proc_pids.txt ps_pids.txt   # In \u002Fproc but not ps → suspicious\ncomm -13 proc_pids.txt ps_pids.txt   # In ps but not \u002Fproc → rootkit hiding\n\n# Network socket hiding detection\nss -tulnp > ss_output.txt\ncat \u002Fproc\u002Fnet\u002Ftcp \u002Fproc\u002Fnet\u002Ftcp6 > proc_net.txt\n# Compare: hidden connections appear in \u002Fproc\u002Fnet but not ss\n\n# Volatility for Linux memory images\nvol3 -f memory.lime linux.bash\nvol3 -f memory.lime linux.check_modules\nvol3 -f memory.lime linux.hidden_modules\nvol3 -f memory.lime linux.check_syscall\n```\n\n## Tools & Resources\n\n| Tool | Purpose | Install |\n|---|---|---|\n| GMER | Windows kernel rootkit scanner (GUI) | gmer.net |\n| Volatility 3 | Memory forensics framework | github.com\u002Fvolatilityfoundation\u002Fvolatility3 |\n| chipsec | UEFI\u002Ffirmware security assessment | github.com\u002Fchipsec\u002Fchipsec |\n| UEFITool | UEFI firmware image parser\u002Feditor | github.com\u002FLongSoft\u002FUEFITool |\n| UEFIExtract | CLI firmware volume extractor | github.com\u002FLongSoft\u002FUEFITool |\n| Sigcheck | Authenticode signature verification | Sysinternals |\n| rkhunter | Linux rootkit scanner | rkhunter.sourceforge.net |\n| chkrootkit | Linux rootkit checker | chkrootkit.org |\n| LOLDrivers | Vulnerable driver database | loldrivers.io |\n| ESET UEFI scanner | UEFI module whitelist checker | eset.com |\n\n## Detection Signatures\n\n| Indicator | Description | Detection |\n|---|---|---|\n| SSDT entry pointing outside ntoskrnl | Kernel function hook | Volatility windows.ssdt |\n| Process in psscan but not pslist | DKOM process hiding | Volatility cross-view comparison |\n| Driver loaded from \\Temp or \\AppData | Suspicious kernel driver | Volatility windows.drvscan + path check |\n| BIOSWE bit unlocked | Firmware writable from OS | chipsec common.bios_wp |\n| SPI region not locked | Flash can be modified | chipsec common.spi_lock |\n| ESP bootloader hash mismatch | Modified bootloader (bootkit) | Hash comparison with vendor baseline |\n| Unsigned .sys file in drivers directory | Potentially malicious driver | Sigcheck -u scan |\n| Known BYOVD driver hash | Vulnerable driver exploitation | LOLDrivers hash comparison |\n\n## Error Handling & Edge Cases\n\n| Issue | Resolution |\n|---|---|\n| GMER crashes or hangs | Rootkit actively fighting scanner; try from WinPE\u002Fsafe mode boot |\n| chipsec requires kernel driver | Run on Linux live USB; Windows needs admin + test signing |\n| Firmware dump size mismatch | SPI flash layout varies; use `chipsec_util spi info` for correct regions |\n| Hypervisor rootkit undetectable | Physical hardware analysis required; use JTAG\u002FSPI programmer for firmware dump |\n| UEFI Secure Boot prevents chipsec | Boot Linux with Secure Boot disabled or MOK-signed chipsec driver |\n| Memory image too large | Use targeted Volatility plugins; filter by PID or address range |\n| Rootkit patches Volatility output | Use multiple analysis tools; cross-reference with raw memory search |\n| Anti-forensics: cleared event logs | Carve deleted entries from raw disk; check alternate log locations |\n\n## Decision Gate\n\n```\nIF suspicious hidden processes\u002Ffiles\u002Fnetwork connections:\n  → Capture full memory dump\n  → Run Volatility cross-view detection (pslist vs psscan)\n  → Check SSDT\u002FIDT\u002FIRP hooks\n  → Scan for known vulnerable drivers (BYOVD)\nIF boot-level persistence suspected:\n  → Dump and verify MBR\u002FVBR integrity\n  → Mount ESP and hash-verify bootloaders\n  → Check Secure Boot configuration\nIF firmware implant suspected:\n  → Dump SPI flash with chipsec\n  → Extract and analyze UEFI volumes\n  → Compare against vendor baseline firmware\n  → Check BIOS write protect and SPI lock status\nIF Linux system:\n  → Run chkrootkit + rkhunter\n  → Compare \u002Fproc PIDs vs ps output\n  → Verify syscall table addresses\n  → Check for hidden kernel modules\nELSE:\n  → Start with GMER quick scan (Windows) or rkhunter (Linux)\n  → Escalate to memory forensics if scanner detects anomalies\n```\n",{"name":5,"metadata":24,"description":7,"allowed-tools":29},{"tags":25,"subdomain":26,"when_to_use":27,"mitre_attack":28},"rootkit, UEFI, bootkit, kernel, firmware, Volatility, chipsec","reverser","rootkit bootkit uefi firmware kernel driver ssdt hook dkom hidden process hypervisor mbr vbr implant bios spi flash ring0 ring-1","T1542.001, T1542.003, T1014","Bash Read Write","master","8e5d356b795eae2edd4a26509a4b8968e2c4c251","packages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Freverser\u002Frootkit-analysis","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix","https:\u002F\u002Fgithub.com\u002FAkapi895","2026-11-06 17:46:09",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Akapi895\u002Fraptix --skill reverser-rootkit-analysis",{"tool":42,"command":43},"bunx","bunx skills add Akapi895\u002Fraptix --skill reverser-rootkit-analysis",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Akapi895\u002Fraptix --skill reverser-rootkit-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Freverser\u002Frootkit-analysis\u002FSKILL.md",true,[],[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M7DGM32SRP4FZSPYWY621BKQ","wps-pixie-dust","WPS Pixie-Dust offline nonce attack (reaver -K \u002F pixiewps) and fallback online PIN brute (bully) to recover the AP's WPA PSK without capturing a handshake.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fwps-pixie-dust\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7DGKXXVDTY0KBZZR83VFPZX","wpa3-sae","WPA3-SAE transition-mode downgrade (DragonShift), SSID Confusion CVE-2023-52424, Dragonblood side-channels, and SAE captive-portal credential recovery against WPA3-Personal networks.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fwpa3-sae\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7DGKSV77ENX3D6TG2HQX9MK","wpa2-psk","WPA\u002FWPA2-PSK handshake capture via targeted deauth + PMKID (no deauth required) + offline hashcat cracking. The most common consumer\u002FSMB encryption mode in 2026.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fwpa2-psk\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7DGKJ9R6YTFRFBSEAJRGGKF","wpa-enterprise-eap","WPA\u002FWPA2\u002FWPA3-Enterprise (802.1X\u002FEAP) rogue-RADIUS evil-twin for MSCHAPv2 capture, GTC downgrade, and PEAP relay. MSCHAPv2 capture equals a NetNTLM hash — the primary wireless on-ramp to Active Directory.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fwpa-enterprise-eap\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7DGKCFZGKK2EQMWZM1A18S8","krack-fragattacks","KRACK key-reinstallation (CVE-2017-13077..13082) and FragAttacks fragmentation\u002Faggregation flaws (CVE-2020-24586..24588, CVE-2020-26139..26147) against legacy or embedded 802.11 supplicants with poor patch cadence.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fkrack-fragattacks\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7DGK76MKZQWBXTZN82W7214","evil-twin-karma","Evil-twin rogue AP with KARMA\u002FMana PNL-probe response, captive-portal credential capture, and post-association MITM for PSK\u002Fopen networks. Distinct from wpa-enterprise-eap which targets 802.1X.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fevil-twin-karma\u002FSKILL.md",[],[]]