Nmap ftp-anon NSE Script


This page contains detailed information about how to use the ftp-anon NSE script. For list of all NSE scripts, visit the Nmap NSE Library.

Select:
Overview
Error Messages

Script Overview


Script source code: https://github.com/nmap/nmap/tree/master/scripts/ftp-anon.nse
Script categories: default, auth, safe
Target service / protocol: ftp, ftps
Target network port(s): 21, 990
List of CVEs: -

Script Description


The ftp-anon.nse script checks if an FTP server allows anonymous logins.

If anonymous is allowed, gets a directory listing of the root directory and highlights writeable files.

Ftp-anon NSE Script Arguments


This is a full list of arguments supported by the ftp-anon.nse script:

ftp-anon.maxlist

The maximum number of files to return in the directory listing. By default it is 20, or unlimited if verbosity is enabled. Use a negative number to disable the limit, or 0 to disable the listing entirely.

- - -
To use this script argument, add it to Nmap command line like in this example:

nmap --script=ftp-anon --script-args ftp-anon.maxlist=value <target>

Ftp-anon NSE Script Example Usage


Here's an example of how to use the ftp-anon.nse script:

nmap --script=ftp-anon <target>

Ftp-anon NSE Script Example Output


Here's a sample output from the ftp-anon.nse script:

PORT   STATE SERVICE
21/tcp open  ftp
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| -rw-r--r--   1 1170     924            31 Mar 28  2001 .banner
| d--x--x--x   2 root     root         1024 Jan 14  2002 bin
| d--x--x--x   2 root     root         1024 Aug 10  1999 etc
| drwxr-srwt   2 1170     924          2048 Jul 19 18:48 incoming [NSE: writeable]
| d--x--x--x   2 root     root         1024 Jan 14  2002 lib
| drwxr-sr-x   2 1170     924          1024 Aug  5  2004 pub
|_Only 6 shown. Use --script-args ftp-anon.maxlist=-1 to see all.

Ftp-anon NSE Script Example XML Output


There is no sample XML output for this module. However, by providing the -oX <file> option, Nmap will produce a XML output and save it in the file.xml file.

Authors


  • Eddie Bell
  • Rob Nicholls
  • Ange Gutek
  • David Fifield

References


See Also


Related NSE scripts to the ftp-anon.nse script:

Visit Nmap NSE Library for more scripts.

The ftp-anon.nse script may fail with the following error messages. Check for the possible causes by using the code snippets highlighted below found in the script source code. This can often times help in identifying the root cause of the problem.

got socket error %q.


Here is a relevant code snippet related to the "got socket error %q." error message:

103:	  end
104:	
105:	  local status, code, message = ftp.auth(socket, buffer, "anonymous", "IEUser@")
106:	  if not status then
107:	    if not code then
108:	      stdnse.debug1("got socket error %q.", message)
109:	    elseif code == 421 or code == 530 then
110:	      -- Don't log known error codes.
111:	      -- 421: Service not available, closing control connection.
112:	      -- 530: Not logged in.
113:	    else

Version


This page has been created based on Nmap version 7.92.

Go back to menu.