# Malware Static Triage Capa Integration

> Use when you want capa capability results wired into every stage of static triage, covering pre-filtering the queue, guiding string and import review, auto-suggesting YARA strings, and producing ATT&CK mapping for reports. Covers capa CLI options for triage speed, interpreting capability namespaces for triage decisions, using verbose output to jump to evidence, batch triage scripting, and custom rules for your environment's top families. Use when triaging sample batches, when building an automated triage pipeline, or when standardizing reports across analysts.

- Skill: `mizazhaider-ceh/malware-static-triage-capa-integration` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/malware-static-triage-capa-integration`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/malware-static-triage-capa-integration/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/malware-static-triage-capa-integration

---


capa turns triage from "read everything" into "read what matters": its
capability list tells you which parts of the binary deserve your limited
minutes. This sub-skill covers integrating capa into the triage workflow
itself: fast CLI usage, letting capabilities aim your string and import
review, scripting batch triage, and writing the team rules that make
capa a family detector. Scope: run capa only on samples you are
authorized to handle, in an isolated lab, during authorized DFIR or
malware research.

## Quick Workflow

1. Run capa on the sample with JSON output for scripting.
2. Read the ATT&CK tactic list: this is the sample's shape in ten
   seconds.
3. For each surprising or verdict-relevant capability, pull the -v
   evidence (function address, strings).
4. Aim string review at the evidence addresses; aim import review at
   the flagged APIs.
5. Select YARA strings from the -v output.
6. Write the ATT&CK mapping and capability summary into the triage
   report.

## 1. capa CLI for triage speed

```bash
# Fast triage pass: default rules, quiet output
capa -q sample.exe

# JSON for the pipeline
capa -j sample.exe -o capa.json

# Only the rules you care about (faster on big batches)
capa -r team_rules/ -t 60 sample.exe

# Show which rule file each hit came from (auditability)
capa -v sample.exe 2>/dev/null | grep "rule path" | sort -u
```

Example `-q` output shape:

```text
PERSISTENCE: Registry Run Keys / Startup Folder [T1547.001]
DEFENSE EVASION: Obfuscated Files or Information [T1027]
COMMAND AND CONTROL: Application Layer Protocol [T1071.001]
```

Three lines, and you already know the verdict direction and which
sections of the parent skill to spend time on.

## 2. Letting capabilities aim your review

Instead of reading all strings, read the strings capa names:

```bash
# Get every string address capa used as evidence
python3 - <<'EOF'
import json
data = json.load(open("capa.json"))
seen = set()
for rule, hits in data["rules"].items():
    for addr, match in hits.get("matches", {}).items():
        for node in str(match):
            pass
print("review the -v output for:", rule)
EOF
```

Practical version: run `capa -v`, find the capability you care about
(say "encode data using XOR"), note the function address, and open that
address in Ghidra or x64dbg. You are now looking at the exact decoder
instead of guessing from a string dump. For YARA, the strings in the -v
output are pre-vetted: capa already decided they indicate malicious
capability, which is stronger than "this string looks odd".

## 3. Batch triage scripting

```python
import json, subprocess, glob

for path in glob.glob("queue/*.exe"):
    subprocess.run(["capa", "-j", path, "-o", path + ".capa.json"],
                   capture_output=True, timeout=300)

# Rank the queue by interestingness
import os
rows = []
for jf in glob.glob("queue/*.capa.json"):
    data = json.load(open(jf))
    tactics = {m["tactic"] for r in data["rules"].values()
               for m in r.get("meta", {}).get("att&ck", [])}
    rows.append((len(tactics), jf))
for n, jf in sorted(rows, reverse=True)[:10]:
    print(f"{n} tactics  {os.path.basename(jf)}")
```

Example output shape:

```text
5 tactics  sample_a.exe.capa.json
4 tactics  sample_c.exe.capa.json
1 tactics  sample_b.exe.capa.json
```

Triage the 5-tactic sample first. Samples with zero capabilities and
tiny import tables go to the unpacking queue, not the clean pile.

## 4. Custom team rules for top families

Write capa rules for behaviors your environment sees repeatedly:

```yaml
rule:
  meta:
    name: nimbus run key persistence
    namespace: persistence/nimbus
    authors: [soc-team]
    scope: function
    att&ck:
      - T1547.001 [Registry Run Keys / Startup Folder]
  features:
    - and:
      - api: advapi32.RegSetValueExA
      - string: "NimbusSync"
```

Deploy with `-r team_rules/` in the pipeline. A capa hit on a team rule
is a family verdict before a human opens the file; route those samples
straight to "known family, confirm and close". Review team rules
quarterly against clean software, same discipline as YARA.

## 5. Report integration

Template section fed by capa:

```text
Capabilities (capa 7.4, ruleset 2026-10-01):
  T1547.001 persist via registry (RegSetValueExA @ 0x4012b3,
              value "NimbusSync")
  T1071.001 send HTTP request (HttpSendRequestA @ 0x401340,
              "/api/v2/beacon")
  T1027     encode data using XOR (decoder @ 0x401500)
Verdict:    MALICIOUS, Nimbus loader, matches team rule
            persistence/nimbus.
```

Pin the capa version and ruleset date in every report; capability
results change as rules improve, and reproducibility matters.

## Edge cases

- Packed samples: capa describes the stub; label it as such and do not
  verdict on stub capabilities.
- Rule updates changing old verdicts: re-run the queue on ruleset
  updates and diff; investigate changes, do not blindly accept them.
- capa timeouts on huge binaries: raise -t or scope rules; a timed-out
  capa run is not a clean result.
- Conflicting rules: two rules can claim different ATT&CK techniques
  for one function; read the -v evidence and decide.

- capa results differ between ruleset versions; pin the version in reports and re-run the queue on upgrade.

## Escalation

- If capa results contradict sandbox behavior badly, escalate for
  re-analysis: one of the two is looking at the wrong layer.
- If a new capability appears across many samples at once, escalate to
  threat intel as a possible tooling shift.

- If batch triage ranks a supposedly clean internal tool high, escalate: either the tool is trojanized or a rule is misfiring, and both matter.
- If capa throughput blocks the pipeline SLA, escalate to scoped rulesets rather than dropping capa entirely.

## Detection and defender view

capa in the pipeline is continuous ATT&CK coverage measurement: every
sample's techniques get logged, and the aggregate shows which
techniques your detections miss. Team capa rules are detections in
their own right; treat them with YARA-grade discipline (versioning,
testing, retirement). Share anonymized capability trends with the SOC
quarterly: "persistence via scheduled tasks up 40%, Run keys down" is
actionable defense planning input.

## Key references

- capa documentation:
  https://github.com/mandiant/capa
- capa-rules repository:
  https://github.com/mandiant/capa-rules
- MITRE ATT&CK:
  https://attack.mitre.org/
- Mandiant FLARE FLOSS:
  https://github.com/mandiant/flare-floss

- capa installation and usage notes:
  https://github.com/mandiant/capa

