Created
November 8, 2022 23:58
-
-
Save finnigja/a021319f05215e82e812b78e6c31edbe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# got a list of IPs you need to do lookups for? | |
# map them back to their ASes with Team Cymru's DNS-based IP-to-ASN lookup service... | |
$ for asn in $( | |
for ip in $(cat ips.txt); do | |
revip=$(echo $ip | awk -F. '{print $4"."$3"."$2"."$1}'); | |
dig +short $revip.origin.asn.cymru.com TXT; | |
done | cut -d ' ' -f 1 | cut -c 2- | sort | uniq | |
); | |
do dig +short AS$asn.asn.cymru.com TXT; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment