Writeup library

CTF writeups, step by step.

19 solved challenges from 10 capture the flag competitions, each written up with the reasoning that led to the flag, plus guides to the events themselves.

19writeups
3crypto
7forensics
1misc
2pwn
3reverse
3web

Every writeup here follows the same four moves: inspect what the task gives you, form a hypothesis, test it cheaply, then solve. The interesting part is rarely the final script. It is the moment a byte pattern, an odd string in a binary or a strange server response told the solver where to look, and the wrong turns taken before that. Those are kept in.

The challenges come from well-known jeopardy events of 2016 and 2017, including TokyoWesterns/MMA, TUM CTF, WhiteHat Contest, Insomni'hack, CTFZone, EKOPARTY and Backdoor CTF. Filter by category below, or start with the forensics tasks if binary visualization is what brought you here: several of them are solved by looking at the data before reading it.

ASIS CTF Finals 2017

ASIS CTF Finals 2017: If He Finds Out, a Broken HEIF Image

The file command calls it data, yet the first bytes spell out a HEIF container. Comparing it with a known-good HEIC sample shows exactly four missing bytes and one overwritten brand list.

Forensics343 pts
BITSCTF 2017

BITSCTF 2017 fanfie: Breaking an Affine Cipher on a Base32 Flag

A 34-character base32 string is the flag after a substitution on its alphabet. The known prefix BITSCTF{ gives enough letter pairs to see that the substitution is a linear map modulo 32.

Crypto20 pts
CTFZone 2017

CTFZone 2017 Decrypt the Undecryptable: Recovering a BMP from AES-CFB

An encrypted bitmap still shows its outline, because the cipher restarts every 128 bytes with a zero IV. The most common ciphertext chunk is the keystream, and XORing with it reveals the picture.

Crypto724 pts
EKOPARTY CTF 2017

EKOPARTY CTF 2017 Silk Road: when a login trusts its backend too much

Silk Road was a 496-point web task behind a Tor hidden service. The login looked closed, yet the weakness sat in how the front end called its own SOAP backend and how much it believed the answers.

Web496 pts
EKOPARTY CTF 2017

EKOPARTY CTF 2017 SlowShell: reading a PHP app from its HHVM repo file

SlowShell was a 498-point web and reverse task that only two teams solved. The source was compiled away, yet the deployment served its own compiled repository, and the login logic had a search space of ten thousand.

Web498 pts
Backdoor CTF 2016

Backdoor CTF 2016 CRC: Recovering Text from Zip CRC32 Checksums

Twenty-seven password-protected zip files each hold a tiny text fragment. The passwords are never needed: the CRC32 stored in every header leaks enough to rebuild a PHP script.

Crypto250 pts
Backdoor CTF 2016

Backdoor CTF 2016 Lossless: data hidden in a PNG pixel difference

Two PNG files look the same to the eye. Subtracting them reveals a small block of pixels whose values differ by one, and that block is a 7-bit ASCII message.

Forensics100 pts
Backdoor CTF 2016

Backdoor CTF 2016 DTune: Decoding a DTMF Recording into Text

A short audio recording turns out to be a vault keypad session. Each tone is a DTMF digit, and runs of the same digit spell letters the way old mobile phones did.

Forensics70 pts
TokyoWesterns/MMA CTF 2nd 2016

Deadnas: rebuilding a crashed RAID-5 NAS from two disk images

Three disk images, one of them a 12-byte note saying it crashed. XOR restores the missing disk, the FAT12 boot sector reveals the block order, and a short loop reassembles a mountable volume.

Forensics50 ptsEasy
TokyoWesterns/MMA CTF 2nd 2016

Defective RAID: recovering files when two of five disks are gone

Five disk images, two missing, and a Ruby emulator whose second parity is not quite RAID-6. The recovery needs the algebra of the parity code, a collision search and a heuristic for picking the likely candidate.

Forensics300 ptsHard
TokyoWesterns/MMA CTF 2nd 2016

Ninth: finding extra data inside a PNG's compressed stream

A PNG that opens as a normal picture but decompresses to about a million bytes more than its pixels need. Counting scanline bytes against the zlib output exposes the hidden tail.

Misc100 pts
TUCTF 2016

TUCTF 2016 The Nack: Rebuilding a GIF from TCP SYN Payloads

A packet capture of failed connections looks empty until each SYN turns out to carry payload. Stripping a five-byte marker and joining the rest produces an animated GIF with the flag in one frame.

Forensics100 pts
TUM CTF 2016

boot2brainfuck: DOS shellcode through a Brainfuck compiler service

The service turns submitted Brainfuck into a running DOS program on a freshly booted virtual machine. Locating the compiled code in memory and overwriting a jump with real shellcode reads the flag off disk.

Pwn150 pts
TUM CTF 2016

Zwiebel, TUM CTF 2016: an ELF that decrypts itself layer by layer

Zwiebel checks a key one character and one bit at a time, each check wrapped in its own layer of XOR-encrypted code. Getting the flag means automating gdb rather than stepping through it by hand.

Reverse50 pts
WhiteHat Contest 11

WhiteHat Contest 11 RE1: a fork-and-pipe crackme with a shuffled key

RE1 hides a plain string comparison behind fork(), two pipes and ptrace checks. Once the control flow is split into parent and child, the whole task reduces to undoing one block permutation.

Reverse100 pts
WhiteHat Contest 11

WYGINWYS (WhiteHat Contest 11): recovering a deleted NTFS script

The disk image holds one visible file of random-looking data. The key to it is a deleted Python bytecode file that ntfsundelete can bring back, and a hand-rolled RSA scheme that must be reversed chunk by chunk.

Forensics200 pts
WhiteHat Contest 11

WhiteHat Contest 11 RE3: recovering Python from a py2exe executable

RE3 ships a Windows executable that crashes with a Python traceback. That traceback gives the task away: the program is bundled Python 2, and the rest is decompilation and a factoring exercise.

Reverse100 pts
WhiteHat Contest 11

Zozo walkthrough: a signal handler overflow to a return-to-libc shell

Zozo gives remote shell access to a limited account and one SGID binary. The binary's SIGINT handler decodes a name field into a fixed buffer with no bounds check, which opens the door to a classic return-to-libc.

Pwn100 pts

An XSS in Rocket.Chat's markdown parser via nested code and images

Rocket.Chat parsed inline code and image-link markdown as separate passes. Nesting one inside the other let an href value escape its attribute, opening a path to session-stealing script injection.

Web

About these writeups

What is a CTF writeup?

A writeup is a solution report for one capture the flag challenge: what the task provided, how the solver worked out what was going on, the dead ends, the decisive idea and how the flag was recovered. Good writeups keep the reasoning, not just the final script, so a reader can apply the same approach to a different challenge.

Are these challenges still playable?

Most CTF infrastructure goes offline after the event, so the live services from 2016 and 2017 are gone. Many organizers publish the challenge files afterwards, and archives such as the CTFtime task pages and community repositories keep copies. Reverse engineering, forensics and crypto tasks are usually the easiest to replay because they only need the original files.

Which category should a beginner read first?

Forensics and crypto writeups are the gentlest start. They need patience and careful reading of file formats more than deep knowledge of memory corruption. Reverse engineering comes next, and binary exploitation (pwn) builds on both. The CTF guide suggests a first-month reading order.

How are difficulty and points shown?

Points are shown when the event published them. Most jeopardy CTFs use dynamic scoring, where a task loses value as more teams solve it, so points are a rough guide to difficulty at best. Where no reliable value exists, the card shows only the category.

New to capture the flag? Formats, teams and a first-month plan in one place.

Read the CTF guide