Skip to main content
Glama
re-audit-mcp
by TLSRUF

re-audit

English | 한국어

CI License: MIT M8ven Score

Static, reverse-engineering-assisted vulnerability triage, as a CLI and an MCP server so an AI agent (Claude Code, etc.) can drive it.

Why this instead of a Ghidra-based MCP server: no Ghidra/Java install, no project database, no GUI to script against -- pip install re-audit and you get an answer in seconds. It trades Ghidra's full decompiler depth for being lightweight, scriptable, and CI-friendly; pair it with a Ghidra/radare2 MCP server for deep manual analysis when a finding here warrants it.

It extracts strings, flags hardcoded-secret patterns, checks ELF/PE/Mach-O exploit mitigations, and audits Android APK manifests -- then hands back a single structured report with a summary_findings list.

re-audit terminal demo

re-audit HTML report

Everything shown above is real output from this repo's own code, run against notepad.exe and the synthetic secrets fixture in tests/ -- nothing in these assets is staged or fabricated.

Scope -- read this first

This tool is static-analysis only:

  • It never sends a network request.

  • It never executes, launches, or instruments the target.

  • It only reads bytes from a local file you point it at.

That makes it safe to run on anything sitting on your disk. It does not make it legal to run against a service you don't own or aren't authorized to test. Before pointing this at anything:

  • Your own code/builds -- always fine.

  • CTF binaries, crackmes, deliberately vulnerable apps (Juice Shop, DVWA, HackTheBox/picoCTF targets) -- fine.

  • A real company's app or website -- only if you have a signed authorization, or the target has a published bug-bounty / vulnerability disclosure program (HackerOne, Bugcrowd, or the vendor's own security.txt / bounty page) and your activity stays inside its stated scope and rules.

  • If no scope or program exists, don't test it. Report findings only through the vendor's official security contact, or via a national CERT (e.g. KISA in Korea) if there's no direct channel. Never demand payment for a report you weren't invited to submit -- that can be read as extortion.

Findings this tool produces are heuristic candidates for human review, not confirmed, exploitable vulnerabilities. Always verify manually before reporting anything to a vendor.

Related MCP server: StaticApkAuditor MCP

Install

pip install -e .

CLI usage

re-audit scan ./my_app.apk               # full audit, human-readable
re-audit scan ./my_app.apk --json        # full report as JSON
re-audit scan ./binary.exe --out report.json
re-audit scan ./binary.exe --html report.html   # styled, shareable HTML report

re-audit strings ./binary.exe            # just string extraction
re-audit secrets ./binary.exe            # just secret-pattern scanning
re-audit binary ./binary.exe             # just exploit-mitigation checks
re-audit apk ./my_app.apk                # just APK manifest audit

MCP server usage

Run directly:

re-audit-mcp

Or register it with Claude Code (claude mcp add) / your MCP client's config, pointing it at re-audit-mcp (stdio transport). Exposed tools:

Tool

Purpose

detect_file_type

Identify ELF / PE / Mach-O / APK / JAR by magic bytes

scan_strings

Extract + classify strings (URLs, IPs, paths, risky API names)

scan_secrets

Hardcoded credential/token/key pattern + high-entropy scan (redacted)

scan_binary_mitigations

NX, PIE/ASLR, RELRO, stack canary, CFG, risky imports

scan_apk

Debuggable/backup/cleartext flags, dangerous permissions, exported components

full_audit

Runs all of the above and merges into one report

The server's instructions tell the connected agent to confirm the target is in-scope before scanning and to present findings as unverified candidates -- but that's a prompt-level nudge, not an enforcement mechanism. The scope decision is still yours.

What it checks

  • Strings: URLs, IPs, filesystem paths, references to risky functions (strcpy, system, eval(, pickle.loads, etc.)

  • Secrets: AWS/Google/Slack/GitHub key formats, PEM private key blocks, JWTs, generic password/API-key assignments, DB connection strings, plus high-entropy token detection for anything the regexes miss.

  • Binaries (via LIEF): NX/DEP, PIE/ASLR, RELRO (ELF), stack canary, Control Flow Guard / SafeSEH (PE), Authenticode signature, and a curated list of memory-unsafe imports.

  • APKs (via androguard): debuggable, allowBackup, usesCleartextTraffic, dangerous permissions, and exported activities/services/receivers/providers without exported="false".

Robustness against adversarial input

re-audit's whole job is parsing files you don't necessarily trust (CTF samples, real malware, hostile APKs), so a scan running on attacker-chosen bytes is the normal case, not an edge case. A Cloudflare security-audit-skill review of this repo found and fixed two concrete DoS vectors along those lines, both confirmed with real local measurements before the fix:

  • A ~50-byte crafted string could hang the secrets scanner for minutes (ReDoS in a regex) -- fixed by rewriting it as a linear-time check.

  • A sub-2MB crafted APK could force ~1-2GB of memory via decompression-bomb amplification in a dependency -- fixed with a header-only size check before any entry is decompressed.

As defense in depth, every entry point now enforces a file-size cap (re_audit/limits.py) and wraps regex-based scanning in a wall-clock timeout, so a future pathological pattern degrades to a clear error instead of a hang.

Development

pip install -e .
pip install pytest
pytest tests/ -v

Tests run against real artifacts (C:\Windows\System32\notepad.exe) rather than mocks, so CI runs on windows-latest. The APK analyzer's end-to-end test needs a real debug .apk you own -- point RE_AUDIT_TEST_APK at one locally to run it; it's skipped otherwise (no binary fixtures are committed to keep the repo small).

To regenerate examples/demo.gif: python scripts/make_demo_gif.py (pure Pillow, hand-renders the terminal frames -- no pty/ffmpeg dependency).

License

MIT

Available Tools

6 tools
detect_file_typeA

Identify whether a file is an ELF, PE, Mach-O binary, APK, JAR, or unknown, by magic bytes.

NameRequiredDescriptionDefault
pathYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the behavioral burden. It reveals the detection mechanism (magic bytes) and the possible return categories, which implies a read-only operation, but it does not explicitly state that the file is not modified, how errors are handled, or any file size or permission constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is a single sentence that is front-loaded with the core verb and resource, then immediately names the recognized formats and the mechanism. There is no filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter detection tool with no output schema, the description is nearly complete: it names the verb, the output categories, and the detection method. The main omission is any explanation of the 'path' parameter, which is left entirely to the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description should compensate for the undocumented 'path' parameter. It does not explain whether 'path' is a local filesystem path, a relative path, or a URI, nor does it mention format constraints; the only clue is the schema's title 'Path'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Identify') and resource ('file'), and enumerates the exact output classes (ELF, PE, Mach-O, APK, JAR, unknown) plus the mechanism ('magic bytes'). This clearly distinguishes it from sibling scan tools such as scan_binary_mitigations or scan_apk, which analyze content rather than classify file type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: an agent can infer this is a preliminary classification step before using scan_strings, scan_secrets, or scan_binary_mitigations. However, the description never explicitly says when to use this tool versus its siblings, nor does it state any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

full_auditA

Run the complete static audit on a file (auto-detects ELF/PE/Mach-O/APK).

Combines string extraction, hardcoded-secret scanning, binary exploit mitigation checks, and (for APKs) manifest/permission analysis into one report with a summary_findings list. Only use on files the caller is authorized to test.

NameRequiredDescriptionDefault
pathYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden. It does disclose the composite nature of the operation, that results are consolidated into a `summary_findings` list, and adds an authorization caveat — real value beyond the schema. However, it never states that this is a read-only, non-mutating operation, nor does it mention cost/latency (a full multi-pass audit on a large binary could be slow) or behavior on unsupported/oversized files.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense and front-loaded: the core action and the auto-detection scope land in the first clause, the aggregation detail follows, and the authorization note closes. No filler sentences, though the multi-line enumeration could be tightened slightly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter tool with no output schema, the description covers what it does and names the key return field (`summary_findings`), which is decent. Gaps remain around read-only semantics, expected runtime, and output shape beyond the single named field — meaningful for a composite audit that runs four separate analyses.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

A single required `path` parameter with 0% schema description coverage, so the description must compensate. It does partially: 'on a file (auto-detects ELF/PE/Mach-O/APK)' clarifies that `path` is a single file rather than a directory and that format need not be specified. It does not state whether the path is local/absolute or remote, or what happens with unsupported formats.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Run the complete static audit on a file') and enumerates exactly what it aggregates: string extraction, secret scanning, mitigation checks, and APK manifest analysis. Because the constituent scans match the sibling tool names (scan_strings, scan_secrets, scan_binary_mitigations, scan_apk), an agent can immediately tell this is the aggregate superset rather than any single scan.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is only implied: the description lists the individual scans, which hints 'use this instead of running the siblings separately,' but never says so explicitly or names when a narrower sibling is preferable. The only explicit directive is a legal/authorization constraint ('Only use on files the caller is authorized to test'), which is a guardrail rather than selection guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

scan_apkB

Static security audit of an Android APK: debuggable/backup/cleartext flags, dangerous permissions, and exported components (activities/services/receivers/providers) lacking guards.

NameRequiredDescriptionDefault
pathYes

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. 'Static' usefully signals the APK is not executed and the scan is non-mutating, but it says nothing about return format, whether the file must be a valid/signed APK, runtime cost, or what happens on a malformed input.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with a colon-delimited checklist — dense and waste-free. The noun-phrase fragment style (no explicit subject) and stray trailing newline keep it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter tool with no annotations and no output schema, the description covers what is inspected but not what the agent gets back (findings list? severity? counts?), nor any failure modes. Adequate to call it, but thin for interpreting the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for the single 'path' parameter, so the description must compensate. Saying the audit is 'of an Android APK' strongly implies path is a filesystem path to an APK file, but the description never confirms this or mentions format, relative vs absolute paths, or extension requirements.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Static security audit of an Android APK') and enumerates the exact checks performed (debuggable/backup/cleartext flags, dangerous permissions, unguarded exported components). The Android-APK scope implicitly separates it from generic siblings like scan_strings or scan_binary_mitigations, though no sibling is named.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: an agent can infer it should call this when the target is an APK rather than a generic binary. There is no explicit statement of when to prefer this over full_audit or scan_binary_mitigations, and no prerequisites or exclusions are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

scan_binary_mitigationsB

Check an ELF/PE/Mach-O binary's exploit mitigations (NX, PIE/ASLR, RELRO, stack canary, CFG) and list imported functions historically associated with memory-corruption bugs.

NameRequiredDescriptionDefault
pathYes

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose the analysis surface (mitigation flags plus a list of risky imports) and implies a read-only inspection. It does not say the file must be locally reachable, whether the binary is ever executed, what happens on an unsupported format, or how errors surface.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short clauses, front-loaded with the core action and the enumerated checks; nothing is padding. Minor awkwardness from the mid-parenthetical line break, but the information density is high.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter read-only scanner with no output schema, the description covers what is inspected but not the shape of the result (per-mitigation booleans? a verdict?) or the path contract. Adequate but leaves real gaps an agent must guess at.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% — the single required 'path' parameter is documented only by its title. The description implies the path points at a binary of a specific format but never says whether it is a local filesystem path, absolute vs relative, or a remote/upload target, so it does not compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb ('Check') plus a precisely enumerated resource: NX, PIE/ASLR, RELRO, stack canary, CFG, plus imported memory-corruption functions on ELF/PE/Mach-O binaries. That is far more concrete than the sibling names alone (full_audit, scan_strings, scan_secrets). It stops short of explicitly differentiating itself from full_audit or scan_apk, which likely overlap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied by the file-format list (ELF/PE/Mach-O), which narrows the applicable scope but never states when to prefer this over full_audit or scan_apk. No prerequisites, no exclusions, no named alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

scan_secretsA

Scan a file's extracted strings for hardcoded credential/token/key patterns and high-entropy blobs.

Matches are redacted in the output. These are heuristic candidates -- verify manually before treating any match as a confirmed live secret.

NameRequiredDescriptionDefault
pathYes

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden and does disclose two important traits: matches are redacted in the output and results are heuristic candidates requiring manual verification. It does not say whether the operation is read-only or whether it writes anything, but the false-positive warning is genuinely useful behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, front-loaded with the operation and followed by output and reliability caveats. No filler; every sentence adds information an agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description appropriately covers the return behavior (redacted matches) and the confidence level of results. The only gap is the ambiguous `path` argument, which is left entirely to a bare schema title.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the single `path` parameter is documented only as "Path". The description implies it points at a file whose strings are extracted, but it does not clarify whether this is an on-disk path, a previously extracted artifact, or what format is expected.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (scan) and target (a file's extracted strings) plus what it looks for: credential/token/key patterns and high-entropy blobs. It is distinguishable from scan_strings by the secret-pattern focus, though the relationship to scan_strings (which presumably produces the strings) is never made explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase "a file's extracted strings" hints that this fits after string extraction, and the closing caveat implies a triage workflow, but no explicit when-to-use, when-not-to-use, or named alternative (scan_strings, full_audit) is given. Usage is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

scan_stringsC

Extract printable strings from a file and classify URLs, IPs, paths, and risky API names.

NameRequiredDescriptionDefault
pathYes
sample_sizeNo

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It discloses the output categories (URLs, IPs, paths, risky API names) but says nothing about sampling behavior, performance on large files, or whether the scan is read-only — relevant for a tool whose only knob is 'sample_size'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler; the action and the enrichment are both stated immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations, no output schema, and 0% parameter coverage, the description is the only source of truth and it omits output structure, sampling semantics, and safety profile. Too thin for a 2-parameter scan tool with an unexplained default.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the description does not mention either parameter. 'path' is loosely inferable as the target file, but 'sample_size' (default 40) is completely unexplained — an agent cannot tell whether it caps strings per category, truncates bytes, or limits output.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb and resource ('Extract printable strings from a file') and adds the classification output. The classification categories implicitly separate it from scan_secrets and full_audit, though it never names those siblings explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No statement of when to use this versus scan_secrets, scan_binary_mitigations, or full_audit, and no prerequisites or exclusions. The agent must infer that this is the raw strings pass and secrets scanning is a separate tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 6 tool updatesv0.1.0
    • First observeddetect_file_type
    • First observedfull_audit
    • First observedscan_apk
    • First observedscan_binary_mitigations
    • First observedscan_secrets
    • First observedscan_strings

TDQS

A3.5/5.0

Scored across 6 tools

Disambiguation4/5

Each scan_* tool targets a distinct analysis dimension (strings, secrets, mitigations, APK manifest), so boundaries are mostly clear. The only overlap is intentional: full_audit orchestrates the same checks, and an agent could be unsure whether to call it or the granular tools for a single check.

Naming Consistency4/5

Names are snake_case with predictable verb_noun structure (detect_file_type, scan_strings, scan_secrets, scan_binary_mitigations, scan_apk). full_audit is the one deviation, lacking a verb prefix, but it stays within the same convention and remains readable.

Tool Count5/5

Six tools is well-scoped for a static binary/APK audit server: one aggregator plus five focused analyzers. No tool feels redundant or missing at this granularity.

Completeness4/5

The surface covers file typing, strings, secrets, native mitigations, and APK manifest issues for ELF/PE/Mach-O/APK. Minor gaps: detect_file_type recognizes JAR but no JAR-specific scan exists, and APK signing/certificate verification is absent, though agents can work around these.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables Android APK security auditing through natural language by decompiling APKs with Apktool and running static analysis heuristics for attack surface, permissions, secrets, crypto, native libraries, and more, with every analysis logged to disk as markdown reports.
    -
  • A
    license
    B
    quality
    C
    maintenance
    Enables local, evidence-first triage of native binaries by extracting bounded symbols, strings, sections, call sites, gadget candidates, and mitigation signals as MCP tools for agent-guided manual review. It also provides metadata-only inspection for carriers such as archives, WebAssembly, firmware, and scripts without claiming verified vulnerabilities.
    12
    5
    MIT
  • A
    license
    C
    quality
    A
    maintenance
    Enables AI agents to inspect APKs and resources, analyze native libraries, trace runtime behavior with Frida, and connect app screen actions to code through ADB.
    89
    MIT