How to remove IFrame Trojan?

Digg


('DiggThis)

Tweet


Reddit


Stumble


Facebook


Share

Removing Iframe TrojanOpen source means choice and freedom for those users who have the skills to download and install softwares but is also prone to attacks because of its unsecure nature. PHP and WordPress are also open source and no doubt a great resource for web developers, but they are attractive to attackers as well.

 

Being a blogger I myself have been using WordPress as a platform for my different blogs and so far I was not facing any problem. But a few days back some of my blogs got infected by a malware called IFrame. And the funny part was that I was not even aware of the infection and I still don’t know how did somebody got this peice of code injected into my blog. One of my IM friend informed me that his antivirus just stopped him to view a page on my blog. He send me the screenshot.

Avast warning message for Iframe Trojan

I was shocked to realize that my antivirus was updated as well with the latest virus definition files, but it didn’t caution me any time. I had BitDefender installed which of course I have changed with AVAST now, and I must say that its been a great tool as its High performance antivirus engine, Anti-spyware & anti-rootkit tool, Resident shield and self-protection, Enhanced user interface and Daily automatic updates let me know of the malicious scripts on different websites I browse earlier with no knowledge.

Avast warning message for Iframe Trojan
Avast warning message for Iframe Trojan

This IFrame malware can infect any PHP file in theory because it is just a piece of code that has to be injected in the file, but provided that you are using WordPress on your blog, most likely the files infected by it are

index.php in root folder
wp-config.php in root folder
index.php in wp-admin folder
index.php in wp-contents\yourtheme\ folder
default-filters.php in wp-includes folder

What it does that it inserts a piece of code at the end of each of the above mentioned file right after the ending ?> PHP tag as shown below in the picture.

IFrame infection

Sometimes it is also found within the php code injected using echo command.

Avast warning message for Iframe Trojan

Here are some issues that you are most likely to face if your site is infected by Iframe malware.

1. You will not be able to login to your wp-admin, rather it will show you that there is some error in default-filters.php file.
2. If you browse your site and you do not have any good anti malware or script blocking software then you will probably see that the layout of your site has become like a jigsaw. Page elements could have been moved to different random locations.
3. The height of some elements on sidebar might have been modified.
4. Your site just do not open, instead it will show a php error message.

Removal of IFrame Malware

Removing that IFrame malware was not easy by any means. I searched over internet and many things were tried. I found another good article regarding IFrame removal written by Fields Marshall. But everything went in vain, everytime I remove that IFrame tag and upload the modified file, it gets inserted after a while. Now I will list the steps which I did and finally got rid of that malware, incase your site is infected by IFrame malware, you follow the same steps and I hope that eventually you will get rid of it as well.

1. Make sure that you have AVAST installed on your system with the latest virus database files.
2. Scan your PC for infections.
3. Change your ftp account password and also the cpanel password.
4. Upload and overwrite a fresh copy of all wordpress files after making necessary changes in wp-config.php file.
5. Download and install TextCrawler, a free utility to find required text in files on your hard drive. Its a freeware and very easy to use. Text Crawler is a fantastic tool for anyone who works with text files. It enables you to instantly find and replace words and phrases across multiple files and folders. It utilises a powerful Regular Expression engine to enable you to create sophisticated searches, perform batch operations, extract text from files and more. It is fast and easy to use, moreover TextCrawler is Freeware!.
6. You might have all files of your theme on your hard drive, if not, then download all files of the theme and search within those files for an iframe tag using Text Crawler. If you find any file containg the iframe tag then remove those lines which resembles like the ones discussed above.
7. Similarly download all plugin files that you are using at the moment and scan them for an iframe tag, if found then just remove those lines.
8. Remove all unwanted themes and plugins that you are not using. Do not use poor themes or less popular plugins. People are spreading free themes and plugins for purpose.
9. After making sure that all your theme files and plugin files are clean upload them.
10. Browse to your site and wait for any AVAST warning to appear, if done exactly as described, chances are that you will not face any trouble again.
11. Enjoy and if you found this article helpful, please consider linking to it or sharing it with someone else.
12. All comments and suggestions are appreciated.

You might be interested in:

22 Responses to “How to remove IFrame Trojan?”

  1. fields Says:

    Sorry you had trouble with my fix. I updated it. to be a little more clear now but yes it seems the infection will keep happening unless you clean up website themes, plugins, etc


  2. spellathon Says:

    Yes marshall, the infection just keeps coming back, by the way your article helped me lot getting the idea. :)


  3. Yagnaroopaya Says:

    Hi, I read your blog now and then, because I run my own site like your blog. and I was wondering.. Do you get tons of spam? How do you contorl it? :)


  4. Woodster Says:

    Marshall,
    Your article is very beneficial. However, when I tried to ascertain the source of my problem, I came up dry. After a considerable amount of time downloading,’crawling’ through text, re-applying WordPress, and removing themes and plugins, I finally decided to look into the actual WordPress posts stored in MySQL. Sure enough, that is where I found several posts had been hacked and included tags.
    I normally run Avast and that is what first alerted me to a problem. After cleaning out the references form the database, the site now comes up and Avast is happy!


  5. Woodster Says:

    Found out the data stored in MySQL was hacked to include the iframe references. A real bugger, that one!


  6. admin Says:

    Hey Yagnaroopaya, sorry for late replying, but now I am back on it. Yeah I get lots of spam comments on my blog, but if you are using WordPress like me then the default Akismet plugin which comes with it will do good for you. Did you try it ?


  7. Xiomara Says:

    Good post. I enjoyed reading your blog. I’ve added you to my bookmarks and will be back soon.


  8. Jennifer Says:

    Very interesting post… Would like to use some of this on my blog. Is that ok or not?


  9. Елизавета Says:

    Отправила первый пост, а он не опубликовался. Пишу второй. Это я, туристка африканских стран


  10. AndrewBoldman Says:

    I really liked this post. Can I copy it to my site? Thank you in advance.


  11. NeeT Says:

    Hey Andrew, Yes you can take whatever stuff you want to provided that you will mention my blog there.
    Thanks.


  12. K. Smith Says:

    I’ve learned a lot from this site – I hope you continue writing because I love your stuff!


  13. Como limpar o maldito vírus IFrame que infectou o seu blog na plataforma Wordpress – WP (vírus de blogs) | Rei da Cocada Preta Says:

    [...] para limpeza usadas neste tutorial: How to remove IFrame Trojan? HTML:Iframe-inf wordpress Infection iFrame Hack on Several WP Sites AntiVirus protection for your [...]


  14. 7 Steps to remove Iframe virus from your Wordpress blog | Techno360 Says:

    [...] How to remove IFrame Trojan? Frame Hack WP on Several Sites Using Combofix to guide and tutorial HTML: iframe wordpress-inf Infection [...]


  15. How to delouse your Wordpress blog. With added Pokemon and pew pew pew noises. Says:

    [...] <http://www.kyle-brady.com/2009/11/07/wordpress-mediatemple-and-an-injection-attack/> and <http://www.techyshell.com/internet/how-to-remove-iframe-trojan/>. Read them first (but do *nothing* – just take it in) then come back. It’s O.K., [...]


  16. chirag kalani Says:

    Thanks a Lot for this information…..

    Thank you….again…


  17. Aneesh Says:

    First Step : change FTP password
    Step 2 : Download all files and clean
    Step3 : upload Files

    Remeber Do not save FTP password in your FTP client
    If you suspects that your system is infected, Format and install OS, then install a good antivirus + firewall. I suggest Avast free edition and Comodo Firewall.

    We have received many inquiries and we cleaned those infected sites. If your site is infected Please contact us

    Best Regards


  18. Simon Says:

    Try our plugin for iframe badware removal for wordpress blogs


  19. Luca Says:

    Thanks for this thread guys. I experienced the same problem today and managed to fix it relatively quickly for this website hoteleconomici-oneclick.it/(you can see it is working!)

    1) Backup everything
    2) Scan the copy of your website downloaded on your local machine using Avast. This will allow you to identify the infected files
    3) Copy a new installation of wordpress following the manual update instructions (here: http://codex.wordpress.org/Updating_WordPress)
    4) Clean manually the files which are not replaces in the update.

    It should work. Good luck!


  20. Todd Says:

    Reply :
    Because this Iframe trojan should have injected some lines of code in many files of wordpress including wp-config, so it is obvious that you have to replace all files, and when you have to replace wp-config then of course you would like to input your mysql database name, username and password into fresh wp-config.php before uploading it. Hope that helps.

    Question: What do you mean in Step 4 when you say, “4. Upload and overwrite a fresh copy of all wordpress files after making necessary changes in wp-config.php file.”

    Thanks!


  21. Mohamed Says:

    I would like to thank you so much really you let me solve a big problem really Knowledge is a power


  22. Walton Tankesly Says:

    Good job. I agree with you.


Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>