The training method behind a top Chinese CTF team: Part 1 overview

CTF · Part 1

A CTF finals competition hall

I recently came across the book “Handbook for CTFers”, written by Nu1L, one of China's strongest CTF teams (CTFtime). Nu1L has run its own contest, N1CTF, every year since 2018 and reached the DEF CON CTF finals in August 2021, placing seventh (results). The book collects the material the team trains its own members with, so you see what a top team expects you to know, and in what order. I will cover key chapters over the next few posts.

Summary

If you are just starting in CTF, go deep in one category before you try to cover everything. Learn the basics first. That means programming, assembly, and how a computer runs your code. Solve real challenges instead of watching tutorials, and after each one write down what tricked you. Do that for a year and you will be ahead of most people who only collect writeups.

CTF is the cheapest and fastest way into offensive security, and the skills that win a flag are the same ones that find real bugs and land real jobs. The teams at the top of DEF CON are not smarter than you. They started earlier, trained harder, and wrote down their mistakes. You can do the same. Open a lab, fail at it, and learn why.

The series

This is a seven-part series, one per area of the book. Read it in order, or jump straight to the part you want.

  1. Overview (this part). What the book is, how it trains, and the lessons that run through every category.
  2. Web. Recon, SQL injection, file read, SSRF, command execution, deserialization, and template injection.
  3. Reverse engineering and PWN. Reading binaries, then stack overflows, ROP, format strings, the heap, and the kernel.
  4. Cryptography. Encoding, classical ciphers, symmetric attacks, and the named RSA attacks.
  5. Forensics and misc. Steganography, encrypted archives, and traffic, memory, and disk forensics.
  6. The finals. Code auditing, attack and defence, and full network penetration testing.
  7. Smart contracts. Ethereum and Solidity bugs, from broken access control to reentrancy.

Content

The book splits into two halves. The first is the online qualifier, where you solve isolated challenges by category. The second is the finals, where teams attack and defend live services and run full network pentests.

#ChapterMain attack vectorsTools
1Introduction to the WebRecon, SQL injection, arbitrary file readGitHacker, dirsearch
2Advanced WebSSRF to code execution, command injection, XSS and CSP bypass, file upload bypassGopherus, Burp Suite
3Advanced Web ChallengesPHP object injection, Python sandbox escape, template injection, padding oraclephpggc, Python
4APKAndroid reversing, anti-debug bypass, unpackingJEB, jadx, Frida
5Reverse EngineeringStatic and dynamic analysis, obfuscation, symbolic executionIDA, Ghidra, angr, Pin
6PWNStack overflow, ROP, format string, heap, kernel exploitationpwntools, GDB, ROPgadget
7CryptoClassical, block and stream ciphers, RSA attacksSageMath, gmpy2
8Smart ContractsEthereum and Solidity bugs, EVM storage layoutRemix, web3.py
9MiscSteganography, USB keystroke recovery, memory and disk forensicsVolatility, Wireshark, binwalk
10Code AuditingPHP and Java source review, deserialization chainsysoserial, IntelliJ IDEA
11AWDPatch your services, exploit everyone else's, covert persistencepwntools, custom scripts
12Penetration TestPivoting, Windows exploits, credential theft, Active Directory attacksMetasploit, mimikatz, nmap

Methodology

Every technique follows the same four steps:

  1. Principle. Why the bug exists.
  2. Tools. The exact command to run.
  3. A real challenge from a named competition, solved end to end.
  4. Personal experience. What trips people up in practice.

The fourth step is the one you cannot get from a manual. One author backs up a competition database, then cannot prove the service still works, because he changed the database password during the backup. His service is marked down and he loses points. The lesson, back up the database and not just the source, is now in print.

The main lessons

1. Fundamentals beat tricks. Learn to program, read assembly, and understand how a computer runs your code before you chase exploits. The book even teaches reverse engineering before PWN, because you cannot exploit what you cannot read.

2. Train for the real job. The techniques map straight onto real attacks. The final chapter chains a web break-in, pivoting, credential theft and an Active Directory takeover into one full compromise.

3. Winning is preparation. Top teams walk into the finals with exploits, backups and scripts already built. The match rewards the work you did before it started.

Prepare for CTF with CyberLearner

Many of the topics covered by the book can be practised on CyberLearner for free.

  • Web. GateCrasher (JWT plus SQL injection), PathProwler (path traversal), HostTrick (header bypass), ForgeX (template injection), BahCoin (SQL injection plus .git recovery).
  • Reverse engineering. The RE series: XOR, anti-debug, packed binaries, custom virtual machines, WebAssembly, ARM firmware, stripped Rust.
  • PWN. StackSmash (stack overflow), RetropWn (return-to-libc), BakuWind (format string).
  • Crypto. Sentinel (Wiener's RSA attack), Courier (Fermat factorisation), Blackbox (token brute force into AES).
  • Forensics. Intercept (audio spectrogram), WireTap (VoIP stego), VolShadow (memory), DiskShadow (disk).

Browse the full set on the challenges page.

Next

Part 2 covers web security in detail: Part 2: web attacks.

Sources


TopicsCTFCapture the flagTrainingOffensive security
Share this article LinkedIn X Facebook Email
← Back to all posts