Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Convert ASN to IPv4 list
# one-liner to convert ASN to ip addresses. Results will be appended to `ips.out`. | 1-7-2017
# requires: apt-get install prips
for asn in AS51468 AS37061 AS198810 AS39513;
do $(for range in $(echo $(whois -h -- "-i origin $asn" | grep -Eo "([0-9.]+){4}/[0-9]+") | sed ':a;N;$!ba;s/\n/ /g');
do prips $range >> ips.out;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment