Nmap xdmcp-discover NSE Script


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

Script Description


The xdmcp-discover.nse script requests an XDMCP (X display manager control protocol) session and lists supported authentication and authorization mechanisms.

Xdmcp-discover NSE Script Arguments


The xdmcp-discover.nse script does not have any arguments.

Xdmcp-discover NSE Script Example Usage


Here's an example of how to use the xdmcp-discover.nse script:

nmap -sU -p 177 --script xdmcp-discover <ip>

Xdmcp-discover NSE Script Example Output


Here's a sample output from the xdmcp-discover.nse script:

PORT    STATE         SERVICE
177/udp open|filtered xdmcp
| xdmcp-discover:
|   Session id: 0x0000703E
|   Authorization name: MIT-MAGIC-COOKIE-1
|_  Authorization data: c282137c9bf8e2af88879e6eaa922326

Xdmcp-discover 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


Visit Nmap NSE Library for more scripts.

The xdmcp-discover.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:

38:	  local result = {}
39:	
40:	  local helper = xdmcp.Helper:new(host, port)
41:	  local status = helper:connect()
42:	  if ( not(status) ) then
43:	    return fail("Failed to connect to server")
44:	  end
45:	
46:	  local status, response = helper:createSession(nil,
47:	    {"MIT-MAGIC-COOKIE-1", "XDM-AUTHORIZATION-1"}, DISPLAY_ID)
48:	

Failed to create xdmcp session


Here is a relevant code snippet related to the "Failed to create xdmcp session" error message:

45:	
46:	  local status, response = helper:createSession(nil,
47:	    {"MIT-MAGIC-COOKIE-1", "XDM-AUTHORIZATION-1"}, DISPLAY_ID)
48:	
49:	  if ( not(status) ) then
50:	    return fail("Failed to create xdmcp session")
51:	  end
52:	
53:	  table.insert(result, ("Session id: 0x%.8X"):format(response.session_id))
54:	  if ( response.auth_name and 0 < #response.auth_name ) then
55:	    table.insert(result, ("Authentication name: %s"):format(response.auth_name))

Version


This page has been created based on Nmap version 7.92.

Go back to menu.