🔨 List all IP ranges from: Google (Cloud & GoogleBot), Bing (Bingbot), Amazon (AWS), Microsoft, Oracle (Cloud), GitHub, Facebook (Meta), OpenAI (GPTBot) and other with daily updates.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
677 B

#!/bin/bash
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-githubs-ip-addresses
set -euo pipefail
set -x
# get from public ranges
curl -s https://api.github.com/meta > /tmp/github.json
# get all prefixes without some keys
jq 'del(.["ssh_keys", "verifiable_password_authentication", "ssh_key_fingerprints", "domains"]) | .[] | .[]' -r /tmp/github.json > /tmp/github-all.txt
# save ipv4
grep -v ':' /tmp/github-all.txt > /tmp/github-ipv4.txt
# save ipv6
grep ':' /tmp/github-all.txt > /tmp/github-ipv6.txt
# sort & uniq
sort -V /tmp/github-ipv4.txt | uniq > github/ipv4.txt
sort -V /tmp/github-ipv6.txt | uniq > github/ipv6.txt