binary-exploitation-methodology

Analyze ELF binaries and develop exploitation strategies for stack, heap, and format string vulnerabilities.

1|Updated Aug 3, 2026
One-click install
npx skills add https://github.com/hanmujun/hanmujun-agent-public --skill binary-exploitation-methodology-hanmujun
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: binary-exploitation-methodology
Source: https://github.com/hanmujun/hanmujun-agent-public/tree/main/skill-library/binary-exploitation-methodology
Command: npx skills add https://github.com/hanmujun/hanmujun-agent-public --skill binary-exploitation-methodology-hanmujun

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Analyzing a vulnerable binary and choosing the right exploitation path requires juggling protection mechanisms (ASLR, NX, Canary, PIE, RELRO), vulnerability types, and glibc version constraints. This Skill provides a structured six-phase methodology that walks from initial binary triage through protection identification, vulnerability classification, exploit strategy selection, payload development, and testing. ## Core Features & Use Cases - Protection Mechanism Analysis: Decision trees for checksec output covering Stack Canary, NX, PIE, ASLR, and RELRO, with concrete bypass methods for each. - Exploit Strategy Selection: Complete decision trees mapping vulnerability types (stack overflow, format string, heap overflow, UAF) to exploitation strategies (ret2win, ret2shellcode, ROP, ret2libc, SROP, stack pivoting). - In-Depth References: Dedicated guides for heap exploitation (tcache poisoning, fastbin, unsorted bin, House of X), format string attacks, libc version identification, and seccomp sandbox assessment. - Use Case: Given a pwn challenge binary with NX and PIE enabled, follow the methodology to leak a libc address via ROP, identify the remote libc version from the leaked offset, compute system and /bin/sh addresses, and build a ret2libc chain with pwntools. ## Quick Start Analyze the attached binary with checksec, identify its vulnerability type, and build a pwntools exploit script following the binary exploitation methodology.

Frequently Asked Questions about binary-exploitation-methodology

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

FAQPage Schema
How do I exploit a stack buffer overflow in a Linux binary?▼

First run checksec to identify protections, then determine the overflow offset with a cyclic pattern in GDB. With no Canary and no PIE, overwrite the return address directly; with NX enabled, build a ROP chain or ret2libc payload using pwntools.

How to bypass ASLR when exploiting a binary with pwntools?▼

Leak a libc address at runtime, typically by calling puts on its own GOT entry via ROP or reading an unsorted bin fd pointer. Subtract the known symbol offset to get the libc base, then compute system and /bin/sh addresses.

What is the difference between tcache poisoning and fastbin attack?▼

Both tamper with a freed chunk's fd pointer so malloc returns an arbitrary address. Fastbin requires a valid size field at the target, while tcache on glibc below 2.29 has no checks; glibc 2.32 adds safe-linking to both, requiring a heap address leak.

Does ret2libc work when the remote libc version is unknown?▼

Yes, but you must first identify the version. Leak two or more libc function addresses, take their low 12 bits, and query libc.blukat.me or the libc-database project to find the matching libc build before computing offsets.

Why does my x86_64 exploit crash inside system with SIGSEGV?▼

The crash is usually a stack alignment issue: x86_64 requires 16-byte alignment at call sites, and movaps faults otherwise. Insert a single ret gadget before jumping to system to realign the stack.

How do I bypass seccomp filters that block execve?▼

Dump the filter with seccomp-tools and check for allowed alternatives like openat, sendfile, or execveat. If the filter only checks ARCH_X86_64, the x32 ABI or 32-bit compatibility mode may use different syscall numbers that escape the rules.