One of the most time consuming things (especially for me) is unblocking customers who have blocked themselves.
If most of your customers are in the same country and you don't get many (if any) attacks from your location you can do the following:
Presuming you have followed I wish to have a block_ip.sh so I can block IPs through DirectAdmin: http://help.directadmin.com/item.php?id=380
First install GeoIPlookup: http://kbeezie.com/geoiplookup-command-line/
Locate the file: /usr/local/directadmin/scripts/custom/block_ip.sh
Underneath the following:
Place something like this:
Obviously change the settings to the country you desire and you will now not automatically block the country specified (failures will still be logged).
If most of your customers are in the same country and you don't get many (if any) attacks from your location you can do the following:
Presuming you have followed I wish to have a block_ip.sh so I can block IPs through DirectAdmin: http://help.directadmin.com/item.php?id=380
First install GeoIPlookup: http://kbeezie.com/geoiplookup-command-line/
Locate the file: /usr/local/directadmin/scripts/custom/block_ip.sh
Underneath the following:
Code:
### Make sure it's not alreaday blocked
COUNT=`grep -c "^${ip}=" $BF`;
if [ "$COUNT" -ne 0 ]; then
echo "$ip already exists in $BF ($COUNT). Not blocking.";
curriptables
exit 2;
fi
Place something like this:
Code:
################### Make sure it's not New Zealand! ##########
now=$(/usr/bin/geoiplookup $ip)
if [[ $now == *NZ* ]]; then
echo "This is a New Zealand ip address - Not Blocking";
curriptables
exit 2;
fi
##############################################################
Obviously change the settings to the country you desire and you will now not automatically block the country specified (failures will still be logged).