ctf::methodology

triage workflow decision flows
Triage Decision Flows Playbooks Flags & Time Pitfalls
01Challenge Triage
First 60 seconds
# identify what you actually have
file sample
strings -n 6 sample
exiftool sample
checksec --file=bin
binwalk -e sample

# service?
nc host port
curl -i URL
nmap -sC -sV host
Classify fast
# ask these first
- file, packet capture, website, binary, archive, image?
- local challenge or remote service?
- obvious encoding?
- user-controlled input?
- flag format known?

# common mapping
forensics → metadata / hidden data / pcap / timeline
web → params / auth / template / file upload
pwn → protections / overflow / format string / heap
rev → input checks / transforms / compare logic
crypto → encoding / xor / rsa / oracle / math
02Decision Flows
File / artifact flow
file target
├─ archive → 7z l / unzip / tar tf
├─ image/audio → exiftool / zsteg / steghide
├─ executable → checksec / strings / disassembler
├─ pcap → tshark / export objects
└─ unknown → xxd / magic bytes / entropy
Remote service flow
nc or curl first
1. read banner / prompt carefully
2. send minimal valid input
3. identify constraints / parsing / echoes
4. reproduce locally if possible
5. automate immediately in Python

# do not brute force blind before understanding format
When to switch strategy
SituationBetter move
stuck in static analysisrun program, trace input, add logging
manual repetitionscript it now
tons of possibilitiesderive constraints first
remote onlybuild a clean local harness around nc/curl
binary crashescollect offset / protections / register state
Automation mindset
# CTF rule
if you do it twice manually, script it.

python3 solve.py
- isolate one primitive
- test on small samples
- log intermediate values
- keep raw bytes until the end

# save evidence
tee output.txt
script -q transcript.txt
03Category Playbooks
Crypto
1. identify encoding before crypto
2. test hex/base64/base32/rot/xor
3. inspect block size / repetition
4. check key reuse / known plaintext
5. for RSA: factor? low e? shared n?

# quick tools
CyberChef, python, sage, factordb
Web
1. map all parameters
2. try normal form + JSON + multipart
3. inspect cookies / JWT / headers
4. test authz separately from authn
5. look for SSTI / SQLi / file upload / IDOR

# quick tools
Burp, curl, ffuf, sqlmap
Pwn / Rev / Forensics
Pwn: checksec → offset → leak → primitive → shell
Rev: strings → main → input path → compare / transform → reimplement
Forensics: metadata → carving → embedded objects → timeline / stream reconstruction
OSINT / Misc / Jail
OSINT: reverse image → exif / geolocation → username pivot → social / domain recon
Misc: read carefully → identify format → script interaction → edge cases
Jail: what's blocked? → enumerate reachable → reflection / meta → rebuild primitives
AI/LLM: probe model → test injection → extract prompt → bypass filters
04Flag Hunting & Time
Common flag locations
# environment
env | grep -i flag
cat /flag /flag.txt /home/*/flag*
find / -name "*flag*" 2>/dev/null

# databases
.tables → SELECT * FROM secrets/flags/...

# web apps
config files, .env, admin panels, hidden routes

# memory / process
/proc/self/environ, core dumps, heap strings

# common flag formats
FLAG{...}  CTF{...}  flag{...}  HTB{...}
grep -rn "flag{" . 2>/dev/null
Time management
# per challenge
- read ALL challenges before starting
- easy/medium first → build momentum
- stuck 30min? switch, come back later
- partial progress is fine — note it and move

# scoring
- dynamic scoring: first-blood bonus fades
- static: 500pt takes 5× longer than 100pt
- always calculate points-per-minute

# team tips
- don't overlap on same challenge silently
- share partial findings immediately
- if someone is close, help them finish
05Common Pitfalls
Mistakes that waste time
PitfallWhy it hurts
assuming textchallenge data is often raw bytes
brute forcing too soonusually one structural clue is enough
ignoring encodingsmany crypto challenges are only layered encoding
not saving outputshard to compare attempts
copy/paste corruptionnewlines and spaces matter
working only remotelybuild local reproducer whenever possible
Minimal reusable notes
mkdir chall && cd chall
script -q transcript.txt
python3 -m venv .venv && . .venv/bin/activate
printf '%s
' 'host=' >> notes.txt

# keep raw material
cp original.bin work.bin