#!/bin/sh ####################################################################### #Script Name: pfloadabipdb #Version: 1.3 #Description: Script to auto load 90% list of abuse ips from #AbuseIPDB #Last Modify Date: 01062021 #Author:Brent Dacus #Email:brent[at]thedacus[dot]net ####################################################################### # Variables # ####################################################################### abuseipdb_key=c13866e213ef23a0fbf2c57cd6474d63477dda0767a2a088249de1151f269157c48ab70a4dc0c531 ####################################################################### # Main # ####################################################################### ## get new abuesipdb server list curl -o /tmp/tmp_abipdb_file -G https://api.abuseipdb.com/api/v2/blacklist \ -d confidenceMinimum=90 \ -H "Key: $abuseipdb_key" \ -H "Accept: text/plain" ## enter into pf anti-ad server table pfctl -t abuseipdb -T replace -f /tmp/tmp_abipdb_file ## clean up and remove temp file rm -rf /tmp/tmp_* exit 0