| name | asnmap |
| description | Auth/lab ref: ProjectDiscovery tool for mapping IP ranges from ASN data. For passive recon to discover the full IP space owned by a target organization before port sweeping, and to identify cloud vs. |
| license | MIT |
| compatibility | Linux/macOS/Windows; Go binary; Requires network access for ASN API queries. |
| metadata | {"author":"AeonDave","version":"1.0"} |
asnmap
Map an organization's full IP space from ASN data. Feeds directly into masscan/nmap scopes.
Quick start
asnmap -d target.com
asnmap -i 1.2.3.4
asnmap -org "Target Corporation"
asnmap -a AS12345
asnmap -d target.com -o cidr_ranges.txt
Input modes
asnmap -d target.com,sub.target.com
asnmap -list domains.txt -o ranges.txt
asnmap -i 1.2.3.4,5.6.7.8
asnmap -org "Target Inc" -json
Output formats
asnmap -d target.com
asnmap -d target.com -json
asnmap -d target.com -silent
asnmap -d target.com -csv
Pipeline integration
asnmap -d target.com -silent | masscan --ports 80,443,8080,8443 -iL - --rate 5000
asnmap -d target.com -silent | nmap -iL - -sV --top-ports 100
asnmap -d target.com -silent | while read cidr; do
shodan search "net:$cidr"
done
asnmap -d target.com -silent | dnsx -resp-only -ptr -o ptr_records.txt
CDN and cloud filtering
Before scanning, filter out CDN and cloud provider IP ranges to avoid wasting time on shared infrastructure.
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[].ip_prefix' > aws_ranges.txt
curl -s https://www.gstatic.com/ipranges/cloud.json | jq -r '.prefixes[].ipv4Prefix // empty' > gcp_ranges.txt
asnmap -d target.com -silent > target_ranges.txt
cat target_ips.txt | cdncheck -resp -o cdncheck_results.txt
Cloud-hosted ranges are valid targets, but:
- Scanning Cloudflare/Akamai origin IPs leaks your source to CDN logs.
- Scanning shared cloud ranges may hit other tenants — check authorization scope.
ASN investigation workflow
asnmap -d target.com -json | jq '.asn'
asnmap -a AS12345 -silent
whois AS12345
shodan search "asn:AS12345" --fields ip_str,port,org
OPSEC notes
- asnmap queries public ASN databases (WHOIS, BGP sources) — passive, no target contact.
- Combine with
cdncheck to tag CDN-hosted IPs before active scanning.
- Large organizations may have dozens of ASNs across regions — always run org name search in addition to domain lookup.
- Cloud provider subnets change frequently — pull fresh CIDR lists before each engagement.