ASN and IP Ranges
A large organization doesn’t have one IP: it has ranges of IPs, and sometimes its own ASN (Autonomous System Number), the identifier of a network on the Internet. Discovering which ranges and ASN the target owns hugely expands the surface: you go from “this domain” to “all the infrastructure this company controls,” including hosts with no DNS name but with exposed services.
What an ASN is
Section titled “What an ASN is”An ASN groups the IP blocks an entity announces via BGP (the Internet’s routing protocol). ISPs and large companies have their own ASNs; a small business usually uses its cloud or hosting provider’s. From the ASN you get all the ranges that entity owns.
Discover the ASN and ranges
Section titled “Discover the ASN and ranges”The starting point is whois on a known IP, and from there to ASN tools:
whois 1.2.3.4 # organization, range, and ASN of that IPasnmap -d target.com # ASN and ranges for the domain (projectdiscovery)amass intel -asn <ASN> # domains within an ASNwhois -h whois.radb.net '!g<AS_NUMBER>' # prefixes announced by the ASVery useful web services: bgp.he.net (Hurricane Electric) to see an organization’s ASNs and prefixes, and ipinfo.io/AS<ASN> for ranges and details.
From ranges to live targets
Section titled “From ranges to live targets”Once you have the ranges (CIDR), discover what’s alive, preferably passively first:
# passive: services in the range via Shodan (see recon-shodan)# Shodan: net:1.2.3.0/24# active (with scope): discovery and scanning (see recon-activo)nmap -sn 1.2.3.0/24 # live hostsmasscan 1.2.3.0/24 -p80,443,22,3389 --rate 5000# reverse DNS of the range (host names)for ip in 1.2.3.{1..254}; do dig +short -x $ip; donePassive discovery is covered in Shodan and Device Search Engines and active discovery in Active Reconnaissance.
Why it matters
Section titled “Why it matters”- Hosts with no DNS name: services exposed on IPs that appear in no subdomain.
- Real IP behind a CDN: if the origin is in the same ASN or range as the org, you find it bypassing Cloudflare (see WAF Bypass).
- Acquisitions and forgotten infra: ranges from acquired companies and old data centers.
- Delimiting the real scope: in a pentest or bug bounty, knowing which IPs are truly the target’s.
BGP: how ranges are announced
Section titled “BGP: how ranges are announced”The Internet routes via BGP: each ASN announces the prefixes (CIDR blocks) it controls, and other routers learn “to reach 1.2.3.0/24, go via AS X.” That information is public and is exactly what you exploit in recon:
whois -h whois.radb.net '!gAS<NUM>' # the AS's route objects (prefixes)whois -h whois.cymru.com ' -v 1.2.3.4' # from a prefix to its origin ASN and orgA prefix is sometimes delegated in smaller blocks to customers, so a nominal ASN range may not be the target’s. Always verify ownership (the inetnum/org object in whois) before scanning.
Cloud: own ASN vs provider’s
Section titled “Cloud: own ASN vs provider’s”The difference determines the whole strategy:
- Org with its own ASN (banks, telcos, large corporations): owns its ranges, and the ASN gives you all its infrastructure directly.
- Org on cloud (most common): its assets live in AWS, Azure, or GCP ranges, i.e. the provider’s ASN. Don’t scan “the AWS ASN”: those are millions of other customers’ IPs. Here recon goes through DNS, subdomains, and Certificate Transparency, not the ASN.
Rule of thumb: the ASN is gold when the target has its own network; for a cloud small business, focus on the asset inventory via DNS.
Mind the scope
Section titled “Mind the scope”An ASN can include customer IPs, shared hosting, or things outside the authorized scope. Verify ownership before scanning: attacking an IP that isn’t the target’s (even if it’s in “its” nominal range) can be illegal and out of scope (see Reading the Scope & Rules).
Common mistakes
Section titled “Common mistakes”- Scanning a cloud provider’s ASN thinking it’s the target’s: you touch third-party infra.
- Assuming an IP is owned without checking the
inetnum/orgin whois. - Forgetting reverse DNS of the range, which often names telltale internal hosts.
- Confusing “in the org’s range” with “in scope”: in bug bounty the program rules.
Defensive note
Section titled “Defensive note”Know your own surface: inventory your ASNs and ranges, be aware of what you expose on DNS-less IPs, protect the origin behind the CDN (not reachable by its direct IP), and monitor your prefixes. An ASM (Attack Surface Management) does exactly this from the defensive side.
Testing checklist
Section titled “Testing checklist”- whois of domain/IP → organization and ASN.
- Target’s ASN and prefixes (asnmap / bgp.he.net / amass intel).
- CIDR ranges collected.
- Passive discovery in the ranges (Shodan
net:). - Reverse DNS of the ranges (host names).
- Real IP behind a CDN searched in the owned ranges.
- Ownership of each IP verified before scanning.
- Hosts with no DNS but with services noted.