Safe Penetration Testing Labs · beginner · ~10 min
- Define ethical hacking and explain what makes a security test *ethical* rather than a crime - Tell apart the three things every assessment protects: **confidentiality, integrity, availability (CIA)** - Explain the difference between a **threat**, a **vulnerability**, and **risk** - Use an **authorization checklist** before you touch any system - Explain why every lab in this course is **local-only** and why that matters legally and technically
Ethical hacking means looking for security weaknesses with explicit permission, so they can be fixed before a real attacker finds them. The word that separates an ethical hacker from a criminal is not a tool or a technique — it is authorization.
You do not need any prerequisites for this lesson; it is the front door to the whole security track. What you learn here — authorization, scope, and lab-only practice — is the rule every later lesson depends on. The next lesson, Rules of engagement, turns "get permission" into a concrete document.
In plain terms: the same command that is professional security work on a system you are paid to test is a computer-crime on a system you are not. The system cannot tell the difference — only the paperwork can.
Running a scanner or an exploit against a system you do not own or have written permission to test is unauthorized access, which is a criminal offence in most countries (for example the UK Computer Misuse Act, the US Computer Fraud and Abuse Act, and the EU Convention on Cybercrime). People have been prosecuted for "just looking."
Getting this right is also what makes you employable: real engagements — penetration tests, bug-bounty programs, internal red teams — all begin with a signed scope and end with a report a defender can act on. The skill that pays is not breaking in; it is finding, explaining, and helping fix weaknesses responsibly.
Definition. Authorization is written, specific permission from the owner of a system to test it in defined ways, during a defined time.
Without it, the activity is illegal regardless of intent. "I was only going to report it" is not a defence. Authorization must exist before the first packet.
Pitfall: verbal "sure, go ahead" is not authorization. Get it in writing, signed, with a date and a scope.
Every security decision serves one of three goals:
| Goal | Question it answers | Example failure |
|---|---|---|
| Confidentiality | Can only authorized people read it? | A database leak exposes user emails |
| Integrity | Can only authorized people change it, and is it correct? | An attacker edits an order's price |
| Availability | Is it there when legitimate users need it? | A service is knocked offline |
A finding matters because it threatens one or more of these. Naming which one sharpens your report.
These three words are often muddled. They are different:
A vulnerability with no realistic threat, or no valuable asset behind it, is low risk. This is why we never label every finding "critical."
Untrusted input / user
|
v <-- trust boundary: validate + authorize HERE
Your application logic
|
v <-- trust boundary: least privilege HERE
Data store / OS / network
A trust boundary is any point where data crosses from a less-trusted zone to a more-trusted one. Most vulnerabilities live at a boundary where the code trusted something it should have checked.
Knowledge check:
This course has no "attack syntax" to memorize. The one thing to internalize is the authorization checklist you run before every lab or engagement:
Before testing:
[ ] I own the system, or I have written, signed permission to test it
[ ] The target(s) are clearly and specifically defined (scope)
[ ] The allowed testing methods are defined
[ ] The testing time window is approved
[ ] Data-handling rules are understood (what I may see, keep, and must delete)
[ ] Emergency contact + stop procedure are known
[ ] Destructive testing is prohibited unless explicitly approved in writing
If any box is unchecked, you do not proceed.
Ethical hacking is testing systems you are explicitly authorised to test, in order to find weaknesses before adversaries do.
It is always bounded by written authorisation that describes the scope and the rules.
Running the same tools without that authorisation is unauthorised access. In most jurisdictions this is illegal, for example:
This course teaches patterns and defensive engineering. You will write code that detects attacks against your own test fixtures. You will never write code that attacks other people's systems.
A concrete, lab-safe way to make "local-only" real: run your practice target in a container that has no network at all, then prove it cannot reach the outside world.
# Start a throwaway lab container with networking fully disabled.
# --network none removes every interface except loopback.
docker run --rm -it --network none debian:stable-slim bash
# Inside the container, confirm it is isolated (this should FAIL):
# getent hosts example.com -> no result
# (there is no route off the box, so nothing can be attacked by accident)
What it does. --network none gives the container only a loopback interface, so code you run inside literally has no path to any other machine. --rm deletes the container on exit so there is nothing to clean up. This is the safety property the whole course relies on: even a mistake stays inside a box you own.
Expected result. Any attempt to resolve or reach an external host fails, because there is no network. That "failure" is the point.
Walking through the authorization checklist the way you would on a real engagement:
| Step | You confirm… | Why it protects you |
|---|---|---|
| Written permission | A signed document exists, naming you | Turns the activity from crime to job |
| Scope | Exactly which hosts/apps/accounts | Stops "scope creep" into systems you may not touch |
| Methods | Which techniques are allowed | Some tests (e.g. DoS) can harm even a willing target |
| Time window | When you may test | Testing outside it is unauthorized again |
| Data rules | What you may see/keep/must delete | Protects real users' privacy |
| Stop procedure | Who to call, how to halt | Lets you abort the moment something looks fragile |
Notice the flow is paperwork first, tools last. Every box is about staying inside the authorized boundary.
Mistake 1 — "It's fine, I'll just report it." Wrong: scanning a live third-party site because you spotted something. Why wrong: unauthorized access is the offence; your good intentions do not change the law. Fix: if you find something on a system you were not authorized to test, stop and use the vendor's responsible-disclosure channel — do not probe further.
Mistake 2 — treating a verbal OK as authorization. Wrong: a colleague says "yeah, test the staging box." Why wrong: no scope, no signature, no record — and they may not own it. Fix: get written scope + sign-off from someone who can actually grant it.
Mistake 3 — labeling everything "critical." Wrong: every finding rated the same, top severity. Why wrong: it destroys trust and buries the findings that truly matter. Fix: rate by realistic risk (likelihood × impact), which you'll learn in the reporting lessons.
How to recognize the trap: if you cannot point to the signed document that authorizes exactly what you are about to do, you are about to make a mistake.
"Debugging" an ethics question means resolving ambiguity before acting:
Questions to ask yourself when unsure: Who owns this? Do I have that in writing? Is this specific action listed as allowed? What is the worst thing that could happen, and is it reversible?
Security & safety — handling what you find. Ethical practice continues after you find a weakness:
The defensive mindset: your job is to reduce risk for the owner, not to accumulate their secrets.
Ethical hacking, done under authorization, shows up as:
Professional habits (start here): always work from written scope; keep detailed, honest notes; report clearly and reproducibly; prefer prevention and detection over flashy exploitation. Advanced habits: threat-model before testing; deconflict with the blue team; measure findings by business risk, not novelty.
Beginner 1 — Spot the boundary. Objective: given three short scenarios (a friend's website, your own laptop VM, a company you were hired to test with a signed contract), label each authorized or not, and name the one fact that decides it. Concepts: authorization, scope.
Beginner 2 — Build your checklist. Objective: write out the 7-line authorization checklist from memory and add one sentence explaining why each line protects you. Constraints: no tools involved. Concepts: authorization, data handling.
Intermediate 1 — Classify by CIA. Objective: for five one-line findings (e.g. "user emails exposed", "attacker can change an order total", "service crashes on a long input"), tag each with the CIA goal it breaks and a rough risk (low/medium/high) with a one-line justification. Concepts: CIA triad, risk.
Intermediate 2 — Isolate a lab. Objective: start a container with --network none, then demonstrate (in writing, with the commands and their output described) that it cannot reach any external host. Concepts: lab isolation, verification. Hint: try to resolve/reach a host and show that it fails.
Challenge — Draft a mini scope. Objective: for a fictional "toy web app on localhost:8080", write a one-page authorization note: in-scope targets, out-of-scope items, allowed methods, time window, data rules, and a stop procedure. Requirements: it must be specific enough that a reader knows exactly what is and isn't allowed. Do not test anything real. Concepts: everything in this lesson; sets up the next lesson on rules of engagement.
docker run --network none), so a mistake can never reach someone else's systems.Next: Rules of engagement — how to turn "get permission" into a concrete, signed document.