AI-powered penetration testing engine
Project description
0xpwn
AI-powered penetration testing engine. Point it at a target and let a ReAct agent drive reconnaissance, scanning, and vulnerability discovery — all tools run inside a Docker sandbox so nothing touches the host.
Input: Target URL, hostname, IP, or CIDR via CLI Output: Structured findings with CVE enrichment, phase-by-phase execution logs
CLI ──▶ ReAct Agent ──▶ Docker Sandbox ──▶ Target
(Typer) (LLM-driven (Kali + nmap, (your scope)
tool selection) nuclei, ffuf,
httpx, subfinder)
Installation
Option 1: Install from PyPI (recommended)
pip install 0xpwn
Option 2: Install with pipx (isolated environment)
pipx install 0xpwn
Verify installation
0xpwn --help
Setup
1. Build the Sandbox Image
All scan tools run inside a Docker container based on Kali Linux:
docker build -t oxpwn-sandbox:dev docker/
2. Configure an LLM Provider
0xpwn uses LiteLLM — any supported provider works:
# Google Gemini
export GEMINI_API_KEY=your_key_here
# OpenAI
export OPENAI_API_KEY=your_key_here
# Anthropic
export ANTHROPIC_API_KEY=your_key_here
# Or use the generic key
export OXPWN_API_KEY=your_key_here
3. Run the Setup Wizard (optional)
0xpwn config wizard
Saves model and API key preferences to ~/.config/oxpwn/config.yaml.
Usage
Run a scan
# Basic scan with model specified
0xpwn scan --target example.com --model gemini/gemini-2.5-flash
# Use environment variable for model
export OXPWN_MODEL=gemini/gemini-2.5-flash
0xpwn scan --target 192.168.1.0/24
# Custom sandbox settings
0xpwn scan --target example.com \
--model openai/gpt-4o \
--sandbox-image oxpwn-sandbox:dev \
--network-mode bridge \
--max-iterations-per-phase 15
If no model is configured, the interactive wizard runs automatically.
Manage configuration
# Show current config
0xpwn config show
# Run setup wizard
0xpwn config wizard
# Reset configuration
0xpwn config reset
Available Tools
The ReAct agent selects tools autonomously based on the scan phase. All tools execute inside the Docker sandbox:
| Tool | What it does |
|---|---|
nmap |
Port scanning and service detection |
subfinder |
Subdomain enumeration |
httpx |
HTTP probing and technology detection |
nuclei |
Vulnerability scanning with templates |
ffuf |
Web fuzzing and directory discovery |
How It Works
0xpwn uses a ReAct (Reasoning + Acting) agent that plans and executes penetration testing in phases:
- Reconnaissance — Subdomain enumeration, port scanning, service fingerprinting
- Scanning — Vulnerability detection, web probing, directory fuzzing
- Analysis — CVE enrichment via NVD, finding correlation, risk assessment
Each phase runs up to N iterations (default 10). The agent decides which tool to run, parses the output, and feeds results into the next decision. Findings are enriched with CVE data from the National Vulnerability Database.
Scan Options
| Flag | Description | Default |
|---|---|---|
--target |
Target URL, hostname, IP, or CIDR | Required |
--model |
LLM model identifier (LiteLLM format) | OXPWN_MODEL env / config |
--llm-base-url |
Override LiteLLM base URL | None |
--sandbox-image |
Docker image for the sandbox | oxpwn-sandbox:dev |
--network-mode |
Docker network mode | bridge |
--max-iterations-per-phase |
Max ReAct iterations per phase | 10 |
Environment Variables
| Variable | Description |
|---|---|
OXPWN_MODEL |
Default LLM model |
OXPWN_API_KEY |
Generic API key (fallback) |
OXPWN_LLM_BASE_URL |
Override LiteLLM base URL |
OXPWN_SANDBOX_IMAGE |
Default sandbox Docker image |
OXPWN_SANDBOX_NETWORK_MODE |
Default Docker network mode |
OXPWN_MAX_ITERATIONS_PER_PHASE |
Default max iterations |
GEMINI_API_KEY |
Google Gemini API key |
OPENAI_API_KEY |
OpenAI API key |
ANTHROPIC_API_KEY |
Anthropic API key |
Architecture
src/oxpwn/
├── cli/ # Typer CLI, Rich streaming output, setup wizard
├── agent/ # ReAct agent loop, tool dispatch, event system
├── llm/ # LiteLLM client wrapper with error taxonomy
├── sandbox/ # Docker container lifecycle management
│ └── tools/ # Tool parsers (nmap, nuclei, httpx, ffuf, subfinder)
├── enrichment/ # NVD CVE lookup, caching, finding extraction
├── config/ # YAML config manager with env/CLI precedence
└── core/ # Data models (ScanState, Finding, ToolResult)
docker/
└── Dockerfile # Kali-based sandbox with pre-installed tools
Key design decisions:
- Docker isolation — all offensive tools run in a sandboxed container, never on the host
- LiteLLM abstraction — swap LLM providers without code changes
- Structured error taxonomy — every failure mode has a typed exception with actionable CLI output
- Phase-based execution — the agent progresses through recon → scanning → analysis with bounded iterations
Troubleshooting
| Error | Fix |
|---|---|
Sandbox image 'oxpwn-sandbox:dev' was not found |
Run docker build -t oxpwn-sandbox:dev docker/ |
Docker sandbox error |
Verify Docker daemon is running: docker ps |
LLM authentication failed |
Export the correct API key for your provider |
LLM rate limited |
Wait and retry, or switch to a provider with more quota |
Missing model configuration |
Pass --model, set OXPWN_MODEL, or run 0xpwn config wizard |
Contributing
Build from source
git clone https://github.com/vahagn-madatyan/0xpwn.git
cd 0xpwn
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
# Install with dev dependencies
pip install -e ".[dev]"
# Build the sandbox image
docker build -t oxpwn-sandbox:dev docker/
# Run from source
0xpwn --help
Run tests
# Unit tests only
pytest tests/unit/ -v --tb=short
# All tests (requires Docker + running services)
pytest tests/ -v
# Specific test file
pytest tests/unit/test_react_agent.py -v
Making a release
Releases are published to PyPI automatically via GitHub Actions when a version tag is pushed:
# Update version in pyproject.toml and src/oxpwn/__init__.py
# Commit the version bump
git tag v0.2.0
git push origin v0.2.0
The CI pipeline builds the distribution, runs tests, publishes to TestPyPI on every push, and publishes to PyPI on tags matching v*.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file 0xpwn-0.1.1.tar.gz.
File metadata
- Download URL: 0xpwn-0.1.1.tar.gz
- Upload date:
- Size: 46.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a44c9f836d3618c2897e99b0fc46cb70da53b7064546c0b78321528c7c4224f4
|
|
| MD5 |
713e5425a363dcf8a297c4a7a55b6b1a
|
|
| BLAKE2b-256 |
deb4f652fcb8447999fc10b455f65f0e43535ee725d6338a2f315502c8cb6542
|
Provenance
The following attestation bundles were made for 0xpwn-0.1.1.tar.gz:
Publisher:
pypi-publish.yml on vahagn-madatyan/0xpwn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
0xpwn-0.1.1.tar.gz -
Subject digest:
a44c9f836d3618c2897e99b0fc46cb70da53b7064546c0b78321528c7c4224f4 - Sigstore transparency entry: 1188993466
- Sigstore integration time:
-
Permalink:
vahagn-madatyan/0xpwn@15c89771288236689207107b2d29646ea8a42c5c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/vahagn-madatyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@15c89771288236689207107b2d29646ea8a42c5c -
Trigger Event:
push
-
Statement type:
File details
Details for the file 0xpwn-0.1.1-py3-none-any.whl.
File metadata
- Download URL: 0xpwn-0.1.1-py3-none-any.whl
- Upload date:
- Size: 61.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92731f4505bfa11569700e4fee89aab13e1d3cd996a2003987159e2c8d6efba7
|
|
| MD5 |
467fd510effc2c8062bb48c099a4e078
|
|
| BLAKE2b-256 |
91bdcb0e6258be55b2946e2a6c53da034aba1e2b9c31fcf47ed40e80698d8d61
|
Provenance
The following attestation bundles were made for 0xpwn-0.1.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on vahagn-madatyan/0xpwn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
0xpwn-0.1.1-py3-none-any.whl -
Subject digest:
92731f4505bfa11569700e4fee89aab13e1d3cd996a2003987159e2c8d6efba7 - Sigstore transparency entry: 1188993471
- Sigstore integration time:
-
Permalink:
vahagn-madatyan/0xpwn@15c89771288236689207107b2d29646ea8a42c5c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/vahagn-madatyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@15c89771288236689207107b2d29646ea8a42c5c -
Trigger Event:
push
-
Statement type: