# malware-analysis-static
Malware analysis skill for static malware analysis and reverse engineering across Windows, Linux, macOS, Android, Office documents, HTML/web payloads, scripts, source-code droppers, and multi-stage chains.
Compatible with:
- Codex CLI
- Claude Code
## Features
- Static malware triage and reverse engineering, not only IOC grepping.
- Multi-stage workflow for embedded, decoded, extracted, dropped, or downloaded payloads.
- Case memory in `AGENTS.md` and analyst report in `REPORT.md`.
- Ordered execution/compromise chain with MD5, SHA1, SHA256, parent-child stage relationships, URLs, domains, IPs, C2s, drop URLs, and stage URLs.
- Authorized lab-only retrieval of drop/stage URLs, preserving parent decoding, decryption, headers, parameters, filenames, and post-download transforms.
- Format-specific playbooks loaded on demand to reduce context usage.
- Android APK family-pattern enrichment using permissions, application values, and intent-related values from the APK.
- Token Budget and Anti-Loop mode to keep chat concise, save verbose evidence to files, avoid repeated failed branches, and prevent unsupported success claims.
- Cross-platform tool discovery for Linux, macOS, and Windows, with explicit user approval before installing missing tools.
## Supported Samples
- Android APKs, split APKs, DEX/JAR-derived Android code, and native `.so` libraries.
- Windows PE binaries, DLLs, drivers, shellcode-like blobs, and .NET assemblies.
- Linux ELF binaries, macOS Mach-O binaries, Unix shell payloads, and Unix-side loaders.
- Office/OLE/OOXML/RTF documents, VBA, VBS, VBE, JS, JSE, HTA, WSF, WSH, PowerShell, BAT, and CMD.
- HTML, HTM, MHTML, SVG, XML, XSL, JavaScript, TypeScript, PHP, Python, Perl, Ruby, Lua, Node.js, JSP, ASP, ASPX, webshells, and source-code droppers.
## Skill Layout
```text
malware-analysis-static/
SKILL.md
references/
apk.md
pe-dotnet.md
office-script.md
web-payload.md
unix-binary.md
```
`SKILL.md` is the core orchestrator. The `references/` files are loaded only when the current sample or stage matches that file type.
## Installation
### Codex CLI
Install:
```bash
git clone https://github.com/guelfoweb/malware-analysis-static.git \
~/.codex/skills/malware-analysis-static
```
Update an existing installation:
```bash
git -C ~/.codex/skills/malware-analysis-static pull --ff-only
```
Restart Codex after installing or updating the skill.
### Claude Code
Install:
```bash
git clone https://github.com/guelfoweb/malware-analysis-static.git \
~/.claude/skills/malware-analysis-static
```
Update an existing installation:
```bash
git -C ~/.claude/skills/malware-analysis-static pull --ff-only
```
Restart Claude Code after installing or updating the skill.
## Demo
Asciinema walkthrough:
- https://asciinema.org/a/Egd1lZpSHj7Pw6kA
## Recommended Prompt
```text
Use the $malware-analysis-static skill to analyze samples in this directory. Run in static mode, create and update AGENTS.md and REPORT.md, rebuild the multi-stage chain, extract C2/drop URL/stage URL/domains/IP, calculate hashes, and attempt to identify the family. You are authorized to download any stages from URLs found only because this is an isolated lab machine.
```
Optional stricter token-control addition:
```text
Keep chat output minimal. Save all verbose outputs, strings, decompiler output, command logs, decoded blobs, and candidate lists under case/. Do not paste raw outputs in chat. Stop speculative branches after two failed attempts and pivot to evidence-backed analysis.
```
## Required Tools
The skill discovers available tools dynamically and should ask before installing anything missing.
Core tools:
- `file`, hash tooling (`md5sum`, `sha1sum`, `sha256sum` or platform equivalents)
- `strings`, `rg`, `python3` or `py`, `7z`, `exiftool`, `yara`, `xxd`, `base64`
Reverse-engineering tools:
- `objdump`, `llvm-objdump`, `readelf`, `nm`, `otool`, `lipo`
- `radare2`/`r2`, `rabin2`, `Ghidra` headless `analyzeHeadless`, `binwalk`
Android tools:
- `jadx`, `apktool`, `aapt2`
- optional: `bundletool`, `apkanalyzer`
Windows PE/.NET tools:
- `floss`, `xorsearch`, `ilspycmd`, `monodis`
- Python modules: `pefile`, `lief`
- optional: `capa`, `upx`, `sigcheck`, `dumpbin`
Office/script/web tools:
- `oletools` (`oleid`, `olevba`), `oledump.py`, `rtfobj`
- `unzip`, `zipinfo`, `xmllint`, `iconv`
- optional: `node`, `php`, `perl`, `pwsh`, `CyberChef CLI`, beautifiers, AST parsers
## Notes
- Tool installation is not silent: the agent should ask before each missing tool installation.
- Remote stage retrieval should only happen when explicitly authorized and from an isolated lab context.
- `AGENTS.md` is working memory. `REPORT.md` is the readable analyst report.
- The skill should save verbose evidence under the case directory and keep chat output concise.
- The repository ships one shared `SKILL.md` plus format-specific `references/` playbooks so the same skill can be used in both Codex CLI and Claude Code.
## Warning
> Malware analysis must be performed only on an isolated lab machine or disposable VM, never on a personal or production workstation.