You practice ethical hacking legally by testing only systems you own, systems in a lab built for testing, or systems whose owner gave you written permission with a defined scope. Free legal targets include TryHackMe, Hack The Box, PortSwigger Web Security Academy, OWASP Juice Shop and bug bounty programs. Testing any other system without permission is a crime in most countries, even if you mean no harm and find nothing.
Key takeaways
- Ethical hacking is legal only with written authorization, your own systems, or a platform built for practice.
- Free legal labs include TryHackMe, Hack The Box, PortSwigger Web Security Academy and OWASP Juice Shop.
- Bug bounties are the bridge to real systems, but only inside the program's published scope.
Ethical hacking looks like breaking into things. The difference between a career and a criminal record is one document: permission. Everything in this guide stays on the legal side of that line — labs built to be attacked, a home lab you own, and bug bounty programs that invite you in.
Is it legal to practice ethical hacking?
Yes, when you test systems you own, systems in a lab built for testing, or systems whose owner gave you written permission with a defined scope. Testing anything else without permission is a crime in most countries, even if you mean no harm.
The rule is simple and does not bend: only test systems you own or are explicitly authorized to test. Curiosity is not permission, a system being publicly reachable is not permission, and a system being insecure is not permission. In the US, unauthorized access falls under the Computer Fraud and Abuse Act; in the UK it is the Computer Misuse Act, and most other countries have an equivalent law.
Written permission means a signed document naming the systems, the dates and the techniques allowed. Verbal approval from someone without authority to give it protects nobody. Bug bounty programs are the one exception that proves the rule: the company publishes a scope that invites testing on specific assets, and that invitation is the authorization.
Where can you practice ethical hacking legally?
You have four legal places to practice: guided lab platforms, capture-the-flag competitions, deliberately vulnerable apps you run yourself, and scoped bug bounty programs. All four exist precisely so you never need to touch a system you do not own.
Guided labs are the best starting point. They give you a target, hints and a walkthrough when you are stuck, and the permission is built into the platform. Capture-the-flag events are puzzle-style challenges where finding a hidden flag by solving a security problem is the whole point, so you are always in bounds.
| Legal practice option | Best for | Cost | What you attack |
|---|---|---|---|
| TryHackMe | Complete beginners | Free tier; paid rooms | Guided browser-based labs |
| Hack The Box | Intermediate learners | Free tier; paid labs | Realistic machines, less guidance |
| PortSwigger Web Security Academy | Web security | Free | Interactive labs on deliberately vulnerable sites |
| OWASP Juice Shop | Web app flaws, self-paced | Free, open source | A deliberately insecure shop app you run locally |
| OverTheWire | Linux and command line | Free | Command-line wargames |
| Bug bounty programs | Real targets, real reports | Free to join; you get paid for valid bugs | In-scope assets only, per program rules |
| Your own home lab | Full control, any tool | Free software; your hardware | Virtual machines you own |
Which free labs should you start with?
Start with TryHackMe if you are brand new. Its structured learning paths hold your hand through networking, Linux and the first attacks, and its rooms run in the browser so you do not need to install anything. Move to Hack The Box once you can work independently: it is harder, less guided and closer to real engagements, and working through retired machines with a published writeup beside you is one of the fastest ways to learn.
For web security specifically, the PortSwigger Web Security Academy is free and is the best web application security training available anywhere. It covers SQL injection, cross-site scripting, authentication flaws and more, each with interactive labs on deliberately vulnerable websites, and the labs are designed to be solved with Burp Suite Community Edition, which is also free. Burp Suite Professional, the paid version, costs $499 per user per year as of November 2026 — but you do not need it to start.
OverTheWire's free command-line wargames build Linux fluency fast, which matters because most targets you will meet run Linux. And for capture-the-flag events, picoCTF is aimed at beginners and runs archived challenges year-round. Pick one platform, finish a full learning path on it, and only then add a second.
How do you build a legal home hacking lab?
A home lab gives you complete freedom: a couple of virtual machines on your own hardware, a deliberately vulnerable target, and an attacker machine. If you own the environment, you are free to break it as much as you want.
Install VirtualBox, which is free virtualization software, on your computer. Then install Kali Linux, the standard operating system for security testing, as your attacker machine — download the ready-made VirtualBox image from the Kali website. For a target, install Metasploitable, a deliberately vulnerable Linux machine built to be attacked, and OWASP Juice Shop, a deliberately insecure web application that covers vulnerabilities from the entire OWASP Top Ten. Juice Shop runs from a Docker image with two commands, as described in the OWASP Developer Guide.
Keep the lab isolated. Put the virtual machines on a host-only network in VirtualBox so lab traffic cannot reach your home network or the internet, and never point lab tools at your router, your ISP or any device you do not own. Take snapshots before each experiment so you can reset a broken target in seconds.
Segmenting the lab matters for the same reason it matters at home: our guide to securing your Wi-Fi explains how to keep lab traffic away from your main network.
What skills do you need first?
Start with foundations, not tools. Three areas carry most of the weight: networking, Linux and web basics. Learn how IP addressing, DNS, TCP and UDP, ports, routing and HTTP work before you run a scanner, because a tool's output is meaningless if you cannot read what the network is doing.
Then get comfortable on the Linux command line and learn a little scripting, usually Python or Bash, so you can automate repetitive tasks and understand the tools you use. Only then move to the attack skills in order: reconnaissance, web vulnerabilities such as SQL injection and cross-site scripting, privilege escalation, and finally reporting — because a finding nobody can reproduce or understand is worthless.
Keep notes as you go. Screenshot what you did, write down why it worked, and store it somewhere organized. A public portfolio of lab writeups helps as much as any certificate when you apply for a first security role, and it proves you can explain your work, not just run a tool.
How do bug bounties work as legal practice?
Bug bounty programs are the bridge from lab practice to real targets, because the permission is explicit and the scope is defined for you. Companies publish which domains and applications are in scope, which vulnerability types are eligible, and what they pay. You test only what is listed, and you report what you find privately.
Read the program rules before you start. GitHub's bug bounty policy, for example, requires testing only on sites you know GitHub operates and that are in scope, forbids social engineering and phishing against employees, and treats good-faith research conducted under the policy as authorized conduct under the Computer Fraud and Abuse Act — a legal safe harbor. It also says that when in doubt, you should ask before doing anything that might go outside the policy.
Stay inside the scope. Testing an out-of-scope domain, accessing another customer's data, or running automated scanners against a program that forbids them can end your account and your legal protection in one move. Submit one vulnerability per report, include step-by-step reproduction and a working proof of concept, and practice responsible disclosure: report privately and give the owner reasonable time to fix the issue before any details go public.
Which certifications help, and what do they cost?
Certifications are not required to practice, but they structure your learning and they are what hiring managers filter on. CompTIA Security+ is the common baseline: broad, vendor-neutral security fundamentals, and a frequent requirement for entry-level roles. Its exam voucher costs $439 as of November 2026.
For hands-on penetration testing, the Offensive Security Certified Professional (OSCP) is the respected practical credential: a grueling hands-on exam where you compromise real machines and write a professional report. The Certified Ethical Hacker (CEH) covers methodology and legal testing practice, and the ISC2 Certified in Cybersecurity (CC) exam costs $199 and is a cheaper entry-level alternative.
Do not collect certificates before you can do the work. Employers ask about lab time and writeups far more than they ask about exam scores, and a Security+ voucher is wasted if you have not finished a lab learning path first.
What should you never do?
Never scan or test a system you do not own and have no written permission to test — not a neighbor's Wi-Fi, not a public website, not an abandoned-looking server, and not a company you are applying to, even to impress them. Never use tools against a live system to demonstrate a flaw you found by accident.
Never access another person's accounts or data, even if you found the credentials lying around, and never share a vulnerability publicly before the owner has had time to fix it. Never run automated scanners against a bug bounty target unless the program allows it, and never test outside a program's scope — the scope is the permission, and stepping outside it removes it.
Finally, never keep what you find to yourself in a way that helps attackers: if you discover a serious flaw in a product people rely on, report it through the vendor's disclosure channel or a platform like HackerOne, even if there is no bounty. The habit of reporting properly is what separates an ethical hacker from everyone else with the same tools.
The bottom line
Ethical hacking is legal when you have permission, and there are more free, legal targets than you could exhaust in years: TryHackMe, Hack The Box, the PortSwigger Web Security Academy, OWASP Juice Shop and scoped bug bounty programs. Build a home lab, learn networking and Linux first, and keep notes on everything you break.
Then, when your lab skills are solid, take them to a bug bounty program with a clear safe harbor and stay inside its scope. That path — labs, home lab, bounty, certification — is how working penetration testers actually learned the job, and it never asks you to touch a system you have no right to test.
If you want to check your own defenses first, start with our small business cybersecurity checklist.
You can also test your own judgment with our free phishing quiz.
Frequently asked questions
Is ethical hacking legal?
Yes, when you have written authorization from the system owner, when you test systems you own, or when you use platforms built for practice. Testing a system without permission is illegal in most countries, regardless of your intent.
Can I practice hacking on my own Wi-Fi network?
Yes, on your own network and your own devices. Do not test your neighbor's Wi-Fi, a public network, or any device you do not own, even if it is unsecured. Keep lab traffic on an isolated network segment so it cannot leak onto other networks.
Is it legal to scan a public website to see if it is secure?
No, not without permission. Scanning a company's public site just to look is unauthorized access in most jurisdictions. If you find a vulnerability on a live site, report it through the company's published disclosure channel and do not exploit it further.
Do I need a certification to practice ethical hacking?
No. Certifications help with jobs, but practice itself needs no certificate. Start with free labs, then consider CompTIA Security+ for fundamentals and OSCP later for hands-on penetration testing.
What is the difference between ethical hacking and penetration testing?
Ethical hacking is the broader skill of finding security weaknesses with permission. Penetration testing is a formal, scoped engagement, usually for a paying client, with a written agreement, a defined target list, rules of engagement and a report at the end.
Can beginners join bug bounty programs?
Yes, but build lab skills first. Bug bounty programs invite testing only inside their published scope, and reports need a working proof of concept. Start with labs, then try a program with a wide scope and a clear safe-harbor policy.
Is Kali Linux legal to use?
Yes. Kali Linux is a legal operating system for security testing, and it is free. What matters is what you point its tools at: your own lab and authorized targets are fine, other people's systems are not.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against OWASP's Juice Shop guide, PortSwigger's Web Security Academy and HackerOne bug bounty program rules.
How we write and fact-check →