ipv6: add support for ipv6 addresses lists (#2113)

This commit is contained in:
Ivan Nardi
2023-10-26 20:15:44 +02:00
committed by GitHub
parent 1832d247b3
commit 611c3b66f0
524 changed files with 36435 additions and 3191 deletions
+16 -7
View File
@@ -12,6 +12,7 @@ TMP3=/tmp/bot_google_c3.json
TMP_BING=/tmp/bot_bing.json
TMP_FB=/tmp/bot_fb.list
LIST=/tmp/bot.list
LIST6=/tmp/bot.list6
#Google Common crawlers
ORIGIN1="https://developers.google.com/static/search/apis/ipranges/googlebot.json"
#Google Special-case crawlers
@@ -48,16 +49,24 @@ is_file_empty "${TMP_FB}"
echo "(2) Processing IP addresses..."
{
jq -r '.prefixes | .[].ipv4Prefix | select( . != null )' $TMP1 # TODO: ipv6
jq -r '.prefixes | .[].ipv4Prefix | select( . != null )' $TMP2 # TODO: ipv6
jq -r '.prefixes | .[].ipv4Prefix | select( . != null )' $TMP3 # TODO: ipv6
jq -r '.prefixes | .[].ipv4Prefix | select( . != null )' $TMP_BING # TODO: ipv6
grep -v route6 $TMP_FB | tr -d 'route:^ ' # TODO: ipv6
jq -r '.prefixes | .[].ipv4Prefix | select( . != null )' $TMP1
jq -r '.prefixes | .[].ipv4Prefix | select( . != null )' $TMP2
jq -r '.prefixes | .[].ipv4Prefix | select( . != null )' $TMP3
jq -r '.prefixes | .[].ipv4Prefix | select( . != null )' $TMP_BING
grep -v route6 $TMP_FB | tr -d 'route:^ '
} > $LIST
is_file_empty "${LIST}"
./ipaddr2list.py $LIST NDPI_HTTP_CRAWLER_BOT > $DEST
{
jq -r '.prefixes | .[].ipv6Prefix | select( . != null )' $TMP1
jq -r '.prefixes | .[].ipv6Prefix | select( . != null )' $TMP2
jq -r '.prefixes | .[].ipv6Prefix | select( . != null )' $TMP3
jq -r '.prefixes | .[].ipv6Prefix | select( . != null )' $TMP_BING
grep route6 $TMP_FB | tr -d 'route6:^ '
} > $LIST6
is_file_empty "${LIST6}"
./ipaddr2list.py $LIST NDPI_HTTP_CRAWLER_BOT $LIST6 > $DEST
is_file_empty "${DEST}"
rm -f $TMP1 $TMP2 $TMP3 $TMP_BING $TMP_FB $LIST
rm -f $TMP1 $TMP2 $TMP3 $TMP_BING $TMP_FB $LIST $LIST6
echo "(3) Crawlers IPs are available in $DEST"
exit 0