Nmap stun-info NSE Script


This page contains detailed information about how to use the stun-info 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/stun-info.nse
Script categories: discovery, safe
Target service / protocol: stun, udp
Target network port(s): 3478
List of CVEs: -

Script Description


The stun-info.nse script retrieves the external IP address of a NAT:ed host using the STUN protocol.

Stun-info NSE Script Arguments


The stun-info.nse script does not have any arguments.

Stun-info NSE Script Example Usage


Here's an example of how to use the stun-info.nse script:

nmap -sV -PN -sU -p 3478 --script stun-info <ip>

Stun-info NSE Script Example Output


Here's a sample output from the stun-info.nse script:

PORT     STATE         SERVICE
3478/udp open|filtered stun
| stun-info:
|_  External IP: 80.216.42.106

Stun-info 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.

Author


  • Patrik Karlsson

References


See Also


Related NSE scripts to the stun-info.nse script:

Visit Nmap NSE Library for more scripts.

The stun-info.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.

Failed to connect to server


Here is a relevant code snippet related to the "Failed to connect to server" error message:

29:	
30:	action = function(host, port)
31:	  local helper = stun.Helper:new(host, port)
32:	  local status = helper:connect()
33:	  if ( not(status) ) then
34:	    return fail("Failed to connect to server")
35:	  end
36:	
37:	  local status, result = helper:getExternalAddress()
38:	  if ( not(status) ) then
39:	    return fail("Failed to retrieve external IP")

Failed to retrieve external IP


Here is a relevant code snippet related to the "Failed to retrieve external IP" error message:

34:	    return fail("Failed to connect to server")
35:	  end
36:	
37:	  local status, result = helper:getExternalAddress()
38:	  if ( not(status) ) then
39:	    return fail("Failed to retrieve external IP")
40:	  end
41:	
42:	  port.version.name = "stun"
43:	  nmap.set_port_state(host, port, "open")
44:	  nmap.set_port_version(host, port)

Version


This page has been created based on Nmap version 7.92.

Go back to menu.