abuseip changed

Grab the abuseip list in plaintext
This commit is contained in:
Alfonso 2023-04-20 17:24:23 +02:00 committed by GitHub
parent 76ec2fd886
commit e2260312be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ $(whereis ipset | cut -d" " -f 2) 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_PATH add crawler_bots 2>&1 curl -s https://isc.sans.edu/api/threatcategory/research?json | jq '.[] | {ipv4}' | grep ':' | awk '{ print $2 }' | tr -d '"' | xargs -L1 $IPSET_PATH add crawler_bots 2>&1
echo "Downloading the most recent IP list from $ABUSE and adding them to abuseipdb" echo "Downloading the most recent IP list from $ABUSE and adding them to abuseipdb"
$(whereis ipset | cut -d" " -f 2) create abuseipdb hash:ip $(whereis ipset | cut -d" " -f 2) create abuseipdb hash:ip
curl -s -H "key: $abuse_key" https://api.abuseipdb.com/api/v2/blacklist | 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_PATH add abuseipdb 2>&1 curl -G -H "key: $abuse_key" -H "Accept: text/plain" -d confidenceMinimum=90 https://api.abuseipdb.com/api/v2/blacklist | xargs -L1 $IPSET_PATH add abuseipdb 2>&1
echo "Adding the iptables rules..." echo "Adding the iptables rules..."
$IPTABLES_PATH -I INPUT -m set --match-set crawler_bots src -j DROP $IPTABLES_PATH -I INPUT -m set --match-set crawler_bots src -j DROP
$IPTABLES_PATH -I INPUT -m set --match-set blocklistde src -j DROP $IPTABLES_PATH -I INPUT -m set --match-set blocklistde src -j DROP