PWN Static Analysis

PWN Static Analysis is a skill for Claude Code from allsmog/pwn-claude-plugin. It costs 69 tokens per session (1,553 once invoked), scanned A, original, MIT.

A guide to examining a compiled program without running it, by reading its machine code and structure. It focuses on finding possible security weaknesses such as buffer overflows.

In plain words
What is it for?
Use it to disassemble binary files, trace program flow, inspect functions and stack layouts, and look for unsafe calls, memory-writing opportunities, or information leaks.
Why use it?
It helps you understand how a program works and spot dangerous input handling before attempting to exploit or fix it.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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 skills/allsmog/pwn-claude-plugin/static-analysis
Any agent
npx skills add allsmog/pwn-claude-plugin --skill static-analysis
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 Analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/allsmog/pwn-claude-plugin/static-analysis.svg)](https://agentmods.dev/skills/allsmog/pwn-claude-plugin/static-analysis)
Your own site
<a href="https://agentmods.dev/skills/allsmog/pwn-claude-plugin/static-analysis"><img src="https://agentmods.dev/badge/skills/allsmog/pwn-claude-plugin/static-analysis.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,553 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.00069 $0.01553
Opus 5 $0.00034 $0.00776
Sonnet 5 $0.00014 $0.00311
Haiku 4.5 $0.00007 $0.00155

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

Security

Grade A, and why

PWN Static Analysis 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 6d 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/skills/static-analysis/SKILL.md · 246 lines

How it starts

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

PWN Static Analysis

Overview

Static analysis examines the binary without execution to identify vulnerabilities, understand program flow, and map out exploitation targets. This phase focuses on disassembly, dangerous function identification, and vulnerability pattern recognition.

Analysis Targets

  1. Main function and program flow
  2. Vulnerable functions (user input handlers)
  3. Buffer sizes and stack layouts
  4. Dangerous function calls
  5. Potential write primitives
  6. Leak opportunities

Step 1: Disassemble Key Functions

Using objdump

# Disassemble specific function
objdump -d ./binary | grep -A 50 '<main>:'

# Disassemble all with Intel syntax
objdump -d -M intel ./binary > disasm.txt

Using radare2

# Quick analysis
r2 -A ./binary -c 'pdf @ main' -q

# Full function list
r2 -A ./binary -c 'afl' -q

Using pwntools

from pwn import *
elf = ELF('./binary')
print(disasm(elf.read(elf.symbols['main'], 100)))

Step 2: Identify Dangerous Functions

Buffer Overflow Sources

Function Risk Pattern
gets() Critical No bounds checking
scanf("%s") Critical No width specifier
strcpy() High No length check
strcat() High Can overflow dest
sprintf() High No bounds on output
read() Medium Check size vs buffer

Search for dangerous calls:

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

Format String Vulnerabilities

Check for user-controlled format strings:

# Look for printf-family calls
objdump -d ./binary | grep -E 'call.*<(printf|fprintf|sprintf|snprintf)@plt>'

Red flags in disassembly:

  • printf called directly after user input
  • No format string argument (just buffer)
  • User buffer passed as first argument to printf

Step 3: Calculate Buffer Sizes

From Disassembly

Look for stack allocation patterns:

; x86_64
sub    rsp, 0x40        ; 64 bytes allocated
lea    rax, [rbp-0x30]  ; Buffer at rbp-0x30 (48 bytes from rbp)

; x86
sub    esp, 0x28        ; 40 bytes allocated
lea    eax, [ebp-0x20]  ; Buffer at ebp-0x20 (32 bytes from ebp)

Read the full file on GitHub · 246 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago First seen · 246 lines · 69 tokens per session scan A 29886522b1c9

Subscribe to this mod's changes

PWN Static Analysis is a skill published in the GitHub repository allsmog/pwn-claude-plugin (2 stars, last pushed 6mo ago), licensed MIT. It adds 69 tokens to every session and 1,553 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

exploiting-linux-kernel-vulnerabilities

Methodology for discovering and exploiting Linux kernel memory-corruption vulnerabilities (UAF, OOB read/write, race/TOCTOU, type confusion) during authorized engagements, covering reachability analysis, building stable read/write primitives from a single bug, defeating KASLR/SMEP/SMAP/KPTI, slab/buddy heap grooming…

xalgorix/xalgorix · 96 tokens

bypassing-binary-exploitation-mitigations

Methodology for identifying and defeating common binary hardening mitigations during authorized exploitation — ASLR, PIE, stack canaries, NX/DEP, and RELRO — by leaking addresses, brute-forcing entropy, abusing forked-process behavior, and selecting the right code-reuse primitive for the protections in place.

xalgorix/xalgorix · 73 tokens

exploiting-arbitrary-write-to-execution

Methodology for converting an arbitrary-write (write-what-where) or write-anything-anywhere primitive into code execution during authorized engagements, covering target selection among GOT/PLT entries, .finiarray/.dtors, mallochook/freehook, the atexit/exitfuncs handler list, and printfarginfotable, plus how…

xalgorix/xalgorix · 108 tokens

exploiting-format-string-vulnerabilities

Methodology for exploiting format string bugs where attacker-controlled data reaches the format argument of printf-family functions, enabling stack/memory disclosure (info leaks for ASLR/PIE/canary defeat) and arbitrary write primitives (%n) to hijack control flow via GOT/.finiarray overwrites.

xalgorix/xalgorix · 69 tokens

exploiting-glibc-heap-vulnerabilities

Methodology for exploiting glibc ptmalloc2 heap vulnerabilities during authorized engagements — use-after-free, double-free, heap overflow, and bin-based attacks (tcache poisoning, fast-bin dup, unsorted/large-bin) — including modern mitigations (tcache key, safe-linking, hook removal) and how to obtain leaks and…

xalgorix/xalgorix · 84 tokens

exploiting-integer-overflow-vulnerabilities

Methodology for finding and exploiting integer overflow, underflow, truncation, and signedness bugs in native code during authorized engagements, focusing on how wrapped arithmetic in size/length calculations leads to undersized allocations, oversized copies, length-check bypasses, and downstream heap/stack overflows.

xalgorix/xalgorix · 69 tokens