Skip to main content
Glama

CI

binowl

Pure-Python binary triage toolkit — hand-rolled ELF/PE parsing, checksec, packer & compiler fingerprinting and anti-debug hints, with CLI and MCP-stdio interfaces.

Formerly rekit — renamed to binowl on 2026-11-20 after a name collision on both PyPI and GitHub. Same codebase, same history; see CHANGELOG.md.

Why binowl?

Every judgement is explainable and reproducible:

  • Hand-rolled parsers — no pyelftools, no pefile, no third-party runtime deps; ELF/PE structures are parsed field-by-field in pure Python.

  • Cross-checked against the authorities — every fingerprint criterion is validated against readelf / objdump / pefile output (see Cross-validation).

  • Explainable fingerprints — packer/compiler detection is based on net-room observation (section names, doubly-anchored Rich header, block-level median entropy, debug-API families), and honestly reports unknown / n/a instead of guessing.

Related MCP server: BinSight

Install

Requires Python >= 3.9 (CI matrix: 3.9 + 3.12, see .github/workflows/ci.yml).

cd <your-checkout-of-this-repo>
python3 -m venv .venv && source .venv/bin/activate
pip install .

This installs the binowl console command.

Usage — three interfaces

1. CLI: one-shot triage (auto ELF/PE detection)

binowl /bin/ls
binowl path/to/some.exe

Prints checksec status (NX / RELRO / PIE / W+X segments), entry point, section table and program headers. Use --format elf|pe to force a format; default is magic-byte auto-detection. Exit codes: 0 success, 2 file-level error, 3 parse-level error.

2. CLI: packer & compiler fingerprint

binowl fp path/to/target.exe

Detects UPX (section layout + UPX! magic), MSVC Rich header (doubly-anchored DanS^key ↔ Rich^key), stripped symbols and five anti-debug API families, with the evidence spelled out:

fingerprint: UPX
  compiler: MSVC(modern, b30729)
  stripped: unknown
  evidence: 节名 UPX0+UPX1
  evidence: UPX! magic
  evidence: Rich 头 11 对 → msvc_modern(DOS stub 幸存)
  evidence: compiler: MSVC(modern, b30729)
  anti-debug: n/a(壳内/PE 判据不可用,诚实降级)

3. MCP server (stdio)

binowl mcp

Speaks JSON-RPC over stdio (echoes MCP protocol version 2025-06-18), exposing the tools info (one-shot triage) and map (segment/section map). Point any MCP client at it, e.g. for Claude Desktop:

{
  "mcpServers": {
    "binowl": {"command": "binowl", "args": ["mcp"]}
  }
}

Python module

>>> import binowl
>>> binowl.__version__
'0.1.0'
>>> from binowl import elf, pe, fingerprint

Sample output

binowl tests/fixtures/bin_ls.elf (ELF64 PIE):

Checksec: NX enabled (GNU_STACK RW) | RELRO full | PIE yes | W+X segs none
Entry: 0x6760  Sections: 30  Phdrs: 14
Nr  Name                     Type           Address                   Off       Size
[ 0]                          NULL           0x0000000000000000 0x00000000 0x00000000
[ 1] .note.gnu.property       NOTE           0x0000000000000350 0x00000350 0x00000020
[ 2] .note.gnu.build-id       NOTE           0x0000000000000370 0x00000370 0x00000024
...

Use with AI agents (MCP)

binowl ships an MCP stdio server exposing two tools: binowl_info (triage summary) and binowl_map (segment/section views). Every tool payload carries a limitations field — a structured list of what the result does not claim (stripped binaries, packed samples, byte-level-only observations), so agents can reason about confidence, not just parse output.

Claude Code:

claude mcp add binowl -- python -m binowl.cli mcp

Cursor / Codex / any MCP client (mcp.json):

{
  "mcpServers": {
    "binowl": { "command": "python", "args": ["-m", "binowl.cli", "mcp"] }
  }
}

Then ask your agent e.g. "run binowl_info on this binary and tell me what the limitations field says before you conclude anything."

Tests & fixtures

pip install pytest
pytest            # 130 assertions green locally (17 fixtures); on a fresh
                  # clone: 114 passed + 8 skipped — see provenance note below

Most fixtures are regenerable (self-constructed samples, no vendored binaries):

python3 tests/build_samples.py    # 6 crafted ELF samples + m2_manifest.json
python3 tests/make_minidll.py     # minimal PE32+ DLL with export table
python3 tests/make_minipe.py      # minimal PE32+ EXE (with .idata)
python3 tests/make_fakerich.py    # fake-Rich negative sample (anti-trap)

Provenance note (redistribution boundary, CHARTER §4): the ELF anchor sample is dyn_ls — self-built (tests/src/dyn_ls.c: distro-style dynamic PIE, Full RELRO, strip, no .comment; regenerable, readelf 2.44/2.38 dual-snapshot verified). Three fixtures are not shipped: bin_ls.elf (host /bin/ls — replaced by dyn_ls) and cli-64.exe / cli64_upx.exe (setuptools-wheel bundled launcher + UPX derivative, provenance registered in the manifest, replacement queued). On a fresh clone the affected tests skip automatically with an explicit reason (no silent degradation). Either way, the wheel itself ships only the binowl package, never any fixture ([tool.setuptools] packages = ["binowl"]).

Cross-validation against authoritative tools

Parser outputs are diffed against readelf / objdump / pefile — the verification scripts live in tests/ and double as usage examples:

python3 tests/verify_fingerprint.py    # fp: all fixtures vs readelf/pefile
python3 tests/verify_packaging.py      # wheel vs source-tree parity

License

MIT — see LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes read-only local analysis tools for source auditing, web traffic review, binary reverse engineering, exploit scaffolding, OSINT, and reporting via JSON-RPC over stdio, enabling LLMs to orchestrate evidence-based security workflows without executing targets or sending network requests.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents and CLI users to statically inspect any binary offline — identifying file type, architecture, imports, packing, embedded content and signatures — and to diff two files to see exactly what changed. It works on ELF, PE and Mach-O executables, firmware dumps and calibration files without ever running them, reporting observations and inferences with file offsets as evidence.
      104 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI coding agents to inspect and reverse-engineer large binaries through bounded stdio JSON-RPC 2.0 tools for graph queries, SSA facts, path solving, runtime grounding, and mod scaffolding.
      1
      AGPL 3.0
    • A
      license
      B
      quality
      C
      maintenance
      This MCP server lets an agent run local binary inspection on ELF, Mach-O, PE, APK, IPA, ASAR, WebAssembly, and firmware targets — pulling symbols, sections, classified strings, disassembly, and mitigation posture, and flagging dangerous imports and CWE patterns. It exposes eight stdio JSON-RPC tools (with no external API keys) that feed a multi-agent swarm for attack-surface mapping and exploit-chain synthesis.
      12
      MIT