Building Your Lab
Everything in this wiki is practiced somewhere you have permission: your own lab, or a platform that gives it to you in writing. Building it properly from day one (isolated, with snapshots, and with the victims kept away from your home network) saves you scares, lets you repeat an attack as many times as you need, and keeps your practice within the law.
Concepts
Section titled “Concepts”What hardware you need
Section titled “What hardware you need”RAM is the main limit. Add up what every VM running at the same time needs, and leave 4 GB for the host.
| Scenario | VMs at once | Host RAM | Free disk |
|---|---|---|---|
| Web and Linux | Kali + 1 Linux victim or Docker | 8 GB (tight), 16 GB comfortable | 80 GB |
| Single Windows box | Kali + 1 Windows | 16 GB | 120 GB |
| Minimal Active Directory | Kali + DC + 1–2 clients | 24–32 GB | 200 GB |
| Online platforms only | Kali (victims live on their network) | 8 GB | 60 GB |
The CPU must support virtualization (VT-x or AMD-V) with it enabled in the BIOS/UEFI. An SSD makes more difference than a faster processor: booting and reverting snapshots is almost all disk.
Which hypervisor
Section titled “Which hypervisor”Network modes, snapshots and VMs versus containers are covered in virtualization and containers. Here, just the choice for a lab:
| Hypervisor | Good for | Keep in mind |
|---|---|---|
| VirtualBox | Getting started; free on Windows, Linux and Intel Macs | Somewhat slower; on Apple Silicon it only runs ARM VMs |
| VMware Workstation Pro / Fusion Pro | Performance and easy networking | Free for any use (commercial included) since November 2024; downloading needs a Broadcom account |
| Proxmox VE | A server or old PC dedicated to the lab | Managed from a web UI; ideal for an AD you leave running |
| UTM (Apple Silicon Mac) | Kali ARM on an M1/M2/M3 Mac | x86 images are emulated and very slow: many downloadable vulnerable machines aren’t practical |
The attack box
Section titled “The attack box”Kali Linux is the default choice because it ships with almost everything; Parrot is an equivalent alternative. Use the official VM image (already prepared for VirtualBox or VMware) instead of installing from the ISO.
- Normal user, not root. Since 2020 Kali works with the
kaliuser andsudo. Keep it that way: tutorials that assume root break on details such as paths under/root, files created as root that you then can’t edit, or tools that needsudoto capture traffic or run SYN scans. - Update when you install and before each study season, but not the night before an exam.
- Snapshot before big changes (an upgrade, installing a tool that touches half the system). If something breaks, you’re back in a minute.
- One folder per target with fixed subfolders (
nmap/,loot/,exploits/,notes.md). What you don’t write down can’t go in the report.
The lab network
Section titled “The lab network”Victims are, by definition, machines with serious flaws. If you connect them in bridged mode they sit on the same network as your phone, your TV and anyone in your home, and so does whatever you expose on them (shells, HTTP servers).
- Internal or host-only network for victims: they talk to Kali and each other, nothing else.
- Kali with two interfaces: one NAT for the internet (updates, downloads) and one on the lab network.
- No NAT on victims. If a victim needs the internet to install, give it NAT only during the install and remove it afterwards.
flowchart LR
I[Internet] --- N["Hypervisor NAT"]
N --- K["Kali<br/>eth0 NAT · eth1 lab"]
K --- L["Lab network<br/>192.168.56.0/24"]
L --- V1["Linux victim"]
L --- V2["DC01 · Windows Server"]
L --- V3["WS01 · Windows client"]
The victims
Section titled “The victims”| Type | Examples | How you set it up |
|---|---|---|
| Downloadable machines | VulnHub, Metasploitable 2 and 3 | Import the .ova and put it on the lab network |
| Vulnerable web apps | OWASP Juice Shop, DVWA | Docker on your own machine or in a VM, bound to 127.0.0.1 or to the lab network |
| Windows | Windows 11 Enterprise and Windows Server evaluation | Legal download from Microsoft’s Evaluation Center; Server lasts 180 days and the client 90 |
| Active Directory | Your own small domain | See below |
Microsoft evaluations expire, and reverting a snapshot doesn’t prevent it, because they count real calendar time. Check the days left with slmgr /dlv and extend with slmgr /rearm (on Server you can rearm several times, 180 days each); otherwise, reinstall. Check the length on the Evaluation Center when you download, as Microsoft has changed it before.
A minimal Active Directory
Section titled “A minimal Active Directory”Three machines are enough to practice the Windows and AD cards:
- DC01 running Windows Server evaluation: a static IP on the lab network, install the AD DS role and promote it to a controller of a new domain (for example
pwnlab.local). - WS01 (and optionally WS02) running Windows evaluation: DNS pointing at the DC’s IP, then join it to the domain.
- Test data: a few users, a group with more privileges than it should have, a service account with an SPN and a weak password, and a share or two. That gives you something to practice enumeration and Kerberos on.
If you’d rather not build it by hand, GOAD (Game of Active Directory) deploys several domains already configured with flaws, but it needs a lot more RAM.
Online platforms
Section titled “Online platforms”| Platform | What it offers | How you access it |
|---|---|---|
| Hack The Box | Machines and network labs, including AD environments | VPN (OpenVPN) or an in-browser attack box |
| TryHackMe | Guided paths with theory, great for starting out | VPN or the in-browser AttackBox |
| PortSwigger Web Security Academy | Free web labs per vulnerability | Browser, no VPN |
| OffSec Proving Grounds | Machines in the style of the OSCP exam | VPN |
Their advantage is that permission is clear (their terms authorize you to attack their machines) and there’s nothing to build. The price is that you don’t control the environment or see what happens on the victim, which you do in your own lab.
In practice
Section titled “In practice”# Snapshots from the command line (VirtualBox)VBoxManage snapshot "kali" take "clean-2026-11" --description "freshly updated"VBoxManage snapshot "kali" list# Name: clean-2026-11 (UUID: 4f1c…) * <- * marks the current snapshotVBoxManage snapshot "kali" restore "clean-2026-11" # the VM must be powered off
# Create the lab's host-only network (Linux/Windows; on macOS with VirtualBox 7: VBoxManage hostonlynet add)VBoxManage hostonlyif create# Interface 'vboxnet0' was successfully createdVBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1 --netmask 255.255.255.0# Connect to a platform over VPNsudo openvpn ~/vpn/lab_user.ovpn# ... Initialization Sequence Completed <- connected; keep this terminal open
# In another terminal: your attack IP is the tun0 oneip -br a show tun0# tun0 UNKNOWN 10.10.14.5/23 <- this is the IP for reverse shells and servers# Vulnerable web apps in Docker, reachable only from your machinedocker run -d --name juice -p 127.0.0.1:3000:3000 bkimminich/juice-shopdocker run -d --name dvwa -p 127.0.0.1:8081:80 vulnerables/web-dvwass -tlnp | grep -E '3000|8081'# LISTEN 0 4096 127.0.0.1:3000 ... <- 127.0.0.1: nobody on your network can reach it# LISTEN 0 4096 127.0.0.1:8081 ...# Check from the (Linux) victim that it can't reach the internetping -c 2 -W 2 1.1.1.1# ping: connect: Network is unreachable <- good: no way outip route# 192.168.56.0/24 dev eth0 proto kernel scope link src 192.168.56.20# <- no "default via" line: no way outNext offensive step
Section titled “Next offensive step”- With the lab running, follow the pentest methodology on your first victim.
- Practice network enumeration and nmap against the lab network.
- With the minimal AD: Active Directory enumeration and Kerberos attacks.
- To choose where to keep practicing: CTF platforms and the certification roadmap.
Cheat sheet
Section titled “Cheat sheet”| Concept | What to remember |
|---|---|
| RAM | The main limit. Minimal AD: 24–32 GB |
| Kali | Official VM image, kali user with sudo, snapshot before big changes |
| Victims | Internal or host-only network, no NAT, never bridged |
| Kali networking | Two interfaces: NAT for the internet and one for the lab |
| Vulnerable Docker | -p 127.0.0.1:PORT:PORT |
| Windows evaluation | Evaluation Center: Server 180 days, client 90 |
| Minimal AD | DC + 1–2 clients with DNS pointing at the DC |
| Platforms | VPN with OpenVPN; your attack IP is the tun0 one |
| Clean snapshot | Right before the first attack on each victim |
| Credentials | Lab-only, never reused |
Review questions
Section titled “Review questions”- You have 16 GB of RAM. Can you run Kali plus a domain with a DC and two clients at once? What would you do?
Answer
Very tight: between the host, Kali and three Windows machines you go over 16 GB. Options: run only the DC plus one client, cut each Windows VM’s RAM to the usable minimum, use Windows Server Core for the DC, or practice AD on an online platform.
- Why shouldn’t a vulnerable victim go in bridged mode?
Answer
Because it lands on your real network, reachable by any device or person on it, and so do the services you open on it during practice. On an internal or host-only network only your attack box can see it.
- You start Juice Shop with
docker run -p 3000:3000. What’s the problem and how do you fix it?
Answer
Docker publishes the port on every interface, so a vulnerable app becomes reachable from your local network. Fix it by binding to 127.0.0.1: -p 127.0.0.1:3000:3000.
- You connect to a platform’s VPN. Which IP do you use as LHOST for a reverse shell, and how do you find it?
Answer
The VPN interface’s, usually tun0: ip -br a show tun0. Your home network IP isn’t reachable from the platform’s machines.
- You build a Windows client and it can’t join the domain. What’s the first thing you check?
Answer
The client’s DNS: it must point at the DC’s IP. The client finds the domain through SRV records in the DC’s DNS; if it uses another DNS server, it won’t find it.
- How do you check that a Linux victim has no internet access?
Answer
With ip route (there must be no default via route) and by testing egress, for example ping -c 2 1.1.1.1 or an HTTP request, which should both fail.
- What’s the advantage of your own lab over an online platform, and the other way round?
Answer
In your own lab you control everything and can see what happens on the victim (logs, processes), which helps you understand both the attack and how it’s detected. A platform needs no setup, has far more machines, and its terms make the permission to attack clear.