From: <abe...@us...> - 2011-11-21 05:40:27
|
Revision: 5264 http://astlinux.svn.sourceforge.net/astlinux/?rev=5264&view=rev Author: abelbeck Date: 2011-11-21 05:40:20 +0000 (Mon, 21 Nov 2011) Log Message: ----------- adaptive-ban-plugin, remove possible IPv4 port numbers extracted from logs, fixes an issue reported by Fernando Fuentes Modified Paths: -------------- branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh Modified: branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh =================================================================== --- branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh 2011-11-20 18:31:22 UTC (rev 5263) +++ branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh 2011-11-21 05:40:20 UTC (rev 5264) @@ -2,10 +2,10 @@ # -= Arno's iptables firewall - Adaptive Ban plugin =- # PLUGIN_NAME="Adaptive Ban plugin" -PLUGIN_VERSION="1.03 BETA" +PLUGIN_VERSION="1.04 BETA" PLUGIN_CONF_FILE="adaptive-ban.conf" # -# Last changed : May 20, 2011 +# Last changed : November 20, 2011 # Requirements : AIF 2.0.0+ # Comments : Parse a log file for failed access with offending IP addresses # Ban the IP address after multiple failed attempts Modified: branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh =================================================================== --- branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh 2011-11-20 18:31:22 UTC (rev 5263) +++ branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh 2011-11-21 05:40:20 UTC (rev 5264) @@ -205,6 +205,9 @@ { local count="$1" type="$2" line host IFS + # Remove possible IPv4 port numbers, IPv4:PORT -> IPv4 + sed -i -r -e 's/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+):[0-9]+$/\1/' "$TEMPFILE" + IFS=$'\n' for line in $(sort "$TEMPFILE" | uniq -c); do if [ "$(echo "$line" | awk '{ print $1; }')" -ge "$count" ]; then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |