Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Ctf Pwn Playbook

ASecurity

Binary exploitation playbook for CTF pwn. Load for any pwn challenge to map mitigations to attack techniques: stack overflow, ret2win, ret2libc, ret2csu, ROP, format string, GOT overwrite, one_gadget, and heap techniques (tcache, fastbin, house of force/orange). Includes a pwntools exploit template.

2 stars
0 votes
0 copies
0 views
Added 9/28/2026
securitypythongoshell

Works with

cli

Security Analysis

A100/100

Scanned 9/28/2026

Install to Claude Code

$npx -y skills add bilal-spotted/claude-code-ctf-rig --skill ctf-pwn-playbook --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ctf Pwn Playbook?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Ctf Pwn Playbook
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bilal-spotted-ctf-pwn-playbook/badge)](https://www.skillsdirectory.com/skills/bilal-spotted-ctf-pwn-playbook)

More formats (shields.io, HTML) on the badges page.

Files
SKILL.md
---
name: ctf-pwn-playbook
description: Binary exploitation playbook for CTF pwn. Load for any pwn challenge to map mitigations to attack techniques: stack overflow, ret2win, ret2libc, ret2csu, ROP, format string, GOT overwrite, one_gadget, and heap techniques (tcache, fastbin, house of force/orange). Includes a pwntools exploit template.
---

# CTF Pwn Playbook

## First, always
`checksec ./bin`. Then map mitigations to what is possible:
- No canary + overflow -> straight stack smash.
- NX on -> no shellcode on stack, use ROP/ret2libc.
- PIE on -> need a leak to defeat ASLR of the binary.
- Full RELRO -> no GOT overwrite; Partial/none -> GOT overwrite viable.
- Canary present -> need leak or brute (forking) or a write primitive
  that avoids it.

## Vulnerability -> technique
- gets()/large read into small buf -> stack overflow.
- printf(user) -> format string: leak (%p/%s) and write (%n).
- scanf %s, off-by-one null -> partial overwrite / frame stitching.
- malloc/free with UAF or double free -> heap (tcache poisoning first,
  it's the modern default on glibc >= 2.26).

## Escalation ladder (typical)
1. Control RIP (find offset with cyclic/pattern).
2. If you need libc: leak a GOT entry via puts(got_entry)/write, then
   compute libc base = leak - known_offset.
3. Return into system("/bin/sh") or a one_gadget (run one_gadget on the
   provided libc; verify constraints).
4. If constrained, ret2csu to control args for a call.

## Format string
- Find your input's stack offset: send AAAA%N$p, find where 0x41414141
  appears.
- Leak: %N$s at a GOT/pointer to read libc/PIE.
- Write: %<val>c%N$n or byte-wise with %hhn for reliability.

## Heap (glibc)
- tcache poisoning: free two same-size chunks, overwrite fd of a freed
  tcache chunk to return an arbitrary pointer from malloc.
- Check glibc version; tcache key/safe-linking (>=2.32) means fd is
  mangled: (ptr >> 12) ^ target. Account for it.
- Older: fastbin dup, unsorted bin leak for libc, house of force/orange
  as fits.

## pwntools template (adapt per challenge)
```python
from pwn import *
context.binary = elf = ELF('./chall')
libc = ELF('./libc.so.6') if os.path.exists('./libc.so.6') else None
context.log_level = 'info'

def conn():
    if args.REMOTE:
        return remote('HOST', 1337)
    return process(elf.path)

io = conn()
# offset = cyclic_find(...)  # compute, do not guess
# ... build payload ...
io.interactive()
```

## Discipline
- Never hardcode an offset you did not compute against THIS binary/libc.
- Prove control locally (RIP overwrite, leak) before going remote.
- If a one_gadget fails, its constraints (register/stack state) were not
  met, pick another or set up the state; don't just retry.

Attribution

bilal-spottedbilal-spotted
View sourceMore from bilal-spotted →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Springboot Security

Java Spring Boot 服务中关于身份验证/授权、验证、CSRF、密钥、标头、速率限制和依赖安全的 Spring Security 最佳实践。

2456590 votes

Security Review

Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.

2456590 votes

Paperclip Evals

Choose, inspect, validate, and report Paperclip Runner or Product E2E evaluations while preserving evidence, provenance, cost, and failure classification.

813270 votes

Paperclip Task Bridge

Create, comment on, update, and list Paperclip tasks from Hermes using scoped Paperclip API credentials.

813270 votes

Summarize Status

Write a short, colloquial summary for a Paperclip summary slot: open with the 1–3 specific, concrete actions the reader needs to take right now to unblock the work, then a brief plain-language status, streaming progress as it works.

813270 votes
View all in security →