I have finally came up with the correct
regex as I believe but I still can't make
lfd to block the IP.
I added these lines to
/etc/csf/regex.custom.pm and then restart CSF:
Code: Select all
if (($lgfile eq $config{CUSTOM1_LOG}) and ($line =~ /^\S+\s+\d+\s+\S+ \S+ webmin\[\d+\]: Invalid login as root from/)) {
return ("Failed Webmin login from",$1,"webmin","2","80,443","1");
}
CUSTOM1_LOG is pointing to
/var/log/secure
I checked and tried to enter wrong passwords 5-10 times. The line that appears in CUSTOM1_LOG is there and it is:
Code: Select all
Apr 2 00:04:21 host webmin[95720]: Invalid login as root from 13.21.66.24
Still nothing is happening, what else am I missing?
Please help!?
P.S. Example of working regex in Perl can be found here:
www . codepad . org/Ug3xJbap