pwn-exploit

pwn-exploit is a command for Claude Code from allsmog/pwn-claude-plugin. It costs 17 tokens per session (805 once invoked), scanned A, original, MIT.

A command for developing exploits from security-analysis findings, such as a buffer overflow, format-string bug, or available code gadgets. It uses binary protections and calculated offsets to guide the attack method.

In plain words
What is it for?
Use it to choose techniques such as shellcode injection, ret2win, ret2libc, or a canary leak, then identify the components and payload structure those techniques require.
Why use it?
It turns scattered vulnerability details into a concrete exploit-development approach, while asking for missing information when the analysis is incomplete.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the pwn-htb plugin — 7 skills, 16 commands, 3 agents, 2 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/allsmog/pwn-claude-plugin/pwn-exploit
Clone the repo
git clone --depth 1 https://github.com/allsmog/pwn-claude-plugin

Made for: Claude Code.

Or install pwn-htb, the plugin that ships this one along with the rest of its 7 skills, 16 commands, 3 agents, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pwn-exploit

README.md
[![agentmods](https://agentmods.dev/badge/commands/allsmog/pwn-claude-plugin/pwn-exploit.svg)](https://agentmods.dev/commands/allsmog/pwn-claude-plugin/pwn-exploit)
Your own site
<a href="https://agentmods.dev/commands/allsmog/pwn-claude-plugin/pwn-exploit"><img src="https://agentmods.dev/badge/commands/allsmog/pwn-claude-plugin/pwn-exploit.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 805 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00017 $0.00805
Opus 5 $0.00009 $0.00402
Sonnet 5 $0.00003 $0.00161
Haiku 4.5 $0.00002 $0.00081

Measured 5d ago against content hash d9f377bc3101, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pwn-exploit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

pwn-htb/commands/pwn-exploit.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PWN Exploit - Exploit Development

Guide exploit development based on previous analysis findings.

Execution Steps

Step 1: Gather Findings

Review previous analysis to determine:

  • Vulnerability type (buffer overflow, format string, etc.)
  • Protections (RELRO, Canary, NX, PIE)
  • Available primitives (win function, libc, gadgets)
  • Calculated offsets

If findings not available, ask user for:

  • Binary protections
  • Vulnerability type
  • Offset to return address
  • Available targets (win function address, libc)

Step 2: Select Technique

Based on protections, recommend technique:

Protections Recommended Technique
No NX, No PIE Shellcode injection
NX, No PIE, win() ret2win
NX, No PIE, No win ret2libc
NX, PIE Leak + ret2libc
Canary present Leak canary first
Full RELRO Stack-based attack only

If --technique flag provided, use that technique. Otherwise, ask user to confirm recommended technique.

Step 3: Find Required Components

Based on technique:

ret2win:

nm <binary> | grep -i win

ret2libc:

# Find gadgets
ROPgadget --binary <binary> | grep "pop rdi"
# Find /bin/sh in libc
strings -t x <libc> | grep "/bin/sh"

ROP:

ROPgadget --binary <binary> --only "pop|ret"
ropper -f <binary> --search "pop rdi"

Format string: Determine offset by testing with pattern.

Step 4: Generate Exploit

Create pwntools exploit script with:

  • Correct context setup
  • Local/remote toggle
  • GDB attach option
  • Educational comments explaining each step
  • All calculated values filled in

Step 5: Save and Test

Save exploit to exploit.py and provide test instructions:

# Local test
python3 exploit.py

# With GDB
python3 exploit.py GDB

# Remote
python3 exploit.py REMOTE

Output Format

## Exploit Development

### Technique Selection
- Vulnerability: Buffer overflow (gets)
- Protections: NX enabled, No PIE, No Canary
- Selected: ret2libc (no win function available)

### Required Components
- pop rdi gadget: 0x401234
- puts@plt: 0x401030
- puts@got: 0x404018
- main: 0x401150

### Exploit Strategy
1. Stage 1: Leak libc address via puts(puts@got)
2. Return to main for second input
3. Stage 2: Call system("/bin/sh") with leaked libc base

### Generated Exploit
```python
#!/usr/bin/env python3
from pwn import *

Read the full file on GitHub · 132 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 132 lines · 17 tokens per session scan A d9f377bc3101

Subscribe to this mod's changes

pwn-exploit is a command published in the GitHub repository allsmog/pwn-claude-plugin (2 stars, last pushed 6mo ago), licensed MIT. It adds 17 tokens to every session and 805 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.