<?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: How to: Linux Iptables block common attacks</title> <atom:link href="http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.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: JB</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-172872</link> <dc:creator>JB</dc:creator> <pubDate>Fri, 29 Jul 2011 20:28:59 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-172872</guid> <description>I am still able to get pinged using another computer running Ubuntu 11.04 and using nmap with those commands.</description> <content:encoded><![CDATA[<p>I am still able to get pinged using another computer running Ubuntu 11.04 and using nmap with those commands.</p> ]]></content:encoded> </item> <item><title>By: scott</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-170543</link> <dc:creator>scott</dc:creator> <pubDate>Sat, 09 Apr 2011 17:05:52 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-170543</guid> <description>i was wondering if there is a way you can do this in windows as well. i get alot of these attacks and i tried the blocking the ICMP rule in my firewall. it worked for a few days but the attacks continued.</description> <content:encoded><![CDATA[<p>i was wondering if there is a way you can do this in windows as well. i get alot of these attacks and i tried the blocking the ICMP rule in my firewall. it worked for a few days but the attacks continued.</p> ]]></content:encoded> </item> <item><title>By: Anonymous</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-155492</link> <dc:creator>Anonymous</dc:creator> <pubDate>Sat, 01 May 2010 20:52:48 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-155492</guid> <description>Completely blocking ICMP may result in a Black Hole situation (RFC 2923) since ICMP is vital to the PMTUD process. This may lock out clients coming over a congested link with MTU sizes below 1500 (e.g. tunnels).</description> <content:encoded><![CDATA[<p>Completely blocking ICMP may result in a Black Hole situation (RFC 2923) since ICMP is vital to the PMTUD process. This may lock out clients coming over a congested link with MTU sizes below 1500 (e.g. tunnels).</p> ]]></content:encoded> </item> <item><title>By: kunoichi</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-154641</link> <dc:creator>kunoichi</dc:creator> <pubDate>Wed, 31 Mar 2010 10:17:57 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-154641</guid> <description>I would like to share with you my iptables rules... I am not gonna explain it in details.
They are ready to be used with the iptables-restore command, Just check your ports and substitute xx.xx.xx.xx with your IP... If you have more IPs just add more IP chains. customise to your requirments.
&lt;code&gt;
*filter
#clear
-F
#clear custom
-X
#default rules
-P INPUT DROP
-P OUTPUT DROP
-P FORWARD DROP
#allow localhost
-A INPUT -i lo -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
#allow output for new, related and established connections
-A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
#
# PACKETS chain
#
-N PACKET
-A PACKET -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -m limit --limit 1/sec -j ACCEPT
-A PACKET -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK RST -m limit --limit 1/sec -j ACCEPT
#limit ping to 1 per second
-A PACKET -p icmp -m icmp --icmp-type 8 -m limit --limit 1/sec -j ACCEPT
#
# STATE_TRACK chain (connection tracking)
#
-N STATE_TRACK
-A STATE_TRACK -m state --state RELATED,ESTABLISHED -j ACCEPT
-A STATE_TRACK -m state --state INVALID -j DROP
#
# PORTSCAN chain (drop common attacks)
#
-N PORTSCAN
-A PORTSCAN -p tcp --tcp-flags ACK,FIN FIN -j DROP
-A PORTSCAN -p tcp --tcp-flags ACK,PSH PSH -j DROP
-A PORTSCAN -p tcp --tcp-flags ACK,URG URG -j DROP
-A PORTSCAN -p tcp --tcp-flags FIN,RST FIN,RST -j DROP
-A PORTSCAN -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
-A PORTSCAN -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
-A PORTSCAN -p tcp --tcp-flags ALL ALL -j DROP
-A PORTSCAN -p tcp --tcp-flags ALL NONE -j DROP
-A PORTSCAN -p tcp --tcp-flags ALL FIN,PSH,URG -j DROP
-A PORTSCAN -p tcp --tcp-flags ALL SYN,FIN,PSH,URG -j DROP
-A PORTSCAN -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
#
# COMMON chain (everything passes through here)
#
-N COMMON
-A COMMON -j STATE_TRACK
-A COMMON -j PORTSCAN
#
# chains relations
#
-A INPUT -j COMMON
-A OUTPUT -j COMMON
-A FORWARD -j COMMON
-A FORWARD -j PACKET
#
# IP chain
#
-N IP1
-A INPUT -d xx.xx.xx.xx -j IP1
-A OUTPUT -d xx.xx.xx.xx -j IP1
-A FORWARD -d xx.xx.xx.xx -j IP1
#SSH On standard port
-A IP1 -p tcp --dport 22 -j ACCEPT
#HTTP HTTPS
-A IP1 -p tcp --dport 80 -j ACCEPT
-A IP1 -p tcp --dport 443 -j ACCEPT
#DNS
-A IP1 -p tcp --dport 53 -j ACCEPT
-A IP1 -p udp --dport 53 -j ACCEPT
Admin Panel (Webmin)
-A IP1 -p tcp --dport 10000 -j ACCEPT
# MORE IP CHAINS
#-N IP2
#-A INPUT -d xx.xx.xx.yy -j IP2
#-A OUTPUT -d xx.xx.xx.yy -j IP2
#-A FORWARD -d xx.xx.xx.yy -j IP2
#SSH
#-A IP2 -p tcp --dport 22 -j ACCEPT
#HTTP HTTPS
#-A IP2 -p tcp --dport 80 -j ACCEPT
#-A IP2 -p tcp --dport 443 -j ACCEPT
#DNS
#-A IP2 -p tcp --dport 53 -j ACCEPT
#-A IP2 -p udp --dport 53 -j ACCEPT
COMMIT
&lt;/code&gt;</description> <content:encoded><![CDATA[<p>I would like to share with you my iptables rules&#8230; I am not gonna explain it in details.<br
/> They are ready to be used with the iptables-restore command, Just check your ports and substitute xx.xx.xx.xx with your IP&#8230; If you have more IPs just add more IP chains. customise to your requirments.</p><p><code><br
/> *filter</p><p>#clear<br
/> -F</p><p>#clear custom<br
/> -X</p><p>#default rules<br
/> -P INPUT DROP<br
/> -P OUTPUT DROP<br
/> -P FORWARD DROP</p><p>#allow localhost<br
/> -A INPUT -i lo -j ACCEPT<br
/> -A OUTPUT -o lo -j ACCEPT</p><p>#allow output for new, related and established connections<br
/> -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT</p><p>#<br
/> # PACKETS chain<br
/> #<br
/> -N PACKET<br
/> -A PACKET -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -m limit --limit 1/sec -j ACCEPT<br
/> -A PACKET -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK RST -m limit --limit 1/sec -j ACCEPT<br
/> #limit ping to 1 per second<br
/> -A PACKET -p icmp -m icmp --icmp-type 8 -m limit --limit 1/sec -j ACCEPT</p><p>#<br
/> # STATE_TRACK chain (connection tracking)<br
/> #<br
/> -N STATE_TRACK<br
/> -A STATE_TRACK -m state --state RELATED,ESTABLISHED -j ACCEPT<br
/> -A STATE_TRACK -m state --state INVALID -j DROP</p><p>#<br
/> # PORTSCAN chain (drop common attacks)<br
/> #<br
/> -N PORTSCAN<br
/> -A PORTSCAN -p tcp --tcp-flags ACK,FIN FIN -j DROP<br
/> -A PORTSCAN -p tcp --tcp-flags ACK,PSH PSH -j DROP<br
/> -A PORTSCAN -p tcp --tcp-flags ACK,URG URG -j DROP<br
/> -A PORTSCAN -p tcp --tcp-flags FIN,RST FIN,RST -j DROP<br
/> -A PORTSCAN -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP<br
/> -A PORTSCAN -p tcp --tcp-flags SYN,RST SYN,RST -j DROP<br
/> -A PORTSCAN -p tcp --tcp-flags ALL ALL -j DROP<br
/> -A PORTSCAN -p tcp --tcp-flags ALL NONE -j DROP<br
/> -A PORTSCAN -p tcp --tcp-flags ALL FIN,PSH,URG -j DROP<br
/> -A PORTSCAN -p tcp --tcp-flags ALL SYN,FIN,PSH,URG -j DROP<br
/> -A PORTSCAN -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP</p><p>#<br
/> # COMMON chain (everything passes through here)<br
/> #<br
/> -N COMMON<br
/> -A COMMON -j STATE_TRACK<br
/> -A COMMON -j PORTSCAN</p><p>#<br
/> # chains relations<br
/> #<br
/> -A INPUT -j COMMON<br
/> -A OUTPUT -j COMMON<br
/> -A FORWARD -j COMMON<br
/> -A FORWARD -j PACKET<br
/> #<br
/> # IP chain<br
/> #<br
/> -N IP1<br
/> -A INPUT -d xx.xx.xx.xx -j IP1<br
/> -A OUTPUT -d xx.xx.xx.xx -j IP1<br
/> -A FORWARD -d xx.xx.xx.xx -j IP1<br
/> #SSH On standard port<br
/> -A IP1 -p tcp --dport 22 -j ACCEPT<br
/> #HTTP HTTPS<br
/> -A IP1 -p tcp --dport 80 -j ACCEPT<br
/> -A IP1 -p tcp --dport 443 -j ACCEPT<br
/> #DNS<br
/> -A IP1 -p tcp --dport 53 -j ACCEPT<br
/> -A IP1 -p udp --dport 53 -j ACCEPT<br
/> Admin Panel (Webmin)<br
/> -A IP1 -p tcp --dport 10000 -j ACCEPT</p><p># MORE IP CHAINS<br
/> #-N IP2<br
/> #-A INPUT -d xx.xx.xx.yy -j IP2<br
/> #-A OUTPUT -d xx.xx.xx.yy -j IP2<br
/> #-A FORWARD -d xx.xx.xx.yy -j IP2<br
/> #SSH<br
/> #-A IP2 -p tcp --dport 22 -j ACCEPT<br
/> #HTTP HTTPS<br
/> #-A IP2 -p tcp --dport 80 -j ACCEPT<br
/> #-A IP2 -p tcp --dport 443 -j ACCEPT<br
/> #DNS<br
/> #-A IP2 -p tcp --dport 53 -j ACCEPT<br
/> #-A IP2 -p udp --dport 53 -j ACCEPT</p><p>COMMIT<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: name</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-151394</link> <dc:creator>name</dc:creator> <pubDate>Sat, 31 Oct 2009 13:38:39 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-151394</guid> <description>A better way of doing this would be to just use connection tracking:
-A INPUT -m conntrack --ctstate INVALID -j DROP
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
And instead of blocking ICMP limiting is IMO a better way, -m limit.</description> <content:encoded><![CDATA[<p>A better way of doing this would be to just use connection tracking:</p><p>-A INPUT -m conntrack &#8211;ctstate INVALID -j DROP<br
/> -A INPUT -m conntrack &#8211;ctstate ESTABLISHED,RELATED -j ACCEPT</p><p>And instead of blocking ICMP limiting is IMO a better way, -m limit.</p> ]]></content:encoded> </item> <item><title>By: Hamza Sani</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-151181</link> <dc:creator>Hamza Sani</dc:creator> <pubDate>Fri, 23 Oct 2009 09:31:14 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-151181</guid> <description>Cyberciti is really very knowledgeable website i would like to say thank you for this.</description> <content:encoded><![CDATA[<p>Cyberciti is really very knowledgeable website i would like to say thank you for this.</p> ]]></content:encoded> </item> <item><title>By: ak</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-145460</link> <dc:creator>ak</dc:creator> <pubDate>Mon, 03 Nov 2008 03:10:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-145460</guid> <description>In Drop all NULL packets,
Please correct spelling.
Change INPIT to INPUT</description> <content:encoded><![CDATA[<p>In Drop all NULL packets,</p><p>Please correct spelling.<br
/> Change INPIT to INPUT</p> ]]></content:encoded> </item> <item><title>By: Ryan Rodriguez</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-144655</link> <dc:creator>Ryan Rodriguez</dc:creator> <pubDate>Thu, 14 Aug 2008 18:12:17 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-144655</guid> <description>This would block the more common XMAS packets.
iptables -A INPUT -p tcp --tcp-flags ALL  FIN,PSH,URG -j DROP</description> <content:encoded><![CDATA[<p>This would block the more common XMAS packets.</p><p>iptables -A INPUT -p tcp &#8211;tcp-flags ALL  FIN,PSH,URG -j DROP</p> ]]></content:encoded> </item> <item><title>By: Matt Newcombe</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-143362</link> <dc:creator>Matt Newcombe</dc:creator> <pubDate>Wed, 02 Apr 2008 17:40:30 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-143362</guid> <description>Many thanks - just what I was looking for.
Matt</description> <content:encoded><![CDATA[<p>Many thanks &#8211; just what I was looking for.</p><p>Matt</p> ]]></content:encoded> </item> <item><title>By: Jlmiller</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-143043</link> <dc:creator>Jlmiller</dc:creator> <pubDate>Sat, 01 Mar 2008 04:51:56 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-143043</guid> <description>Cyberciti had the answers I was looking for and the information is quite easy.</description> <content:encoded><![CDATA[<p>Cyberciti had the answers I was looking for and the information is quite easy.</p> ]]></content:encoded> </item> <item><title>By: dhaval</title><link>http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-142782</link> <dc:creator>dhaval</dc:creator> <pubDate>Tue, 05 Feb 2008 07:07:56 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-10-how-to-block-common-attack.html#comment-142782</guid> <description>Cyberciti is the great.</description> <content:encoded><![CDATA[<p>Cyberciti is the great.</p> ]]></content:encoded> </item> </channel> </rss>
