π CTF & Cyber Competition β Methodology & Strategy
Panduan metodologi, time triage, dan strategy untuk menghadapi kompetisi keamanan siber β dari jeopardy CTF sampai attack-defense, dari digital forensic sampai incident response. Fokus pada yang universal dan tidak terikat event tertentu. Untuk gambaran besar level kompetisi, lihat hierarchy-ctf-competition-framework. Untuk tools reference, lihat ctf-tool-arsenal-universal.
Prinsip Golden
βScore the lowest-hanging fruit first, then work up.β Di kompetisi, poin sama nilainya apakah Anda mendapatkannya dalam 5 menit atau 5 jam. Prioritaskan soal yang cepat diselesaikan, lalu investasikan sisa waktu untuk soal yang kompleks.
Daftar Isi
- Fase Pra-Kompetisi β Persiapan & Recon
- Metodologi Jeopardy CTF (L1-L2)
- Metodologi Attack-Defense CTF (L3)
- Metodologi Digital Forensic & Incident Response
- Metodologi Topikal β Per Kategori
- Time Triage β Strategi Menit ke Menit
- Teamwork & Komunikasi
- Tools Prioritization β Fallback Chain
- Post-Mortem & Knowledge Base
Fase Pra-Kompetisi β Persiapan & Recon
H-7 sampai H-1
| Periode | Aktivitas | Output |
|---|---|---|
| H-7 | Baca rulebook, scoring system, format flag | Paham: flag format (CTF{β¦}), tiebreaker (first blood? time?), peraturan anti-cheat |
| H-3 | Test koneksi ke platform, VPN/auth setup | Cache login. Pastikan VM/container bisa diakses |
| H-1 | Team sync: siapa handle kategori apa, komunikasi channel mana | RACI matrix per kategori + backup person |
| H-0 (30 menit sebelum) | Cek tools terinstall, internet stabil, backup comms (WA vs Discord vs Telegram) | Semua siap, no last-minute tool install |
Team Role Assignment (sudah harus fix sebelum mulai)
Kompetisi tim (3β5 orang):
| Role | Handle | Kompetensi | Backup |
|---|---|---|---|
| Web/PWN | Exploit & web challenge | Web security, binary exploitation, reverse engineering | Crypto person |
| Forensic/RE | File analysis, memory dump, binary reverse | Forensik, malware analysis, steganography | Anyone |
| Crypto/Misc | Cipher, encoding, logika | Cryptography, encoding, logic puzzles | Web person |
| Attack (A/D) | Exploit service lawan | Network scanning, exploit dev, service monitoring | Semua anggota |
| Defense (A/D) | Patch service sendiri | Hardening, patch management, checker script | Semua anggota |
Untuk tim 2β3 orang: tiap orang pegang 2 kategori. Prioritas pada strength masing-masing.
Metodologi Jeopardy CTF (L1-L2)
Anatomi Soal CTF
Setiap soal CTF memiliki struktur yang sama:
Soal = Description + Attachment (optional) + Target/Endpoint + Flag
Flow umum menyelesaikan soal:
Read Description β Identifikasi Kategori β Cari Tool Default
β Eksekusi Tool β Analyze Output β Dapat Flag
The 5-Minute Rule
Jika dalam 5 menit pertama Anda belum tau harus mulai dari mana:
- Baca description lagi β 80% clue ada di description, bukan di attachment
- Google judul soal + βCTF writeupβ β mungkin soal lama yang di-recycle
- Jalankan CyberChef Magic β deteksi encoding/encryption otomatis
strings,binwalk,file,exiftoolpada attachment- Skip β tandai sebagai βbutuh revisitβ, kerjakan soal lain dulu
Flowchart Pemecahan Soal Per Kategori
Menerima Soal
β
βββ Ada attachment?
β βββ Ya β file, strings, binwalk, exiftool
β β βββ Hasil? β Flag langsung? β Submit
β β βββ Tidak β Analisis lebih lanjut (RE/decompile/carving)
β βββ Tidak β Cek koneksi ke endpoint
β βββ Web β curl/nmap/dirb
β βββ PWN β nc/netcat, checksec
β βββ Misc β Ikuti petunjuk
β
βββ 5 menit? Tidak dapat progress?
βββ Skip. Tandai. Kembali nanti.
Metodologi Attack-Defense CTF (L3)
Fase-Fase Attack-Defense
Setiap ronde Attack-Defense memiliki siklus yang sama:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Start Ronde β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 1. SCAN & RECON (2β5 menit) β
β nmap -p- team_lawan β Cari service terbuka β
β β
β 2. PATCH & HARDEN (2β5 menit) β
β Cek service sendiri β Tutup celah β Restart β
β Service harus jalan + checker harus lulus β
β β
β 3. ATTACK (sisa waktu) β
β Exploit service lawan β Inject flag β Submit β
β Monitor checker: service sendiri masih health? β
β β
β 4. RECOVER (menit terakhir) β
β Jika service down β restart + re-patch β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Golden Rules Attack-Defense
| Rule | Penjelasan |
|---|---|
| Hardening dulu, attack kedua | Jika service Anda sendiri tidak jalan, Anda dapat 0 poin defense + lawan dapat attack points. Harden service sendiri dulu baru attack |
| Checker script > exploit | Kalau checker script tidak lulus, skor defense Anda hilang. Pastikan checker bisa jalan terus. Monitor checker output adalah prioritas #1 |
| Satu service, satu orang | Attack person fokus ke 1 service β jangan gonta-ganti. Defense person monitor checker dan log |
| Restart policy | while true; do ./service; done bukan solusi β service harus restart dengan state yang valid. Pastikan flag di-inject ulang setelah restart |
| Exploit sederhana > exploit keren | Buffer overflow yang reliable > ROP chain yang kadang crash. Yang penting flag masuk, bukan elegance |
| Backup service binary | Sebelum patch, backup service binary. Jika crash setelah patch, restore dari backup |
Script Starter untuk Attack-Defense
#!/usr/bin/env python3
"""Checker script template untuk Attack-Defense CTF"""
import requests
import sys
import time
TEAM_ID = sys.argv[1]
TARGET = f"http://10.0.{TEAM_ID}.3:8080"
def check_service():
"""Pastikan service berjalan & return status"""
try:
r = requests.get(f"{TARGET}/health", timeout=5)
return r.status_code == 200
except:
return False
def submit_flag(flag):
"""Submit flag ke server"""
r = requests.post("http://scoreboard/submit",
json={"flag": flag, "team": TEAM_ID})
return r.json().get("status") == "ok"
# Main loop
while True:
if not check_service():
print(f"[!] Service DOWN! Restarting...")
# Panggil restart script di sini
else:
print(f"[+] Service OK")
time.sleep(30)Metodologi Digital Forensic & Incident Response
Universal Forensic Triage
Ketika dapat soal forensic / incident response:
1. Cek file type β file command atau header magic bytes
2. Cek strings β strings file | grep -iE "flag|ctf|key|secret|password"
3. Cek metadata β exiftool
4. Cek embedded file β binwalk -Me
5. Cari hidden data β foremost/scalpel/photorec
6. Analisis spesifik β tergantung kategori (lihat kategori forensic di bawah)
Urutan Analisis Berdasarkan File Type
Disk Image (.dd, .e01, .img, .vmdk, .vhd)
file β mmls (partition table) β fls (file listing) β icat (file content)
Timeline: log2timeline/plaso
File carving: foremost, scalpel, photorec
Registry: regripper (Windows)
Memory Dump (.raw, .vmem, .mem, dumpit)
imageinfo (Volatility 3) β psscan β netscan β cmdline/malfind
String ekstraksi: volatility windows.strings
YARA scan: yara dengan malware signature
PCAP (.pcap, .pcapng)
Statistics: capinfos, wireshark statistics
Filter: HTTP objects β File β Export Objects β HTTP
DNS: dns query β cari exfiltration
TLS: SSL/TLS handshake β cek certificate, cipher, SNI
TCP follow stream β cari flag dalam teks
Binary (.exe, .bin, .elf)
strings β file β binwalk β objdump/readelf
Decompile: Ghidra, IDA Free, radare2, cutter
YARA: custom rule
Hash cek: VirusTotal, Hybrid Analysis
Cold-Start Playbook untuk Soal Forensic
Ketika baru buka soal forensic dan belum tahu harus mulai dari mana:
strings file | grep -i "flag\|CTF\|KEY\|secret\|password\|htb"
β Jika hasil positif β Submit flag. Selesai.
exiftool file
β Cek metadata: author, camera, GPS, software, timestamps.
file + binwalk -Me file
β Cek tipe file. Jika archive (zip/tar/gz) β extract.
foremost -T -i file -o output/
β File carving. Cari file tersembunyi.
strings file | grep -E "^[A-Za-z0-9+/]{20,}={0,2}$"
β Cek base64 string dalam file.
hexdump -C file | grep -v "00 00 00" | head -50
β Cek struktur non-null β mungkin ada data anomali.
Metodologi Topikal β Per Kategori
πΉ Web Exploitation
| Step | Tool | Command |
|---|---|---|
| Recon | curl, wget, nmap | curl -v http://target:port |
| Directory busting | dirb/gobuster/dirsearch | gobuster dir -u http://target -w wordlist.txt |
| Parameter fuzzing | ffuf | ffuf -u http://target/FUZZ -w wordlist.txt |
| SQL Injection | sqlmap | sqlmap -u "http://target/?id=1" --batch --dump |
| Cookie/session | dev tools / jwt.io | Baca cookie, decode JWT |
| Source code | view-source: | Cek komentar HTML, JS, hidden input |
| API endpoint | Postman, Burp Suite | Repeater, Intruder |
Checklist Web:
- robots.txt β sering ada endpoint tersembunyi
- .git/config β git exposed (git-dumper)
- /admin, /api, /swagger, /graphql
- parameter pollution (WAF bypass)
- JWT none algorithm attack
- SSTI (Server-Side Template Injection) β {{7*7}}
- LFI/RFI β /../../../../etc/passwd
- File upload β .php, .phtml, .php5, .phar
πΉ Binary Exploitation (PWN)
| Step | Tool | Command |
|---|---|---|
| Cek proteksi | checksec | checksec --file=binary |
| Disassemble | objdump, Ghidra, radare2 | objdump -d binary |
| Find gadgets | ROPgadget | ROPgadget --binary binary |
| Test overflow | Python/pwntools | cyclic(100) β gdb pattern offset |
| Exploit | pwntools | p = remote('host', port) |
Checklist PWN:
- checksec: NX, PIE, RELRO, Stack Canary, ASLR
- Cari fungsi yang terlihat vulnerable (gets, strcpy, sprintf, scanf %s)
- Coba buffer overflow dengan cyclic pattern
- Hitung offset ke RIP/EIP
- ROP chain jika NX enabled
- ret2libc/ret2system jika ada libc leak
- one-gadget jika RCE tujuan
πΉ Cryptography
| Step | Tool | Command |
|---|---|---|
| Auto-detect | CyberChef Magic | Magic recipe β detect otomatis |
| Frequency analysis | quipqiup.com | Substitution cipher solver |
| RSA | RsaCtfTool | python RsaCtfTool.py -n N -e e --uncipher c |
| XOR brute | xortool | xortool cipher.bin |
| Hash identify | hash-identifier | hashid hash.txt |
Checklist Crypto:
- Cek encoding dulu: base64, base32, base16, hex, ascii85
- Cek cipher klasik: Caesar, ROT13, Vigenere, Atbash
- XOR key length β xortool brute
- RSA: small N (factordb), small e (Coppersmith), common modulus
- AES/block cipher: ECB mode (copy-paste block), CBC bit flipping
- Padding oracle attack jika ada endpoint decrypt
- Hash: rainbow table (crackstation.net), google hash
πΉ Reverse Engineering
| Step | Tool | Command |
|---|---|---|
| Metadata | file, strings, exiftool | strings binary | grep -i flag |
| Disassemble | objdump, radare2, Ghidra | objdump -d binary |
| Decompile | Ghidra, IDA Free, cutter | Import binary β decompile |
| Debugger | gdb, x64dbg (Windows) | gdb ./binary |
| .NET/DLL | dnSpy, ILSpy | Buka .NET binary langsung |
Checklist RE:
-
stringsdulu β sering flag langsung ada di string table - Cek fungsi compare/strcmp/strncmp β mungkin flag dibanding langsung
- Trace input/output: coba input berbeda, lihat behavior
- Patch conditional jump (JNZ β JZ) untuk bypass check
- Angry XOR: cari XOR dengan key tertentu, atau auto-XOR brute
- UPX packed?
upx -d
πΉ Digital Forensic
| Step | Tool | Command |
|---|---|---|
| File type | file | file evidence.bin |
| Strings | strings | strings evidence | grep -i flag |
| Disk partisi | mmls (sleuth kit) | mmls disk.dd |
| File listing | fls | fls -o OFFSET disk.dd |
| File content | icat | icat -o OFFSET disk.dd INODE |
| Timeline | plaso/log2timeline | log2timeline --storage timeline.plaso disk.dd |
| Registry | regripper | rip.pl -r SYSTEM -f system |
Checklist Forensic:
- strings dulu β jangan lupa grepping case-insensitive
- binwalk β cek embedded file dalam image
- foremost β file carving mencari file yang dihapus
- $MFT analysis β cari file dihapus, timestamp anomali
- $Recycle.Bin β file apa yang dihapus
- Prefetch β program apa yang pernah dijalankan
- Event Log β login/logoff, service start/stop
- Browser history β apa yang diakses user
- Volume Shadow Copy β file versi sebelumnya (sering luput)
πΉ Attack Defense β Infrastruktur & Hardening
| Step | Tool | Command |
|---|---|---|
| Scan service sendiri | nmap | nmap -p- localhost |
| Cek port listening | netstat/ss | ss -tlnp |
| Cek proses berjalan | ps, htop | ps aux | grep service |
| Patch permission | chmod, chown | chmod 755 /opt/service |
| Firewall | iptables/nftables | iptables -A INPUT -p tcp --dport 8080 -j ACCEPT |
| Monitor | tail, journalctl | tail -f /var/log/service.log |
Checklist Hardening Cepat (menit-menit pertama):
- Non-root user untuk service β jangan jalan sebagai root
- Bind ke localhost dulu β
Listen 127.0.0.1:PORT - Firewall β hanya port yang dibutuhkan
- Rate limiting β
limit_requntuk Nginx - Input validation β semua input = malicious sampai terbukti aman
- Hapus debug mode / verbose error
- Rotate credentials β ganti default password
- Backup binary sebelum patch
- Test checker script β pastikan jalan valid
Time Triage β Strategi Menit ke Menit
Jeopardy (24+ jam)
0β30 menit β Scan semua soal, kategorisasi: easy/hard, cari "first blood"
30β60 menit β Kerjakan semua "easy" soal β 1 soal per 10 menit maks
1β4 jam β Kerjakan soal "medium" β kolaborasi 2 orang per soal jika stuck
4β12 jam β Istirahat 15 menit per 2 jam. Kerjakan "hard"
12β24 jam β Review soal yang di-skip β mungkin ada clue baru dari soal lain
24+ jam β Final push: cari flag fragment, cari unintended solution
Attack-Defense (6β10 jam)
5 menit pertama:
- Scan service sendiri β identifikasi service apa yang jalan
- Patch service sendiri β nonaktifkan debug/endpoint berbahaya
- Cek checker script β pastikan checker lulus
Setiap ronde (30β60 menit):
- 5 menit: scan service lawan β port/service baru?
- 5 menit: cek service sendiri β masih jalan?
- Sisa waktu: attack
Akhir ronde:
- 2 menit: restart service jika crash
- 1 menit: submit flag yang didapat
Incident Response (Live Exercise, 2β5 hari)
Hari 1 β Triage & Containment:
- Identifikasi scope: apa yang terkena, apa yang tidak
- Isolate: disconnect dari network jika lateral movement terdeteksi
- Collect volatile evidence: RAM, network, process (L0-L2)
Hari 2 β Analysis & Eradication:
- Analisis malware/malicious artifact
- Hapus persistence mechanism
- Patch vulnerability yang dieksploitasi
Hari 3 β Recovery & Lessons Learned:
- Restore service dari backup bersih
- Monitoring post-recovery β apakah attacker kembali?
- Dokumentasi timeline + TTP untuk laporan
Teamwork & Komunikasi
Communication Protocol (dalam tim)
| Situasi | What to Say | What NOT to Say |
|---|---|---|
| Stuck di soal >30 menit | βSaya stuck di X, butuh bantuan Y" | "Ini susah bangetβ |
| Ada clue baru | βDi soal Z ada clue: β¦β | (diam saja) |
| First blood | βSoal X solved, flag di spreadsheet" | "Gampang kaliβ |
| Service down (A/D) | βService Y down, restartingβ¦" | "Waduh kacauβ |
| Dapet flag besar | βFlag X dapet, submit yaβ | (langsung submit tanpa info tim) |
Shared Resources
Tim harus punya satu spreadsheet bersama (Google Sheets / Notion) dengan:
| Soal | Kategori | Points | Status | Assigned | Notes |
|---|---|---|---|---|---|
| Forensic 1 | Forensics | 100 | β Solved | Alice | strings β base64 decode |
| Web 1 | Web | 200 | π΄ Stuck | Bob | SQL injection butuh bypass WAF |
| Crypto 1 | Crypto | 300 | βΈοΈ Skipped | β | RSA, N besar β factordb? |
Format flag:
flag{nama_soal_flag}
Tools Prioritization β Fallback Chain
Untuk setiap kategori, punya 3 tier tool:
| Tier | Arti | Contoh |
|---|---|---|
| Tier 1 | Default β langsung jalan | CyberChef, strings, file, exiftool, nmap |
| Tier 2 | Spesifik β butuh setup minimal | Volatility, Ghidra, foremost, sqlmap |
| Tier 3 | Advanced β butuh waktu setup | Plaso, custom script, IDA Pro |
Aturan: Jika Tier 1 gagal, jangan langsung Tier 3 β coba Tier 2 dulu untuk 15 menit. Jika masih gagal, baru Tier 3.
Tool Fallback per Kategori
Forensics: exiftool β strings β foremost β binwalk β Volatility 3 β plaso Web: curl β nmap β gobuster β sqlmap β Burp Suite PWN: checksec β objdump β gdb β pwntools β ROPgadget Crypto: CyberChef Magic β hash-identifier β xortool β RsaCtfTool RE: strings β file β objdump β Ghidra β gdb
Post-Mortem & Knowledge Base
Setelah Kompetisi Selesai
Dalam 24 jam setelah kompetisi, lakukan writeup:
- Tulis setiap soal yang solved β langkah, tool, command, flag
- Tulis setiap soal yang NOT solved β analisis: kurang tool? waktu? skill?
- Simpan attachment soal β karena biasanya ditutup setelah event
- Catat insight unik β mis: βdi soal forensic ternyata ada hidden NTFS streamβ
Writeup Template
# [Nama Kompetisi] β [Soal Nama]
**Kategori:** [Forensic / Web / PWN / Crypto / RE / Misc]
**Points:** [100]
**Status:** β
Solved | β Not Solved
## Deskripsi Soal
[Copy paste deskripsi dari soal]
## Attachment
[Path ke attachment yang disimpan]
## Solusi
### Langkah 1: ...
Command: `...`
Output: `...`
### Langkah 2: ...
...
## Flagflag{β¦}
## Key Takeaway
[Apa yang dipelajari dari soal ini]
Knowledge Base dari Writeup
Kumpulkan writeup di folder 03_Resources/[nama-event]/. Link ke ctf-tool-arsenal-universal jika ada tool baru yang dipelajari. Update tool arsenal jika ada tool yang ternyata berguna.
Yang wajib dicatat:
- Command yang berhasil β jangan lupa flag path
- Tool version β tool update bisa ubah behavior
- One-liner yang berguna β untuk reuse di event berikutnya
Quick Reference β One-Liners Penting
# Cari flag dalam semua file
grep -r "CTF{" .
# Cari string base64: minimal 32 char, alphanumeric
strings file | grep -E "^[A-Za-z0-9+/]{32,}={0,2}$"
# Cek magic bytes file
xxd file | head -1
# Extract semua string ASCII printable
strings -n 6 file
# Carving dengan foremost
foremost -T -i file -o output/
# Binwalk extract semua embedded file
binwalk -Me file
# Volatility 3: cari process anomali
python3 vol.py -f memory.dump windows.psscan
# Ekstrak file dari PCAP HTTP
tshark -r capture.pcap --export-objects http,output/Cross-Link
- Hierarchy Level Kompetisi β hierarchy-ctf-competition-framework
- Attack-Defense Range β hierarchy-cyber-range-adversary-emulation
- Digital Evidence Acquisition β hierarchy-digital-evidence-acquisition
- Tool Arsenal Lengkap β ctf-tool-arsenal-universal
- PicoCTF Beginner Guide β picoctf-master-index
- Master Index β master-index
CTF Methodology & Strategy Β· Universal β tidak terikat event Β· Triage > Brute Force Β· Team Communication = Force Multiplier