How to remove Malware from Your Site?
Nowadays, more and more Websites are facing online threats and being infected with viruses, injections, backdoors, malware, adware pop-ups etc. When someone opens an unsecured Website then infections gets transferred to his/her computer through cookies and cache. On detection of malware, famous search engines and security software companies can blacklist your Website. To be on safe side, you should scan your Website through online tools and take necessary steps to remove the infections. We will illustrate the ways to detect and remove virus infection through your Website in this article.
NOTE: We suggest you taking the backup of your Website (files & database) and scan it on following tools on weekly basis.
You can scan your Website at following famous online tools:
- McAfee SiteAdvisor
- AVG Threat Labs
- Sucuri Site Check
- Norton Safe Web
- Google Safe Browsing
- TrendMicro Site Safety
- Unmask Parasites
- Amada Malware Database
- URL Void
- Online Link Scan
- Browser Defender
Confirming the Detection
If any one of above scanner list the infection then it is the time to trace it out. You can use the ‘Firebug’ extension for Google Chrome & Firefox to trace the culprit code. Most of the times, the infected code is hidden in the files or adds up as a redirect in the .htaccess file. Following are the steps to confirm the virus infection: –
- If you have a backup of Website files prior to detection of virus infection, then download all the new files from the server.
- Download and install WinMerge Tool to compare the files.
- Compare the new files with previously backed up files using WinMerge.
- Download Lynx, command line browser, to browse the Website and detect any hidden code.
Protection from blacklist
Do you want to save your Website from being blacklisted? Yes, then you should immediately purchase a hosting at a new Hosting Provider, which provides secured Web Hosting on daily or monthly basis. If necessary, you can also book a new domain name quite similar to your Website.
You must have a good & safe backup of your Website files and databases, dating before virus detection. Upload these previously backed up file and export database to the new hosting. Make sure to change the DNS settings in order to redirect the visitors to new safe Website. If necessary, take help of new Website Hosting Provider to configure the DNS properly. After recovery, you can change the DNS settings to redirect the visitors to the old Website.
It is the time to remove the infections and retrieve your Website. Perform following two actions when a tool detects infection:
- List out the tools, which have notified your Website as unsecure and download their reports.
- Note down the infected links, their location, type of infection and other details mentioned in the reports.
- Scan the computer(s) on which you have access to the Website with a trusted antivirus and dedicated antispyware product.
- Erase all the login details to access your Website like that of FTP, Control Panel (cPanel), CMS Dashboard etc.
- Reset the browser(s) and completely delete their Browsing History.
Before proceeding to next steps, you should make sure that your computer(s) are totally secure and does not have a single infection. If necessary, you can backup your data and get formatted your computer. Now, you have to take following actions to remove infections from your Website.
After performing each step, you should open your Website in the browser to check the symptoms and test at the listed tools of Step 1.
- Check the .htaccess file and remove any suspicious code. Not sure which one is the suspicious code then replace it with the default .htaccess file. If you do not have the backup of default .htaccess file then visit CoolTips htaccess Generator, configure the options and generate a new .htaccess file for you. If you are using a CMS then visit their support/forum section and get a default .htaccess file.
- Visit http://www.htaccesstools.com/htpasswd-generator and generate the code to apply username and password to access .htaccess file. Insert this code inside the .htaccess file.
- If you have not booked a new domain and hosting then create a Site Maintenance page specifying that ‘Your Website is under maintenance for NN hours/minutes.”
- Add a redirect in the .htaccess file to redirect all of the visitors to a Site Maintenance Page.
- You can also email the registered users or subscribers about the downtime with a request not to browse your Website in prescribed timings with a genuine reason like “to avoid load shedding” or “to help in quick maintenance”. After the recovery process, you can email them again specifying that your Website is up and running.
- Immediately remove the identified suspicious code from each location of your Website.
- If you using a CMS then disable all the plug-ins or extensions, themes etc. one by one. We suggest you to disable one at a time until you identify the main culprit extension. If you do not find any conflicting plugin or theme, then do not enable the plugins/themes back.
- Remove each additional code from your Website, which you have added for extra features like social sharing options, analytics code, license code, banners etc.
- Test your Website now with above tools. If they do not find any infection then it is good to go else continue to perform steps.
- Most of the Website Hosting companies provide the options to scan the file system and database through trusted antivirus on demand. Contact your host and check whether they provide such service or not.
- If your Web Host do not provide scanning services then download all the files to your computer through FTP or SFTP.
- Take back up of the downloaded files at a safe location.
- Scan the files with trusted antivirus.
- Remove infections, if detected. If not then skip step 15 to 17.
- Remove all the files from the File System of your Website and upload the scanned files through FTP or SFTP.
- Try to open your Website and check whether it opens up or not.
- If the Website does not open then remove the files at your server and upload the backup taken in Step 9.
- If above steps does not work then take services of experienced security professionals to recover your Website.
Still no help after performing each step then it is the time to reinstall or re-setup your Website from scratch. Backup all the files & databases; remove them from server, and then setup from the beginning of the time. If you are using a CMS then reinstall it from starting and re-tailor it according to your need.
It is the best practice to backup your Website and scan it using above listed tools on weekly basis. In addition, you should perform above steps to recover your Website from the infections. We invite our readers to provide feedback and suggestions through their valuable comments. You can list your experience with virus detection and removal at your Website.
Keshav Arora is a Senior Technical Writer with seo-Semantic-xhtml.com, a specialized division of IPraxa. He specializes in topics on Content Management Systems, Web Design and Development Technologies. seo-semantic-xhtml.com provides PSD to HTML, XHTML, CSS and 3rd party application integration. Follow us on Twitter, and be our fan on Facebook.