Why build it
Reading about attacks only goes so far. To understand what an intrusion looks like, and later what it leaves behind for a forensic investigator, I wanted to run real exploits against real vulnerable systems. That meant building a place where doing that couldn’t hurt anything else on my network.
Design goals
- Contained. Vulnerable machines can’t reach my home network or the internet.
- Reachable. I can still use the lab from my laptop, at home or away.
- Repeatable. I can spin up fresh targets in seconds and throw them away afterward.
Isolation
The lab lives on its own VLAN, assigned to a dedicated Lab Isolated firewall zone on my UniFi gateway. That zone is default-deny in every direction: no internet, and no access to any other zone. The only thing allowed is the gateway’s DHCP and DNS so machines can get an address.
The lab originally shared a zone with my cameras, and that zone allowed outbound traffic. I moved it into its own zone so lab and camera policies can never affect each other. The network segmentation write-up covers the full design.
Where the attacker box lives
My first plan kept Kali on my laptop in VMware and opened a firewall path from the laptop into the lab. Pings to the target failed, and the cause turned out to be routing, not the firewall. Kali was on VMware’s NAT network, so its traffic never reached my physical network. Then I realized I was working remotely through a Tailscale exit node, which added a second routing problem.
That pushed me to rethink where Kali should sit. I weighed three options:
- Kali on my main network, with a rule allowing it to reach the lab. The downside is that if Kali were ever compromised, the attacker would be on my trusted network.
- Kali inside the lab with no internet. This is very safe, but Kali couldn’t get updates or tools.
- Kali inside the lab, plus one narrow rule allowing Kali, and only Kali, out to the internet. The targets stay fully offline.
I went with the third option. A compromised Kali box would only be able to reach other lab machines and the internet, never my home network.
For remote access, Kali runs its own Tailscale client. I can reach it from anywhere without opening a path from my trusted network into the lab, and without punching a general hole in the lab firewall. I set up xrdp for a responsive desktop session in place of the laggy hypervisor console. That took some debugging of X session startup before it was stable.
Repeatable targets
Metasploitable 2 runs on Proxmox. I converted the configured VM into a template and create targets as linked clones, which are near-instant and share the base disk. Each clone just needs the lab’s VLAN tag on its network interface to land inside the isolated segment. One caveat: VLANs isolate segments from each other, not machines within the same segment. If I run several vulnerable targets at once, client isolation on the lab network keeps them from reaching each other.
First exploit chain
Recon. I started with nmap -sV -sC against the target to identify services and versions. Metasploitable lights up with deliberately vulnerable services, so this one scan surfaced plenty to work with. One detail worth understanding: nmap reported the OS as “Unix.” That label is Samba’s generic self-description, not a claim the box runs commercial UNIX. It’s actually an old Ubuntu release.
Picking a target. The web server itself (Apache 2.2.8) wasn’t the interesting part. The vulnerable applications hosted on it were. I searched Metasploit for TWiki modules and skipped the first result, which targets a plugin for a different wiki entirely despite the similar name. I used check before exploit on each candidate. The twiki_history module (TWiki History function command execution) reported the target as vulnerable.
The exploit “worked” but gave no shell. It ran cleanly and reported “no session was created.” The cause was a payload architecture mismatch. Metasploit defaulted to a 64-bit Meterpreter payload, but Metasploitable is a 32-bit system. The vulnerability was triggered, but the payload couldn’t run. Switching to an architecture-independent command shell payload (cmd/unix/reverse) fixed it.
Result: an interactive shell on the target as www-data, the web server’s service account. That’s a foothold, not full control.
What’s next
- Privilege escalation from
www-datato root - The defender’s view. Point my Wazuh SIEM at the target, rerun the same attack, and see what was and wasn’t logged. That’s the step that matters most for the forensics work I’m heading into.
- Work through the other vulnerable services, doing some manually instead of through Metasploit, to understand what each exploit actually does
Takeaways
- Isolation is a design decision, not a setting. Where the attacker box sits changes your blast radius.
- When a connection fails, check routing before blaming the firewall.
- A successful exploit with no session usually means the payload is wrong. Match the payload to the target’s architecture.
- Use
checkbeforeexploit. It’s faster and quieter, and it tells you whether you’re on the right path.
Skills demonstrated
Penetration testing fundamentals · Metasploit · nmap service enumeration · network isolation design · Proxmox templates and linked clones · VLAN tagging · Tailscale · Linux desktop and RDP troubleshooting