FTP Enumeration - eJPTv2

Notes: FTP Enumeration with Metasploit


Overview

FTP (File Transfer Protocol) is a standard protocol used to transfer files between systems over a network. It operates on a client-server model, where the client initiates a connection to the server for file operations.

In this lab, we will explore FTP enumeration using the Metasploit Framework to gather information about the target FTP server and test for vulnerabilities.


Step-by-Step Guide


1. Verify Target Accessibility

Ensure the target machine is reachable by performing a ping test.

Command:

ping -c 4 demo.ine.local

2. Launch Metasploit Framework

Start the Metasploit console to begin enumeration.

Command:

msfconsole

3. Identify the FTP Service Version

Use the ftp_version module in Metasploit to identify the FTP server's version.

Commands:

use auxiliary/scanner/ftp/ftp_version
set RHOSTS demo.ine.local
run

The result reveals the FTP server version. Example: ProFTPD 1.3.5a.


4. Perform Brute-Force to Find FTP Credentials

Load the ftp_login module to perform brute force and identify valid credentials.

Commands:

use auxiliary/scanner/ftp/ftp_login
set RHOSTS demo.ine.local
set USER_FILE /usr/share/metasploit-framework/data/wordlists/common_users.txt
set PASS_FILE /usr/share/metasploit-framework/data/wordlists/unix_passwords.txt
run

5. Test for Anonymous Logins

Check if the FTP server allows anonymous access.

Commands:

use auxiliary/scanner/ftp/anonymous
set RHOSTS demo.ine.local
run

6. Log in to the FTP Server

Use the obtained credentials to log in to the FTP server.

Command:

ftp demo.ine.local

Successful authentication grants access to the FTP server.


Conclusion

In this lab, we:


Advanced Techniques and Insights


1. Manual Enumeration Techniques

If Metasploit is unavailable, manual enumeration can be performed:


2. Exploitation of Vulnerabilities

Certain versions of FTP servers (e.g., ProFTPD) may have vulnerabilities:


3. Custom Wordlists

Improve brute-force accuracy by using customized wordlists:


4. Logging FTP Activity

Capture FTP traffic for further analysis using tools like Wireshark or tcpdump.

Command:

tcpdump -i eth0 port 21 -w ftp_traffic.pcap

5. Bypassing Brute-Force Protections


6. Further Analysis with Nmap

Nmap scripts for FTP can provide additional insights: Command:

nmap -p 21 --script=ftp-* demo.ine.local

These advanced techniques supplement the basic enumeration process, providing deeper insights and enhancing your approach to FTP penetration testing. Let me know if you'd like to expand or tweak any section!