Nmap targets-xml NSE Script


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

Script Overview


Script source code: https://github.com/nmap/nmap/tree/master/scripts/targets-xml.nse
Script categories: safe
Target service / protocol: -
Target network port(s): -
List of CVEs: -

Script Description


The targets-xml.nse script loads addresses from an Nmap XML output file for scanning.

Address type (IPv4 or IPv6) is determined according to whether -6 is specified to nmap.

Targets-xml NSE Script Arguments


This is a full list of arguments supported by the targets-xml.nse script:

targets-xml.iX

Filename of an Nmap XML file to import

targets-xml.state

Only hosts with this status will have their addresses input. Default: "up"

slaxml.debug

Debug level at which default callbacks will print detailed parsing info. Default: 3

max-newtargets

Sets the number of the maximum allowed new targets. If set to 0 or less then there is no limit. The default value is 0.

newtargets

If specified, lets NSE scripts add new targets.

- - -
To use these script arguments, add them to the Nmap command line using the --script-args arg1=value,[arg2=value,..] syntax. For example:

nmap --script=targets-xml --script-args targets-xml.iX=value,targets-xml.state=value <target>

Targets-xml NSE Script Example Usage


Here's an example of how to use the targets-xml.nse script:

nmap --script targets-xml --script-args newtargets,iX=oldscan.xml

Targets-xml NSE Script Example Output


Here's a sample output from the targets-xml.nse script:

Pre-scan script results:
|_targets-xml: Added 16 ipv4 addresses

Targets-xml NSE Script Example XML Output


Here's a sample XML output from the targets-xml.nse script produced by providing the -oX <file> Nmap option:

16

Author


  • Daniel Miller

References


See Also


Related NSE scripts to the targets-xml.nse script:

Visit Nmap NSE Library for more scripts.

Version


This page has been created based on Nmap version 7.92.