<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Control WebPanel Wiki &#187; CSF Brute Force Protection</title>
	<atom:link href="https://wiki.centos-webpanel.com/tag/csf-brute-force-protection/feed" rel="self" type="application/rss+xml" />
	<link>https://wiki.centos-webpanel.com</link>
	<description>CentOS WebPanel Wiki</description>
	<lastBuildDate>Wed, 12 Feb 2025 20:38:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>CSF/LFD Brute Force Protection</title>
		<link>https://wiki.centos-webpanel.com/csf-lfd-brute-force-protection</link>
		<comments>https://wiki.centos-webpanel.com/csf-lfd-brute-force-protection#comments</comments>
		<pubDate>Tue, 07 Apr 2015 02:54:01 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[CSF Brute Force Protection]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=254</guid>
		<description><![CDATA[Activate CSF Brute Force Protection for CWP Login and customize according to you needs. Replace in: /etc/csf/csf.conf (somewhere at the end of the file) CUSTOM1_LOG = "/var/log/customlog" replace with CUSTOM1_LOG = "/var/log/cwp_client_login.log" Add in: /usr/local/csf/bin/regex.custom.pm if (($globlogs{CUSTOM1_LOG}{$lgfile}) and ($line =~ /^\S+\s+\S+\s+(\S+)\s+Failed Login from:\s+(\S+) on: (\S+)/)) { return ("Failed CWP-Login login for User: $1 from IP: [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Activate CSF Brute Force Protection for CWP Login and customize according to you needs.</strong></p>
<p><strong>Replace in:</strong> /etc/csf/csf.conf (somewhere at the end of the file)</p>
<pre>CUSTOM1_LOG = "/var/log/customlog"</pre>
<p>replace with</p>
<pre>CUSTOM1_LOG = "/var/log/cwp_client_login.log"</pre>
<p><strong>Add in:</strong> /usr/local/csf/bin/regex.custom.pm</p>
<pre>if (($globlogs{CUSTOM1_LOG}{$lgfile}) and ($line =~ /^\S+\s+\S+\s+(\S+)\s+Failed Login from:\s+(\S+) on: (\S+)/)) {
               return ("Failed CWP-Login login for User: $1 from IP: $2 URL: $3",$2,"cwplogin","5","2030,2031","1");
}</pre>
<p><strong>Now restart CSF &#038; LFD</strong></p>
<pre>csf -r</pre>
<p><strong>Example in LFD Logs</strong></p>
<pre>Apr  6 22:50:29 server1 lfd[17676]: (cwplogin) Failed CWP-Login login for User: root from IP: 99.138.135.52 URL: http://75.4.159.85:2030/login.php?login=failed</pre>
<p><strong>Instructions for configuration</strong><br />
$2 = the offending IP address</p>
<p>"cwplogin" = a unique identifier for this custom rule, must be alphanumeric and have no spaces</p>
<p>"5" = the trigger level for blocking (Block IP after 5 failed login attempts)</p>
<p>"2030,2031" = the ports to block the IP from in a comma separated list, only used if LF_SELECT enabled. To specify the protocol use 53;udp,53;tcp</p>
<p>"1" = n/temporary (n = number of seconds to temporarily block) or 1/permanant IP block, only used if LF_TRIGGER is disabled</p>
<p><strong>How to test ?</strong><br />
Simple, try to login 5 times with invalid password and you will be blocked by the firewall.</p>
<p>More detailed info for CSF/LFD configration can be found here.<br />
<a href='/csflfd-firewall-configuration'>CSF/LFD firewall configuration</a></p>
]]></content:encoded>
			<wfw:commentRss>https://wiki.centos-webpanel.com/csf-lfd-brute-force-protection/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
