ctf-pwn
Skill26 starsChanged 32 days agoMITView on GitHub
CTF pwn challenge playbook — fast pwntools workflow against "nc host port" services: reproduce the remote environment locally with the provided libc/ld (patchelf, Docker), exploit format-string bugs (the CTF staple) for leaks and writes, and iterate a script from crash to flag. Load when the handout is a binary plus connection info. Signals: "pwn" category, nc host port, checksec output, provided libc.so.6/ld-linux, Dockerfile, "%p" reflections, menu-driven heap note apps.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- NoorQureshi/roninword for word, first seen Oct 11, 2026
- NoorQureshi/security-skillsword for word, first seen Oct 11, 2026
- TaiMaBenJi/taima-skillstheir own version, first seen Oct 11, 2026
- wgpsec/AboutSecuritytheir own version, first seen May 21, 2026
- MateoBogo/CLEAVEtheir own version, first seen Apr 23, 2026
- ljagiello/ctf-skillstheir own version, first seen Mar 28, 2026
Other versions7 projects use a version of this.
Word for word · 2
- NoorQureshi/security-skills★ 27100% same
- NoorQureshi/ronin★ 26100% same
Edited · 0
None found.
Wrote their own version · 5
- ljagiello/ctf-skills★ 3.7ksame name
- wgpsec/AboutSecurity★ 1.8ksame name
- naravid19/claude-ctf-skills★ 5same name
- MateoBogo/CLEAVE★ 4same name
- TaiMaBenJi/taima-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository207 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ad-adcsSkill
- ad-dacl-abuseSkill
- ad-delegation-abuseSkill
- ad-kerberoastingSkill
- ad-pivot-arsenalSkill
- ai-agent-tool-abuseSkill
- ai-insecure-output-handlingSkill
- ai-jailbreakSkill
- ai-llm-dosSkill
- ai-mcp-securitySkill
- ai-model-extractionSkill
- ai-prompt-injectionSkill
- ai-rag-poisoningSkill
- ai-sensitive-data-disclosureSkill
- ai-supply-chainSkill
- ai-system-prompt-leakageSkill
- api-auth-attacksSkill
- api-bolaSkill
- api-fuzzingSkill
- api-graphqlSkill
- api-grpcSkill
- api-mass-assignmentSkill
- api-mongo-agg-facet-bypassSkill
- api-testing-checklistSkill
- api-versioningSkill
- automation-browserSkill
- automation-nuclei-templatesSkill
- automation-recon-pipelineSkill
- cloud-azureSkill
- cloud-container-escapeSkill
- cloud-docker-api-abuseSkill
- cloud-docker-registrySkill
- cloud-gcpSkill
- cloud-iam-privescSkill
- cloud-imds-ssrfSkill
- cloud-kubernetesSkill
- cloud-s3-exposureSkill
- code-review-cicdSkill
- code-review-cppSkill
- code-review-dangerous-sinksSkill
- code-review-dotnetSkill
- code-review-goSkill
- code-review-iacSkill
- code-review-javaSkill
- code-review-methodologySkill
- code-review-nodejsSkill
- code-review-phpSkill
- code-review-pythonSkill
- code-review-rubySkill
- code-review-rustSkill
- code-review-secrets-detectionSkill
- code-review-soliditySkill
- crypto-oracle-attacksSkill
- crypto-rsa-attacksSkill
- ctf-cryptoSkill
- ctf-forensicsSkill
- ctf-methodologySkill
- ctf-revSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Run it, feed it garbage and long input, try %p %p %p on any echo.
- Distinctive: line 46
Never exploit against your host libc and hope.
- Very specific: line 55
Use sendlineafter(b'> ', payload) anchored on the actual prompt.
- Distinctive: line 57
Format strings — the CTF staple: When input is reflected:
- Distinctive: line 72
Read-only flag perms → the SUID flag-reader on the box is the second stage.
- Very specific: line 75
Iterate remotely like a scientist: Run the same script ≥ 20 times against remote.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CTF pwn challenges
When it applies
The handout is a binary, usually with nc host port, often with a bundled libc.so.6 +
ld-linux-x86-64.so.2 and sometimes a Dockerfile. This skill covers the CTF-specific workflow —
environment reproduction, remote iteration, and format-string handling. For the exploit chains
themselves (ret2libc/one_gadget, tcache/fastbin/unsorted techniques, kernel pwn, stabilization),
work exploit-pwn-chain; for finding the bug, reverse-eng-binary-triage and
exploit-memory-corruption.
Why it works
CTF pwn is deterministic: the organizer ships you the exact remote environment (libc, ld, sometimes the whole image), so "local works, remote crashes" is a choice, not a hazard — if you run the provided libc locally, offsets are identical and the only remote variables left are ASLR (leak it) and network timing (anchor your reads). Format strings recur constantly because they're a compact way to give both a leak and an arbitrary write.
Method
- Triage the handout (3 minutes).
checksec --file=chall,file chall, note provided files. Run it, feed it garbage and long input, try%p %p %pon any echo. Read the Dockerfile if given: it pins the OS/libc, the flag path, and any seccomp wrapper. - Reproduce the remote environment locally — always. With a provided libc/ld:
or run viapatchelf --set-interpreter ./ld-linux-x86-64.so.2 --set-rpath '$ORIGIN' ./chall./ld-linux-x86-64.so.2 --library-path . ./chall. With only a Dockerfile,docker build -t chal . && docker run -it --cap-add=SYS_PTRACE chaland exploit inside it. Never exploit against your host libc and hope. - Set up the pwntools loop. One script, toggleable target:
Usefrom pwn import * context.binary = elf = ELF('./chall') context.log_level = 'debug' io = gdb.debug('./chall', 'b main\nc') if args.GDB else \ (process('./chall') if args.LOCAL else remote('host', port))sendlineafter(b'> ', payload)anchored on the actual prompt;cyclic()/cyclic_find()for offsets; finish withio.interactive(). - Format strings — the CTF staple. When input is reflected:
- Leak:
%7$p-style direct-parameter reads dump the stack — hunt libc pointers (return addresses into__libc_start_main), PIE base (code addresses on the stack), and the canary (the value ending in00at a consistent slot).FmtStr(execute_fmt=send_payload)in pwntools finds the offset for you. - Write:
%n/%hn/%hhn— writepwntools'fmtstr_payload(offset, {addr: value})instead of hand-crafting. Classic targets: GOT entry →system(partial RELRO), a saved return address,__free_hook(glibc < 2.34), or a globalauth/is_adminvariable. - GOT overwrite often needs the function to be called again — loop the menu or re-trigger.
- Leak:
- Match the rest to checksec (defer to
exploit-pwn-chainfor depth): no PIE + no canary +system//bin/shin binary → plain ret2win; NX + libc leak → ret2libc/one_gadget against the provided libc; menu-driven add/edit/delete/show note app → heap, technique picked by the provided libc's version (tcache poisoning ≥2.27, safe-linking ≥2.32, no hooks ≥2.34). - Handle the CTF-only obstacles. Seccomp (
seccomp-tools dump ./chall) restricting syscalls → open/read/write ROP instead ofsystem, or an ORW shellcode (open("/flag"); read; write). Read-only flag perms → the SUID flag-reader on the box is the second stage. Forking server → canary is constant across children; brute it byte-by-byte if you have a crash oracle. - Iterate remotely like a scientist. Run the same script ≥ 20 times against remote; a
1-in-N success rate usually means an unhandled alignment (
movaps— add oneret) or a leak parse that occasionally grabs the wrong slot (anchorrecvuntiltighter).
Gotchas
- Wrong libc is the #1 remote-only failure — if the handout ships a libc, use it, not
libc-database guesses. Verify locally:
./libc.so.6prints its version banner. %nwrites need writable target memory — Full RELRO kills GOT overwrites; pivot to a saved return address or a function pointer the app uses (menu structs often have one).- Format-string payload too long for the read size — keep it under the
fgetslimit by writing two bytes at a time (%hn) and packing addresses at the end. - Stack misalignment on remote only (
movaps) — insert a singleretgadget before the call that crashes; seeexploit-pwn-chain. system("/bin/sh")broken by seccomp or missing shell — fall back toexecveROP or ORW; check allowed syscalls before choosing the final stage.- Interactive menus desync silently — one
sendlinewhere asendlineafterwas needed shifts every later read; debug withcontext.log_level='debug'and match on exact prompts.
Verify success
cat /flag (or the shell) from the remote service, reproducibly — the script lands the flag
in consecutive remote runs, not once by luck. Record the leaked libc symbol and offset used.
References
Chains and glibc-version heap table: exploit-pwn-chain (+ its cheatsheet.md); bug hunting:
reverse-eng-binary-triage, exploit-memory-corruption; pwntools docs (FmtStr,
fmtstr_payload); seccomp-tools. Triage via ctf-methodology.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

