Agentic binary exploitation framework built around an LLM-driven ReAct loop, MCP tool servers, and pwntools execution.
AutoPwn analyzes ELF binaries, chooses exploitation strategies based on mitigations, and iterates toward working exploits with built-in dynamic-analysis and exploit-generation tools.
- ReAct-style exploitation loop with tool use (
checksec, symbols, gadgets, GDB, exploit execution) - MCP-backed tool servers for:
- static/recon helpers (ELF symbols, strings, libc offsets, payload builders)
- dynamic debugging helpers (GDB breakpoint/run/stack/vmmap)
- Exploit runner with machine-readable success signals (
shell_detected,flag_detected) - Prompt + knowledge-base driven strategy guidance
- Test suite with challenge fixtures for ret2win/ret2libc/format/shellcode workflows
agent/- ReAct loop, prompts, planner, CLI entrypointagent/mcp_servers/- packaged MCP tool server implementationstests/- unit/integration tests + challenge binaries/sourcesexploits/- generated solve scripts and latest attempt mirrors
- Python 3.11+
gdbavailable for dynamic-analysis tools- optional:
pwntoolsextras for exploit workflows - optional: Ghidra + a JDK for the
ghidra_decompiletool (setGHIDRA_HOME/PWN_GHIDRA_HOME; putjavaonPATHor setJAVA_HOME/PWN_JAVA_HOME)
git clone https://github.com/colinthebomb1/AutoPwn.git
cd AutoPwn
python -m venv .venv
source .venv/bin/activate
pip install .Copy .env.example to .env and set at least:
ANTHROPIC_API_KEY(required)
Optional knobs:
MODEL_NAME(default:claude-sonnet-4-6; use a dated model ID if you need to pin a snapshot)PWN_AGENT_MAX_ITERATIONS(default:30)PWN_AGENT_CONTEXT_TURNSPWN_AGENT_TOOL_RESULT_MAXPWN_AGENT_RUN_EXPLOIT_SCRIPT_SNIPPWN_AGENT_MAX_OUTPUT_TOKENSPWN_AGENT_BOOTSTRAP_GHIDRA(default:1) — run headless Ghidra once at startup; set0to skipPWN_AGENT_BOOTSTRAP_MAX_CHARS_WITH_GHIDRA— larger bootstrap JSON cap when decompilation succeeds (default12000)JAVA_HOMEorPWN_JAVA_HOME— ifjavais not on yourPATH(common in some venvs/IDE launches), point at a JDK so Ghidra can startPWN_AGENT_USER_CONTEXT_MAX— max length for--notes/--notes-filetext sent to the model (default12000)
Run against a local challenge binary:
autopwn tests/challenges/ret2win_x64Override model / iteration budget:
autopwn tests/challenges/ret2libc_real_x64 -m claude-sonnet-4-6 -n 20Preview prompt/playbook selection without calling the model:
autopwn tests/challenges/heap_poison_null_byte_x64 --prompt-reportUse remote target:
autopwn ./chall -r host:portAdd CTF or author context (description, constraints, suspected bug class, solve sketch):
autopwn ./chall --notes "Heap UAF + FSOP; libc 2.39, Full RELRO"Long writeups:
autopwn ./chall --notes-file ./challenge.txt(--notes-file overrides --notes if both are passed.)
Run all tests:
pytest -qIn constrained environments where PTYs are limited, skip dynamic GDB tests:
pytest -q --ignore=tests/test_mcp_dynamic.py- Latest attempted exploit is mirrored to
exploits/last_attempt_<binary>.py. - Successful solves save to
exploits/solve_<binary>.py. - The framework is intended for CTF/research and controlled targets you are authorized to test.
MIT