Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 38 ยท Getting Started

A Safe Practice Lab and Ethical Testing

Learn the legal and ethical rules for security testing, how to set up a safe local practice lab, what vulnerable training apps exist, and how this track keeps you inside the law.

Learning web security means learning how attacks work, and that comes with responsibility. Testing a system you do not own, without written permission, is illegal in most countries, even if you "only looked" and caused no damage. This lesson sets the ground rules, then shows how to build a lab where you can experiment freely.

The rules

  1. Only test what you own or have written permission to test. Written permission defines the scope: which hosts, which techniques, which dates. Without it, stop.
  2. Stay inside the scope. If you find a way into a system next to the one you were allowed to test, report it; do not use it.
  3. Do no harm. Avoid actions that delete data, lock accounts or take services down. Prefer read-only proof.
  4. Protect data you stumble on. If you see personal data, record the minimum needed and report it. Never copy or share it.
  5. Report responsibly. Give the owner details privately and time to fix before you talk about it publicly (coordinated disclosure).
  6. Follow program rules. Bug bounty programs publish what is in scope and how to report. Their safe-harbor statements protect you only when you follow them.

The mindset is that of a professional: you are a guest with a key someone handed you, not a trespasser.

Nothing in this track tells you to test a real website. All demonstrations run in your browser on invented data, and you should practice only in a lab you control.

What counts as a lab

A good lab is isolated (nothing reaches the internet or other people), disposable (you can wipe and rebuild it) and intentional (it is meant to be broken). Common choices:

Option What it is Notes
Your own code A small app you write with deliberately unsafe versions Best for learning fixes
Intentionally vulnerable apps Training projects such as OWASP Juice Shop, DVWA, WebGoat Run locally in containers or VMs, never expose them to the internet
Capture-the-flag (CTF) sites Hosted challenges that authorise you to attack their targets Read each site's rules
Browser-based stand-ins The runnable examples in this track Zero risk

Running a deliberately vulnerable app on a public IP address is dangerous, because attackers scan the internet continuously and will take it over. Bind labs to 127.0.0.1 (localhost) or a private virtual network only.

TEXT
# Example, read-only: start a training app on your own machine,
# reachable only from localhost (container tool required)
docker run --rm -p 127.0.0.1:3000:3000 example/training-app

The 127.0.0.1: prefix is what keeps it private. Without it the port may be open to your whole network.

Safe habits for your lab

  • Use a separate browser profile for testing, so test cookies never mix with your real accounts.
  • Use fake data only; never import real customer data into a lab.
  • Snapshot or version your lab so you can reset it.
  • Keep notes: what you tried, what happened, how to fix it. These notes become your reports.
Python Check that an address is local-only

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

When you configure a lab, prefer loopback addresses. Binding to 0.0.0.0 is the classic mistake that turns a private experiment into a public target.

A simple scope file

Professional testers write down their rules of engagement before touching anything. You can practice the habit even in a lab: a tiny allow-list that your own scripts consult prevents accidents.

Python A scope guard for your own tools

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Every scanner you write or script you borrow should refuse targets outside the list. The tooling chapter builds on this idea.

Learning paths and professional work

Security skills lead to several careers: application security engineer, penetration tester, security-minded developer, incident responder. Certifications and CTF competitions are popular ways to practice. Remember the law protects testers who work under contract and scope; it does not protect "curiosity".

Responsible disclosure in practice

When you find a flaw in a system you were not asked to test (for example while using a website normally), the safe sequence is:

  1. Stop poking. Do not try to see how far it goes.
  2. Look for a security.txt file (a standard /.well-known/security.txt that lists a contact) or a published disclosure policy.
  3. Send a short report: what, where, how to reproduce with minimal steps, and the potential impact. No demands.
  4. Give the owner a reasonable time to respond and fix.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. You find a login form on a company's public site and want to see if it is vulnerable. What do you need first?

    Public does not mean permitted. Without written authorization, testing can be a crime regardless of intent.
  2. 2. Which bind address keeps a training app reachable only from your own computer?

    127.0.0.1 is the loopback address. 0.0.0.0 listens on all interfaces and exposes the app to the network.
  3. 3. You accidentally see another person's data while testing in scope. What should you do?

    Handle personal data minimally and report it. Collecting or sharing it makes the situation worse.
  4. 4. What is coordinated disclosure?

    You report to the owner first and wait a reasonable time, so users are not exposed while a fix is prepared.

Summary

  • Test only systems you own or have written permission to test, and stay inside the agreed scope.
  • Build labs that are isolated, disposable and bound to localhost.
  • Use deliberately vulnerable training apps only locally, never on the internet.
  • Use fake data, separate browser profiles and notes.
  • Report discovered flaws privately and give owners time to fix them.

Next: Access Control Fundamentals