Tools

RE Toolkit (5/5): malware triage and patch diffing — capa, FLOSS, YARA-X, BinDiff, ghidriff

TL;DR

Automated triage answers 'what can this file do' in minutes with capa, FLOSS and YARA-X. Patch diffing with ghidriff (one command, Ghidra), BinDiff or Diaphora shows which functions a patch changed. Keep learning with mytechnotalent/Reverse-Engineering and nightmare.

Two questions come up constantly in security work: "What can this unknown file do?" and "What did the patch that just shipped fix?". Answering them by reading every function in Ghidra takes days. The final part of the RE Toolkit series covers repos that automate both: capa, FLOSS and YARA for fast triage, BinDiff, Diaphora and ghidriff for patch diffing, plus three learning repos to keep going.

GitHub page of mandiant/capa
GitHub page of mandiant/capa (captured November 2026)

GitHub: https://github.com/mandiant/capa · about 6.3k stars · Python · Apache-2.0

Part 1: fast triage

RepoAnswers the questionStars · License
mandiant/capaWhat capabilities does this program have (network, persistence, crypto…)?~6.3k · Apache-2.0
mandiant/flare-flossWhich strings are hidden (encrypted, stack-built) where strings can't see them?~4.2k · Apache-2.0
VirusTotal/yara-x / yaraWhich files match known patterns? (YARA-X is the Rust rewrite)~1.4k / ~10k · BSD-3-Clause

capa: capabilities instead of signatures

capa takes a PE, ELF, .NET module, shellcode or sandbox report and matches it against the community rule set (the capa-rules repo) to list capabilities mapped to MITRE ATT&CK. Results like "send HTTP request", "create service" or "execute shell command" tell you which functions to open first.

capa sample.exe          # ATT&CK table + capability list
capa -v sample.exe       # verbose: where each capability lives

Results can be explored visually in capa Explorer Web or loaded into IDA/Ghidra to jump to the relevant functions.

FLOSS and YARA

FLOSS emulates decoding routines to recover hidden strings, often revealing C2 URLs, mutex names and registry keys. YARA turns those findings into rules to scan thousands of other files:

floss sample.exe

rule Suspicious_Downloader {
  strings:
    $api = "URLDownloadToFileA" ascii
    $cmd = "cmd.exe /c" ascii nocase
  condition:
    uint16(0) == 0x5A4D and all of them
}

yr scan rules.yar ./samples/     # YARA-X

Part 2: patch diffing

When a vendor ships a security fix without details, diffing the binary before and after shows exactly which functions changed. Defenders use it to judge urgency and write detections; developers use it to check that a third-party library's patch really matches its changelog.

RepoRuns onStrengthsStars · License
google/bindiffIDA, Ghidra, Binary Ninja (via BinExport)Industry standard, open-sourced by Google, graph comparison UI~3.2k · Apache-2.0
joxeankoret/diaphoraIDAMany matching heuristics, compares decompiled pseudocode too~4.5k · AGPL-3.0
clearbluejar/ghidriffGhidra, command lineOne command, Markdown/JSON/HTML output, easy to automate~0.8k · GPL-3.0

ghidriff: a patch diff in one command

ghidriff uses free Ghidra to find added, deleted and modified functions, plus "meta diffs" of strings and callers/callees. Per its README, once Ghidra analysis is done it can diff the entire Windows kernel in under a minute.

pip install ghidriff        # requires an installed Ghidra
ghidriff old/driver.sys new/driver.sys
# or with Docker:
docker run -it --rm -v $(pwd)/ghidriffs:/ghidriffs \
  ghcr.io/clearbluejar/ghidriff:latest ghidriffs/old.sys ghidriffs/new.sys

The Markdown output can be pasted straight into a gist, internal wiki or ticket, so the whole team can review it.

Part 3: repos to keep learning

Caveats

  • capa and YARA are only as good as their rules; new or heavily obfuscated samples may match nothing.
  • FLOSS emulates the sample's code rather than running it natively, but still use it inside an analysis VM.
  • Diffing builds from different compilers or optimisation levels yields lots of noise; compare adjacent versions.

How to apply it

  • Dev / SOC: Wrap capa + floss + yr scan into one triage script that runs on every suspicious file before anyone opens Ghidra.
  • Tech Lead: When a critical native library ships a security fix, run ghidriff between the two versions and attach the report to the upgrade ticket.
  • PM: Automated triage decides within minutes which files need an expert, instead of queueing everything for manual analysis.

Sources & references

  1. mandiant/capa (GitHub) — mandiant
  2. mandiant/flare-floss (GitHub) — mandiant
  3. VirusTotal/yara-x (GitHub) — VirusTotal
  4. google/bindiff (GitHub) — google
  5. joxeankoret/diaphora (GitHub) — joxeankoret
  6. clearbluejar/ghidriff (GitHub) — clearbluejar
  7. mytechnotalent/Reverse-Engineering (GitHub) — mytechnotalent
  8. guyinatuxedo/nightmare (GitHub) — guyinatuxedo