<?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: Protect Your Network from spamming, scanning, harvesting and dDoS attacks with DROP List</title> <atom:link href="http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Christian</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-173953</link> <dc:creator>Christian</dc:creator> <pubDate>Wed, 14 Sep 2011 14:42:27 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-173953</guid> <description>This script could be a little more secure. I.e. use a random tmp and clean up handler. Also the list processing can be done in bash (not awk needed.)
&lt;pre&gt;
#!/bin/bash
URL=&quot;http://www.spamhaus.org/drop/drop.lasso&quot;
drop=/tmp/drop.lasso.$$.$RANDOM
trap &quot;rm -f $drop&quot; EXIT
echo -n &quot;Applying DROP list to existing firewall...&quot;
wget -q -O $drop $URL
blocks=$(cat $drop &#124; egrep -v &#039;^;&#039; &#124; while read line ; do echo ${line%%;*} ; done)
...
&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>This script could be a little more secure. I.e. use a random tmp and clean up handler. Also the list processing can be done in bash (not awk needed.)</p><pre>
#!/bin/bash
URL="http://www.spamhaus.org/drop/drop.lasso"
drop=/tmp/drop.lasso.$$.$RANDOM
trap "rm -f $drop" EXIT
echo -n "Applying DROP list to existing firewall..."
wget -q -O $drop $URL
blocks=$(cat $drop | egrep -v '^;' | while read line ; do echo ${line%%;*} ; done)
...
</pre>]]></content:encoded> </item> <item><title>By: Firas</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-154903</link> <dc:creator>Firas</dc:creator> <pubDate>Fri, 09 Apr 2010 12:23:09 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-154903</guid> <description>Should we add the script in all our vps ? or just the node ?</description> <content:encoded><![CDATA[<p>Should we add the script in all our vps ? or just the node ?</p> ]]></content:encoded> </item> <item><title>By: Hamish</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142936</link> <dc:creator>Hamish</dc:creator> <pubDate>Tue, 19 Feb 2008 11:17:34 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142936</guid> <description>It works well as a cron job, but you need to flush the old rules first. I added the following lines to the top of this script:
#!/bin/bash
iptables -F
./regular_rules
FILE=&quot;/tmp/drop.lasso&quot;
URL=&quot;http://www.spamhaus.org/drop/drop.lasso&quot;
Where regular_rules is a file containing all your standard iptables rules that you want to add the spamhaus rules to each day.
Not sure if i should stop and start the iptables service, i don&#039;t currently, but i guess it&#039;s an easy addition... Thanks for the script...</description> <content:encoded><![CDATA[<p>It works well as a cron job, but you need to flush the old rules first. I added the following lines to the top of this script:<br
/> #!/bin/bash<br
/> iptables -F<br
/> ./regular_rules<br
/> FILE=&#8221;/tmp/drop.lasso&#8221;<br
/> URL=&#8221;http://www.spamhaus.org/drop/drop.lasso&#8221;</p><p>Where regular_rules is a file containing all your standard iptables rules that you want to add the spamhaus rules to each day.</p><p>Not sure if i should stop and start the iptables service, i don&#8217;t currently, but i guess it&#8217;s an easy addition&#8230; Thanks for the script&#8230;</p> ]]></content:encoded> </item> <item><title>By: Me</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142722</link> <dc:creator>Me</dc:creator> <pubDate>Thu, 31 Jan 2008 11:01:00 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142722</guid> <description>The script is problematic as a cron job.
It will create redundant drop rules, so every day
iptables will double its rules number.
Just run the script a few times and see.
1st run iptables rules count: 365
2nd run: 592
3rd run: 865</description> <content:encoded><![CDATA[<p>The script is problematic as a cron job.<br
/> It will create redundant drop rules, so every day<br
/> iptables will double its rules number.</p><p>Just run the script a few times and see.<br
/> 1st run iptables rules count: 365<br
/> 2nd run: 592<br
/> 3rd run: 865</p> ]]></content:encoded> </item> <item><title>By: Ashi</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142437</link> <dc:creator>Ashi</dc:creator> <pubDate>Fri, 11 Jan 2008 09:24:46 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142437</guid> <description>spamming is surely a threat to cyber space. most of the spammers are also hackers and they break into your pc as soon as you click on their email links. in order to fight the spam threat we need a strong spam filters for our emails which secures us from most of the spam mails. i have heard that http://www.zapak.com is one of the good e-mail service provider who gives maximum protection from most of the spam mails, now that is what we internet lovers require.</description> <content:encoded><![CDATA[<p>spamming is surely a threat to cyber space. most of the spammers are also hackers and they break into your pc as soon as you click on their email links. in order to fight the spam threat we need a strong spam filters for our emails which secures us from most of the spam mails. i have heard that <a
href="http://www.zapak.com" rel="nofollow">http://www.zapak.com</a> is one of the good e-mail service provider who gives maximum protection from most of the spam mails, now that is what we internet lovers require.</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142062</link> <dc:creator>vivek</dc:creator> <pubDate>Wed, 05 Dec 2007 01:55:07 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142062</guid> <description>Joe,
This will only block bad guyes and not ssh, until and unless your IP is one of them ;)</description> <content:encoded><![CDATA[<p>Joe,</p><p>This will only block bad guyes and not ssh, until and unless your IP is one of them ;)</p> ]]></content:encoded> </item> <item><title>By: Joe  Klemmer</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142061</link> <dc:creator>Joe  Klemmer</dc:creator> <pubDate>Tue, 04 Dec 2007 23:58:55 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142061</guid> <description>I&#039;m getting ready to try this out.  There&#039;s one thing that&#039;s not clear to me, though.
This article states specifically&lt;blockquote&gt;you need to run on Linux based &lt;strong&gt;firewall&lt;/strong&gt; / &lt;strong&gt;router&lt;/strong&gt; / dedicated &lt;strong&gt;Linux web&lt;/strong&gt; / &lt;strong&gt;mail&lt;/strong&gt; server&lt;/blockquote&gt;My server is doing everything and it&#039;s brother.  Is this going to affect all the other crap this box is doing (well, specifically ssh)?</description> <content:encoded><![CDATA[<p>I&#8217;m getting ready to try this out.  There&#8217;s one thing that&#8217;s not clear to me, though.</p><p>This article states specifically<br
/><blockquote>you need to run on Linux based <strong>firewall</strong> / <strong>router</strong> / dedicated <strong>Linux web</strong> / <strong>mail</strong> server</p></blockquote><p>My server is doing everything and it&#8217;s brother.  Is this going to affect all the other crap this box is doing (well, specifically ssh)?</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142022</link> <dc:creator>vivek</dc:creator> <pubDate>Fri, 30 Nov 2007 14:49:20 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142022</guid> <description>Gregg,
thanks for sharing shorewall script.</description> <content:encoded><![CDATA[<p>Gregg,</p><p>thanks for sharing shorewall script.</p> ]]></content:encoded> </item> <item><title>By: Gregg Lain</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142020</link> <dc:creator>Gregg Lain</dc:creator> <pubDate>Fri, 30 Nov 2007 12:34:44 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-142020</guid> <description>Nice posting - expanded on the alternate route and  since shorewall is running happily on my servers - why not let that &quot;manage&quot; the drops:
&lt;code&gt;#!/bin/sh
#
# Drop all these bad IP&#039;s
#
TMPFILE=/tmp/`apg -a 1 -M nc -n 1 -m 26`
touch $TMPFILE
curl -s http://www.spamhaus.org/drop/drop.lasso &#124;grep ^[1-9]&#124;cut -f 1 -d &#039; &#039; &gt; $TMPFILE
for IP in `cat $TMPFILE`; do
/sbin/shorewall drop $IP
sleep 5
done
rm $TMPFILE&lt;/code&gt;
The sleep statement helps the process from hogging all server resources....
Set this to run via cron twice daily - prefer to be a little paranoid in case of mid-day updates  :)</description> <content:encoded><![CDATA[<p>Nice posting &#8211; expanded on the alternate route and  since shorewall is running happily on my servers &#8211; why not let that &#8220;manage&#8221; the drops:</p><p><code>#!/bin/sh<br
/> #<br
/> # Drop all these bad IP's<br
/> #<br
/> TMPFILE=/tmp/`apg -a 1 -M nc -n 1 -m 26`<br
/> touch $TMPFILE<br
/> curl -s <a
href="http://www.spamhaus.org/drop/drop.lasso" rel="nofollow">http://www.spamhaus.org/drop/drop.lasso</a> |grep ^[1-9]|cut -f 1 -d ' ' &gt; $TMPFILE<br
/> for IP in `cat $TMPFILE`; do<br
/> /sbin/shorewall drop $IP<br
/> sleep 5<br
/> done<br
/> rm $TMPFILE</code></p><p>The sleep statement helps the process from hogging all server resources&#8230;.</p><p>Set this to run via cron twice daily &#8211; prefer to be a little paranoid in case of mid-day updates  :)</p> ]]></content:encoded> </item> <item><title>By: Joe  Klemmer</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-141660</link> <dc:creator>Joe  Klemmer</dc:creator> <pubDate>Fri, 09 Nov 2007 23:25:31 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-141660</guid> <description>Are there any metrics, empirical or subjective, measurements on the hit rate of false positives?  I&#039;d love to do more to keep the spam out.</description> <content:encoded><![CDATA[<p>Are there any metrics, empirical or subjective, measurements on the hit rate of false positives?  I&#8217;d love to do more to keep the spam out.</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-141539</link> <dc:creator>vivek</dc:creator> <pubDate>Thu, 25 Oct 2007 12:25:28 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-141539</guid> <description>Jerod,
You are dropping all incoming traffic from bad guys .</description> <content:encoded><![CDATA[<p>Jerod,</p><p>You are dropping all incoming traffic from bad guys .</p> ]]></content:encoded> </item> <item><title>By: Jerod Santo</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-141529</link> <dc:creator>Jerod Santo</dc:creator> <pubDate>Wed, 24 Oct 2007 22:05:33 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-141529</guid> <description>Correct me if I&#039;m wrong, but doesn&#039;t adding &lt;code&gt;ip route network mask null0&lt;/code&gt; only affect traffic leaving my network if said router is the gateway to my LAN?
If so, does that add much benefit?</description> <content:encoded><![CDATA[<p>Correct me if I&#8217;m wrong, but doesn&#8217;t adding <code>ip route network mask null0</code> only affect traffic leaving my network if said router is the gateway to my LAN?</p><p>If so, does that add much benefit?</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-141528</link> <dc:creator>vivek</dc:creator> <pubDate>Wed, 24 Oct 2007 18:11:21 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-141528</guid> <description>Jerod,
Yes you need to update or add those ips to null0.</description> <content:encoded><![CDATA[<p>Jerod,</p><p>Yes you need to update or add those ips to null0.</p> ]]></content:encoded> </item> <item><title>By: Jerod Santo</title><link>http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-141525</link> <dc:creator>Jerod Santo</dc:creator> <pubDate>Wed, 24 Oct 2007 17:07:04 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/block-spamming-scanning-with-iptables.html#comment-141525</guid> <description>The script provided for Cisco devices simply updates a text file of the banned netblocks. Are we then supposed to use the cisco-cmd script to add the null routes to our cisco configs?</description> <content:encoded><![CDATA[<p>The script provided for Cisco devices simply updates a text file of the banned netblocks. Are we then supposed to use the cisco-cmd script to add the null routes to our cisco configs?</p> ]]></content:encoded> </item> </channel> </rss>
