Nmap ip-geolocation-map-kml NSE Script


This page contains detailed information about how to use the ip-geolocation-map-kml 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/ip-geolocation-map-kml.nse
Script categories: safe
Target service / protocol: -
Target network port(s): -
List of CVEs: -

Script Description


The ip-geolocation-map-kml.nse script queries the Nmap registry for the GPS coordinates of targets stored by previous geolocation scripts and produces a KML file of points representing the targets.

Ip-geolocation-map-kml NSE Script Arguments


This is a full list of arguments supported by the ip-geolocation-map-kml.nse script:

ip-geolocation-map-kml.map_path

(REQUIRED)

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

nmap --script=ip-geolocation-map-kml --script-args ip-geolocation-map-kml.map_path=value <target>

Ip-geolocation-map-kml NSE Script Example Usage


Here's an example of how to use the ip-geolocation-map-kml.nse script:

nmap -sn -Pn --script ip-geolocation-geoplugin,ip-geolocation-map-kml --script-args ip-geolocation-map-kml.map_path=map.kml <target>

Ip-geolocation-map-kml NSE Script Example Output


Here's a sample output from the ip-geolocation-map-kml.nse script:

| ip-geolocation-map-kml:
|_  The map has been saved at 'map.kml'.

Ip-geolocation-map-kml 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


References


See Also


Related NSE scripts to the ip-geolocation-map-kml.nse script:

Visit Nmap NSE Library for more scripts.

The ip-geolocation-map-kml.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 open file '%s'.


Here is a relevant code snippet related to the "Failed to open file '%s'." error message:

48:	
49:	  kml = table.concat(kml, "\n")
50:	
51:	  local f = io.open(path, "w")
52:	  if not f then
53:	    return false, ("Failed to open file '%s'."):format(path)
54:	  end
55:	
56:	  if not f:write(kml) then
57:	    return false, ("Failed to write file '%s'."):format(path)
58:	  end

Failed to write file '%s'.


Here is a relevant code snippet related to the "Failed to write file '%s'." error message:

52:	  if not f then
53:	    return false, ("Failed to open file '%s'."):format(path)
54:	  end
55:	
56:	  if not f:write(kml) then
57:	    return false, ("Failed to write file '%s'."):format(path)
58:	  end
59:	
60:	  f:close()
61:	
62:	  return true, ("The map has been saved at '%s'."):format(path)

Need to specify a path for the map.


Here is a relevant code snippet related to the "Need to specify a path for the map." error message:

63:	end
64:	
65:	local parse_args = function()
66:	  local map_path = stdnse.get_script_args(SCRIPT_NAME .. '.map_path')
67:	  if not map_path then
68:	    return false, "Need to specify a path for the map."
69:	  end
70:	
71:	  return true, map_path
72:	end
73:	

Script argument problem


Here is a relevant code snippet related to the "Script argument problem" error message:

77:	end
78:	
79:	action = function()
80:	  -- Parse and sanity check the command line arguments.
81:	  local status, path = oops.raise(
82:	    "Script argument problem",
83:	    parse_args())
84:	  if not status then
85:	    return path
86:	  end
87:	

Version


This page has been created based on Nmap version 7.92.

Go back to menu.