This page provides information about identifying, removing, and preventing maleware on your website. It does not cover every situation, only the most common cases that we see at Dman. Some cases may require further assistance from security professional. You may also find additional information and volunteer assistance in our online community.
We provide this advice as-is and cannot guarantee the results of following it. Like you, we do the best we can.
There are three basic steps to restoring and maintaining a clean website:
1.Identifying maleware behavior 2.Removing the maleware behavior 3.Preventing future infection
Identifying maleware behavior The first step to keeping your website badware-free is to check for any badware or badware behaviors that may already be on your site.
What to look for The three most common forms of maleware that we see on compromised sites are:
Malicious scripts Malicious scripts are often used to redirect site visitors to a different website and/or load maleware and adware from another source. These scripts will often be injected by an attacker into the content of your web pages, or sometimes into other files on your server, such as images and PDFs. Sometimes, instead of injecting the entire script into your web pages, the attacker will only inject a pointer to a .js or other file that the attacker saves in a directory on your web server.
Many malicious scripts use obfuscation to make them more difficult for anti-virus scanners to detect.
Some malicious scripts use names that look like they’re coming from legitimate sites except they will have a single letter mispelling or a extra character such a period or number. Such as http://yahoo1.com/comments/reply.php. Note that yahoo1 is not yahoo.com the search engine, that extra character could be anyone doing anything on the world wide web. So check the spelling of links carefully.
htaccess redirects The Apache web server, which is used by many hosting providers, uses a hidden server file called .htaccess to configure certain access settings for directories on the website. Attackers will sometimes modify an existing .htaccess file on your web server or upload new .htaccess files to your web server containing instructions to redirect users to other websites, often ones that lead to badware downloads or fraudulent product sales.
Hidden iframes An iframe is a section of a web page that loads content from another page or site. Attackers will often inject malicious iframes into a web page or other file on your server. Often, these iframes will be configured so they don’t show up on the web page when someone visits the page, but the malicious content they are loading will still load, hidden from the visitor’s view. Hackers look for files that are left chmod at 777 by novice website owners. Easy for them to copy, add thier iframe and then place back to await your unaware visitors.
How to look for it If your site was reported as a badware site by Google, you can use Google’s Webmaster Tools to get more information about what was detected. This includes a sampling of pages on which the badware was detected and, using a Labs feature, possibly even a sample of the bad code that was found on your site. Certain information can also be found on the Google Diagnostics page, which can be found by replacing example.com in the following URL with your own site’s URL: www.google.com/safebrowsing/diagnostic?site=example.com
There exist several free and paid website scanning services on the Internet that can help you zero in on specific badware on your site. There are also tools that you can use on your web server and/or on a downloaded copy of the files from your website to search for specific text. StopBadware does not list or recommend such services, but the volunteers in our online community will be glad to point you to their favorites.
Removing the maleware behavior Once you have located the code that is causing the badware behavior, removing it is often as simple as deleting the offending code from all files in which it appears. Sometimes, it is easier, if you have a clean backup of your site’s contents, to re-upload all of the site’s files, though be careful about overwriting files that may have changed since your last backup. In some cases, the bad content may be stored in one or more database records, in which case restoring a recent backup of the database or manually editing the relevant records may be necessary.
Preventing future infection Preventing badware on your website requires protecting three things: your site itself, the password(s) used to upload content to the site, and the computer(s) used to upload content to the site. The site itself must be protected because attackers often look for vulnerable software to exploit so they can modify your site’s contents. The passwords are critical because, if they are guessed or stolen, they can be used to modify the site. Finally, computers are important because badware on your computer can steal your password and/or modify the contents that you are uploading.
Protect your site •Ensure that any software you use (e.g., blogging software like WordPress, third party scripts, etc.) is kept up to date with the latest security fixes, either by you (if you installed the software) or by your hosting provider. •Remove any scripts, services, or other software that you are no longer using. •Change any default passwords that come with the software you are using. •Use appropriate file permissions on your web server. Protect your password •Use a strong password and change it occasionally, especially if you have reason to think it has been compromised.