X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=config%2Fguardian%2Fguardian.pl;h=0c37c34f4f8e22e4bd59c44dfcf9bd9069a7029e;hb=e21bd39e1271891eb3105e980c85bdd72306ccbd;hp=5c421868b9bebb25faab1044541dfee9f206462a;hpb=6579aab26777a1a21932aec0eb629d9f55716d3e;p=people%2Fpmueller%2Fipfire-2.x.git diff --git a/config/guardian/guardian.pl b/config/guardian/guardian.pl index 5c421868b9..0c37c34f4f 100644 --- a/config/guardian/guardian.pl +++ b/config/guardian/guardian.pl @@ -34,12 +34,13 @@ if ($hostipaddr !~ /\d+\.\d+\.\d+\.\d+/) { $networkaddr = $hostipaddr; $networkaddr =~ s/\d+$/0/; -$gatewayaddr = $hostipaddr; -$gatewayaddr =~ s/\d+$/$hostgatewaybyte/; +$gatewayaddr = `cat /var/ipfire/red/remote-ipaddress 2>/dev/null`; $broadcastaddr = $hostipaddr; $broadcastaddr =~ s/\d+$/255/; &build_ignore_hash; +print "My gatewayaddess is: $gatewayaddr\n"; + # This is the target hash. If a packet was destened to any of these, then the # sender of that packet will get denied, unless it is on the ignore list.. @@ -93,7 +94,7 @@ for (;;) { while () { chop; if ($_=~/.*sshd.*Failed password for root from.*/) { - my @array=split(/ /,$_);&checkssh ($array[10], "possible SSH-Bruteforce Attack");} + my @array=split(/ /,$_);&checkssh ($array[11], "possible SSH-Bruteforce Attack");} } } @@ -210,7 +211,8 @@ sub build_ignore_hash { if ($ignorefile ne "") { open (IGNORE, $ignorefile); while () { - chop; + $_=~ s/\s+$//; + chomp; next if (/\#/); #skip comments next if (/^\s*$/); # and blank lines $ignore{$_}=1;