Free tech learning for everyone, from basics to pro

Ethical HackingCyber SecurityBeginner

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.

Types of capture the flag challengeCTF challengesfind the hidden flagWebapps and APIsCryptocodes andciphersForensicsfiles andpacketsReverseengineeringhow a programworksPwnexploitingprograms
Figure 1. Jeopardy-style CTFs group challenges by category, so you can start with the areas you know.

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

PlatformGood for
TryHackMeGuided, beginner-friendly "rooms" that run in the browser
Hack The BoxVulnerable machines and an academy, from easy to very hard
PortSwigger Web Security AcademyFree, high-quality web application security labs
OverTheWireLinux command line and basic security wargames (start with Bandit)
picoCTFA 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

A practice path for beginnersLinux andnetworkingthe basicsGuided roomsstep-by-steplabsBeginner CTFseasychallengesHarder boxesless guidanceWrite-upsshare what youlearnt
Figure 2. Move to less guidance only when the easier level feels comfortable.

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?
A hidden piece of text, often in a format like flag{...}, that proves you solved the challenge.
How is an attack-defence CTF different from a jeopardy CTF?
In attack-defence, teams defend their own servers while attacking others; jeopardy has separate challenges by category for points.
Why should you avoid publishing write-ups for active challenges?
Many platforms ban spoilers for live content, and publishing early spoils the challenge for others.

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.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

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.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: