06-30-2021, 05:32 PM
(06-28-2021, 01:13 PM)StevenB Wrote: Hi,
For those who have a server that running with CSF, this is how to block WordPress login attack.
/usr/local/csf/bin/regex.custom.pm
You can replace 3600 with 1 if want to block IP permanently.Code:if (($globlogs{CUSTOM4_LOG}{$lgfile}) and ($line =~ /(\S+).*] "POST \/wp-login\.php.*" 200/)) {
return ("Failed Wordpress login from",$1,"wordpress","5","80,443","3600");
}
/etc/csf/csf.conf
The load on the server will not high. Mine load only load average: 9.78, 10.68, 10.16.Code:CUSTOM4_LOG = "/var/log/apache2/domlogs/*/*"
You can check this using tail -f /var/log/lfd.log
Cheers!
Working perfectly thanks, been having so many issues with WP lately.