pwn-dynamic

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

A command for dynamically analyzing a crashing program with GDB, a debugger, and cyclic input patterns. It finds the exact input position that controls a crash and verifies the result.

In plain words
What is it for?
Use it to generate a cyclic pattern, inspect a crash, calculate the instruction-pointer offset, test the offset, and create a project GDB configuration.
Why use it?
It replaces guesswork about crash offsets with a repeatable debugging process, which is useful in binary-exploitation work.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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

Good fit Use it to generate a cyclic pattern, inspect a crash, calculate the instruction-pointer offset, test the offset, and create a project GDB configuration.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/allsmog/pwn-claude-plugin/pwn-dynamic
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.

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-dynamic

README.md
[![agentmods](https://agentmods.dev/badge/commands/allsmog/pwn-claude-plugin/pwn-dynamic/github.svg)](https://agentmods.dev/commands/allsmog/pwn-claude-plugin/pwn-dynamic)
Your own site
<a href="https://agentmods.dev/commands/allsmog/pwn-claude-plugin/pwn-dynamic"><img src="https://agentmods.dev/badge/commands/allsmog/pwn-claude-plugin/pwn-dynamic/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pwn-dynamic

Your own site · 80×15
<a href="https://agentmods.dev/commands/allsmog/pwn-claude-plugin/pwn-dynamic"><img src="https://agentmods.dev/badge/commands/allsmog/pwn-claude-plugin/pwn-dynamic.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 819 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00019 $0.00819
Opus 5 $0.00010 $0.00409
Sonnet 5 $0.00004 $0.00164
Haiku 4.5 $0.00002 $0.00082

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

Security

Grade A, and why

pwn-dynamic 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 8d 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-dynamic.md · 149 lines

How it starts

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

PWN Dynamic - Dynamic Analysis

Perform dynamic analysis to verify findings and calculate exact exploitation offsets.

Execution Steps

Step 1: Generate Cyclic Pattern

python3 -c "from pwn import *; print(cyclic(200).decode())"

Save pattern to file for GDB input:

python3 -c "from pwn import *; open('/tmp/pattern', 'wb').write(cyclic(200))"

Step 2: Run Binary with Pattern in GDB

Create a GDB command file:

cat > /tmp/pwn-debug.gdb << 'EOF'
set disable-randomization on
run < /tmp/pattern
EOF

Run GDB:

gdb -q -x /tmp/pwn-debug.gdb <binary>

Step 3: Analyze Crash

After crash, in GDB (pwndbg):

# Check what value is at RSP (return address location)
x/gx $rsp

# Find offset
cyclic -l <value_at_rsp>

# Or for 32-bit
cyclic -l $eip

Step 4: Verify Offset

Test with calculated offset:

python3 << 'EOF'
from pwn import *
offset = 72  # Replace with calculated offset
payload = b'A' * offset + p64(0xdeadbeef)
open('/tmp/verify', 'wb').write(payload)
EOF

Run in GDB and verify RIP/EIP is 0xdeadbeef.

Step 5: Generate Project .gdbinit

Create .gdbinit for the challenge:

# Challenge-specific GDB config for pwndbg
set disable-randomization on
file ./binary

# Useful breakpoints
b main
# b *vuln+<offset_to_ret>

# Commands on stop
define hook-stop
    telescope $rsp 8
end

# Helper commands
define pwn-check
    checksec
    vmmap
    got
end

Step 6: Document Register Control

From crash analysis, document:

  • Which registers are controlled
  • Stack state at crash
  • Any useful values on stack (canary leaks, addresses)

Output Format

## Dynamic Analysis

### Findings
- Offset to RIP: 72 bytes (verified)
- RSP control: Full (can place ROP chain)
- Register state at crash:
  - RAX: 0x0 (return from gets)
  - RBX: 0x0
  - RDI: Points to buffer
- Stack contains: No useful leaks observed

### Debug Session

Program received signal SIGSEGV RSP: 0x7fffffffe4a8 → 'haaaiaaaj...'

Read the full file on GitHub · 149 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. 8d ago First seen · 149 lines · 19 tokens per session scan A c29340136435

Subscribe to this mod's changes

pwn-dynamic is a command published in the GitHub repository allsmog/pwn-claude-plugin (2 stars, last pushed 6mo ago), licensed MIT. It adds 19 tokens to every session and 819 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.