Lookup the AS (autonomous system) name, number and netblocks associated with an IP address or ASN, and generate blocklists by ASN.
You can jump directly to the data with: https://asntool.com/<ip|asn>
Netblocks can be added or removed from autonomous systems at any time.
Something like this (use at your own risk): iptables-save | grep -v "ASNTool" | iptables-restore
I would tell you my source (which I came across by pure luck), but I'm afraid the more people who know about it, the more likely it is to dry up. I do not know why AS data is such a closely guarded secret. I hate how it only seems to be accessible through middlemen (at a price). That's why I created this.
That's because I combine adjacent netblocks where possible.
I'm not sure how long I can offer it before the bandwidth is cost prohibitive, but here it is: data.tsv.gz.
Format is: subnet low address (as an integer), subnet high address (as an integer), netblock string, ASN, AS name.
To find the ASN given a source IP, convert the IP to an integer, and find the rightmost (largest) low address (i.e. the first column) less than or equal to the source IP. Then ensure the source IP is between (inclusive) of the low/high address. The Python bisect module and find_le function is useful for this.
I won't stop you from making automated HTTP requests (if you keep it to a reasonable level). Put your email address in the HTTP user agent so I can contact you.
1 request per second. Exceeding the limit is undefined behavior.
I generated it from an attack on my own website in December of 2022. If you know of a better source, email me.
I'm holding out for IPv7.
I don't. It is provided to you out of the goodness of my heart.
I'll allow it. rumpelstiltskin at this domain.
Last AS data update: Wed, 06 Nov 2024 03:33:34 GMT