From 7c4db3f0118a2a436eadde9673be9769427bcf45 Mon Sep 17 00:00:00 2001 From: borekon Date: Wed, 5 May 2021 09:05:10 +0200 Subject: [PATCH] Update blocklist.sh Supress errors --- blocklist.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blocklist.sh b/blocklist.sh index ddf5b18..be250a0 100644 --- a/blocklist.sh +++ b/blocklist.sh @@ -17,10 +17,10 @@ if [ ! -f $GREP_PATH ]; then echo "Cannot find [ grep ]. Is it installed? Exitin echo "Downloading the most recent IP list from $BLOCKLISTDE ... and adding them to ipset blocklistde" ipset create blocklistde hash:ip -curl -s https://lists.blocklist.de/lists/all.txt | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" | xargs -L1 ipset add blocklistde +curl -s https://lists.blocklist.de/lists/all.txt | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" | xargs -L1 ipset add blocklistde 2>&1 echo "Downloading the most recent IP list from $BLOCKLISTDE ... and adding them to ipset crawlers" ipset create crawler_bots hash:ip -curl -s https://isc.sans.edu/api/threatcategory/research?json | jq '.[] | {ipv4}' | grep ':' | awk '{ print $2 }' | tr -d '"' | xargs -L1 ipset add crawler_bots +curl -s https://isc.sans.edu/api/threatcategory/research?json | jq '.[] | {ipv4}' | grep ':' | awk '{ print $2 }' | tr -d '"' | xargs -L1 ipset add crawler_bots 2>&1 echo "Adding the iptables rules..." iptables -I INPUT -m set --match-set crawler_bots src -j DROP iptables -I INPUT -m set --match-set blocklistde src -j DROP \ No newline at end of file