An isolated security lab for authorised practice
Build a locked-down lab with an attacker machine and deliberately vulnerable targets on an isolated network, so you can practise scanning, web testing and defence legally and safely.
What you need
Security skills must be practised on systems you own or have written permission to test. The safe way is a closed lab: an attacker VM and one or more target VMs on a network that is cut off from the internet and from your home network.
- Attacker: a security-focused Linux distribution such as Kali Linux (kali.org) or Parrot, provided as ready-made virtual machine images.
- Targets: systems built to be attacked, such as OWASP Juice Shop (a web application), DVWA (Damn Vulnerable Web Application) and Metasploitable (a deliberately weak Linux machine). Download them only from their official project pages.
- Defender tools: a normal Ubuntu VM with logging, so you can also watch your attacks arrive and write the detection (see the SOC lab guide).
Set it up
- Create a host-only or internal network in your virtualisation tool with no route to the internet. This is the most important step.
- Import the attacker image and attach it to that network only (add a temporary NAT adapter only when you must update it, then remove it).
- Run each target on the same isolated network. Juice Shop and DVWA run easily in containers (see the container lab guide) with their published ports reachable only inside the lab.
- Give the machines fixed addresses (for example attacker
10.20.20.5, target10.20.20.10) and confirm they can ping each other. - Take a snapshot of every machine in its clean state.
Check that it works
- The attacker can reach the target (
ping 10.20.20.10) and cannot reach the internet or your home network (ping 8.8.8.8fails). nmap 10.20.20.10from the attacker lists the target’s open ports.- The vulnerable web application loads in the attacker’s browser at the target’s address.
Practise safely
- Isolation is the rule. Never put a vulnerable target on a bridged adapter or your home network: it is easy to compromise and could be used to attack others.
- Authorisation is the law. Scan and test only your own lab. In most countries unauthorised access, even “just looking”, is a crime. Real engagements need a written scope and permission, as the course cases show.
- Never reuse real passwords or real data in a lab, and do not connect lab VMs to your accounts.
- Keep a lab diary: what you tried, what worked, and how it would be detected and fixed.
- Restore snapshots after exploitation so the next attempt starts clean.
Go further
- For each weakness you find (a default password, an injectable field, an outdated service), write the fix and the detection, not just the attack. A professional is judged on the defence.
- Run the same scan before and after hardening a target and compare.
- Practise reporting: write a short finding with evidence, impact and recommended fix, in your own words.
- Legal practice sites and competitions exist online (for example picoCTF and OverTheWire, plus the free tiers of platforms such as TryHackMe); read each one’s rules and what is currently free before you use it.
Courses that use this lab
Other lab guides
- A virtual machine lab on your own computer
- A Linux practice machine
- A network lab with free simulators and virtual routers
- A packet-capture lab with Wireshark and tcpdump
- A network-services lab: DHCP, DNS, proxy, load balancer, time and failover
- A Windows Server and Active Directory lab
- A developer workstation: editor, Git, Python and Node
- A container and Kubernetes lab
- A monitoring lab with Prometheus and Grafana
- A security operations (SOC) practice lab
- A cloud lab that cannot surprise you with a bill
- An embedded and microcontroller lab: simulators first, hardware second
- An electronics lab: simulate first, then build on a breadboard
- A Raspberry Pi lab, with or without a Pi
- A home automation lab with Home Assistant and MQTT
- An audio, video, streaming and show-control lab
- A data lab: Python, pandas and Jupyter on your own computer
- A machine learning lab: scikit-learn, notebooks and honest experiments
- An LLM lab: a free local model, embeddings and a test harness
- A TypeScript lab: Node.js, the compiler and a test runner
- A web deployment lab: Git, a free host and environment settings
Software changes quickly. Menu names and version numbers may differ a little from what you see; the ideas and the check at the end of each section stay the same. Always download from the project's own website, and read the licence terms for your situation.