💻 Scripts
Discovering Prefixes of an AS
descobre_prefixos.py
This script obtains prefixes based on RADB. It can be extremely useful if your router is not exporting ASNs through the flow data. With this script, you can add these prefixes, for example, to the file fav-asn-prefix-graphs.json or use it for CDN discovery of an operator (script above).
Install the required packages and download the script.
apt install python3-netaddr whois wget
wget -O /bin/descobre_prefixos https://rrflow.com.br/downloads/descobre_prefixos.py
chmod +x /bin/descobre_prefixos
Now just run your script followed by the ASN for which you want to obtain the prefixes.
To get only IPv4 prefixes:
descobre_prefixos AS32934 -4
To get only IPv6 prefixes:
descobre_prefixos AS32934 -6
To get both:
descobre_prefixos AS32934
The output will be:
{
"description": "Prefixos AS32934",
"filter": {
"prefix": [
"31.13.24.0/21",
"31.13.64.0/18",
"45.64.40.0/22",
"57.144.0.0/14",
"66.111.48.0/22",
"66.220.144.0/20",
"69.63.176.0/20",
"69.171.224.0/19",
"74.119.76.0/22",
"102.132.96.0/20",
"103.4.96.0/22",
"129.134.0.0/16",
"147.75.208.0/20",
"157.240.0.0/16",
"163.70.128.0/17",
"163.77.128.0/17",
"173.252.64.0/18",
"179.60.192.0/22",
"185.60.216.0/22",
"185.89.216.0/22",
"204.15.20.0/22",
"2401:db00::/32",
"2620:0:1c00::/40",
"2a03:2880::/31",
"2a03:2887:ff0c::/47",
"2a03:2887:ff0f::/48",
"2a03:2887:ff10::/47",
"2a03:2887:ff13::/48",
"2a03:2887:ff15::/48",
"2a03:2887:ff28::/48",
"2a03:2887:ff2c::/47",
"2a03:2887:ff31::/48",
"2a03:2887:ff32::/48",
"2a03:2887:ff42::/48",
"2a03:2887:ff46::/47",
"2a03:2887:ff58::/47",
"2a03:83e0::/32",
"2a10:f781:10:cee0::/64"
]
}
}
Just use them in your filters now!
Here is a short list of AS:
Youtube » AS36040
Google Cloud » AS396982
Google » AS15169
Facebook » AS32934
Valve Corp. » AS32590
Telefonica » AS18881
Amazon » AS16509
Akamai » AS20940
Level3 » AS3356
Fastly » AS54113
ByteDance (Tiktok) » AS396986
ZEN-ECN » AS21859
CloudFlare » AS13335
Netflix » AS2906
CDS Global Cloud » AS63199
CDN77 (Xvideos) » AS60068