<?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>jim80.net &#187; DDoS</title>
	<atom:link href="http://blog.jim80.net/tag/ddos/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jim80.net</link>
	<description></description>
	<lastBuildDate>Mon, 16 Jan 2012 04:15:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Dynamic iptables &#8211; &#8220;Flexible (and fun)&#8221;</title>
		<link>http://blog.jim80.net/2009/05/30/dynamic-iptables-flexible-and-fun/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dynamic-iptables-flexible-and-fun</link>
		<comments>http://blog.jim80.net/2009/05/30/dynamic-iptables-flexible-and-fun/#comments</comments>
		<pubDate>Sat, 30 May 2009 18:29:18 +0000</pubDate>
		<dc:creator>jim</dc:creator>
				<category><![CDATA[DoS]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[DDoS]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://blog.jim80.net/?p=213</guid>
		<description><![CDATA[Have you ever said to yourself that there should be a tool to do x, start building a tool to do it, then about halfway through your little project, somebody glances over your shoulder and says to you &#8220;hey, I use a tool like that, it&#8217;s called y, you should check it out,&#8221; so you [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever said to yourself that there should be a tool to do <em>x</em>, start building a tool to do it, then about halfway through your little project, somebody glances over your shoulder and says to you &#8220;hey, I use a tool like that, it&#8217;s called <em>y</em>, you should check it out,&#8221; so you do, and <em>that</em> tool is far more comprehensive and well built than the one you were working on?</p>
<p>Well this isn&#8217;t one of those times, because this tool hit me from left field while I was researching ways to mitigate a DDoS attack. Though there are many, many ways to do it, if all you have is a Linux box facing the world with nothing to hide its private parts except iptables, then this &#8220;flexible (and fun)&#8221; toolset is another weapon you can deploy when you get that 2:30AM call saying &#8220;our website&#8217;s down and I think it&#8217;s being DDoS&#8217;d.&#8221;</p>
<p>The tool is a simple set of scripts that make adding and removing specific IP&#8217;s quick and simple. The main site of the author is at <a href="http://www.ibm.com/developerworks/library/l-fw/">http://www.ibm.com/developerworks/library/l-fw/</a>, or is available (hosted locally) <a href='http://blog.jim80.net/wp-content/uploads/2009/05/dynfw-1.0.tar.gz'>here</a>.</p>
<p>Once installed, you can simply ban/unban an IP by typing <strong><code>ipdrop {IP ADDRESS} {on|off}</code></strong></p>
<p>While perusing <a href="http://www.webhostingtalk.com/showthread.php?t=225477">this thread</a> at webhostingtalk.com, member <em>dynamicnet</em> mentioned grep-ing for ridiculous levels of SYN_RECV &#8216;d connections (this is indicative of a TCP SYN Flood attack) and generating ipdrop commands for quick banning of a SYN Flood-ing IP&#8217;s. Though you may accidentally drop one or two legitimate IP&#8217;s (have a rule already in place so you don&#8217;t ban yourself out of a remote box), you&#8217;ll likely get the bulk of the attacking IP&#8217;s.</p>
<p>Use <strong><code>netstat -n -p|grep SYN_REC | wc -l</code></strong> to count how many SYN_RECV connections you have.</p>
<p>Use <strong><code>netstat -n -p | grep SYN_REC | awk '{print $5}' | sort -u | awk -F: '{print "ipdrop "$1 " on"}'</code></strong> to generate code to ban IP&#8217;s in SYN_RECV status.</p>
<p>Use <strong><code> cat /root/.dynfw-ipdrop |awk -F: '{print "ipdrop "$1" off"}' </code></strong> to generates code to &#8220;undrop&#8221; those IP&#8217;s.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jim80.net/2009/05/30/dynamic-iptables-flexible-and-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

