<?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>Engineer Tim &#187; iptables</title>
	<atom:link href="http://engineertim.com/category/iptables/feed/" rel="self" type="application/rss+xml" />
	<link>http://engineertim.com</link>
	<description>Engineers Blog</description>
	<lastBuildDate>Thu, 10 Jun 2010 16:53:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>asterisk bfd (brute force detection) rules for sip and iax</title>
		<link>http://engineertim.com/linux/asterisk-bfd-brute-force-detection-rules-for-sip-and-iax/</link>
		<comments>http://engineertim.com/linux/asterisk-bfd-brute-force-detection-rules-for-sip-and-iax/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 23:44:54 +0000</pubDate>
		<dc:creator>Engineer Tim</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apf / bfd]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://engineertim.com/?p=114</guid>
		<description><![CDATA[



Thank you to a couple users who pointed out that my bfd rules were a little less than perfect.  They worked great for me on a older version of bfd, but I believe a update to the bfd application caused them to stop working.  Either way, new rules have been created.
This one is [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-2722578695771488";
/* Engineertim 200x90 */
google_ad_slot = "4567243520";
google_ad_width = 200;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Thank you to a couple users who pointed out that my bfd rules were a little less than perfect.  They worked great for me on a older version of bfd, but I believe a update to the bfd application caused them to stop working.  Either way, new rules have been created.</p>
<p>This one is for SIP wrong passwords.  Save this as asterisksip</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># failed logins from a single address before ban<br />
# uncomment to override conf.bfd trig value<br />
TRIG=&quot;5&quot;<br />
<br />
# file must exist for rule to be active<br />
REQ=&quot;/usr/sbin/asterisk&quot;<br />
<br />
if [ -f &quot;$REQ&quot; ]<br />
then<br />
LP=&quot;/var/log/asterisk/full&quot;<br />
TLOG_TF=&quot;asterisk.sip&quot;<br />
TMP=&quot;/usr/local/bfd/tmp&quot;<br />
<br />
## ASTERISK: SIP wrong password<br />
ARG_VAL=`$TLOG_PATH $LP $TLOG_TF | grep -i &quot;wrong password&quot; | grep chan_sip | awk '{NF=NF-3} {print $NF}'| tr -d '\'\' `<br />
fi</div></div>
<p>This rule is for wrong or non existent extension.  Save this as asterisksip2</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># failed logins from a single address before ban<br />
# uncomment to override conf.bfd trig value<br />
TRIG=&quot;5&quot;<br />
<br />
# file must exist for rule to be active<br />
REQ=&quot;/usr/sbin/asterisk&quot;<br />
<br />
if [ -f &quot;$REQ&quot; ]<br />
then<br />
LP=&quot;/var/log/asterisk/full&quot;<br />
TLOG_TF=&quot;asterisk.sip2&quot;<br />
TMP=&quot;/usr/local/bfd/tmp&quot;<br />
<br />
## ASTERISK: SIP no extension<br />
ARG_VAL=`$TLOG_PATH $LP $TLOG_TF | grep -i &quot;No matching peer found&quot; | grep chan_sip | awk '{NF=NF-5} {print $NF}'| tr -d '\'\' `<br />
fi</div></div>
<p>This rule is for IAX.  Save this as asteriskiax.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># failed logins from a single address before ban<br />
# uncomment to override conf.bfd trig value<br />
<br />
TRIG=&quot;5&quot;<br />
# file must exist for rule to be active<br />
REQ=&quot;/usr/sbin/asterisk&quot;<br />
<br />
<br />
if [ -f &quot;$REQ&quot; ]<br />
then<br />
LP=&quot;/var/log/asterisk/full&quot;<br />
TLOG_TF=&quot;asterisk.iax&quot;<br />
TMP=&quot;/usr/local/bfd/tmp&quot;<br />
<br />
## ASTERISK: IAX2 auth failed<br />
<br />
ARG_VAL=`$TLOG_PATH $LP $TLOG_TF | grep -i &quot;failed MD5 authentication&quot; | grep chan_iax2 | awk '{NF=NF-8} {print $NF}'`<br />
fi</div></div>
<p>Special thanks goes to Ioan Indreias and Gonzalo Gonzalez.<br />
If it looks like the code is missing, try to highlight it all and copy/paste it into a text document.  Hopefully this will show the entire rule without issue.<br />
Make sure these rules are stored in /usr/local/bfd/rules/ Then rerun bfd with bfd -q and see if the new rules are in place by checking for the files in /usr/local/bfd/tmp/ .</p>
<p>Thank you,<br />
Engineer Tim</p>
]]></content:encoded>
			<wfw:commentRss>http://engineertim.com/linux/asterisk-bfd-brute-force-detection-rules-for-sip-and-iax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.200 seconds -->
