<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[iRedMail — HOWTO: Protect against postfix AUTH DoS attacks]]></title>
		<link>https://forum.iredmail.org/topic8172-howto-protect-against-postfix-auth-dos-attacks.html</link>
		<atom:link href="https://forum.iredmail.org/feed-rss-topic8172.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in HOWTO: Protect against postfix AUTH DoS attacks.]]></description>
		<lastBuildDate>Tue, 24 Sep 2019 08:19:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: HOWTO: Protect against postfix AUTH DoS attacks]]></title>
			<link>https://forum.iredmail.org/post70809.html#p70809</link>
			<description><![CDATA[<div class="quotebox"><cite>svoboda77 wrote:</cite><blockquote><p>======== Required information ====<br />- iRedMail version: any<br />- Store mail accounts in which backend (LDAP/MySQL/PGSQL): any<br />- Linux/BSD distribution name and version: any<br />- Related log if you&#039;re reporting an issue: <br />====</p><p>I have tons of</p><p><em>Oct 19 06:30:49 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:49 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:49 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]<br />Oct 19 06:30:49 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]<br />Oct 19 06:30:51 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:51 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:51 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]</em><br />in my logs. If you are on the same boat and want to block such attacks, you can use <a href="https://essaydune.com/"><span style="color:#333333">essay writing service</span></a> tools and fail2ban:<br />1/ add following section to the end of your /etc/fail2ban/jail.local</p><div class="codebox"><pre><code>[postfix-auth]
enabled     = true
filter      = postfix.auth
action      = iptables-multiport[name=postfix, port=&quot;http,https,smtp,submission,pop3,pop3s,imap,imaps,sieve&quot;, protocol=tcp]
#           sendmail[name=Postfix, dest=you@mail.com]
logpath     = /var/log/mail.log</code></pre></div><p>2/ create new file /etc/fail2ban/filter.d/postfix.auth.conf</p><div class="codebox"><pre><code>[Definition]
failregex = lost connection after AUTH from (.*)\[&lt;HOST&gt;\]
ignoreregex =</code></pre></div><p>3/ Restart fail2ban. Attacker will be blocked after five attempts.</p></blockquote></div><br /><br /><p>Hi,</p><p>I forgot to add a &lt;host&gt; part. <br />I found this in one of the comments by Dean Willis on Maxoberberger blog:<br />[INCLUDES]<br />before = common.conf<br />[Definition]<br />_daemon = postfix/smtpd<br />failregex = lost connection after AUTH from [-._\w]+\[&lt;host&gt;\]<br />ignoreregex =<br />[Init]<br />journalmatch = _SYSTEMD_UNIT=postfix.service</p>]]></description>
			<author><![CDATA[null@example.com (brainsage)]]></author>
			<pubDate>Tue, 24 Sep 2019 08:19:04 +0000</pubDate>
			<guid>https://forum.iredmail.org/post70809.html#p70809</guid>
		</item>
		<item>
			<title><![CDATA[Re: HOWTO: Protect against postfix AUTH DoS attacks]]></title>
			<link>https://forum.iredmail.org/post39126.html#p39126</link>
			<description><![CDATA[<p>Hi Jochie,</p><p>Thanks for sharing. i added this improved regx in iRedMail, it will be available in next release. <img src="https://forum.iredmail.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Sat, 16 May 2015 00:48:33 +0000</pubDate>
			<guid>https://forum.iredmail.org/post39126.html#p39126</guid>
		</item>
		<item>
			<title><![CDATA[Re: HOWTO: Protect against postfix AUTH DoS attacks]]></title>
			<link>https://forum.iredmail.org/post39115.html#p39115</link>
			<description><![CDATA[<p>I&#039;d suggest to update that line to :</p><p><strong>lost connection after (AUTH|UNKNOWN|EHLO) from (.*)\[&lt;HOST&gt;\]</strong><br />The unknown and EHLO also seem to flood my log files, and aren&#039;t filtered out and banned.<br />After updating my regex it became silent again.</p>]]></description>
			<author><![CDATA[null@example.com (Jochie)]]></author>
			<pubDate>Fri, 15 May 2015 15:04:20 +0000</pubDate>
			<guid>https://forum.iredmail.org/post39115.html#p39115</guid>
		</item>
		<item>
			<title><![CDATA[Re: HOWTO: Protect against postfix AUTH DoS attacks]]></title>
			<link>https://forum.iredmail.org/post33920.html#p33920</link>
			<description><![CDATA[<p>Another way is simply adding &#039;failregex&#039; in file /etc/fail2ban/filter.d/postfix.iredmail.conf.<br />I added this regular expression in iRedMail by default. Thanks for your contribution.</p>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Fri, 24 Oct 2014 06:38:42 +0000</pubDate>
			<guid>https://forum.iredmail.org/post33920.html#p33920</guid>
		</item>
		<item>
			<title><![CDATA[HOWTO: Protect against postfix AUTH DoS attacks]]></title>
			<link>https://forum.iredmail.org/post33919.html#p33919</link>
			<description><![CDATA[<p>======== Required information ====<br />- iRedMail version: any<br />- Store mail accounts in which backend (LDAP/MySQL/PGSQL): any<br />- Linux/BSD distribution name and version: any<br />- Related log if you&#039;re reporting an issue: <br />====</p><p>I have tons of</p><p><em>Oct 19 06:30:49 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:49 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:49 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]<br />Oct 19 06:30:49 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:50 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]<br />Oct 19 06:30:51 mail postfix/smtpd[14043]: connect from unknown[151.237.190.118]<br />Oct 19 06:30:51 mail postfix/smtpd[14043]: lost connection after AUTH from unknown[151.237.190.118]<br />Oct 19 06:30:51 mail postfix/smtpd[14043]: disconnect from unknown[151.237.190.118]</em></p><p>in my logs. If you are on the same boat and want to block such attacks, you can use fail2ban:</p><p>1/ add following section to the end of your /etc/fail2ban/jail.local</p><div class="codebox"><pre><code>[postfix-auth]
enabled     = true
filter      = postfix.auth
action      = iptables-multiport[name=postfix, port=&quot;http,https,smtp,submission,pop3,pop3s,imap,imaps,sieve&quot;, protocol=tcp]
#           sendmail[name=Postfix, dest=you@mail.com]
logpath     = /var/log/mail.log</code></pre></div><p>2/ create new file /etc/fail2ban/filter.d/postfix.auth.conf</p><div class="codebox"><pre><code>[Definition]
failregex = lost connection after AUTH from (.*)\[&lt;HOST&gt;\]
ignoreregex =</code></pre></div><p>3/ Restart fail2ban. Attacker will be blocked after five attempts.</p>]]></description>
			<author><![CDATA[null@example.com (svoboda77)]]></author>
			<pubDate>Fri, 24 Oct 2014 05:48:51 +0000</pubDate>
			<guid>https://forum.iredmail.org/post33919.html#p33919</guid>
		</item>
	</channel>
</rss>
