binary

Analyze and exploit CTF binary challenges using Ghidra, pwntools, and dynamic debugging.

545|48|Updated Nov 10, 2025
One-click install
npx skills add https://github.com/yhy0/CHYing-agent --skill binary
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: binary
Source: https://github.com/yhy0/CHYing-agent/tree/main/agent-work/.claude/skills/binary
Command: npx skills add https://github.com/yhy0/CHYing-agent --skill binary

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pwntools, capstone, keystone, unicorn, angr, z3-solver, frida, pycryptodome, and includes references (resource) components.

What problem does it solve?

Solving PWN and reverse engineering challenges in CTF competitions requires deep expertise across static analysis, dynamic debugging, heap exploitation, ROP chains, and shellcode development. This Skill provides a systematic workflow that guides an AI agent through reconnaissance, vulnerability identification, and exploit development for binary targets.

Core Features & Use Cases

  • Ghidra MCP Static Analysis: Decompile functions, trace cross-references, and extract encryption keys from stripped binaries using 27 Ghidra MCP tools as the primary analysis path.
  • Vulnerability Pattern Recognition: Identify stack overflows, heap bugs (tcache poisoning, UAF, double free), format strings, integer overflows, race conditions, and kernel exploits with ready-made exploitation templates.
  • Exploit Development: Generate working pwntools scripts covering ret2libc, ROP chains, GOT overwrites, FSOP, and address leak techniques, plus angr symbolic execution and Frida instrumentation for automated solving.
  • Use Case: Given a stripped ELF binary from a CTF challenge, the agent runs checksec and reconnaissance, decompiles the validation logic in Ghidra, identifies a tcache poisoning primitive, and produces a runnable pwntools exploit that captures the flag.

Quick Start

Analyze the attached binary challenge file, identify the vulnerability type, and write a working pwntools exploit script to capture the flag.

Frequently Asked Questions about binary

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

FAQPage Schema
How do I exploit a stack overflow in a CTF binary?

First run checksec to identify protections, then use a cyclic pattern to calculate the exact offset to the return address. Depending on protections, apply ret2text for binaries with a backdoor function, ret2libc when NX is enabled, or shellcode injection when the stack is executable.

How to reverse engineer a stripped binary with Ghidra?

Load the binary with analyzeHeadless, then use Ghidra MCP tools to list functions, search strings for flag or key references, and decompile suspicious functions to C pseudocode. Follow cross-references from input functions to validation logic to understand the algorithm before writing any solver script.

What is tcache poisoning and when does it work?

Tcache poisoning corrupts the fd pointer of a freed chunk so the next malloc returns an arbitrary address. On glibc 2.27-2.31 it works directly, while glibc 2.32+ adds safe-linking, requiring a heap leak to compute the mangled fd value as target XOR (heap address shifted right by 12).

Can angr automatically solve reverse engineering challenges?

Yes, angr performs symbolic execution to find inputs that reach a success state while avoiding failure states. Define the input as a symbolic bitvector, explore toward the success address, and evaluate the model to recover the valid input, which works well for constraint-based flag checkers.

Why does my ret2libc exploit fail on 64-bit binaries?

The most common cause is stack alignment: many libc functions like system crash if rsp is not 16-byte aligned at the call. Insert a single ret gadget before the system call in your ROP chain, and ensure you pass the /bin/sh address through pop rdi rather than pushing arguments on the stack.

When should I skip Ghidra analysis for a binary challenge?

Skip Ghidra when the flag appears directly in strings output, when strace fully reveals the relevant data flow, or when the challenge is purely dynamic and solvable with gdb or angr. Ghidra is essential for stripped binaries with custom encryption, C2 protocols, or algorithms you must reimplement.