asnmap
Map IP addresses to Autonomous System Numbers
TLDR
Lookup CIDR ranges for an ASN
Lookup CIDR ranges for an IP address
Lookup CIDR ranges for a domain
Lookup CIDR ranges for an organization
Lookup CIDR ranges from a file of targets
Output results in JSON format
Output results in CSV format
Update asnmap to the latest version
SYNOPSIS
asnmap [-6dejlmPrsS] [-f poolfile] [-o outputfile] [-p asnfile] [-t threads] [cidr...]
PARAMETERS
-6
Enable IPv6 mode
-d
Debug mode (verbose output)
-e
Enumerate ASNs in range
-j
JSON output format
-l
Lookup mode (default, IP to ASN)
-m
Map mode (detailed prefix info)
-P
Print prefixes only
-r
Reverse lookup (IPs in ASN)
-s
Silent mode (no progress)
-S
CSV output format
-f poolfile
Load pre-built pool file
-o outputfile
Output to file
-p asnfile
ASN data file path
-t threads
Number of threads (default: cores)
DESCRIPTION
asnmap is a high-performance utility for mapping IP addresses or CIDR ranges to their corresponding Autonomous System Numbers (ASNs), organizations, and prefixes. Developed by NCC Group, it excels in speed by pre-loading BGP-derived ASN data into memory pools, enabling rapid lookups without real-time queries.
Ideal for network reconnaissance, security audits, and large-scale scans (e.g., with masscan or zmap), asnmap processes millions of IPs per second on multi-core systems. It supports both IPv4 and IPv6, with output formats like JSON, CSV, or plain text.
Key workflow: Download/update ASN data via asnmap-getasn, load into pools, then scan ranges. Modes include lookup (default), mapping (per-prefix details), enumeration (ASNs per range), and reverse (IPs from ASN). Its efficiency stems from radix trees and thread-parallelism, minimizing latency for bulk operations.
CAVEATS
Requires asnmap-getasn for data; high memory use for large pools; IPv6 support experimental; not for real-time whois.
INSTALLATION
Compile from source: git clone https://github.com/nccgroup/asnmap.git; make. Install asnmap-getasn for data.
DATA UPDATE
Run asnmap-getasn daily: fetches RouteViews BGP dumps, builds asn.mmap pools.
HISTORY
Released by NCC Group in 2017; active on GitHub (nccgroup/asnmap). Evolved from need for fast ASN resolution in scanning tools; regular updates for BGP data formats.


