From 00badb2811e3f70c10c1b7627cd6f6c3cf7bcdb5 Mon Sep 17 00:00:00 2001 From: Lord Alfred <2259979+lord-alfred@users.noreply.github.com> Date: Mon, 22 Nov 2021 21:43:57 +0300 Subject: [PATCH] Add bingbot --- .github/workflows/update.yml | 3 +++ README.md | 5 +++++ bing/downloader.sh | 20 ++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 bing/downloader.sh diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 568bbb62..3c72ffd5 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -17,6 +17,7 @@ jobs: bash microsoft/downloader.sh bash oracle/downloader.sh bash digitalocean/downloader.sh + bash bing/downloader.sh - name: Set up Python 3.7 uses: actions/setup-python@v2 @@ -45,12 +46,14 @@ jobs: python utils/merge.py --source=microsoft/ipv4.txt | sort -h > microsoft/ipv4_merged.txt python utils/merge.py --source=oracle/ipv4.txt | sort -h > oracle/ipv4_merged.txt python utils/merge.py --source=digitalocean/ipv4.txt | sort -h > digitalocean/ipv4_merged.txt + python utils/merge.py --source=bing/ipv4.txt | sort -h > bing/ipv4_merged.txt # ipv6 python utils/merge.py --source=google/ipv6.txt | sort -h > google/ipv6_merged.txt python utils/merge.py --source=amazon/ipv6.txt | sort -h > amazon/ipv6_merged.txt python utils/merge.py --source=microsoft/ipv6.txt | sort -h > microsoft/ipv6_merged.txt # oracle not provide ipv6 python utils/merge.py --source=digitalocean/ipv6.txt | sort -h > digitalocean/ipv6_merged.txt + # bing not provide ipv6 - name: Commit files env: diff --git a/README.md b/README.md index 930c271f..1f3681f1 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,11 @@ All addresses are stored in `.txt` files with CIDRs, where each range is on a ne - IPv6: https://raw.githubusercontent.com/lord-alfred/ipranges/main/google/ipv6.txt - IPv6 (merged): https://raw.githubusercontent.com/lord-alfred/ipranges/main/google/ipv6_merged.txt +### Bing (Bingbot) + +- IPv4: https://raw.githubusercontent.com/lord-alfred/ipranges/main/bing/ipv4.txt +- IPv4 (merged): https://raw.githubusercontent.com/lord-alfred/ipranges/main/bing/ipv4_merged.txt + ### Amazon (AWS) - IPv4: https://raw.githubusercontent.com/lord-alfred/ipranges/main/amazon/ipv4.txt diff --git a/bing/downloader.sh b/bing/downloader.sh new file mode 100644 index 00000000..8b120c0d --- /dev/null +++ b/bing/downloader.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# https://www.bing.com/webmasters/help/verify-bingbot-2195837f + +set -euo pipefail +set -x + + +# get from public ranges +curl -s https://www.bing.com/toolbox/bingbot.json > /tmp/bing.json + + +# save ipv4 +jq '.prefixes[] | [.ipv4Prefix][] | select(. != null)' -r /tmp/bing.json > /tmp/bing-ipv4.txt + +# ipv6 not provided + + +# sort & uniq +sort -h /tmp/bing-ipv4.txt | uniq > bing/ipv4.txt