knowledge/malware-analysis/SKILL.md
Malware-analysis workflow; suspicious PE/ELF/Mach-O/APK/docs/scripts, static/dynamic triage, strings, disassembly, YARA, configs, IOCs, reports.
npx skillsauth add aeondave/malskill malware-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Structured malware analysis workflow: triage, reverse engineering, IOC extraction, and reporting. Supports static-first analysis with optional controlled dynamic inspection. Works across Windows (native + WSL) and Linux.
Show this before starting any analysis:
Warning: malware analysis must be performed on an isolated lab machine or disposable VM. Never run samples on personal or production systems containing real credentials or user data.
Supported targets:
Primary mode is static analysis. Dynamic analysis only in an isolated disposable lab when the user explicitly requests it.
Before analysis, detect the platform and available tools:
# Linux / WSL
uname -s && uname -m
command -v file strings objdump readelf nm gdb r2 rabin2 yara floss capa exiftool 7z python3 pip3
python3 -c "import pefile, lief, yara, capstone, unicorn" 2>/dev/null
# Windows
$PSVersionTable.PSVersion
Get-Command file,strings,objdump,dumpbin,r2,rabin2,yara,floss,capa,exiftool,7z,python,py,gdb -ErrorAction SilentlyContinue
py -c "import pefile, lief, yara, capstone" 2>$null
Record results. If a mandatory tool is missing, report degraded capability and offer to install after user authorization, or use the built-in Python fallback scripts.
file, sha256sum/Get-FileHash, strings, python3/py, pip
objdump/dumpbin, readelf/nm, yara, exiftool, 7z, radare2 (r2, rabin2), ripgrep (rg), xxd, binwalk
Python packages: pefile, lief, yara-python, capstone, oletools, pycryptodome
floss, capa, Ghidra headless (analyzeHeadless), Binary Ninja (headless API), jadx, apktool, dnSpy/ilspycmd (.NET), gdb + pwndbg/GEF, x64dbg (Windows GUI), WinDbg (kernel + crash dumps), volatility3, upx, die (Detect It Easy)
gdb + gef/pwndbg, Frida (runtime hooking), strace/ltrace, procmon, wireshark/tshark, fakenet-ng, WinDbg (TTD recording)
Load references/install-guide.md for per-platform install commands (apt, winget, pip, brew).
For every analysis, follow these steps:
file or Python magicsha256sum sample.bin
file sample.bin
Get-FileHash sample.bin -Algorithm SHA256
If file is missing, use the built-in script: python scripts/triage.py sample.bin
floss for obfuscated/decoded strings when availablestrings -a -n 6 sample.bin > strings_ascii.txt
strings -a -n 6 -el sample.bin > strings_utf16.txt
rg -i '(https?://|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|api\.telegram)' strings_ascii.txt
If strings is missing, run python scripts/triage.py sample.bin --strings.
Run the appropriate sub-workflow based on file type:
references/pe-analysis.mdreferences/elf-macho-analysis.mdreferences/apk-analysis.mdreferences/document-script-analysis.mdCommon tasks across all types:
Use python scripts/triage.py sample.bin --full for a comprehensive automated triage when dedicated CLI tools are unavailable.
Goal: understand what the sample does, not just what it contains. Escalate depth until the question is answered.
Escalation path — follow this order, go deeper only when the current level is insufficient:
capa if available to get ATT&CK-mapped capability summaryr2, objdump, or Python capstone — the radare2 skill covers r2 command detailsilspycmd for .NET, jadx for APK — the ghidra skill covers Ghidra workflowsWhat to look for at each level:
Tool selection by sample type:
r2 (headless scripting), Ghidra headless, or Binary Ninja headless for decompilation — see radare2, ghidra, binaryninja skillsdnSpy/dnSpyEx for GUI decompile+debug, ilspycmd for CLI — see dnspy skilljadx for Java decompilation, apktool for smali + resourcescapa, section names), unpack with upx -d or manual OEP finding via x64dbg — see x64dbg skillbinwalk for extraction — see binwalk skill — then analyze extracted ELF/ARM blobsFrida for API interception, SSL pinning bypass, anti-debug bypass — see frida skillWinDbg for kernel debugging, SSDT analysis, crash dumps — see windbg skillgdb with pwndbg/GEF for breakpoints, syscall tracing, anti-debug bypass — see gdb skillRun YARA rules after RE to validate findings:
yara -r rules/ sample.bin
Use python scripts/entropy_scan.py sample.bin for zero-dependency entropy analysis with region classification.
Only perform when user authorizes and environment is an isolated lab:
gdb skillx64dbg skillwindbg skillfrida skilldnspy skill# GDB with pwndbg/gef in WSL or Linux
gdb -q -ex "break send" -ex "break connect" -ex "run" ./sample.elf
# Frida — trace all network calls
frida -f ./sample -l network_trace.js
# WinDbg — record with Time Travel Debugging for reverse analysis
# File → Launch Executable (Advanced) → Record with TTD
Load references/dynamic-analysis.md for detailed dynamic workflows. Load individual tool skills for command references.
Attempt attribution only with technical evidence:
If attribution is uncertain, state candidates with confidence level.
Produce structured output containing:
When a preferred CLI tool is missing, use this hierarchy:
pefile for PE, lief for PE/ELF/Mach-O, oletools for Office, capstone for disassemblyscripts/ — zero-dependency Python implementations for triage, entropy, strings, IAT dumpstruct, hashlib, re, standard libraryThe scripts/ directory contains self-contained Python tools that require no external packages beyond the standard library (except where noted). The agent can use these directly when system CLI tools are unavailable.
| Script | Purpose | Dependencies |
|---|---|---|
| scripts/triage.py | Hash, file-type, strings, PE/ELF header parsing, section info | stdlib only |
| scripts/entropy_scan.py | Per-section and sliding-window entropy with region classification | stdlib only |
| scripts/iat_analyzer.py | Import table parsing with suspicious-API categorization | stdlib only |
| scripts/string_scanner.py | IOC-focused string extraction (URLs, IPs, domains, keys, paths) | stdlib only |
| scripts/yara_scanner.py | YARA rule runner with built-in generic rules | yara-python |
| scripts/setup_env.py | Detect OS, check tools, install missing packages after confirmation | stdlib only |
triage.py — all-in-one triage: hashing, file identification, header parsing, string extraction. Run as first step when CLI tools are unavailable.entropy_scan.py — Shannon entropy per section and sliding-window heatmap with encrypted/compressed/code classification.iat_analyzer.py — PE import table parser with 6-category suspicious API scoring (injection, evasion, process, memory, crypto, network).string_scanner.py — extract and classify strings by IOC type (URL, IP, domain, registry, file path, API name, crypto constant).yara_scanner.py — run YARA rules against samples; includes built-in generic detection rules.setup_env.py — detect OS/arch, enumerate available tools, install missing ones via pip/apt/winget after user consent.install-guide.md — per-platform installation commands for all tool tiers. Load when the agent needs to install tools.pe-analysis.md — detailed PE/.NET analysis procedure. Load for Windows binary analysis.elf-macho-analysis.md — ELF and Mach-O analysis procedure. Load for Linux/macOS binary analysis.document-script-analysis.md — Office, PDF, and script analysis procedure. Load for document/script malware.dynamic-analysis.md — GDB, x64dbg, strace, procmon workflows. Load when dynamic analysis is requested.yara-rules.md — generic YARA rule templates for common malware patterns.case-template/ — directory structure for organizing case evidence. Copy to create a new case workspace.development
White-box auditing methodology for AI-generated ('vibe-coded') applications. Focuses on modern stack misconfigurations (Supabase, Next.js, Vercel).
development
Hybrid AI/Deterministic SAST methodology for discovering zero-day vulnerabilities in source code. Orchestrates structural search with AI-driven data flow and sink validation.
development
Auth assessment: hardware/embedded methodology; UART/JTAG/SWD/SPI/I2C, firmware extraction, boot/debug paths, embedded OS evidence.
devops
Container methodology: Identifying containerization limits, Docker/K8s misconfigurations, and executing escapes to the host node.