Home page logo
/
Intro Reference Guide Book Install Guide
Download Changelog Zenmap GUI Docs
Bug Reports OS Detection Propaganda Related Projects
In the Movies In the News

File banner

Download: http://nmap.org/svn/scripts/banner.nse

User Summary

A simple banner grabber which connects to an open TCP port and prints out anything sent by the listening service within five seconds.

The banner will be truncated to fit into a single line, but an extra line may be printed for every increase in the level of verbosity requested on the command line.

Script Output

21/tcp open  ftp
|_ banner: 220 FTP version 1.0\x0D\x0A

Requires


categories discovery safe

author jah <jah at zadkiel.plus.com>

copyright © See Nmap License: http://nmap.org/book/man-legal.html

Action

action (host, port)

Grabs a banner and outputs it nicely formatted.

Parameters

  • host:
  • port:

Portrule

portrule (host, port)

Script is executed for any TCP port.

Parameters

  • host:
  • port:

Functions

extra_output ()

Returns a number for each level of verbosity specified on the command line.

get_timeout ()

Returns a number of milliseconds for use as a socket timeout value (defaults to 5 seconds).

grab_banner (host, port)

Connects to the target on the given port and returns any data issued by a listening service.

output (out)

Formats the banner for printing to the port script result.

replace_nonprint (s, len)

Replaces characters with ASCII values outside of the range of standard printable characters (decimal 32 to 126 inclusive) with hex encoded equivalents.



Functions

extra_output ()

Returns a number for each level of verbosity specified on the command line.

Ignores level increases resulting from debugging level.

Return value:

Number
get_timeout ()

Returns a number of milliseconds for use as a socket timeout value (defaults to 5 seconds).

Return value:

Number of milliseconds.
grab_banner (host, port)

Connects to the target on the given port and returns any data issued by a listening service.

Parameters

  • host: Host Table.
  • port: Port Table.

Return value:

String or nil if data was not received.
output (out)

Formats the banner for printing to the port script result.

Non-printable characters are hex encoded and the banner is then truncated to fit into the number of lines of output desired.

Parameters

  • out: String banner issued by a listening service.

Return value:

String formatted for output.
replace_nonprint (s, len)

Replaces characters with ASCII values outside of the range of standard printable characters (decimal 32 to 126 inclusive) with hex encoded equivalents.

The second parameter dictates the number of characters to return, however, if the last character before the number is reached is one that needs replacing then up to three characters more than this number may be returned. If the second parameter is nil, no limit is applied to the number of characters that may be returned.

Parameters

  • s: String on which to perform substitutions.
  • len: Number of characters to return.

Return value:

String.

Nmap Site Navigation

Intro Reference Guide Book Install Guide
Download Changelog Zenmap GUI Docs
Bug Reports OS Detection Propaganda Related Projects
In the Movies In the News
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]