Skip to content Dark Web Informer - Cyber Threat Intelligence

Asnmap: Go CLI and Library for quickly mapping organization network ranges using ASN information


GitHub: https://github.com/projectdiscovery/asnmap


asnmap is a fast and flexible tool by ProjectDiscovery to look up ASN and CIDR ranges from a wide variety of input formats — IPs, domains, organizations, or ASNs. Perfect for OSINT, threat recon, or attack surface mapping.


✨ Key Features

  • ASN → CIDR lookup
  • ORG → CIDR lookup
  • DNS → CIDR lookup
  • IP → CIDR lookup
  • Supports input via ASN/DNS/IP/ORG
  • JSON, CSV, and plain text output formats
  • STDIN and STDOUT support for chaining
  • Built-in support for piping into tools like naabu, httpx, dnsx, tlsx, nuclei

⚙️ Installation

Requires Go 1.21+

bashCopyEditgo install github.com/projectdiscovery/asnmap/cmd/asnmap@latest

Or download binaries from the release page.


🧪 Example Usage

bashCopyEditasnmap -h

Input Examples

bashCopyEditasnmap -a AS45596 -silent
asnmap -i 100.19.12.21 -silent
asnmap -d hackerone.com -silent
asnmap -org GOOGLE -silent

You can also pipe input directly:

bashCopyEditecho GOOGLE | ./asnmap -silent


🔐 Authentication

asnmap uses the ProjectDiscovery Cloud Platform and requires an API key.

Using Environment Variable

bashCopyEditexport PDCP_API_KEY=your_api_key

Using Interactive Auth

bashCopyEditasnmap -auth


📤 Output Options

  • -json: JSON output
  • -csv: CSV output
  • -o <file>: Save results to file
  • -silent: Clean output
  • -v6: Show IPv6 CIDRs
  • -verbose: Debug/verbose output

📦 Output Example

CIDR (Default Output)

bashCopyEdit8.8.4.0/24
8.8.8.0/24

JSON Output

jsonCopyEdit{
"timestamp": "...",
"input": "hackerone.com",
"as_number": "AS13335",
"as_name": "CLOUDFLARENET",
"as_country": "US",
"as_range": [
"104.16.0.0/14",
"104.20.0.0/16"
]
}

CSV Output

swiftCopyEdittimestamp|input|as_number|as_name|as_country|as_range
2022-09-19|hackerone.com|AS13335|CLOUDFLARENET|US|104.16.0.0/14,104.20.0.0/16


🔁 Chaining with Other Tools

asnmap supports seamless piping into other ProjectDiscovery tools:

bashCopyEditecho AS54115 | asnmap | naabu -p 443 | httpx | nuclei -id tech-detect


📚 Library Usage

You can import asnmap directly into your Go projects. See examples for implementation details.


🙏 Acknowledgments

Thanks to Frank Denis for maintaining the open IP→ASN database used by asnmap.

Latest