Anonymous FTP scanning differences between Metasploit and Nmap

Metasploit has a auxiliary module dedicated to anonymous FTP scanning. I was interest to compare this Metasploit module with Nmap ftp-anon NSE script.

I decided to scan a /19 rang, how represent 8192 IP addresses with the 2 tools, compare the results and the time to do these scans.


    Just play with Metasploit cli to have the possibility, without configuring the Metasploit database, to measure the needed time to do the complete scan.
    time ./msfcli auxiliary/scanner/ftp/anonymous ConnectTimeout=1 FTPTimeout=1 E
    By default, the Metasploit ftp_anonymous auxiliary module is single threaded, you can if you want increase the number of thread  by setting the THREADS variable. We will not change this default configuration, cause Nmap is single threaded.  But we will decrease the ConnectTimeout and FTPTimeout advanced configuration to 1 second.
    Metasploit has take around 75 minutes to scan all the 8192 IP addresses, and return us 35 anonymous FTP.
    With 256 threads, to be fair ^^, Metasploit scans the 8192 IP addresses in 1 minute 27seconds. (LOL)
    We had these kinds of results :
    [*] Anonymous READ (220 FTP server ready)
    [*] Scanned 4075 of 8192 hosts (050% complete)
    [*] Auxiliary module execution completed
    [*] bbb.bbb.bbb.bbb:21 Anonymous READ/WRITE (220 Welcome to my FTP Server)
    [*] Scanned 5045 of 8192 hosts (060% complete)
    [*] Auxiliary module execution completed
    To test if the anonymous FTP is writable, Metasploit try to create a directory with the MKD command, and if the creation is successful, this directory is directly deleted by the RMD command. If the anonymous FTP is not writable, then he is logically only readable 🙂 In addition Metasploit will also grab the FTP banners of the anonymous FTP server.


    With Nmap, the following command will permit you to scan anonymous FTP, grab the banner and fingerprint the service, but will not test for you if the anonymous FTP is writable or not.
    time sudo nmap -p21 -n -sC -sV –script=banner –script=ftp-anon
    Nmap has take around 20 minutes to scan all the 8192 IP addresses, and return us only 11 anonymous FTP.
    We has these kinds of results :
    Nmap scan report for
    Host is up (0.026s latency).
    21/tcp open  ftp     ProFTPD
    |_banner: 220 FTP server ready
    |_ftp-anon: Anonymous FTP login allowed
    Service Info: Host:; OS: Unix
    Nmap scan report for bbb.bbb.bbb.bbb
    Host is up (0.027s latency).
    21/tcp open  ftp
    |_banner: 220 Welcome to my FTP Server
    |_ftp-anon: Anonymous FTP login allowed
    1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at :
    Service Info: Host: my
    We have test 2 times the complete scans with Metasploit and Nmap, and we got the same results. What is surprising is the difference between the number of anonymous FTP detected by Metasploit (and verified by hand later) and the results of Nmap.
    As suggested by Ron Bowes, I tested a different approach for the Nmap anon-ftp scanning, to increase the time optimization.
    First test with :
    time sudo nmap -p21 -PS -n –script=ftp-anon
    Nmap has finish the scan in 6 minutes and 20 seconds, still more than Metasploit, but no more 20 minutes.
    Second test with :
    time sudo nmap -p21 -PS -n -T4 –script=ftp-anon
    Nmap has finish the scan in 6 minutes and 35 seconds, the -T4 option doesn’t has change anything in term of performances.
    Ron has also confirm that nmap anon-ftp LUA script is missing some anonymous FTP, and this randomly.