Nmap targets-asn NSE Script


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

Script Description


The targets-asn.nse script produces a list of IP prefixes for a given routing AS number (ASN).

This script uses a whois server database operated by the Shadowserver Foundation. We thank them for granting us permission to use this in Nmap.

Output is in CIDR notation.

Targets-asn NSE Script Arguments


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

targets-asn.asn

The ASN to search.

targets-asn.whois_port

The whois port to use. Default: 43.

targets-asn.whois_server

The whois server to use. Default: asn.shadowserver.org.

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-asn --script-args targets-asn.asn=value,targets-asn.whois_port=value <target>

Targets-asn NSE Script Example Usage


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

nmap --script targets-asn --script-args targets-asn.asn=32

Targets-asn NSE Script Example Output


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

Pre-scan script results:
| targets-asn:
|   32
|     128.12.0.0/16
|_    171.64.0.0/14

Targets-asn 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


  • John R. Bond

References


See Also


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

Visit Nmap NSE Library for more scripts.

Version


This page has been created based on Nmap version 7.92.