Aller au contenu
Skillpedia
Sécurité6.5k · #14162

ctf-triage

Ce qu’il fait

Ce guide propose une méthode pour classer les défis de capture du drapeau et choisir les outils adaptés. Il s'adresse aux étudiants et aux joueurs de compétitions de sécurité légales.

Quand l’utiliser

  • ✓Quand quelqu'un bloque sur un fichier de défi de capture du drapeau et ne connaît pas sa catégorie.
  • ✓Quand un joueur veut un plan étape par étape pour un défi de binaire ou de cryptographie en compétition.
  • ✓Quand un apprenant veut s'entraîner sur des compétences de sécurité avec un défi d'entraînement.

Lien du skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/ctf-triage/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/ctf-triage/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“J'ai un fichier de type CTF qui ressemble à un binaire. Comment savoir de quel type de défi il s'agit ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Le skill demande à l'IA de vérifier d'abord le type de fichier et les signatures courantes, puis de passer aux étapes de résolution correspondantes. Il garde un ordre clair pour que le joueur ne saute aucune vérification.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

CTF Challenge Triage and Solve Methodology

Authorized-use caveat: This skill is for legal CTF competitions, security education, and authorized research environments only. Never apply these techniques to systems without explicit written authorization.

Phase 0 — Initial Triage (always first)

Identify challenge category before touching any tool.

# Universal file fingerprint
file challenge_file
xxd challenge_file | head -4         # magic bytes
strings -n 8 challenge_file | head -30
binwalk challenge_file               # embedded files / compression layers
exiftool challenge_file              # metadata (images, PDFs)
Magic bytes / extension Category Next phase
ELF / PE / Mach-O Pwn / Rev Phase 1a / 1b
PNG / JPG / BMP / WAV Steganography / Forensics Phase 2
PCAP / PCAPNG Network forensics Phase 3
Memory dump (.raw, .vmem, .dmp) Memory forensics Phase 4
Ciphertext / hex blob / base64 Crypto Phase 5
Web URL / source Web Use exploit/web/ skills
Archive / unknown binary Misc / forensics Phase 6

Phase 1a — Pwn (Binary Exploitation)

Step 1 — Security property enumeration

checksec --file=./binary
# Key outputs: RELRO, Stack Canary, NX, PIE, RUNPATH
Property Absent = exploitable via...
Stack canary Stack overflow → ret2libc / ROP
NX (No-Execute) Shellcode injection to stack/heap
PIE Fixed address assumptions for ROP gadgets
Full RELRO GOT overwrite

Step 2 — Static analysis

objdump -d ./binary | grep -A 20 "<main>"
strings ./binary | grep -E "(flag|CTF|pass|secret|/bin/sh)"
readelf -s ./binary | grep -E "(sym|FUNC)"
# Heavy analysis
ghidra ./binary  # or: r2 -A ./binary

Step 3 — Dynamic analysis + offset finding

# GDB with GEF/PEDA
gdb -q ./binary
# Inside GDB:
# pattern create 200
# run < <(python3 -c "print('A'*200)")
# pattern offset $rsp

# Pwntools skeleton
python3 - <<'EOF'
from pwn import *
context.binary = elf = ELF('./binary')
p = process('./binary')
# or: p = remote('challenge.host', 1337)

offset = cyclic_find(0x61616161)  # replace with crashing value
payload = b'A' * offset + p64(elf.sym['win'])
p.sendline(payload)
p.interactive()
EOF

Step 4 — ROP chain (when NX set)

ROPgadget --binary ./binary --rop | grep "pop rdi"
# or: ropper -f ./binary --search "pop rdi"

python3 - <<'EOF'
from pwn import *
elf = ELF('./binary')
libc = ELF('./libc.so.6')
rop = ROP(elf)
rop.call('puts', [elf.got['puts']])
rop.call(elf.sym['main'])
# Leak libc base, then ret2libc
EOF

Step 5 — Libc identification (remote exploits)

# Identify libc from leaked addresses
python3 -m one_gadget libc.so.6
# or: libc-database lookup

Phase 1b — Reverse Engineering

Step 1 — Static disassembly

# Strings for quick wins (flag format, hardcoded keys)
strings ./binary | grep -iE "(flag\{|ctf\{|[A-Z0-9_]{10,}\})"

# Ghidra headless (no GUI)
analyzeHeadless /tmp/ghidra_proj ChalProj \
  -import ./binary \
  -postScript PrintASM.java \
  -scriptPath /opt/ghidra/Ghidra/Features/Decompiler/ghidra_scripts \
  2>/dev/null

# radare2 (faster for known binary formats)
r2 -A ./binary
# Inside r2: afl (functions), pdf @ sym.main, VV (visual)

Step 2 — Anti-debug / packer detection

# Detect packers
upx -t ./binary  # UPX packed?
die ./binary     # Detect-It-Easy
# If packed: upx -d ./binary

# Entropy analysis (high entropy sections = packed/encrypted)
binwalk -E ./binary

If packed, see reverser/packer-unpacking/SKILL.md.

Step 3 — Symbolic execution for constraint solving

# Angr — solve unknown input to reach target state
python3 - <<'EOF'
import angr, claripy
proj = angr.Project('./binary', auto_load_libs=False)
flag_chars = [claripy.BVS(f'flag_{i}', 8) for i in range(32)]
flag = claripy.Concat(*flag_chars)
state = proj.factory.full_init_state(stdin=flag)
for c in flag_chars:
    state.add_constraints(c >= 0x20, c <= 0x7e)
sm = proj.factory.simulation_manager(state)
sm.explore(find=lambda s: b'Correct' in s.posix.dumps(1),
           avoid=lambda s: b'Wrong' in s.posix.dumps(1))
if sm.found:
    print(sm.found[0].solver.eval(flag, cast_to=bytes))
EOF

Phase 2 — Steganography / Image Forensics

Triage order (fast to slow)

# 1. Metadata
exiftool challenge.
Questions fréquentes

Quels types de défis couvre-t-il ?

L'exploitation de binaires, la rétro-ingénierie, la cryptographie, l'investigation numérique, le web et les défis divers.

Est-il réservé aux compétitions ?

Il est destiné aux compétitions légales, à l'enseignement et à la recherche autorisée.

Résout-il les défis à la place du joueur ?

Il fournit une méthode et des outils, et c'est toujours le joueur qui résout le défi.

Détails

Description originale de l’auteur

CTF challenge triage and solve methodology — category detection, tool selection, and multi-step solve chains across pwn/rev/crypto/forensics/web/misc.

repo: BitterSecurity/Decepticon

Popularité

Étoiles GitHub
6.5k
Position au classement
#14162
Licence
Apache-2.0
Mis à jour
01/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires