Overview of capa capabilities
masterc2/shell, communication/http/client).repository·master·Indexed 27 days ago
https://github.com/mandiant/capaAn open-source tool by the FLARE team that detects capabilities in executable files (PE, ELF, .NET, shellcode) and sandbox reports, mapping them to ATT&CK tactics and techniques. It includes plugins for IDA Pro and Ghidra, a web-based explorer, and support for dynamic analysis via CAPE, DRAKVUF, and VMRay reports. Users can author custom rules using a YAML-based format to identify specific program behaviors.
c2/shell, communication/http/client).capa output can be consumed through several interfaces depending on your workflow:
-v, -vv), JSON (-j), or other formats. Best for scripting, CI/CD, or one-off analysis.capa Explorer plugin for interactive analysis with jump-to-address capabilities.capa Explorer plugin for interactive analysis integrated with Ghidra.capa using Binary Ninja as the analysis backend.capa on dynamic sandbox reports (e.g., CAPE, VMRay) to analyze executable behavior.capa/sigs directory contains FLIRT signatures used by capa to identify library functions. By identifying these functions, capa can ignore them during analysis, which helps reduce false positives and improves overall runtime performance.You can use capa Explorer Web in two ways:
To integrate capa into an existing Python project, install the flare-capa module using pip.
Note on Rules and Signatures: Installing via pip does not include the default rule set or library identification signatures. You must provide them manually using the -r (rules) and -s (signatures) flags.
-r flag to point to the rules directory.-s flag to point to the signatures directory.# Install the module
$ pip install flare-capa
# Example: Running with downloaded rules
$ wget https://github.com/mandiant/capa-rules/archive/refs/tags/v9.4.0.zip
$ unzip v9.4.0.zip
$ capa -r capa-rules-v9.4.0/ suspicious.exe
# Example: Running with rules and signatures
$ capa -s /path/to/capa-sigs suspicious.exeTo modify the capa source code, clone the repository and install it in 'editable' mode. This allows changes to the source to be reflected immediately without re-installing.
Use --recurse-submodules to include code, rules, and test files.
CAUTION: The testfiles submodule contains malware samples; ensure you use a directory ignored by your antivirus.
Use pip install -e to link the local directory to your Python environment.
Use venv to avoid dependency conflicts and ensure all requirements are captured in setup.py.
Install pinned dependencies from requirements.txt first, then install the local package with development extras ([dev] or [dev,scripts]).
# Clone with all submodules
$ git clone --recurse-submodules https://github.com/mandiant/capa.git /local/path/to/src
# OR: Clone only code and rules
$ git clone https://github.com/mandiant/capa.git /local/path/to/src
$ cd /local/path/to/src
$ git submodule update --init rules
# Create and activate virtual environment
$ python3 -m venv ../capa-env
$ source ../capa-env/bin/activate
# Install dependencies and package in editable mode
$ pip install -r requirements.txt
$ pip install -e /local/path/to/src[dev]To ensure the Python environment is correctly loaded for the plugin, you must start Ghidra using the pyghidraRun script located in your Ghidra installation's support directory. You should execute pyghidraRun from within the same Python environment where you installed flare-capa.
<ghidra_install>/support/pyghidraRunYou can install the Ghidra backend support for the flare-capa Python package by installing the ghidra extra.
$ pip install "flare-capa[ghidra]"capa supports dynamic capability detection by analyzing reports generated from supported sandboxes. This allows capa to match capabilities against both static features and dynamic features captured during execution.
To use this feature:
capa against the report file instead of the original binary.Supported Sandboxes and Formats:
.json, .json_, .json.gz.log, .log.gz.zip