Home page logo
/
Intro Reference Guide Book Install Guide
Download Changelog Zenmap GUI Docs
Bug Reports OS Detection Propaganda Related Projects
In the Movies In the News

Sponsors


File asn-query

Script types: hostrule
Categories: discovery, external, safe
Download: http://nmap.org/svn/scripts/asn-query.nse

User Summary

Maps IP addresses to autonomous system (AS) numbers.

The script works by sending DNS TXT queries to a DNS server which in turn queries a third-party service provided by Team Cymru (team-cymru.org) using an in-addr.arpa style zone set up especially for use by Nmap. The responses to these queries contain both Origin and Peer ASNs and their descriptions, displayed along with the BGP Prefix and Country Code. The script caches results to reduce the number of queries and should perform a single query for all scanned targets in a BGP Prefix present in Team Cymru's database.

Be aware that any targets against which this script is run will be sent to and potentially recorded by one or more DNS servers and Team Cymru. In addition your IP address will be sent along with the ASN to a DNS server (your default DNS server, or whichever one you specified with the dns script argument).

Script Arguments

dns

The address of a recursive nameserver to use (optional).

unittest.run

See the documentation for the unittest library.

Example Usage

nmap --script asn-query [--script-args dns=<DNS server>] <target>

Script Output

Host script results:
|  asn-query:
|  BGP: 64.13.128.0/21 | Country: US
|    Origin AS: 10565 SVCOLO-AS - Silicon Valley Colocation, Inc.
|      Peer AS: 3561 6461
|  BGP: 64.13.128.0/18 | Country: US
|    Origin AS: 10565 SVCOLO-AS - Silicon Valley Colocation, Inc.
|_     Peer AS: 174 2914 6461

Requires


Author: jah, Michael Pattrick

License: Same as Nmap--See http://nmap.org/book/man-legal.html

action

action (host)

Cached results are checked before sending a query for the target and extracting the relevant information from the response. Mutual exclusion is used so that results can be cached and so a single thread will be active at any time.

Parameters

  • host: Host table.

Return value:

Formatted answers or nil on errors.

hostrule

hostrule (host)

This script will run for any non-private IP address.

Parameters

  • host:

Nmap Site Navigation

Intro Reference Guide Book Install Guide
Download Changelog Zenmap GUI Docs
Bug Reports OS Detection Propaganda Related Projects
In the Movies In the News
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]