Module 1 · Build a safe hacking lab · Lesson 6 of 16
Wire the lab network and add targets
Host-only, NAT and bridged networking, which one each machine gets, the targets you will attack, and snapshots.
In this lesson · about 25 minutes
- Explain host-only, NAT and bridged networking
- Wire Kali and Metasploitable 2 so the target can never reach your real network
- Add the course targets and take a clean snapshot
Whiteboard · watch and try
How the lab network keeps you safe
Press Play. Three network modes, two that are fine in the right place and one that must never be used for a vulnerable machine.
Tip: press Pause, then use the pen to work along on the board. Space plays and pauses; Ctrl+Z undoes your last mark.
Set the adapters
In VirtualBox, open File › Tools › Network Manager and make sure a host-only network exists (usually vboxnet0 or "VirtualBox Host-Only Ethernet Adapter", using 192.168.56.0/24). Then set each machine's adapters:
| Machine | Adapter 1 | Adapter 2 |
|---|---|---|
| Kali | NAT (internet for updates) | Host-only (lab network) |
| Metasploitable 2 | Host-only only | Disabled |
Add your targets
- Metasploitable 2: an old Ubuntu server made vulnerable on purpose by Rapid7. Download it from its official SourceForge page, create a new VM (Linux, Ubuntu 32-bit) using its existing disk file, and set its only adapter to host-only. It appears as
192.168.56.101in this course. - OWASP Juice Shop: a modern, deliberately insecure web shop used for web testing. It runs as a Docker container on Kali itself; you start it in the next lesson's lab.
- DVWA: a simple vulnerable PHP app. Optional, also in Docker.
Snapshots: your undo button
Labs break things on purpose. With both VMs shut down, select each one in VirtualBox, open Snapshots and take one named clean. After every lab, restore it and you are back to a fresh machine in seconds. From your computer's own command line, the same thing is:
VBoxManage snapshot "Metasploitable2" take "clean"Check your understanding0 of 3 correct
Quiz score: 0 of 3
For authorized, lab-based learning only. Tana Roasters and every person, address and password in this course are fictional. Every terminal is simulated. "Kali Linux" is a trademark of OffSec; this course is not affiliated with or endorsed by OffSec.