Add few scripts to easily update some IPs lists (#1436)
* Add few scripts to easily update some IPs lists Some IPs lists should be updated frequently: try to easy the process. The basic idea is taken fromd59fefd0anda8fe74e5(for Azure addresses): one specific .c.inc file and one script for each protocol. Add the possibility to don't load a specific list. Rename the old NDPI_PROTOCOL_HOTMAIL id to NDPI_PROTOCOL_MS_OUTLOOK, to identify Hotmail/Outlook/Exchange flows. TODO: ipv6 Remove the 9 addresses associated to BitTorrent: they have been added ine2f21116but it is not clear why all the traffic to/from these ips should be classified as BitTorrent. * Added quotes * Added quotes Co-authored-by: Luca Deri <lucaderi@users.noreply.github.com>
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd "$(dirname "${0}")"
|
||||
|
||||
DEST=../src/lib/ndpi_tor_match.c.inc
|
||||
LIST=/tmp/tor.list
|
||||
# There are at least two lists:
|
||||
# * https://torstatus.rueckgr.at/ip_list_all.php/Tor_ip_list_ALL.csv
|
||||
# * https://check.torproject.org/torbulkexitlist
|
||||
# The latter seems to be more "stable" (the former changes every few seconds!)
|
||||
ORIGIN="https://check.torproject.org/torbulkexitlist"
|
||||
|
||||
|
||||
echo "(1) Downloading file..."
|
||||
http_response=$(curl -s -o $LIST -w "%{http_code}" ${ORIGIN})
|
||||
if [ $http_response != "200" ]; then
|
||||
echo "Error $http_response: you probably need to update the list url!"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "(2) Processing IP addresses..."
|
||||
./ipaddr2list.py $LIST NDPI_PROTOCOL_TOR > $DEST
|
||||
rm -f $LIST
|
||||
|
||||
echo "(3) TOR IPs are available in $DEST"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user