pwn-static

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

A command workflow for examining a compiled program by disassembling its machine code and checking how it handles memory. It looks for unsafe functions, buffer sizes, and possible ways program control could be redirected.

In plain words
What is it for?
Use it to inspect a program's main and vulnerable functions, find unsafe calls such as gets or strcpy, calculate overwrite offsets, and look for functions or code fragments useful in an exploit.
Why use it?
It turns a binary file into evidence you can inspect when the original source code is unavailable. This helps identify likely buffer overflows and useful functions during binary-exploitation practice.

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 inspect a program's main and vulnerable functions, find unsafe calls such as gets or strcpy, calculate overwrite offsets, and look for functions or code fragments useful in an exploit.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/allsmog/pwn-claude-plugin/pwn-static/github.svg)](https://agentmods.dev/commands/allsmog/pwn-claude-plugin/pwn-static)
Your own site
<a href="https://agentmods.dev/commands/allsmog/pwn-claude-plugin/pwn-static"><img src="https://agentmods.dev/badge/commands/allsmog/pwn-claude-plugin/pwn-static/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-static

Your own site · 80×15
<a href="https://agentmods.dev/commands/allsmog/pwn-claude-plugin/pwn-static"><img src="https://agentmods.dev/badge/commands/allsmog/pwn-claude-plugin/pwn-static.svg" alt="Reviewed on agentmods" width="80" 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 782 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.00017 $0.00782
Opus 5 $0.00009 $0.00391
Sonnet 5 $0.00003 $0.00156
Haiku 4.5 $0.00002 $0.00078

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

Security

Grade A, and why

pwn-static 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-static.md · 101 lines

How it starts

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

PWN Static - Static Analysis

Perform static analysis on a binary to identify vulnerabilities through disassembly.

Execution Steps

Step 1: Disassemble Main Function

objdump -d -M intel <binary> | grep -A 50 '<main>:'

Step 2: Identify and Disassemble Vulnerable Functions

First find interesting functions:

nm <binary> 2>/dev/null | grep -iE '(vuln|read_input|get_input|buffer)'

Then disassemble each:

objdump -d -M intel <binary> | grep -A 30 '<vuln>:'

Step 3: Find Dangerous Function Calls

objdump -d <binary> | grep -E 'call.*<(gets|strcpy|sprintf|strcat|scanf|printf|read)@plt>'

Step 4: Calculate Buffer Sizes

From disassembly, identify:

  • Stack allocation: sub rsp, 0xXX or sub esp, 0xXX
  • Buffer location: lea rax, [rbp-0xXX] or lea eax, [ebp-0xXX]

Calculate offset to return address:

  • x86_64: buffer_offset + 8 (saved RBP) = offset to RIP
  • x86: buffer_offset + 4 (saved EBP) = offset to EIP

Step 5: Find Win Functions or Useful Gadgets

# Win functions
nm <binary> 2>/dev/null | grep -iE '(win|flag|shell|system)'

# Check if system@plt exists
objdump -d <binary> | grep '<system@plt>'

# Basic gadget search
objdump -d <binary> | grep -E '(ret$|pop.*ret)'

Output Format

## Static Analysis

### Findings
- Vulnerability: Buffer overflow in vuln() via gets()
- Buffer: 64 bytes at [rbp-0x40]
- Offset to RIP: 72 bytes (64 + 8)
- Win function: 0x401234
- Dangerous calls:
  - gets@plt at 0x401186
  - printf@plt at 0x401190 (check if format string)

### Disassembly Highlights
```asm
0000000000401156 <vuln>:
  401156:    push   rbp
  401157:    mov    rbp,rsp
  40115a:    sub    rsp,0x40          ; 64 bytes
  40115e:    lea    rax,[rbp-0x40]    ; buffer start
  401162:    mov    rdi,rax
  401165:    call   401030 <gets@plt> ; VULNERABLE
  40116a:    nop
  40116b:    leave
  40116c:    ret

Implications

  • Direct ret2win: Overflow buffer (72 bytes) + win address
  • Stack alignment may be needed (add ret gadget before win)
  • No format string (printf has format specifier)

Next Steps

  1. Verify offset with cyclic pattern in GDB
  2. Check win() function requirements (arguments?)
  3. Craft payload: b'A'*72 + p64(0x401234)

Read the full file on GitHub · 101 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 · 101 lines · 17 tokens per session scan A af613f73240c

Subscribe to this mod's changes

pwn-static 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 782 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.