This lab guides learners through Metasploitable 2 service enumeration using Nmap NSE scripts to transform a port list into a prioritized attack surface map. Building on Lab 2's discovery of 23 open ports, Lab 3 identifies vulnerable service versions, maps them to known CVEs and Metasploit modules, enumerates web applications, and creates an attack priority matrix that organizes targets by exploitation likelihood and impact. This structured enumeration output becomes the reference document for all subsequent exploitation labs in the series.
- NSE scripts reveal service depth beyond port scanningNmap's Scripting Engine runs targeted, service-specific checks that basic version detection misses. For example, ftp-vsftpd-backdoor specifically tests whether port 6200 opens in response to the ":)" username trigger, confirming not just that vsftpd 2.3.4 is present but that the CVE-2011-2523 backdoor is actually functional. Similarly, smb-enum-shares and smb-os-discovery extract available shares and security mode from SMB services, and mysql-empty-password tests for unauthenticated database root access — data essential for building an accurate attack plan.
- CVE mapping transforms versions into exploitation pathsThe article demonstrates building a service-to-CVE mapping table where each vulnerable version links directly to a known vulnerability identifier and corresponding Metasploit module path. For instance, vsftpd 2.3.4 maps to CVE-2011-2523 and the module exploit/unix/ftp/vsftpd_234_backdoor; Samba 3.0.20 maps to CVE-2007-2447 and exploit/multi/samba/usermap_script. This mapping eliminates guesswork during exploitation and enables prioritization based on whether vulnerabilities are actively exploitable with available tools.
- Web application enumeration discovers multiple attack surfacesHTTP enumeration on port 80 reveals at least seven distinct vulnerable applications hosted on a single port: DVWA (practicing OWASP Top 10), Mutillidae (40+ vulnerabilities), phpMyAdmin (MySQL admin access with empty root password), TikiWiki (CVE-2012-0911 RCE), TWiki (CVE-2005-2877 RCE), WebDAV, and the default Apache page. The article emphasizes that phpMyAdmin with unauthenticated root access enables full database compromise plus potential remote code execution through MySQL's INTO OUTFILE file write capability, creating a complete MySQL-to-webshell-to-RCE exploitation chain.
- Attack priority matrix organizes findings by impactThe matrix ranks all discovered services by priority tier (CRITICAL, HIGH, MEDIUM), listing port, service, version, CVE, exploitation method, and corresponding Metasploit module. The four CRITICAL targets on Metasploitable (vsftpd backdoor, Samba usermap, bindshell 1524, UnrealIRCd backdoor) are distinguished by requiring no credentials, no brute force, and no social engineering — the vulnerabilities enable direct shell access in under 60 seconds each. This organization transforms raw enumeration data into an actionable exploitation sequence.
- Backdoor vulnerabilities differ from traditional exploitationThe vsftpd 2.3.4 backdoor (CVE-2011-2523) represents a specific threat model: a compromised open-source distribution containing intentionally inserted malicious code rather than a coding error. Sending a username containing ":)" triggers the backdoor to open a root command shell on port 6200. The NSE script ftp-vsftpd-backdoor verifies port 6200 responds, confirming the backdoor is present and active — a supply chain integrity failure documented as an educational example within Metasploitable.
- Enumeration phase output drives all downstream exploitationThe attack priority matrix built in Lab 3 serves as the reference document for Labs 4 through 10. Each exploitation lab targets a service identified and prioritized during enumeration. Lab 4 begins with vsftpd because it appears as CRITICAL priority, offers clean demonstration of the Metasploit module workflow, and requires only a single exploit command to achieve root shell — the enumeration phase's structured output determines the optimal teaching and testing sequence.
- Exercise structure validates enumeration completenessThe three exercises progress from running NSE scripts (Exercise 1: 20 minutes testing FTP, SMB, HTTP, MySQL, vulnerability scan), to mapping web applications (Exercise 2: 15 minutes enumerating port 80 paths and testing phpMyAdmin access), to consolidating findings into the attack matrix (Exercise 3: 10 minutes compiling and sorting by priority). A well-executed enumeration should identify at least 4 CRITICAL and 6+ HIGH priority targets; fewer results indicate incomplete scanning of services.
Bottom line: Service enumeration using targeted NSE scripts transforms a list of open ports into a prioritized attack surface map organized by exploitation feasibility and impact — this structured output becomes the operational reference for every subsequent exploitation attempt, eliminating guesswork and ensuring efficient targeting of the highest-value vulnerabilities first. Building and documenting this attack matrix (port, service, version, CVE, priority, exploit method, Metasploit module) is the core de
Part of the Metasploitable Lab Series
🎯 What You’ll Master in Lab 3
⏱️ 40 min · 3 exercises · Lab 3 of 10
✅ Before You Start
- Lab 2 — Nmap Enumeration — the four-stage scan from Lab 2 confirmed all 23 open ports. Today I take those ports and run targeted NSE scripts to get service versions, CVE indicators, and the full attack surface map.
- Metasploitable 2 running on host-only network · Kali Linux on same host-only adapter · You know Metasploitable’s IP from Lab 2
📋Metasploitable Service Enumeration Lab – Contents
The attack surface I build organises the Metasploitable target for every subsequent lab. After Lab 2’s Nmap scan, this lab adds depth. The full exploitation sequence continues in Lab 4 where I run the first Metasploit module against the highest-priority service found today. The Metasploitable hub has the complete series. Use the Port Scanner Tool to verify port status before each lab.
NSE Scripts — Service-Specific Enumeration
Nmap’s NSE (Nmap Scripting Engine) adds targeted checks on top of basic port scanning. The scripts I run on Metasploitable cover the six highest-value service categories: FTP, SSH, SMB, HTTP, databases, and vulnerability detection. Each script category extracts information the basic version scan misses.
⏱️ 20 minutes · Kali Linux + Metasploitable 2 on host-only network
Run the NSE script chain against each high-priority service. The vsftpd backdoor check and SMB enumeration results will shape the attack plan for Labs 4 and 5.
Step 1: FTP NSE check
nmap -sV -p21 –script ftp-anon,ftp-vsftpd-backdoor TARGET_IP
Did the vsftpd backdoor check trigger? What did it return?
Is anonymous FTP enabled?
Step 2: SMB NSE enumeration
nmap -p139,445 –script smb-os-discovery,smb-enum-shares,smb-security-mode TARGET_IP
What OS did smb-os-discovery return?
What shares are available?
Is SMB signing enforced?
Step 3: HTTP title and enumeration
nmap -p80 –script http-title,http-enum TARGET_IP
List every web path http-enum found.
How many web applications are running on port 80?
Step 4: MySQL empty password check
nmap -p3306 –script mysql-empty-password,mysql-info TARGET_IP
Is the MySQL root account accessible without a password?
What databases are listed?
Step 5: Comprehensive vuln scan
nmap –script vuln -p21,22,23,80,139,445,3306 TARGET_IP -oN vuln_output.txt
cat vuln_output.txt | grep “VULNERABLE\|CVE\|EXPLOIT”
How many vulnerable services does it identify?
Document: full output from each scan. Note: service, version, finding.
📸 Screenshot showing vsftpd backdoor detection result. Share in #metasploitable-labs.
Version Analysis — CVE Mapping
After version detection, I map each service version to known CVEs. The table I build from this mapping is the attack priority list — services ranked by exploitation likelihood and impact, with the Metasploit module path for each.
Web Application Enumeration — Port 80
Port 80 on Metasploitable runs Apache hosting multiple intentionally vulnerable web applications. The http-enum NSE script finds most of them, but I always follow up with direct browsing to understand what’s actually exposed.
⏱️ 15 minutes · Kali + browser
Enumerate every web application running on port 80 and document what attack surface each one offers.
nmap -p80 –script http-enum TARGET_IP
List all paths returned.
Step 2: gobuster directory scan
gobuster dir -u http://TARGET_IP/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 30 -o web_enum.txt
What paths does gobuster find that http-enum missed?
Step 3: Browse each application
Open browser to each found path.
For each app note:
– What is it? (DVWA, phpMyAdmin, CMS, etc.)
– What are the default credentials? (check online)
– What vulnerability class does it practice?
Step 4: phpMyAdmin — MySQL access
http://TARGET_IP/phpMyAdmin/
Login: root / (empty password)
Does it work?
What databases are visible?
Document: application name, URL path, default credentials, attack surface.
📸 Screenshot showing phpMyAdmin logged in as root. Share in #metasploitable-labs.
Building the Attack Priority Matrix
The attack surface document I build from enumeration organises every finding by exploitation difficulty and impact. This is the reference document I carry through every subsequent lab — it tells me which target to hit when I want to demonstrate a specific technique.
⏱️ 10 minutes · compile and document your findings
Consolidate everything from Labs 2 and 3 into the attack matrix document that drives the rest of the series. This is the deliverable you’d include in a real pentest report’s attack surface section.
For each service/application found, record:
PORT | SERVICE | VERSION | CVE/FINDING | PRIORITY | EXPLOIT METHOD | METASPLOIT MODULE
Template rows (fill in from your scan output):
21 | vsftpd | 2.3.4 | CVE-2011-2523 | CRITICAL | backdoor port 6200 | exploit/unix/ftp/vsftpd_234_backdoor
445 | Samba | 3.0.20 | CVE-2007-2447 | CRITICAL | username map script | exploit/multi/samba/usermap_script
1524 | shell | direct | no CVE needed | CRITICAL | nc TARGET 1524 | manual
[add all others from your scans]
Sort by: CRITICAL first, then HIGH, then MEDIUM.
Final check:
cat attack_matrix.txt
How many CRITICAL priority targets did you find?
Which 3 would you exploit first and why?
📸 Screenshot your completed attack_matrix.txt. Share in #metasploitable-labs.
📋 Lab 3 Command Reference
🏆 Lab 3 Complete — Service Enumeration
NSE script enumeration, CVE mapping, web application discovery, and the attack priority matrix. Lab 4 is where the work pays off — I take the vsftpd 2.3.4 backdoor finding and run the first complete Metasploit module against a real vulnerable service.
🧠 Quick Check
❓ Frequently Asked Questions
What services run on Metasploitable 2?
What is the vsftpd 2.3.4 backdoor?
How do you enumerate SMB on Metasploitable?
What web applications are on Metasploitable port 80?
What Nmap NSE scripts are most useful for Metasploitable?
What is the attack priority order for Metasploitable?
Lab 2 — Nmap Enumeration
Lab 4 — Metasploit First Module
📚 Further Reading
- Lab 2 — Nmap Enumeration — The four-stage scan that produced the port list this lab’s NSE scripts build on. Required context for understanding why each NSE script targets the specific ports it does.
- Metasploitable Lab Series Hub — All 10 labs in sequence. The service enumeration output from Lab 3 is referenced in Labs 4 through 10 — every exploitation lab targets a service identified here.
- Port Scanner Tool — Quick external port verification before starting any Metasploitable lab session — confirms the target is up and the host-only interface is correctly configured.
- Nmap NSE Documentation — The complete NSE script library reference. Every script used in this lab is documented here with parameters, output examples, and category classification for building targeted scan commands.
- Rapid7 Vulnerability Database — The CVE database behind Metasploit module targeting. Look up each CVE found in your enumeration output to understand the vulnerability details and available exploitation options.

