Skip to content

Instantly share code, notes, and snippets.

@jayswan jayswan/cidrs.sh
Created Jul 26, 2016

Embed
What would you like to do?
Scripts to retrieve CIDR blocks for various services
# Fastly
curl -s https://api.fastly.com/public-ip-list | jq -r '.addresses | .[]'
# Google
dig @8.8.8.8 +short txt _netblocks.google.com | awk '{gsub("ip4:","");for (col=2; col<NF;++col) print $col}'
# AWS
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | \
jq --raw-output '.prefixes | map(.ip_prefix) | .[]'
# Tor
curl -s https://check.torproject.org/exit-addresses \
| awk '/ExitAddress/ {print $2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.