something seems to have either hacked a webserver, or we have some sort of semi-malicious code running that keeps injecting code into our website. it seems to affect just a couple of coldfusion and html file. we've run malwarebytes, spybot, and AVG antivirus and removed any entries they find, though there weren't many. I'm in the process of researching and installing some Intrusion Detection software (like Snort or OSSEC) to see if this will help me find the culprit, but i was wondering if anyone had ever seen anything like this or knew where malicious code could be hiding.
it appears to inject the following code:
<iframe scrolling="no" frameborder="0" src="http://www.collegefun4u.com/" width="0" height="0"></iframe>
into a couple of files every night, at completely random times.
This is on a Windows 2003 server, running Coldfusion MX7. Nothing appears in the logs/event viewer when these files are changed.
The first thing to do is immediately check out what
collegefun4u
is all about.Requesting the site in a safe way and unpacking the JS code behind it, we get:
Note that I beautified the HTML for easier reading.
As you can see, it at least does not try to harm your users in any way but just inserts some Webhosting (learned from the title) spam, three links in a table that span across your whole screen. It should also be noted that they're analysis your traffic through Google Analytics.
Looking further on the internet, I've found a similar cause that appears to have the same problem as you. A request to his page later loads in the
collegefun4u
site. URL Query is quite smart and tells us it detected BlackHole exploit kit HTTP GET request.Exactly, the BlackHole exploit kit is gaining fame these days to adjust files on servers. They simply use zero day exploits in various types of server software to be able to adjust files to be able to spam or infect many clients.
The bottom line of the story here is three fold:
Track the versions of your server and its software and make sure everything is update, this goes from Apache / IIS to Plesk to your framework to PHPMyAdmin and beyond.
Make sure you configured anything facing the internet to not be able to write to your disk, this mostly means configuring Plesk / PHP / File Permissions right.
If it continues to happen, make sure that you log file accesses so that you know which process is doing this. On Windows you have Process Monitor for this, set it to filter on
.html
and/or.js
files so you don't fill your page file with all accesses. This might learn you more...