How to write a write-up CTF: template and mistakes part 1

Depov

Moderator
Staff member
MODERATOR
ULTIMATE
SUPREME
PREMIUM
MEMBER
Joined
Feb 18, 2025
Messages
790
Reaction score
1,484
Why write a write-up if the problem is already solved

By the time you finish a CTF task, your brain has already moved on to the next one. Writing down your solution seems like a waste of time—you already remember everything. A week later, you remember half of it. A month later, you remember the name of the tool and the feeling that "it wasn't hard." Documenting a CTF task doesn't capture the answer, but the method: why the third of five hypotheses worked, while the other four didn't. For more details, see our review of creating CTF tasks.

Writing-up is not a personal diary. A high-quality analysis of a CTF task works in three directions at once.

A personal knowledge base. CTF problems follow patterns: heap overflow may look different at one competition, but it's exploited using the same technique as at the previous one. A personalized, written-up guide is the fastest, because it's written in your language and context. When you encounter a similar format string bug three months later, you can open your own text instead of googling it from scratch.

Contribution to the community. The official write-up from the problem authors shows the intended path—one, usually the most direct, route to the flag. Your path may be more convoluted, but it demonstrates alternative approaches. According to ctf7.com, unintended solutions are one of the most valuable parts of CTF culture : thinking in information security is nonlinear. Your "curved" path may prove to be a breakthrough in someone else's understanding of an entire class of vulnerabilities.

Portfolio. The line "familiar with reverse engineering" on a resume is just empty words. A link to a write-up where you step-by-step analyze an obfuscated binary in Ghidra, explaining each solution, is proof. Employers don't see a grade, but a process: how you think, how you overcome dead ends, and how you explain complex issues in simple terms.
Notes during CTF are the foundation of good writing.

The biggest mistake when attempting to write a CTF is doing it from memory after the competition. After 48 hours of sleepless marathon, you won't remember which payload worked on the third attempt or why the first two failed. The terminal history will show the commands, but it won't explain why you ran them.

CTF methodology that really saves time: start a separate .md-a file for each task right when the task is opened. Not a clean copy, but a draft. Here's what goes in there:

Screenshots —everything: the task interface, command output, error messages, hints from the organizers. You can never have too many screenshots. Deleting unnecessary ones while writing a write-up takes seconds; restoring an undone one is impossible. Keyboard shortcuts for screenshots without switching from the solution context are everything.

Commands and payloads are copy-pasted from the terminal. Don't rely on bash_history: it won't save the context of what order and why you tried each command, and it won't show the output.

Hypotheses and dead ends —one or two sentences: "I thought it was XSS via POST, tried it in the username field—it's filtered; switched to SQLi." It's these dead ends that later transform a write-up from a set of commands into a story with a methodology.

Timestamps are not necessarily per-second, but "at 02:30 we found the vector, at 03:15 we received the flag" help us to reconstruct the sequence and logic of transitions between hypotheses when writing.

Correspond with teammates —if a colleague suggests an idea or discovers a key detail, document it. This is necessary both for credits in the final text and for restoring the logic of the solution.

Tools—any, as long as they're familiar. Obsidian, VS Code with Markdown preview, Cherry Tree, vimin a nearby terminal. Some teams take notes directly in a shared Markdown document on GitHub, so the draft is immediately accessible to all participants. The key is that the file exists before the solution is created, not after.

From experience: if you take notes during a CTF, 70% of the writing will write itself. All that's left is to polish the structure and add a "why" explanation for each step.
Write-up CTF Structure: What to Include and in What Order

For beginners, CTF writing often feels like a stream of consciousness—from the first click to the flag, without any breakdown. Experienced readers are wired differently: they first scan the text with their eyes—TL;DR, headings, code blocks—and only then dive deeper if the topic is relevant. The structure of the writing should support both scenarios: quick scanning and deep reading.
Metadata and TL;DR

Start with a metadata table: CTF title, challenge title, category (web, crypto, pwn, reverse, forensics, misc), points, date, nickname, and team. If the organizers specified the challenge's author, add it. If the points are dynamic, mark it. The header allows the reader to determine in three seconds whether they should continue reading: the category matches their interests, the difficulty level is appropriate, and the CTF is familiar.

Next comes the TL;DR: one or two sentences about the vulnerability and the key insight. "The flag was in the JPEG's EXIF comment in base64 format—a metadata check before using stego tools found it in one command" is the TL;DR. "An interesting forensic task, solved quickly" is not. Paradoxically, the TL;DR is written last (once you understand the key insight), but it's placed first. This is one of the most useful techniques for presenting a CTF solution—many readers won't go beyond the TL;DR, and even then they'll find value.
Task description and first look

Insert the task description verbatim, as it was given in the CTF. Wrap it in a quotation ( >) to visually separate the original text from yours. If files were attached, provide their names and hashes (SHA256). If the task is network-related, provide the address and port, with a note that the infrastructure is already disabled.

Next is a "first look": what I checked first and why. This isn't a recap of the steps, but a demonstration of the methodology. "The file was identified as a JPEG with EXIF, stringsshowed a long base64 string at the beginning of the file—where metadata usually lives. The metadata became the first hypothesis." The reader sees not just "I ran strings," but a cause-and-effect relationship: what I observed → what conclusion I made → where I went next.
Dead ends are the most underrated part of writing.

Dead ends are what separate a useful write-up from a useless one. And what almost all beginners discard. Dead ends reveal which obvious ideas don't work and why. A beginner stumbling upon a similar problem would save hours if they saw: "steghide with an empty password is empty, there's no password hint, so steganography is unlikely."

Format: one or two lines per dead end. Idea → what you tried → why you discarded it. Don't spend a paragraph describing each dead end—it's tedious. But don't hide them either: without dead ends, a write-up reads as if the author knew the answer from the very first second. This is unrealistic and useless. According to ctf7.com, dead ends are "the most underrated part of a write-up ." I completely agree: it's dead ends that teach triage—the ability to quickly discard unworkable hypotheses.
Step-by-step solution

The core of write-up. Each step is built on the formula: why → what you did → what you saw → what it means . Commands without context teach nothing. Before each block of code, there's a single sentence explaining what you expect to see. After, there's what you actually got and what conclusion you drew. The reader will be able to reuse this chain of reasoning, even when your specific commands aren't relevant to their task.

Code should be minimal: only what is needed to reproduce the solution. Comments should be about the "why," not the "what." Line # сервер переиспользует nonce, поэтому keystream повторяетсяMore valuable than ten lines without commentary. Subheadings for the steps—"Step 1: Extracting Metadata," "Step 2: Decoding Base64"—allow the reader to jump to the desired location without reading the entire text.

If the solution requires a script, show it in full, but only if it's short and commented. Longer scripts are best placed in a separate repository and linked. Don't forget to use placeholders instead of actual URLs: chal.example.lab:31337instead of an IP that no longer works.
Flag, conclusions and thanks

Flag – one line in the backticks. If the organizers ask not to publish it, write "flag hidden at the request of the organizers" and briefly describe the format.

Lessons learned – two or three points: what you'll check first next time, what tool or technique you learned, and what was a turning point. This section seems formal, but it's what makes the writing-up useful for you six months later: you don't need to reread the entire text to recall the gist.

Acknowledgments – mention the problem's author (if the organizers provided a name), teammates whose ideas helped, and links to articles or other people's write-ups that suggested the key trick. This requires zero effort, but it supports a culture of openness in the community.
 
Top Bottom