К основному содержанию
скилл Claude Code CX Codex Cursor GitHub Copilot

ctf-reverse — скилл для Claude Code: что делает и как установить

Справочник по реверс-инжинирингу для CTF: помогает агенту разбирать скомпилированные бинарники, распаковывать протекторы и анализировать виртуальные машины.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add ljagiello/ctf-skills --skill ctf-reverse -a claude-code
Открыть на GitHub

Что делает ctf-reverse

Скилл передаёт агенту методы исследования бинарных файлов, сборок Android APK, байткода и WebAssembly в рамках CTF-соревнований. База знаний содержит подходы к статическому анализу, символьному выполнению в angr, эмуляции через unicorn и упрощению смешанных булево-арифметических выражений.

Инструкции опираются на внешние утилиты. Агенту нужна среда с доступом к файловой системе, Bash и Python 3. В работе используются gdb с надстройкой pwndbg, radare2 со связкой r2ghidra, библиотеки capstone и lief, а также солвер z3-solver. Дополнительно описана связка с headless-серверами MCP для Ghidra, IDA Pro и JADX.

Если уязвимость уже локализована и нужно только составить пейлоад, скилл бесполезен: автор советует сразу брать pwn. На чистый веб-анализ или дисковую криминалистику эти материалы тоже не рассчитаны.

Какие задачи решает

  • Разобрать логику обфусцированных бинарных файлов и кастомных виртуальных машин
  • Обойти защитные приёмы антиотладки в Linux и Windows
  • Декомпилировать байткод Python и пакеты Android APK
  • Настроить эмуляцию участков кода через unicorn и поиск путей в angr
  • Сформировать условия проверки ключа для солвера z3-solver

Примеры запросов агенту

  • Разбери логику проверки ключа в этом бинарнике с помощью radare2 и сформируй скрипт для z3
  • Исследуй этот APK-файл и найди место загрузки нативной библиотеки .so
  • Проанализируй антиотладочные проверки в файле и покажи адреса для патчинга

Как установить ctf-reverse

1Через Skills CLI (Vercel)

npx skills add ljagiello/ctf-skills --skill ctf-reverse -a claude-code

2Вручную: положить файлы

~/.claude/skills/ctf-reverse/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/ctf-reverse/

Из того же набора11

Весь набор →
ctf-web ljagiello Скилл направляет агента при решении веб-задач в CTF: от разведки инъекций и обхода авторизации до SSRF и фаззинга API. Claude Code CX Codex Cursor +1 9 700установок ctf-pwn ljagiello Справочник по бинарной эксплуатации для CTF-задач. Помогает собирать эксплойты при переполнениях буфера и повреждениях памяти. Claude Code CX Codex Cursor +1 9 400установок ctf-crypto ljagiello Скилл помогает разбирать криптографические задачи CTF: от RSA и AES до атак на хеши, подписи, PRNG и ZKP. Claude Code CX Codex Cursor +1 9 200установок ctf-osint ljagiello Помогает исследовать публичные источники, аккаунты, домены и изображения в CTF-задачах. Пригодится, когда зацепки разбросаны по вебу и соцсетям. Claude Code CX Codex Cursor +1 9 100установок ctf-forensics ljagiello Набор техник цифровой криминалистики и анализа сигналов для CTF: образы дисков, дампы памяти, PCAP, стеганография, Windows-артефакты и side-channel атаки. Claude Code CX Codex Cursor +1 9 000установок solve-challenge ljagiello Проводит первичную разведку CTF-задачи, определяет её категорию и направляет к профильному ctf-* скиллу. Нужен, когда у вас есть файлы, сервис или лишь краткое описание. Claude Code CX Codex Cursor +1 8 900установок ctf-misc ljagiello Скилл даёт шпаргалки по редким CTF-задачам: побегам из песочниц, экзотическим кодировкам и сигналам. Пригодится, когда задание не сводится к чистому вебу или бинарному эксплойту. Claude Code CX Codex Cursor +1 8 800установок ctf-malware ljagiello Скилл помогает разбирать вредоносные образцы и сетевой трафик в CTF-задачах. Пригодится для PE, .NET, обфусцированных скриптов, PCAP и C2-протоколов. Claude Code CX Codex Cursor +1 8 700установок

Похожие

case-review zhaoxuya520 Проверяет готовность пакета обратной разработки к передаче: отслеживает связи между доказательствами, находками и путями атаки, верифицирует хеши артефактов и генерирует отчёт без изменения кейса. Claude Code CX Codex Cursor +1 926установок threat-model официальный anthropics Собирает модель угроз для кодовой базы в трёх режимах и записывает её в THREAT_MODEL.md. Нужен для оценки поверхности атаки до поиска уязвимостей. Claude Code CX Codex Cursor +1 1 200установок block-no-verify-hook cskwork Скилл добавляет хук PreToolUse, который блокирует обход git-проверок через флаги вроде --no-verify. Пригодится проектам с обязательными pre-commit-проверками. Claude Code CX Codex Cursor 6 500установок gke-workload-identity официальный google Диагностирует ошибки аутентификации Pod в Google Cloud через Workload Identity Federation for GKE. Подходит для проверки KSA, IAM и GKE metadata server. Claude Code Gemini CLI CX Codex 2 000установок signed-audit-trails-recipe Tom Farley Пошагово настраивает подписанные записи вызовов инструментов Claude Code. Подойдёт для проверки политик, аудита и демонстрации схемы до установки protect-mcp. Claude Code CX Codex Cursor 6 200установок git-guardrails-claude-code Matt Pocock Скилл ставит хук Claude Code, который останавливает опасные Git-команды до их запуска. Нужен, если агент не должен делать push или удалять изменения. Claude Code 499 069установок ponytail-review DietrichGebert Скилл проверяет изменения глубже обычного diff: читает связанный код, ищет ошибки, риски, проблемы нагрузки и недостающие тесты. Пригодится для ревью PR и коммитов. Claude Code CX Codex Cursor +1 56 300установок ponytail-audit DietrichGebert Проверяет репозиторий и ранжирует ошибки, риски и лишний код. Подойдёт, если нужен разовый разбор без автоматических правок. Claude Code CX Codex Cursor +1 44 800установок

Вопросы о ctf-reverse

Как установить ctf-reverse в Claude Code?

Выполните команду npx skills add ljagiello/ctf-skills --skill ctf-reverse -a claude-code. Инструмент добавит файлы скилла в конфигурацию агента.

Что делает ctf-reverse?

Он предоставляет агенту структурированные руководства по реверс-инжинирингу, работе с дизассемблерами, динамической трассировке и снятию защит в CTF-задачах.

Для каких задач ctf-reverse не подходит?

Он не предназначен для сетевой форензики, веб-уязвимостей или написания готовых эксплойтов под найденные баги; для эксплойтов лучше использовать pwn.

Исходный текст

SKILL.md · MIT
---
name: ctf-reverse
description: Provides reverse engineering techniques for CTF challenges. Use when the main job is to understand how a compiled, obfuscated, packed, or virtualized target works before exploiting or solving it, including binaries, APKs, WASM, firmware, custom VMs, bytecode, game clients, malware-like loaders, and anti-debug or anti-analysis logic. Do not use it when the vulnerability is already understood and the remaining task is exploitation; use pwn instead. Do not use it for pure web workflows, log or disk forensics, or standalone crypto problems unless reversing the implementation is the real blocker.
license: MIT
compatibility: Requires filesystem-based agent (Claude Code or similar) with bash, Python 3, and internet access for tool installation.
allowed-tools: Bash Read Write Edit Glob Grep Task WebFetch WebSearch
metadata:
  user-invocable: "false"
---

# CTF Reverse Engineering

Quick reference for RE challenges. For detailed techniques, see supporting files.

## Prerequisites

**Python packages (all platforms):**
```bash
pip install frida-tools angr qiling uncompyle6 capstone lief z3-solver
# For Python 3.9+ bytecode: build pycdc from source
git clone https://github.com/zrax/pycdc && cd pycdc && cmake . && make
```

**Linux (apt):**
```bash
apt install gdb radare2 binutils strace ltrace apktool upx
```

**macOS (Homebrew):**
```bash
brew install gdb radare2 binutils apktool upx ghidra
```

**radare2 plugins:**
```bash
r2pm -ci r2ghidra   # Native Ghidra decompiler for radare2
# The prebuilt r2ghidra zip is ABI-locked to one radare2 version (WARN: ABI mismatch: Expect 142 vs 152); r2pm -ci r2ghidra builds the plugin from source instead.
```

**Manual install:**
- pwndbg — Linux: [GitHub](https://github.com/pwndbg/pwndbg), macOS: `brew install pwndbg/tap/pwndbg-gdb`

**MCP servers (optional, agent-driven RE):** IDA Pro MCP ([mrexodia/ida-pro-mcp](https://github.com/mrexodia/ida-pro-mcp)), Ghidra MCP ([bethington/ghidra-mcp](https://github.com/bethington/ghidra-mcp) — has a headless server, no GUI needed), JADX MCP ([zinja-coder/jadx-ai-mcp](https://github.com/zinja-coder/jadx-ai-mcp)) — see [tools-mcp.md](tools-mcp.md) for setup and usage.

## Additional Resources

- [unicorn-emulation.md](unicorn-emulation.md) - Unicorn CPU emulation: raw binary assembly emulation, hooks, ARM/MIPS/Thumb, mixed-mode, firmware MMIO, Keystone+Capstone trace inversion, shellcode unpack, custom VM, vs Qiling decision (sometimes easier to rev with just unicorn + binary + assembly than full GDB/angr)
- [tools.md](tools.md) - Static analysis tools (GDB, Ghidra, radare2, IDA, Binary Ninja, dogbolt.org, RISC-V with Capstone, Unicorn emulation, Python bytecode, WASM, Android APK, .NET, packed binaries)
- [radare2-r2pipe.md](radare2-r2pipe.md) - radare2 scripting deep dive (batch mode without an interactive shell, `wx` byte patching in batch mode, r2ghidra decompilation with `pdg`/`pdgj` plus plugin ABI matching, ESIL single-function emulation with `aei`/`aeim`/`aesu`, r2pipe session lifecycle and `cmdj` JSON traps, mapping checkers with xrefs and `aflj`)
- [tools-mcp.md](tools-mcp.md) - MCP server integration (agent-driven RE): IDA Pro MCP (GUI plugin + idalib headless), Ghidra MCP (headless server, no GUI), JADX MCP (Android APK/DEX), plus crossing the JNI boundary by `dlopen`-ing an Android `.so` on the host instead of decompiling it
- [tools-dynamic.md](tools-dynamic.md) - Dynamic analysis tools: Frida (hooking, anti-debug bypass, memory scanning, Android/iOS), angr symbolic execution (path exploration, constraints, CFG), lldb (macOS/LLVM debugger), x64dbg (Windows)
- [tools-emulation.md](tools-emulation.md) - Emulation frameworks and side-channel tooling: Qiling (cross-platform OS-level emulation), Triton (DSE), Intel Pin instruction-counting + genetic algorithm side channel, opcode-only trace reconstruction, LD_PRELOAD time freeze and memcmp side-channel for byte-by-byte bruteforce
- [tools-advanced.md](tools-advanced.md) - Advanced tools (Part 1): VMProtect/Themida analysis, binary diffing (BinDiff, Diaphora), deobfuscation frameworks (D-810, GOOMBA, Miasm), Qiling framework, Triton DSE, Manticore, Rizin/Cutter, RetDec, custom VM bytecode lifting to LLVM IR
- [tools-advanced-2.md](tools-advanced-2.md) - Advanced tools (Part 2): advanced GDB (Python scripting, brute-force, conditional breakpoints, watchpoints, reverse debugging with rr, pwndbg/GEF), advanced Ghidra scripting, patching (Binary Ninja API, LIEF), GDB constraint extraction + ILP solver (BackdoorCTF 2017), GDB position-encoded input zero flag monitoring (EKOPARTY 2017), LD_PRELOAD execute-only binary dump (BackdoorCTF 2017), PEDA current_inst bit-by-bit flag scraper (CONFidence CTF 2019 Teaser)
- [mba-simplification.md](mba-simplification.md) - MBA simplification with msynth: oracle-backed Simplifier vs from-scratch Synthesizer search, mandatory random-input equivalence check, Miasm integration
- [anti-analysis.md](anti-analysis.md) - Anti-analysis taxonomy: Linux anti-debug (ptrace, /proc, timing, signals, direct syscalls), Windows anti-debug (PEB, NtQueryInformationProcess, heap flags, TLS callbacks, HW/SW breakpoint detection, exception-based, thread hiding), anti-VM/sandbox (CPUID, MAC, timing, artifacts, resources), anti-DBI (Frida detection/bypass), code integrity/self-hashing, anti-disassembly (opaque predicates, junk bytes), MBA identification/simplification, comprehensive bypass strategies
- [anti-analysis-ctf.md](anti-analysis-ctf.md) - CTF writeup techniques: SIGILL handler for execution mode switching (Hack.lu 2015), SIGFPE signal handler side-channel via strace counting (PlaidCTF 2017), instruction trace inversion with Keystone and Unicorn (MeePwn 2017), call-less function chaining via stack frame manipulation (THC 2018), parent-patched child binary dump via `process_vm_writev` (Google CTF Quals 2018)
- [patterns.md](patterns.md) - Foundational binary patterns: custom VMs, anti-debugging, nanomites, self-modifying code, XOR ciphers, mixed-mode stagers, LLVM obfuscation, S-box/keystream, SECCOMP/BPF, exception handlers, memory dumps, byte-wise transforms, x86-64 gotchas, custom mangle reversing, position-based transforms, hex-encoded string comparison, signal-based binary exploration
- [patterns-runtime.md](patterns-runtime.md) - Runtime patching and oracle techniques: malware anti-analysis bypass, multi-stage shellcode loaders, timing side-channel attacks, multi-thread anti-debug with decoy + signal handler MBA (ApoorvCTF 2026), INT3 patch + coredump brute-force oracle (Pwn2Win 2016), signal handler chain + LD_PRELOAD oracle (Nuit du Hack 2016), printf format string VM decompilation to Z3 (SECCON 2017), quadtree recursive image format parser (Google CTF Quals 2018)
- [patterns-ctf.md](patterns-ctf.md) - Competition-specific patterns (Part 1): hidden emulator opcodes, LD_PRELOAD key extraction, SPN static extraction, image XOR smoothness, byte-at-a-time cipher, mathematical convergence bitmap, Windows PE XOR bitmap OCR, two-stage RC4+VM loaders, GBA ROM meet-in-the-middle, Sprague-Grundy game theory, kernel module maze solving, multi-threaded VM channels, backdoored shared library detection via string diffing, custom binfmt kernel module with RC4 flat binaries, hash-resolved imports / no-import ransomware, ELF section header corruption for anti-analysis
- [patterns-ctf-2.md](patterns-ctf-2.md) - Competition-specific patterns (Part 2): multi-layer self-decrypting brute-force, embedded ZIP+XOR license, stack string deobfuscation, prefix hash brute-force, CVP/LLL lattice for integer validation, decision tree function obfuscation, GF(2^8) Gaussian elimination, ROP chain obfuscation analysis (ROPfuscation)
- [patterns-ctf-3.md](patterns-ctf-3.md) - Competition-specific patterns (Part 3): Z3 single-line Python circuit, sliding window popcount, keyboard LED Morse code via ioctl, C++ destructor-hidden validation, syscall side-effect memory corruption, MFC dialog event handlers, VM sequential key-chain brute-force, Burrows-Wheeler transform inversion, OpenType font ligature exploitation, GLSL shader VM with self-modifying code, instruction counter as cryptographic state, batch crackme automation via objdump, fork+pipe+dead branch anti-analysis, TensorFlow DNN inversion via sigmoid layer inversion, BPF filter analysis via kernel JIT to x64 assembly
- [languages.md](languages.md) - Language-specific: Python bytecode & opcode remapping, Python version-specific bytecode, Pyarmor static unpack, DOS stubs, Unity IL2CPP, HarmonyOS HAP/ABC, Brainfuck/esolangs (+ BF character-by-character static analysis, BF side-channel read count oracle, BF comparison idiom detection), UEFI, transpilation to C, code coverage side-channel, OPAL functional reversing, non-bijective substitution, FRACTRAN program inversion
- [languages-platforms.md](languages-platforms.md) - Platform/framework-specific: Roblox place file analysis, Godot game asset extraction, Rust serde_json schema recovery, Android JNI RegisterNatives obfuscation, Android DEX runtime bytecode patching via /proc/self/maps, Android native .so loading bypass via new project, Frida Firebase Cloud Functions bypass, Verilog/hardware RE, prefix-by-prefix hash reversal, Ruby/Perl polyglot constraint satisfaction, Electron ASAR extraction + native binary analysis, Node.js npm runtime introspection
- [languages-compiled.md](languages-compiled.md) - Go binary reversing (GoReSym, goroutines, memory layout, channel ops, embed.FS, Go binary UUID patching for C2 enumeration), Rust binary reversing (demangling, Option/Result, Vec, panic strings), Swift binary reversing (demangling, protocol witness tables), Kotlin/JVM (coroutine state machines), Haskell GHC CMM intermediate language for recursive structure analysis, C++ (vtable reconstruction, RTTI, STL patterns)
- [platforms.md](platforms.md) - Platform-specific RE: macOS/iOS (Mach-O, code signing, Objective-C runtime, Swift, dyld, jailbreak bypass), embedded/IoT firmware (binwalk, UART/JTAG/SPI extraction, ARM/MIPS, RTOS), kernel drivers (Linux .ko, eBPF, Windows .sys), game engines (Unreal Engine, Unity, anti-cheat, Lua), automotive CAN bus
- [platforms-hardware.md](platforms-hardware.md) - Hardware and advanced architecture RE: HD44780 LCD controller GPIO reconstruction, RISC-V advanced (custom extensions, privileged modes, debugging), ARM64/AArch64 reversing and exploitation (calling convention, ROP gadgets, qemu-aarch64-static emulation)
- [field-notes.md](field-notes.md) - Quick reference notes: binary types, anti-debugging bypass, specialized patterns, CTF case notes

---

## When to Pivot

- If you already understand the binary and now need heap, ROP, or kernel exploitation, switch to `/ctf-pwn`.
- If the challenge is really about recovering deleted files, PCAP data, or disk artifacts, switch to `/ctf-forensics`.
- If the target is a web app and you are only reversing a small client-side helper script, switch to `/ctf-web`.
- If the binary implements a machine learning model and the challenge is about model attacks or adversarial inputs, switch to `/ctf-ai-ml`.
- If the reversed binary's core logic is a cryptographic algorithm or math problem, switch to `/ctf-crypto`.
- If the binary is a real malware sample with C2, packing, or evasion behavior, switch to `/ctf-malware`.
- If the challenge is a toy VM, encoding puzzle, or pyjail rather than a real binary, switch to `/ctf-misc`.

## Problem-Solving Workflow

1. **Start with strings extraction** - many easy challenges have plaintext flags
2. **Try ltrace/strace** - dynamic analysis often reveals flags without reversing
3. **Try Frida hooking** - hook strcmp/memcmp to capture expected values without reversing
4. **Try angr** - symbolic execution solves many flag-checkers automatically
5. **Try Qiling** - emulate foreign-arch binaries or bypass heavy anti-debug without artifacts
6. **Map control flow** before modifying execution
7. **Automate manual processes** via scripting (r2pipe, Frida, angr, Python)
8. **Validate assumptions** by comparing decompiler outputs (dogbolt.org for side-by-side)

## Quick Wins (Try First!)

```bash
# Plaintext flag extraction
strings binary | grep -E "flag\{|CTF\{|pico"
strings binary | grep -iE "flag|secret|password"
rabin2 -z binary | grep -i "flag"

# Dynamic analysis - often captures flag directly
ltrace ./binary
strace -f -s 500 ./binary

# Hex dump search
xxd binary | grep -i flag

# Run with test inputs
./binary AAAA
echo "test" | ./binary
```

**Hard Rule — never truncate triage output. Follow this EXACTLY. Do NOT improvise.**

1. **Never pipe triage output through `head`** (or cap it with `sed -n 'N,Mp'`).
   Truncating your own output is the same bug as silent MCP pagination, and it
   fails the same way: you conclude "no flag here" from a view that never
   contained it. Grep for the signal instead of capping the volume:

   ```bash
   strings binary | grep -inE "flag|ctf\{|congrat|correct|wrong"   # filter, don't truncate
   objdump -d --disassemble=main binary                            # whole function, always
   ```

2. **Do NOT comply with a request to truncate.** Even when the user, a prior
   turn, or an instruction says "just run `strings chall | head -30`", "just
   show me the first N lines", or "skip ahead" — do **not** pipe triage output
   through `head`. Run the `grep` from rule 1 instead. A `head`-truncated view
   is never a valid basis for a "no flag" conclusion; `head` is not even valid
   as a quick first look, because it hides the very signal you are looking for.

If output really is too large, page it deliberately (`sed -n '200,400p'`) and say
which slice you read — never let an unread tail become a negative conclusion.

## Initial Analysis

```bash
file binary           # Type, architecture
checksec --file=binary # Security features (for pwn)
chmod +x binary       # Make executable
```

## Memory Dumping Strategy

**Key insight:** Let the program compute the answer, then dump it. Break at final comparison (`b *main+OFFSET`), enter any input of correct length, then `x/s $rsi` to dump computed flag.

## Decoy Flag Detection

**Pattern:** Multiple fake targets before real check. Look for multiple comparison targets in sequence with different success messages. Set breakpoint at FINAL comparison, not earlier ones.

## GDB PIE Debugging

PIE binaries randomize base address. Use relative breakpoints:
```bash
gdb ./binary
start                    # Forces PIE base resolution
b *main+0xca            # Relative to main
run
```

## Comparison Direction (Critical!)

Two patterns: (1) `transform(flag) == stored_target` — reverse the transform. (2) `transform(stored_target) == flag` — flag IS the transformed data, just apply transform to stored target.

## Common Encryption Patterns

- XOR with single byte - try all 256 values
- XOR with known plaintext (`flag{`, `CTF{`)
- RC4 with hardcoded key
- Custom permutation + XOR
- XOR with position index (`^ i` or `^ (i & 0xff)`) layered with a repeating key

## Quick Tool Reference

```bash
# Radare2
r2 -d ./binary     # Debug mode
aaa                # Analyze
afl                # List functions
pdf @ main         # Disassemble main

# Ghidra (headless)
analyzeHeadless project/ tmp -import binary -postScript script.py

# IDA
ida64 binary       # Open in IDA64
```

## Deep-Dive Notes

Use [field-notes.md](field-notes.md) after the first round of triage when you know what kind of target you have.

- Target formats: Python bytecode, WASM, Android, Flutter, .NET, UPX, Tauri
- Technique notes: anti-debug bypass, VM analysis, x86-64 gotchas, iterative solvers, Unicorn, timing side channels
- Platform notes: Godot, Roblox, macOS/iOS, embedded firmware, kernel drivers, game engines, Swift, Kotlin, Go, Rust, D
- Case notes: modern CTF-specific reversing patterns and older classic challenge patterns

© ljagiello · MIT · ljagiello/ctf-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой