How to prepare for your first CTF competition
By Vikram · Updated 4 Dec 2026
A CTF (capture the flag) competition hides secret codes, called flags, inside deliberately vulnerable websites, files and programs. You find each flag by solving a security problem and submit it as proof. You don't need to be an expert to start: you need a working setup, the basics of a few categories, and practice on real challenges.
What happens in a CTF
Most CTFs give you a set of challenges in categories such as web, crypto, forensics, reversing and pwn, each worth points. Others, like the CyberSec Hackathon, give every team one long mission where each stage's flag unlocks the next. A flag usually looks like H4H{some_text}, and you submit it exactly as found.
| Category | What you do | Learn first |
|---|---|---|
| Web | Find and exploit bugs in a web app | HTTP requests, cookies, SQL injection, SSRF, Burp Suite |
| Crypto | Break weak or home-made encryption | XOR, base64, hashes, how RSA and AES are misused |
| Forensics | Dig through files, network captures and disk or memory images | file types, Wireshark, strings, git internals, Volatility |
| Reversing | Work out what a program does without its source | Assembly basics, Ghidra, a debugger |
| Pwn | Exploit memory bugs in a binary | Stack layout, buffer overflows, pwntools |
| OSINT | Find answers in public information | Search operators, metadata, archives |
Set up your machine
- Linux: Ubuntu or Kali, as your main system, under WSL on Windows, or in a virtual machine.
- Web: your browser's developer tools, curl, and Burp Suite Community or OWASP ZAP to see and change requests.
- Scripting: Python 3 with requests and pwntools. Most solves end with a short script.
- Files: git, binwalk, exiftool, strings, xxd and Wireshark.
- Reversing: Ghidra (free) and gdb with a plugin such as pwndbg.
- Crypto: CyberChef in the browser for quick decoding.
Tip: Install and test everything before the CTF starts. Losing the first hour to a broken setup is the most common beginner mistake.
A 2-week practice plan
- Days 1–3, web: learn how HTTP requests, cookies and sessions work, then solve beginner web challenges on free practice sites. Get comfortable intercepting requests in Burp Suite.
- Days 4–5, git and files: learn how git stores history (objects, commits, the reflog) and how to recover deleted files. Practise spotting what a file really is with file and binwalk.
- Days 6–7, crypto: XOR, encodings and the classic mistakes: reusing a key, rolling your own scheme, checksums used instead of real signatures.
- Days 8–10, reversing: open small programs in Ghidra, find the main function and follow how input is checked.
- Days 11–12, forensics: packet captures in Wireshark and a first memory image with Volatility.
- Days 13–14, a full practice CTF: play an old CTF with a timer, as a team, and write up every solve.
How to play on the day
- Read everything first. In a mission-style CTF, every clue you need is hidden in what you already found.
- Split the work by skill, but share every finding in one team channel.
- Keep notes as you go: commands, URLs, screenshots. They become your write-up.
- Don't brute force. Most CTFs rate-limit requests, and the answer is almost never "try a million passwords".
- Stay in scope. Only attack the targets the organizers list. Attacking anything else is illegal and gets you disqualified.
Write a write-up that scores
Many CTFs, including judged ones on Hack4Hack, score your write-up as well as your flags. For each challenge or stage, write:
- What you found and where.
- The steps, in order, with the exact commands, requests or code.
- Why it worked: the underlying weakness, in one or two sentences.
- The flag, and how someone else could repeat the solve.
Screenshots help; walls of unexplained output don't. Can someone who wasn't there follow your write-up and get the same flag? Then it's a good one.
Find a CTF to play
See the current CTF competitions and cybersecurity hackathons on Hack4Hack, with dates, prizes and how teams are ranked.
Frequently asked questions
Can a complete beginner play a CTF?
Yes. Most CTFs have beginner-friendly challenges or stages. Learn basic Linux, HTTP and Python, install the tools, and practise for two weeks before your first event.
Do I need to know programming for a CTF?
Basic Python helps a lot: most solves end with a short script to send requests, decode data or automate a step. You don't need to be a software engineer.
Is CTF the same as ethical hacking?
A CTF is a legal practice ground for ethical hacking skills: you attack only systems built for the contest, with permission. Attacking real systems without permission is illegal.
Can I use AI tools in a CTF?
It depends on the rules of each CTF. Where AI is allowed, it helps with scripts and research, but judged CTFs also check that your team understands and can explain every step.
What is a CTF write-up?
A document explaining how you solved each challenge: what you found, the steps and commands, why it worked and the flag. Judged CTFs score it alongside the flags.