<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: IPTables against SSH dictionary attacks</title>
	<atom:link href="http://mwolf.net/archive/iptables-against-ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://mwolf.net/archive/iptables-against-ssh/</link>
	<description>Software development and assorted geekery</description>
	<lastBuildDate>Tue, 23 Feb 2010 06:06:46 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tom smish</title>
		<link>http://mwolf.net/archive/iptables-against-ssh/comment-page-1/#comment-7402</link>
		<dc:creator>Tom smish</dc:creator>
		<pubDate>Thu, 26 Nov 2009 10:28:42 +0000</pubDate>
		<guid isPermaLink="false">http://mwolf.net/archive/iptables-against-ssh/#comment-7402</guid>
		<description>Iâ€™ve always tried to learn the minimum to get iptables to do what I want it to. Using it effectively is like mastering another programming language.</description>
		<content:encoded><![CDATA[<p>Iâ€™ve always tried to learn the minimum to get iptables to do what I want it to. Using it effectively is like mastering another programming language.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: D. Stussy</title>
		<link>http://mwolf.net/archive/iptables-against-ssh/comment-page-1/#comment-5029</link>
		<dc:creator>D. Stussy</dc:creator>
		<pubDate>Thu, 04 Jun 2009 13:48:53 +0000</pubDate>
		<guid isPermaLink="false">http://mwolf.net/archive/iptables-against-ssh/#comment-5029</guid>
		<description>If one has to have SSH open to the world, it&#039;s better to implement the recent feature as a WHITELIST, not a blacklist - and deny everyone else.

As far as how to put systems into the whitelist, that&#039;s done by accessing some other resource on the same physical machine.  It doesn&#039;t matter if this is a different TCP (or even UDP) port or a different IP address (for a multi-homed machine or one that services multiple IPs via virtual hosting), or an out-of-band method such as a web server script that writes directly the IP address of the requestor to the appropriate file in &quot;/proc/net/xt_recent/&quot; or via e-mail to a special mailbox that extracts the address to write.  The whitelist should use both the &quot;--seconds&quot; and &quot;--rttl&quot; features of the &quot;recent&quot; module to time out entries and help prevent source IP forgery (at least by comparing TTL values).</description>
		<content:encoded><![CDATA[<p>If one has to have SSH open to the world, it&#8217;s better to implement the recent feature as a WHITELIST, not a blacklist &#8211; and deny everyone else.</p>
<p>As far as how to put systems into the whitelist, that&#8217;s done by accessing some other resource on the same physical machine.  It doesn&#8217;t matter if this is a different TCP (or even UDP) port or a different IP address (for a multi-homed machine or one that services multiple IPs via virtual hosting), or an out-of-band method such as a web server script that writes directly the IP address of the requestor to the appropriate file in &#8220;/proc/net/xt_recent/&#8221; or via e-mail to a special mailbox that extracts the address to write.  The whitelist should use both the &#8220;&#8211;seconds&#8221; and &#8220;&#8211;rttl&#8221; features of the &#8220;recent&#8221; module to time out entries and help prevent source IP forgery (at least by comparing TTL values).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Wolf&#8217;s weblog &#187; Blog Archive &#187; Firewall improvements from R. Scott Smith</title>
		<link>http://mwolf.net/archive/iptables-against-ssh/comment-page-1/#comment-1351</link>
		<dc:creator>Martin Wolf&#8217;s weblog &#187; Blog Archive &#187; Firewall improvements from R. Scott Smith</dc:creator>
		<pubDate>Sun, 03 Feb 2008 20:11:22 +0000</pubDate>
		<guid isPermaLink="false">http://mwolf.net/archive/iptables-against-ssh/#comment-1351</guid>
		<description>[...] In response to my article about using the recent IPTables module to fight brute-force password attacks, based on an idea from Andrew Pollock, a reader worked out the idea into a complete firewall script, with configurable whitelisting, the ability to block multiple ports, and several other enhancements. Read his post for the details. [...]</description>
		<content:encoded><![CDATA[<p>[...] In response to my article about using the recent IPTables module to fight brute-force password attacks, based on an idea from Andrew Pollock, a reader worked out the idea into a complete firewall script, with configurable whitelisting, the ability to block multiple ports, and several other enhancements. Read his post for the details. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: me</title>
		<link>http://mwolf.net/archive/iptables-against-ssh/comment-page-1/#comment-169</link>
		<dc:creator>me</dc:creator>
		<pubDate>Fri, 04 May 2007 00:09:56 +0000</pubDate>
		<guid isPermaLink="false">http://mwolf.net/archive/iptables-against-ssh/#comment-169</guid>
		<description>The reason it didn&#039;t work right most likely is because you added -j ACCEPT to the first command. just strip that off.</description>
		<content:encoded><![CDATA[<p>The reason it didn&#8217;t work right most likely is because you added -j ACCEPT to the first command. just strip that off.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Wolf</title>
		<link>http://mwolf.net/archive/iptables-against-ssh/comment-page-1/#comment-124</link>
		<dc:creator>Martin Wolf</dc:creator>
		<pubDate>Sun, 25 Mar 2007 16:25:50 +0000</pubDate>
		<guid isPermaLink="false">http://mwolf.net/archive/iptables-against-ssh/#comment-124</guid>
		<description>Thanks!

I have made the script you sent me available for download:
http://mwolf.net/misc-files/rc.firewall

It&#039;s linked to from a new article:
http://mwolf.net/archive/firewall-script-from-scott/</description>
		<content:encoded><![CDATA[<p>Thanks!</p>
<p>I have made the script you sent me available for download:<br />
<a href="http://mwolf.net/misc-files/rc.firewall" rel="nofollow">http://mwolf.net/misc-files/rc.firewall</a></p>
<p>It&#8217;s linked to from a new article:<br />
<a href="http://mwolf.net/archive/firewall-script-from-scott/" rel="nofollow">http://mwolf.net/archive/firewall-script-from-scott/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: R. Scott Smith</title>
		<link>http://mwolf.net/archive/iptables-against-ssh/comment-page-1/#comment-123</link>
		<dc:creator>R. Scott Smith</dc:creator>
		<pubDate>Sun, 25 Mar 2007 03:30:25 +0000</pubDate>
		<guid isPermaLink="false">http://mwolf.net/archive/iptables-against-ssh/#comment-123</guid>
		<description>I made the improvements I described earlier.  I also added some descriptions to what&#039;s happening.  The other thing is the logging switch.  I put that in, but I have it turned off.  Since I&#039;m not interested in logging when the block occurs, I did not put that ability in script, but I don&#039;t think it would be too hard to add. I&#039;m e-mailing the script to you now.

This is my personal e-mail address you are receiving this from.  I don&#039;t give this one out to businesses or the like, only people I know.  Please respect that and use meetscott@netscape.net if you want to distribute some correspondence to someone else.  Thanks.</description>
		<content:encoded><![CDATA[<p>I made the improvements I described earlier.  I also added some descriptions to what&#8217;s happening.  The other thing is the logging switch.  I put that in, but I have it turned off.  Since I&#8217;m not interested in logging when the block occurs, I did not put that ability in script, but I don&#8217;t think it would be too hard to add. I&#8217;m e-mailing the script to you now.</p>
<p>This is my personal e-mail address you are receiving this from.  I don&#8217;t give this one out to businesses or the like, only people I know.  Please respect that and use <a href="mailto:meetscott@netscape.net">meetscott@netscape.net</a> if you want to distribute some correspondence to someone else.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Wolf</title>
		<link>http://mwolf.net/archive/iptables-against-ssh/comment-page-1/#comment-122</link>
		<dc:creator>Martin Wolf</dc:creator>
		<pubDate>Fri, 23 Mar 2007 16:26:52 +0000</pubDate>
		<guid isPermaLink="false">http://mwolf.net/archive/iptables-against-ssh/#comment-122</guid>
		<description>Hi Scott,

Cool! I&#039;m very interested to see your improvements. If you don&#039;t have a server to publish it on, feel free to use mine. If you prefer, you can mail it to me at &quot;martin&quot; at this domain, and I&#039;ll publish it for you as a separate article.</description>
		<content:encoded><![CDATA[<p>Hi Scott,</p>
<p>Cool! I&#8217;m very interested to see your improvements. If you don&#8217;t have a server to publish it on, feel free to use mine. If you prefer, you can mail it to me at &#8220;martin&#8221; at this domain, and I&#8217;ll publish it for you as a separate article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: R. Scott Smith</title>
		<link>http://mwolf.net/archive/iptables-against-ssh/comment-page-1/#comment-120</link>
		<dc:creator>R. Scott Smith</dc:creator>
		<pubDate>Thu, 22 Mar 2007 15:58:56 +0000</pubDate>
		<guid isPermaLink="false">http://mwolf.net/archive/iptables-against-ssh/#comment-120</guid>
		<description>Okay, I&#039;ve added some functionality that others might be interested in.  I did some more studying of iptables and came up with a method of including a whitelist along with this limiting behavior for the dictionary attacks.  In addition, I have added the notion of listing other services.  For example, right now I&#039;m limiting ssh, ftp, and pop3.  I recently got a pop3 attack that caused me to look at that too.

In summary:
 - I have a whitelist that is *not* limited by the number of login attempts.
 - I have this hack presented here that limits the number of attempts from *all* other people for the 10 minute period, same as presented above.
 - I have a blacklist, which is no longer being used but it&#039;s still nice that I can use it if I change my mind.
 - I close all ports except the ones I specify to open.
 - And finally, I drop SYN packets which are inbound start up requests.
 - Another note is that all the adjustable parts listed above are either set in variables at the top of the script or they are included in external files (eg the whitelist and blacklist).  Open ports are in an easily editable list and the limiting ports are in an easily editable list at the top of the firewall script.  So in order to open up another port, just add it to the list.  To make a port limited to use per time, just add it to the LIMITED list.  Once something has been adjusted, the firewall script just gets re-run.  The ports are treated as a group so 3 ssh attempts, 2 ftp attempts, and then 1 pop3 attempt will trigger the 10 minute blocking (unless you&#039;re on the whitelist of course ;-)

For now, I think this is all the functionality I have ever wanted out of iptables or a any other firewall for that matter.  I&#039;m thinking I might want to eventually adjust it for variables on the number of attempts, the time frame for those attempts, and then the blocking time.

If you&#039;re interested I&#039;ll post the script.  Otherwise, I&#039;ll likely post it on a how to once I get my own server co-located.  Thanks for all the help.</description>
		<content:encoded><![CDATA[<p>Okay, I&#8217;ve added some functionality that others might be interested in.  I did some more studying of iptables and came up with a method of including a whitelist along with this limiting behavior for the dictionary attacks.  In addition, I have added the notion of listing other services.  For example, right now I&#8217;m limiting ssh, ftp, and pop3.  I recently got a pop3 attack that caused me to look at that too.</p>
<p>In summary:<br />
 &#8211; I have a whitelist that is *not* limited by the number of login attempts.<br />
 &#8211; I have this hack presented here that limits the number of attempts from *all* other people for the 10 minute period, same as presented above.<br />
 &#8211; I have a blacklist, which is no longer being used but it&#8217;s still nice that I can use it if I change my mind.<br />
 &#8211; I close all ports except the ones I specify to open.<br />
 &#8211; And finally, I drop SYN packets which are inbound start up requests.<br />
 &#8211; Another note is that all the adjustable parts listed above are either set in variables at the top of the script or they are included in external files (eg the whitelist and blacklist).  Open ports are in an easily editable list and the limiting ports are in an easily editable list at the top of the firewall script.  So in order to open up another port, just add it to the list.  To make a port limited to use per time, just add it to the LIMITED list.  Once something has been adjusted, the firewall script just gets re-run.  The ports are treated as a group so 3 ssh attempts, 2 ftp attempts, and then 1 pop3 attempt will trigger the 10 minute blocking (unless you&#8217;re on the whitelist of course <img src='http://mwolf.net/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>For now, I think this is all the functionality I have ever wanted out of iptables or a any other firewall for that matter.  I&#8217;m thinking I might want to eventually adjust it for variables on the number of attempts, the time frame for those attempts, and then the blocking time.</p>
<p>If you&#8217;re interested I&#8217;ll post the script.  Otherwise, I&#8217;ll likely post it on a how to once I get my own server co-located.  Thanks for all the help.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
