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.asnThe ASN to search.
targets-asn.whois_portThe whois port to use. Default: 43.
targets-asn.whois_serverThe whois server to use. Default: asn.shadowserver.org.
max-newtargetsSets the number of the maximum allowed new targets. If set to 0 or less then there is no limit. The default value is 0.
newtargetsIf 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
- https://nmap.org/nsedoc/scripts/targets-asn.html
- https://github.com/nmap/nmap/tree/master/scripts/targets-asn.nse
- http://www.shadowserver.org/wiki/pmwiki.php/Services/IP-BGP
- https://nmap.org/svn/docs/licenses/BSD-simplified
See Also
Related NSE scripts to the targets-asn.nse script:
- targets-ipv6-map4to6.nse
- targets-ipv6-multicast-echo.nse
- targets-ipv6-multicast-invalid-dst.nse
- targets-ipv6-multicast-mld.nse
- targets-ipv6-multicast-slaac.nse
- targets-ipv6-wordlist.nse
- targets-sniffer.nse
- targets-traceroute.nse
- targets-xml.nse
Visit Nmap NSE Library for more scripts.
Version
This page has been created based on Nmap version 7.92.