A step-by-step guide to building your own security practice lab environment.
| Option | Pros | Cons | Best For |
|---|---|---|---|
| Local VMs | Full control, offline, free | Resource intensive | Dedicated practice |
| Cloud Labs | Managed, accessible anywhere | Monthly cost | Beginners, convenience |
| WSL2 | Low overhead, Windows integration | Limited features | Quick tasks, learning |
| Cloud VPS | Custom setups, always on | Cost, security concerns | Advanced users |
Minimum:
- 16GB RAM (8GB usable for VMs)
- 256GB SSD
- Intel i5/Ryzen 5 or better
Recommended:
- 32GB RAM
- 512GB+ NVMe SSD
- Intel i7/Ryzen 7
- Download from virtualbox.org
- Install with default options
- Install Extension Pack for USB 3.0, RDP support
- Workstation Pro: Paid, more features
- Workstation Player: Free for personal use
- Fusion Pro: Paid
- Fusion Player: Free for personal use
- Best option for M1/M2/M3 Macs
- Download from mac.getutm.app
Kali Linux (Recommended)
- Download: kali.org/get-kali
- Choose: Virtual Machine image (pre-built)
- Default credentials: kali/kali
Parrot OS (Alternative)
- Download: parrotsec.org/download
- Lighter weight than Kali
| VM | Description | Download |
|---|---|---|
| Metasploitable 2 | Classic vulnerable Linux | SourceForge |
| Metasploitable 3 | Modern vulnerable Windows/Linux | GitHub |
| DVWA | Damn Vulnerable Web App | GitHub |
| VulnHub VMs | Various vulnerable machines | vulnhub.com |
Create an internal network so your attack machine can communicate with targets without exposing them to your real network:
VirtualBox:
- Settings → Network → Adapter 1
- Attached to: Internal Network
- Name: "lab-network"
- Apply to all lab VMs
VMware:
- Edit → Virtual Network Editor
- Add Network → Host-only
- Assign to lab VMs
When you need to update tools or connect to cloud labs:
- Add second adapter set to NAT
- Enable only when needed
┌─────────────────────────────────────────────────────┐
│ Your Host PC │
│ │
│ ┌─────────────────────────────────────────────┐ │
│ │ Internal Lab Network │ │
│ │ │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ Kali │ │ Metaspl. │ │ DVWA │ │ │
│ │ │ 10.0.0.1 │ │ 10.0.0.2 │ │ 10.0.0.3 │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
│ │ │ │
│ └─────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────┘
After setting up Kali Linux:
# Update system
sudo apt update && sudo apt upgrade -y
# Update tools
sudo apt install -y kali-linux-large
# Create working directories
mkdir -p ~/htb ~/thm ~/ctf ~/tools
# Install additional useful tools
sudo apt install -y \
gobuster \
feroxbuster \
seclists \
wordlists \
rlwrap
# Clone useful repositories
cd ~/tools
git clone https://github.com/carlospolop/PEASS-ng
git clone https://github.com/swisskyrepo/PayloadsAllTheThings
git clone https://github.com/The-Z-Labs/linux-exploit-suggester| Platform | Cost | Best For |
|---|---|---|
| TryHackMe | Free tier / $10-14/mo | Beginners, guided learning |
| HackTheBox | Free tier / $14/mo | Intermediate+, realistic |
| PentesterLab | $20/mo | Web security focus |
| OffSec Proving Grounds | $19/mo | OSCP preparation |
- Create account at tryhackme.com
- Download OpenVPN config file
- Connect:
sudo openvpn your-config.ovpn
- Access machines through the VPN
- Create account at hackthebox.com
- Download OpenVPN config
- Connect and access machines
- Starting point machines are beginner-friendly
-
Open PowerShell as Administrator:
wsl --install -
Restart computer
-
Install Kali Linux from Microsoft Store or:
wsl --install -d kali-linux
-
Launch Kali and set up:
sudo apt update && sudo apt upgrade -y sudo apt install -y kali-linux-default
- ❌ No GUI by default (can be added with WSLg)
- ❌ Limited hardware access
- ❌ Some network tools won't work
- ✅ Great for learning Linux
- ✅ Good for web testing with Burp
- ✅ Low resource overhead
| Provider | Minimum Cost | Good For |
|---|---|---|
| DigitalOcean | $4-6/mo | Simple, cheap |
| Linode | $5/mo | Similar to DO |
| Vultr | $2.50/mo | Budget option |
| AWS/Azure/GCP | Free tier | Cloud security practice |
⚠️ Warning: Running attack tools on public cloud requires caution
- Never run vulnerable VMs with public IPs
- Use VPC/private networks
- Enable firewall rules before deployment
- Destroy resources when not in use
# Connect to VPS
ssh root@your-vps-ip
# Install Docker for isolated containers
apt update && apt install -y docker.io
# Run vulnerable apps in containers
docker run --name dvwa -p 80:80 vulnerables/web-dvwa
# Run Kali container
docker run -it kalilinux/kali-rolling /bin/bash- Set up Kali Linux VM
- Create TryHackMe account
- Complete TryHackMe "Pre-Security" path
- Learn basic Linux commands
- Set up Metasploitable 2
- Complete TryHackMe "Complete Beginner" path
- Practice Nmap scanning
- Set up DVWA
- Start PortSwigger Academy
- Practice with Burp Suite
- Set up Active Directory lab (see below)
- Start HackTheBox
- VulnHub machines
For practicing enterprise attacks, you need an AD environment.
| VM | OS | Role |
|---|---|---|
| DC01 | Windows Server 2019 | Domain Controller |
| WS01 | Windows 10 | Workstation |
| Kali | Kali Linux | Attack machine |
-
Download Windows ISOs:
- Windows Server eval: Microsoft Eval Center
- Windows 10 eval: Same location
-
Create Domain Controller:
- Install Windows Server
- Add Active Directory role
- Promote to Domain Controller
- Create domain (e.g., lab.local)
-
Create Workstation:
- Install Windows 10
- Join to domain
- Create standard user accounts
-
Introduce Vulnerabilities:
- Weak passwords
- Kerberoastable service accounts
- Misconfigured ACLs
- SMB signing disabled
After lab setup, verify:
- Attack machine can ping targets
- Targets are isolated from internet/production network
- Snapshots created for easy reset
- Basic tools working (Nmap, Burp, etc.)
- OpenVPN works for cloud platforms
Always create snapshots at key points:
- Clean install - Before any customization
- Post-update - After updating tools
- Pre-exercise - Before each practice session
- Post-exploitation - If you want to preserve state
VirtualBox:
# CLI snapshot
VBoxManage snapshot "VM Name" take "snapshot-name"
VBoxManage snapshot "VM Name" restore "snapshot-name"VMware:
- Snapshot → Take Snapshot
- Snapshot → Snapshot Manager → Restore
- Enable virtualization in BIOS (VT-x/AMD-V)
- Disable Hyper-V if using VirtualBox on Windows
- Allocate less RAM if host is low on memory
- Verify both VMs on same internal network
- Check IP addresses are in same subnet
- Disable host firewall temporarily for testing
- Update Kali:
sudo apt update && sudo apt upgrade - Reinstall tool:
sudo apt install --reinstall <tool> - Check GitHub issues for tool-specific bugs