Metasploitable 2 is a Linux server made by Rapid7 to be hacked. It runs dozens of outdated, misconfigured and backdoored services, which makes it the classic first target for practising scanning and exploitation. It's also genuinely dangerous: put it on a real network and anyone can take it over. So we'll set it up only on LabNet.
Download
Get it from sourceforge.net/projects/metasploitable. The zip file contains a folder (Metasploitable2-Linux) with the virtual disk Metasploitable.vmdk. There's no installer: the disk already has a ready-made system on it. Move the folder into your VirtualBox machine folder before continuing.
Create a VM around the existing disk
- New → Name Metasploitable2, leave ISO Image empty.
- Type Linux, Version Other Linux (32-bit) (Ubuntu 32-bit works too). It's an old 32-bit system from 2008.
- Hardware: 512 MB RAM, 1 CPU. That's all it needs.
- Hard disk: choose Use an Existing Virtual Hard Disk File → Add → select Metasploitable.vmdk.
- Settings → Network: attach Adapter 1 to Host-only Adapter (LabNet) and make sure Adapters 2–4 are disabled.
Never give Metasploitable a NAT or Bridged adapter. It has no business on the internet, and on Bridged, anyone on your Wi-Fi (or a café's) could take it over in seconds.
Boot and log in
Start it and log in with msfadmin / msfadmin. It has a US keyboard layout and no desktop. Find its IP:
ifconfig eth0 # look for "inet addr:192.168.56.1xx"
But don't use that IP yet. A real attacker doesn't get to log in first.
Find it from Kali, like an attacker
sudo netdiscover -r 192.168.56.0/24 # ARP scan: lists live hosts and their MAC vendors
nmap -sn 192.168.56.0/24 # ping sweep: the same idea with Nmap
Spot the new host (its MAC vendor shows as an Oracle VirtualBox NIC), then fingerprint it:
nmap -sV 192.168.56.1xx
A few of the services you'll find, and why attackers love them:
| Port | Service | Why it matters |
|---|---|---|
| 21 | vsftpd 2.3.4 | This exact version shipped with a backdoor |
| 23 | telnet | Logins travel in plain text. Sniff them with Wireshark |
| 80 | Apache 2.2.8 | Hosts DVWA, Mutillidae and phpMyAdmin, all vulnerable web apps |
| 139 / 445 | Samba 3.x | Old SMB with known remote exploits |
| 1524 | bindshell | A root shell just waiting for a connection |
| 3306 / 5432 | MySQL / PostgreSQL | Databases with weak default passwords |
| 6667 | UnrealIRCd | Another backdoored release |
You'll exploit these one by one in the Ethical Hacking path. For now, open http://192.168.56.1xx/dvwa in Kali's browser and log in with admin / password. That's the Damn Vulnerable Web Application, ready for web-attack practice.
Take a snapshot named fresh before you attack anything, so one click puts it back to new.
Importing any vulnerable VM (VulnHub and others)
Sites like VulnHub share hundreds of free vulnerable machines, usually as .ova files.
- File → Import Appliance → select the .ova → Next.
- Set MAC Address Policy to Generate new MAC addresses for all network adapters, then Finish.
- Before the first boot, open Settings → Network and switch every adapter to Host-only (LabNet). Many boxes ship set to Bridged or NAT.
- Boot it. These machines have no login for you; finding a way in is the challenge. Discover its IP from Kali with
netdiscover.
Some boxes come as VMware files (.vmx + .vmdk). Treat them like Metasploitable: create a new VM and attach the .vmdk as an existing disk.
Box got no IP? This is common with VMware-built machines. Power it off and change Adapter Type (under Advanced) to Intel PRO/1000 MT Desktop or PCnet-FAST III, then try again.
Vulnerable-VM safety checklist
- Host-only (LabNet) or Internal network only
- Snapshot fresh before attacking, restore when you're done
- Never reuse a real password inside the lab
- Power it off when you're not using it