pwn-chain

Builds working exploits from identified memory corruption vulnerabilities using pwntools and ROP techniques.

21|8|Updated Aug 3, 2026
One-click install
npx skills add https://github.com/chengzongcai/reverse-skill-backup --skill pwn-chain-chengzongcai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pwn-chain
Source: https://github.com/chengzongcai/reverse-skill-backup/tree/main/skills/pwn-chain
Command: npx skills add https://github.com/chengzongcai/reverse-skill-backup --skill pwn-chain-chengzongcai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Turning a known vulnerability (stack overflow, heap corruption, kernel ioctl bug) into a stable, remotely working exploit is hard: local CTF payloads often crash against remote targets due to libc version mismatches, stack alignment, heap spray timing, and kernel protections like SMEP/SMAP/KASLR. This Skill provides an engineering workflow that bridges that gap. ## Core Features & Use Cases - Stack Exploitation: ret2libc, ret2csu, one_gadget, stack alignment fixes, and libc-database fingerprinting for unknown remote libc versions. - Heap Exploitation: glibc version-specific techniques covering tcache poisoning, fastbin/unsorted bin attacks, safe-linking bypass, and FILE struct attacks for glibc 2.34+. - Kernel Pwn: QEMU debugging setup, slab spraying with msg_msg/pipe_buffer, commit_creds ROP chains, and modprobe_path hijacking for privilege escalation. - Use Case: You have a 64-bit ELF binary with NX, PIE, and canary plus a known stack overflow. The Skill walks you through leaking the canary and a libc address, computing the libc base, building a ROP chain with proper stack alignment, and validating remote stability across 20+ runs. ## Quick Start Use the pwn-chain skill to write a stable remote exploit for this binary with a known stack overflow vulnerability.

Frequently Asked Questions about pwn-chain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a ret2libc exploit with pwntools?▼

Leak a libc function address via the GOT, compute the libc base by subtracting the symbol offset, then build a ROP chain calling system with a /bin/sh string address. Insert a single ret gadget before the chain to fix 16-byte stack alignment, which is the most common cause of remote crashes.

Why does my exploit work locally but crash on the remote server?▼

Remote failures usually come from libc version mismatches, stack misalignment triggering movaps faults, or network timing issues. Use libc-database to fingerprint the remote libc from leaked addresses, add a ret gadget for alignment, and replace sleep calls with recvuntil anchored on exact strings.

How does glibc version affect heap exploitation techniques?▼

Heap techniques are tightly bound to glibc versions: tcache appeared in 2.27, safe-linking in 2.32 requires leaking the heap base first, and 2.34 removed __free_hook and __malloc_hook entirely. For 2.34+, exploitation shifts to FILE struct vtable hijacking or exit handler overwrites.

How do I bypass SMEP and SMAP in kernel exploitation?▼

SMEP and SMAP prevent executing or accessing userland from kernel mode, so exploits use kernel ROP chains calling prepare_kernel_cred(0) then commit_creds, returning via swapgs_restore_regs_and_return_to_usermode. Alternatively, overwrite modprobe_path with an arbitrary write primitive to trigger root execution.

What tools are needed for binary exploitation with this workflow?▼

The core toolchain is pwntools for exploit scripting, GEF or pwndbg for debugging, ROPgadget or Ropper for gadget search, one_gadget for magic gadgets, and libc-database for remote libc fingerprinting. Kernel work additionally requires qemu-system-x86_64 and cpio for initramfs manipulation.

When should I use this skill instead of static reverse engineering?▼

Use this skill only after a vulnerability has already been identified through auditing, fuzzing, or static analysis. It covers the path from a known bug to a working exploit; discovering the vulnerability itself belongs to reverse engineering or fuzzing workflows.