malware-analysis-triage
Use when triaging a suspicious PE, ELF, .NET binary, or shellcode for authorized malware analysis, defensive detection engineering, CTF, or reverse engineering.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- malware-analysis-triage
- description
- Use when triaging a suspicious PE, ELF, .NET binary, or shellcode for authorized malware analysis, defensive detection engineering, CTF, or reverse engineering.
02 资源文件 1
- 参考文档references/commands.md6.0 KB
03 SKILL.md 正文
Malware Analysis Triage (capa / FLOSS / ghidriff)
Overview
Three FLARE/Mandiant defensive CLIs that turn an unknown blob into actionable intelligence in seconds, before you sink hours into IDA/Ghidra:
- capa — what can this binary do? Static capability detection mapped to MITRE ATT&CK and MBC (persistence, C2, injection, anti-analysis, crypto).
- FLOSS — what is it hiding? Recovers stack / tight / decoded strings that
plain
stringscannot see (C2 URLs, keys, mutexes, config). - ghidriff — what changed? Headless Ghidra binary diff between two builds, rendered as shareable markdown — for n-day / Patch-Tuesday research and variant hunting.
Framing: This is defensive triage and authorized RE. Use it on samples you are authorized to analyze (your own, quarantined, sandbox-detonated, CTF, or vendor patches). Every capability you find should feed a detection, not an attack — see the Defensive Pairing column below.
When to Use
- You have an unknown/suspicious executable and need a fast behavior summary.
stringsreturned nothing useful but the sample is clearly doing something.- You need MITRE ATT&CK technique IDs to write or validate Sigma/EDR/YARA rules.
- You want to know exactly which functions to reverse first (jump to addresses).
- A vendor shipped a patch and you need to find the fixed code path (n-day).
When NOT to use: dynamic/sandbox detonation (use CAPE/DRAKVUF/VMRay, then
feed their JSON to capa); live debugging (use $reverse-engineering-toolkit);
deep manual decompilation (these tools point you there, they don't replace it).
Install (Windows, this workspace)
Python 3.14 + pip are on PATH; Ghidra 12.0.3 is installed with
GHIDRA_INSTALL_DIR already set (satisfies ghidriff's Ghidra 11.4+ need).
python -m pip install --user flare-capa flare-floss ghidriff
Installed and verified in this workspace: flare-capa 9.4.0, flare-floss 3.1.1, ghidriff 1.0.0 (Python 3.14).
Invocation gotcha (load-bearing): pip install --user puts the console
scripts in C:\Users\Prekzursil\AppData\Roaming\Python\Python314\Scripts, which
is not on PATH — so a bare capa / floss / ghidriff will not resolve.
Use the PATH-independent module form (verified working):
python -m capa.main --version # capa 9.4.0 (NOTE: capa.main, not -m capa)
python -m floss --version # FLOSS 3.1.1
python -m ghidriff --version # ghidriff 1.0.0
echo "$GHIDRA_INSTALL_DIR" # D:\Program Files\Ghidra\ghidra_12.0.3_PUBLIC
Alternatively add that Scripts dir to PATH (or call the .exe files there
directly) to use the bare capa / floss / ghidriff commands shown in the
Quick Reference below.
capa needs rules + signatures (load-bearing — pip does NOT bundle them). The
flare-capa wheel ships no rules or FLIRT signatures, so a bare
capa sample.exe fails with default embedded rules not found! (maybe you installed capa as a library?) and then default signature path ... doesn't exist. Both are already fetched in this workspace (matching v9.4.0):
rules: C:\Users\Prekzursil\.local\share\capa\capa-rules-9.4.0
sigs: C:\Users\Prekzursil\.local\share\capa\sigs
So every capa run must pass -r and -s (verified working):
python -m capa.main -r ~/.local/share/capa/capa-rules-9.4.0 -s ~/.local/share/capa/sigs sample.exe
To re-provision after a capa upgrade, re-download the matching tag:
capa-rules from github.com/mandiant/capa-rules/archive/refs/tags/vX.Y.Z.zip
and the sigs/ folder from the capa source tarball
github.com/mandiant/capa/archive/refs/tags/vX.Y.Z.zip. The standalone capa
binary bundles both rules and sigs, so it sidesteps this entirely — prefer it
inside an analysis VM.
Standalone-binary alternative (no Python deps, good for an isolated analysis VM): download the release binaries for capa and FLOSS from their GitHub releases and drop them on PATH. Prefer the standalone build inside the malware VM so you are not adding the sample's dependencies to your Python env.
capa ships its own pinned rule set; refresh periodically with
capa --version and pulling the latest flare-capa. For a separate rules
checkout use capa -r <rules-dir>.
Quick Reference
capa needs -r RULES -s SIGS (see Install). Shorthand below: set
R=~/.local/share/capa/capa-rules-9.4.0 S=~/.local/share/capa/sigs and use
python -m capa.main -r "$R" -s "$S" ....
| Goal | Command |
|---|---|
| Capability + ATT&CK report | python -m capa.main -r "$R" -s "$S" sample.exe |
| Same, with exact addresses per capability | ... -r "$R" -s "$S" -vv sample.exe |
| JSON for tooling / pipelines | ... -r "$R" -s "$S" -j sample.exe > caps.json |
| Ingest a sandbox report (beats packing) | ... -r "$R" -s "$S" cape_report.json |
| All hidden strings | floss sample.exe |
| Only stack + tight strings | floss --only stack tight -- sample.exe |
| Skip slow decoded-string emulation | floss --no decoded -- sample.exe |
| Plain static strings only (fast) | floss --only static -- sample.exe |
| Diff two builds to markdown | ghidriff old.bin new.bin |
| Side-by-side HTML diff | ghidriff --sxs old.bin new.bin |
| Cap RAM on a large binary | ghidriff --max-ram-percent 50 old.bin new.bin |
Run capa and FLOSS together on every sample — they are complementary and both cheap.
Defensive Pairing (turn findings into detections)
| Tool finding | Defensive action |
|---|---|
| capa ATT&CK ID, e.g. T1053 "scheduled task" | Confirm you alert on schtasks/Task Scheduler events; write/validate a Sigma rule for that technique. |
| capa "process injection" / "C2 over HTTP" | Seed an EDR hunt hypothesis; map to existing analytics coverage. |
| FLOSS-recovered C2 URL / key / mutex | Add IOC to blocklist/feed; build a YARA rule on the constant or decoded string. |
| ghidriff patched-function delta | Write detection for the pre-patch exploitation primitive before exploits ship. |
The whole point: capa's technique IDs are the same IDs you feed to Sigma/EDR, so triage output drives detection engineering directly.
Gotchas
- capa static backend is defeated by heavy packing/obfuscation — pivot to
the sandbox-report mode (
capa report.json) or unpack first. Rule set is version-pinned to the installedflare-capa. - FLOSS decoded-string recovery emulates decoder functions and has a time
budget; very large/packed binaries may need
--no decoded. It is NOT a sandbox — no network/IO is performed. - ghidriff diff quality depends on Ghidra auto-analysis completing; large
binaries are RAM-hungry (tune
--max-ram-percent). First run is slow because Ghidra analyzes both binaries. For IDA-bound, microcode-level CVE localization or symbol porting, escalate to Diaphora (AGPL, IDA plugin). - Always analyze samples in an isolated VM with no host shares mounted. capa and FLOSS do not execute the sample, but you will be handling live malware on disk.
Workflow
python -m capa.main -r "$R" -s "$S" -vv sample.exe— read the capability + ATT&CK summary; note addresses of the highest-value capabilities (injection, C2, persistence, crypto).python -m floss sample.exe— pull config/IOCs; record C2, keys, mutexes.- Open the sample in IDA/Ghidra/BN (
$reverse-engineering-toolkit,$re-ensure) and jump straight to the capa addresses instead of reading the whole binary. - If you have an old + new build (patch research):
ghidriff old newand read the markdown for the changed functions. - Turn every finding into a detection (Defensive Pairing table) —
$semgrep,$code-security, Sigma, or YARA.
Related
references/commands.md— fuller command reference and CI/headless notes.$reverse-engineering-toolkit— choosing the next tool after triage.$re-ensure,$ghidra-mcp,$ida-pro-mcp— bring up disassembler backends.- security-kb
gems-seclis.md§1-2 — source decision-queue for these gems.
04 同仓库更多 Skills
clarify-requirements
Resolve genuine pre-execution ambiguity by scanning repo context, generating 1-6 grounded options, and asking 1-3 focused questions via AskUserQuestion. NOT for mid-task use (injection risk); NOT when the goal is already unambiguous; use to disambiguate vague prompts before any file edits.
openmm-md
Run FREE, open-source, Windows-native GPU molecular dynamics via the openmm-md MCP (OpenMM + CUDA on the local NVIDIA GPU). Use for protein / protein-ligand MD when you want a free stack or are on Windows without a Schrodinger license. Covers the full workflow (prepare, solvate, minimize, equilibrate, production, analyze, mmgbsa) AND an honest decision guide vs Schrodinger Desmond, including how to run Desmond legitimately on Linux or a cloud GPU with a real license. This is a deliberately LESSER free alternative and does NOT replace the schrodinger MCP tools. Do NOT use it to pick a free tool when a validated FEP+, WaterMap, IFD-MD, or Prime MM-GBSA result is actually required.
visual-review
Take screenshots of web pages and UI using Playwright for visual review and iteration
status
Diagnostic status report — shows metaswarm installation state, project setup, and potential issues
start
Use when starting work on any task, when the user mentions metaswarm, or when the user wants to begin tracked development work
setup
Interactive project setup — detects your project, configures metaswarm, writes project-local files