Capture the flag (CTF) and legal places to practise ethical hacking
In short: Capture the flag (CTF) events are legal hacking challenges where you find hidden text strings called flags. Challenges cover web, crypto, forensics, reverse engineering and exploitation. Training platforms such as TryHackMe, Hack The Box, PortSwigger Web Security Academy, OverTheWire and picoCTF let you practise legally and build a portfolio.
What is a capture the flag (CTF)?
A capture the flag competition is a set of security puzzles. Each challenge hides a piece of text called a flag, often in a format like flag{...}. You find it by solving the problem, then submit it for points. CTFs are legal because the organisers build the targets on purpose and give everyone permission to attack them. They are one of the best ways to turn reading into real skill, and employers often value them.
Jeopardy and attack-defence CTFs
- Jeopardy-style CTFs have a board of separate challenges in categories, each worth points. Most beginner events use this format.
- Attack-defence CTFs give each team its own servers to protect while attacking other teams' servers. They are fast-moving and better suited to experienced teams.
Many events are online and free, run over a weekend, and welcome teams of all levels. School and university events such as picoCTF are aimed at beginners.
Legal practice platforms
| Platform | Good for |
|---|---|
| TryHackMe | Guided, beginner-friendly "rooms" that run in the browser |
| Hack The Box | Vulnerable machines and an academy, from easy to very hard |
| PortSwigger Web Security Academy | Free, high-quality web application security labs |
| OverTheWire | Linux command line and basic security wargames (start with Bandit) |
| picoCTF | A free, beginner-level CTF with a large practice archive |
These platforms give you explicit permission to attack their targets. That permission does not extend to anything else. Testing real websites or networks without authorisation is illegal (see ethics, law and scope).
A practice path and portfolio
Write short write-ups of challenges you solve, explaining your thinking and how a defender would fix the problem. Publish them only after an event ends, or for retired challenges, because many platforms ban spoilers for active content. A small collection of clear write-ups shows employers how you think, which is often more convincing than a list of tools on a CV.
Real-world example: from help desk to junior analyst
A fictional help desk technician spends three evenings a week on guided rooms for six months, then joins a beginner CTF team. He focuses on forensics and web challenges and writes up ten solved challenges on a simple blog, each ending with "how to defend against this". At an interview for a junior security analyst role, the panel asks him to walk through one write-up. He explains the packet capture he analysed and the alert rule that would have caught it. He gets the job, and the hiring manager later says the write-ups made the difference.
Practice
What is a flag in a CTF?
How is an attack-defence CTF different from a jeopardy CTF?
Why should you avoid publishing write-ups for active challenges?
Key takeaways
- CTFs are legal hacking challenges where you find hidden flags.
- Jeopardy CTFs suit beginners; attack-defence CTFs suit experienced teams.
- Platforms such as TryHackMe, Hack The Box and PortSwigger Academy give permission to practise.
- Permission covers only the platform's own targets, never real systems.
- Write-ups that explain fixes build a strong portfolio.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.