04. Metasploit Basic Exploitation vsftpd
The Metasploitable2 virtual machine is intentionally vulnerable and commonly used for testing exploits. One such vulnerability involves the vsftpd FTP service. Below are the steps for exploiting it.
Prerequisites¶
-
Metasploitable2 VM is running and reachable.
-
Metasploit Framework is installed and configured.
-
Target system IP address is known.
Steps for Exploitation¶
1. Identify FTP Service¶
Use an auxiliary scanner to verify the FTP service and its version.
Command:
Example:
This confirms the target is running vsftpd and identifies the version.
2. Search for Exploit Module¶
Identify an exploit module for the vsftpd vulnerability.
Command:
Output Example:
Matching Modules
================
Name Disclosure Date Rank Description
---- --------------- ---- -----------
exploit/unix/ftp/vsftpd_234_backdoor 2011-07-03 excellent VSFTPD v2.3.4 Backdoor Command Execution
3. Load the Exploit¶
Load the identified exploit module.
Command:
4. Configure Module Options¶
Set the target IP address and other necessary options.
Commands:
Example:
5. Execute the Exploit¶
Run the exploit to compromise the target.
Command:
Output: If successful, you should get a shell or a backdoor connection to the target system.
Post-Exploitation¶
-
Confirm Access:
-
Verify the obtained shell or connection.
-
Execute basic commands like
whoamioruname -a.
-
-
Document Findings:
- Record details of the exploit and gathered information.
-
Clean Up:
- Close the session and remove traces, if required.
Best Practices and Warnings¶
-
Only exploit systems you own or have permission to test.
-
Document every step for reproducibility and reporting.
-
Understand the exploit’s behavior to minimize unintended consequences.
Exploiting vsftpd in Metasploitable2 demonstrates the workflow for penetration testing and helps build practical skills in ethical hacking.