<?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>Hello System Admin &#124; Where system admins share technical article and tips &#124; Create free Blog &#124; Updates on domains, web hosting, servers and more &#187; IPtables</title>
	<atom:link href="http://hellosystemadmin.com/blog/category/linux/iptables/feed/" rel="self" type="application/rss+xml" />
	<link>http://hellosystemadmin.com</link>
	<description></description>
	<lastBuildDate>Fri, 09 Jul 2010 04:29:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IFRAME Virus injecting malicious code &#124; Web server security</title>
		<link>http://hellosystemadmin.com/blog/iframe-virus-injecting-malicious-code-web-server-security/</link>
		<comments>http://hellosystemadmin.com/blog/iframe-virus-injecting-malicious-code-web-server-security/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 06:13:36 +0000</pubDate>
		<dc:creator>Aneesh</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[IPtables]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Server Security]]></category>

		<guid isPermaLink="false">http://www.hellosystemadmin.com/?p=112</guid>
		<description><![CDATA[



This year, there has been a large increase in the number of legitimate websites infected by a so-called &#8220;iframe&#8221; threat &#8211; a type of malicious script.
Several prominent websites have come under attack from hackers who have modified the underlying code so that malware can be distributed to unsuspecting users who visit the site. When a [...]]]></description>
			<content:encoded><![CDATA[<p><code><script type="text/javascript"><!--
google_ad_client = "pub-2585810307670535";
/* 468x60, created 11/28/09 */
google_ad_slot = "9594852426";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></code></p>
<p>This year, there has been a large increase in the number of legitimate websites infected by a so-called &#8220;iframe&#8221; threat &#8211; a type of malicious script.</p>
<p>Several prominent websites have come under attack from hackers who have modified the underlying code so that malware can be distributed to unsuspecting users who visit the site. When a user visits an infected site, an invisible connection is established to a remote server, which can then attempt to install malware on the user&#8217;s computer. The intention could be to generate spam, or possibly something more sinister, such as stealing personal information e.g. bank account or credit card details. The above texts are taken from Avast news letter]</p>
<p><strong>How does Iframe attack happens ?</strong></p>
<p>Iframes are inserted to web sites files through FTP. Normally ,  people (developers, webmasters etc) used to save the ftp password in their FTP client programs (Cute FTP, filezilla etc). In such case, if  that system is infected with virus or any malware the saved ftp password will be taken and emailed to hackers (who created the virus or malware to get the ftp details of web sites). Once hackers get this ftp password, they have automated system to insert the Iframe to web site files thorugh their FTP program.  Once the iframes are inserted to the website, when users broswse  the infected website their system also get infected with malware or virus. If users are using a good antivirus program  they may get a warning that the server is infected.</p>
<p><strong>What can i do if my system is infected ?</strong></p>
<p>I did not  find any anti virus program that will detect the virus or malware. I think it is best idea to Format the system and reinstall everything than taking RISK. Also Enable Firewall in the system after installing the OS</p>
<p><strong>What all security methods can be taken in order to prevent this kind of iframe attack ?</strong></p>
<p>Since the Iframe attack happens thorugh FTP password our first attention should go to securing FTP server.  Instead of using normaly FTP, use SFTP and this can help us upt to an extend. Also,  the best idea is to allow FTP access from allowed IPs only. This can be done using either software or hardware firewalls. Since , hardware firewall is expensive we can think of software firewalls. For windows IIS ftp service, we can deny all ips except allowed IPs.  For linux this can be done  using Iptables (http://www.hellosystemadmin.com/restrict-ftp-access-using-iptables/). The above tasks  can be  done by an administrator only and this will not be so a fast method when FTP usrs have dynamic Ip address.  So we need to think about creating some scripts (php , VB, shell ) which can be used by all  users.  For  example in a linux server we can create some PHP script which will use Iptables command to add his ip to the firewall.  I suggest a simple algorithm to do this task</p>
<p>Create a mysql database  with two tables  &#8216;users&#8217; and &#8216;rules&#8217; . The table &#8216;users&#8217; includes the customer Id and password. And the second table should include CustomerID, IPAddress and Status (You can add any other fields according to your convenience). Now we needto create a php script which will call iptables command to add the firewall rule. Follwoing is sampel rule</p>
<p><em>iptables -I INPUT -s XXX.XXX.XXX.XXX  -d 0.0.0.0-p tcp -m tcp €“dport 21 -j ACCEPT</em></p>
<p>In the above command, we can pass the IP address and Status as  php variables</p>
<p><code><script type="text/javascript"><!--
google_ad_client = "pub-2585810307670535";
/* 468x60, created 11/28/09 */
google_ad_slot = "9594852426";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></code></p>
<p><strong>Is your website compromised  ?</strong> Simply fill the form given below</p>
<div class="wpcf7" id="wpcf7-f3-p112-o1"><form action="/blog/category/linux/iptables/feed/#wpcf7-f3-p112-o1" method="post" class="wpcf7-form">
<div style="display: none;">
<input type="hidden" name="_wpcf7" value="3" />
<input type="hidden" name="_wpcf7_version" value="2.0.7" />
<input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f3-p112-o1" />
</div>
<p>Your Name (required)<br />
    <span class="wpcf7-form-control-wrap your-name"><input type="text" name="your-name" value="" class="wpcf7-validates-as-required" size="40" /></span> </p>
<p>Your Email (required)<br />
    <span class="wpcf7-form-control-wrap your-email"><input type="text" name="your-email" value="" class="wpcf7-validates-as-email wpcf7-validates-as-required" size="40" /></span> </p>
<p> Web site name (required)<br />
    <span class="wpcf7-form-control-wrap your-site"><input type="text" name="your-site" value="" class="wpcf7-validates-as-required" size="40" /></span> </p>
<p>Subject<br />
    <span class="wpcf7-form-control-wrap your-subject"><input type="text" name="your-subject" value="" size="40" /></span> </p>
<p>Your Message<br />
    <span class="wpcf7-form-control-wrap your-message"><textarea name="your-message" cols="40" rows="10"></textarea></span> </p>
<p><input type="submit" value="Send" /> <img class="ajax-loader" style="visibility: hidden;" alt="ajax loader" src="http://hellosystemadmin.com/wp-content/plugins/contact-form-7/images/ajax-loader.gif" /></p>
<div class="wpcf7-response-output wpcf7-display-none"></div></form></div>
 <script type="text/javascript"><!--
google_ad_client = "pub-2585810307670535";
/* 468x60, created 11/28/09 */
google_ad_slot = "9594852426";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<!--Session data-->
<div id="st0000000001" class="st-taf"><script src="http://taf.socialtwist.com:80/taf/js/shoppr.core.js?id=0000000001"></script><img style="border:0;margin:0;padding:0;" src="http://tellafriend.socialtwist.com:80/wizard/images/tafbutton_blue16.png" onmouseout="hideHoverMap(this)" onmouseover="showHoverMap(this, '0000000001', 'http%3A%2F%2Fhellosystemadmin.com%2Fblog%2Fiframe-virus-injecting-malicious-code-web-server-security%2F', 'IFRAME+Virus+injecting+malicious+code+%7C+Web+server+security')" onclick="cw(this, {id:'0000000001',link: 'http%3A%2F%2Fhellosystemadmin.com%2Fblog%2Fiframe-virus-injecting-malicious-code-web-server-security%2F', title: '+IFRAME+Virus+injecting+malicious+code+%7C+Web+server+security+' })"/></div>]]></content:encoded>
			<wfw:commentRss>http://hellosystemadmin.com/blog/iframe-virus-injecting-malicious-code-web-server-security/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>restrict ftp access using iptables</title>
		<link>http://hellosystemadmin.com/blog/restrict-ftp-access-using-iptables/</link>
		<comments>http://hellosystemadmin.com/blog/restrict-ftp-access-using-iptables/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 04:25:48 +0000</pubDate>
		<dc:creator>Aneesh</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[IPtables]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://dev3.ispg.in/aneesh/sysadmin/?p=75</guid>
		<description><![CDATA[



Assume the server&#8217;s IP address is 125.121.156.156. Now we can block all ftp connections to the server withe the following ip tables rule
iptables -I INPUT -s 0.0.0.0   -d125.121.156.156 -p tcp -m tcp &#8211;dport 21 -j DROP
Now we can allow only authorised ip by the folloing rule. Assume the IP to be allowed is [...]]]></description>
			<content:encoded><![CDATA[<p><code><script type="text/javascript"><!--
google_ad_client = "pub-2585810307670535";
/* 468x60, created 11/28/09 */
google_ad_slot = "9594852426";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></code></p>
<p>Assume the server&#8217;s IP address is 125.121.156.156. Now we can block all ftp connections to the server withe the following ip tables rule<br />
<em>iptables -I INPUT -s 0.0.0.0 </em><em> </em><em> -d</em><em>125.121.156.156</em><em> -p tcp -m tcp &#8211;dport 21 -j DROP</em><br />
Now we can allow only authorised ip by the folloing rule. Assume the IP to be allowed is 121.125.121.125<br />
<em>iptables -I INPUT -s 121.125.121.125 -d 125.121.156.156 -p tcp -m tcp &#8211;dport 21 -j ACCEP</em></p>
<p>Now save the iptables rule using following command<br />
<em>/etc/init.d/iptables save</em></p>
<p><code><script type="text/javascript"><!--
google_ad_client = "pub-2585810307670535";
/* 468x60, created 11/28/09 */
google_ad_slot = "9594852426";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></code></p>
<div id="st0000000001" class="st-taf"><script src="http://taf.socialtwist.com:80/taf/js/shoppr.core.js?id=0000000001"></script><img style="border:0;margin:0;padding:0;" src="http://tellafriend.socialtwist.com:80/wizard/images/tafbutton_blue16.png" onmouseout="hideHoverMap(this)" onmouseover="showHoverMap(this, '0000000001', 'http%3A%2F%2Fhellosystemadmin.com%2Fblog%2Frestrict-ftp-access-using-iptables%2F', 'restrict+ftp+access+using+iptables')" onclick="cw(this, {id:'0000000001',link: 'http%3A%2F%2Fhellosystemadmin.com%2Fblog%2Frestrict-ftp-access-using-iptables%2F', title: '+restrict+ftp+access+using+iptables+' })"/></div>]]></content:encoded>
			<wfw:commentRss>http://hellosystemadmin.com/blog/restrict-ftp-access-using-iptables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
