Site   Web
Featured Article Picture
avatar

Security on WordPress has, especially in the past couple of months, become a serious issue. Never before have I seen so many determined and sophisticated hacking attempts directed against the WordPress sites I own or manage.

These run the whole gamut of attack variations:

* Blackhole Exploit Kit attacks
* SQL Injection attempts
* Login & Password access efforts
* Link Injection & Phishing attacks, where links to bank fraud efforts are made
* Etc…

Attacks are primarily initiated in Russia, Poland, Germany and India. The firewall software I use also identifies hosts being blocked from Australia, random European countries, plus sources that are unidentifiable due to IP address concealment etc.

Generally speaking, its easy to minimize the potential threat by a few minutes of pre-emptive efforts! In other words, an ounce of prevention is still easier to apply than a pound of cure!

WordPress Security Plugins

This is the first line of defense – a properly implemented security plugin will thwart the majority of hacking efforts – particularly the script-based automated ones! Where a human-driven attack is initiated, you can easily make it extremely difficult to gain access to the internals of your website. The more difficult it is, the greater the likelihood of the attacker giving up and seeking out a softer, easier target. Even in the hacking world, time is money…

There are multiple WordPress security plugin applications available, each with its own methodology or variation on a theme. Selection of one over the other will often be based on the server environment – some simply won’t install if the right PHP elements or server settings are not enabled. Those that I have direct and extensive personal experience with are:

* Better WordPress Security

* Wordfence Security

* Bullet Proof Security

* Secure WordPress

Each has its peculiarities, peccadilloes and quirks! Each works…

Better WordPress Security

I’ve used Better WordPress Security a lot and do like the comprehensive way in which it tackles a broad range of prospective threats. Its evolution has been significant and rapid. Unfortunately, the new releases have been occurring at almost weekly intervals for the past couple of months. Upgrades sometimes culminate in a crisis on the site, such as 500 Server Errors. This issue is particularly problematic if you have WordPress running in a sub-directory! Such issues can only remedied by:

* accessing the site via FTP
* deactivating the BWS plugin by renaming or deleting the directory
* editing the BWS code from the .htaccess file (or deleting .htaccess completely)

Obviously, that’s a pain in the proverbial, and is not an endearing aspect of the plugin! :-)

If your WordPress installation runs from the root directory, BWS will give you peace of mind, but you will need a good understanding of WordPress, security issues, and confidence in WordPress troubleshooting…

Minor Irritation

* The “Backup” option being ON by default – that interferes with any backup scheduling you already have in place, such as BackupBuddy or WP DB-Manager etc. That can sometimes culminate in 2 dozen copies of your site backup arriving in your email account overnight! LOL

Major Irritation

* Checking files outside the WordPress installation will give timeout errors and lock up Admin access if you’ve got other large software applications OR add-on domains. There is an “exclude directories” option, but it requires manual selection… Such a lockup is not recoverable and requires deactivation as above.

That said, it’s damned effective at preventing security breaches and I’ve not had a single unauthorized access on a site running BWS! Despite the irritations, I actually made a $50 donation towards the BWS cause, as it’s obviously taking up a huge amount of dedicated effort to get it right, and it’s getting better and better.

Wordfence

While I would prefer to use a single WordPress security plugin across all sites I manage, I’ve got Wordfence Security installed on multiple sites because of WP running from within a sub-directory, or in the case of add-on domains as mentioned above.

Wordfence has a relatively simple interface compared to BWS or BPS, and operates in a different way. It seems very robust, and the firewall settings are easy to configure. Basically, I recommend simply selecting the following setting;

“Level 4: Lockdown. Protect the site against an attack in progress at the cost of inconveniencing some users.”

That’s going to defeat the most determined of automated hacking efforts without impacting on the site’s usability! Wordfence can be configured to provide email warning of a variety of threats, including:

* Alert on critical problems
* Alert on warnings
* Alert when an IP address is blocked
* Alert when someone is locked out from login
* Alert when the “lost password” form is used for a valid user
* Alert when someone with administrator access signs in
* Alert when a non-admin user signs in

Other important security aspects include:

* Enable automatic scheduled scans
* Scan core files against repository versions for changes
* Scan for signatures of known malicious files
* Scan file contents for backdoors, trojans and suspicious code
* Scan posts for known dangerous URLs and suspicious content
* Scan comments for known dangerous URLs and suspicious content
* Scan for out-of-date plugins, themes and WordPress versions
* Check the strength of passwords
* Monitor disk space
* Scan for unauthorized DNS changes
* Scan files outside your WordPress installation

The fast alerts on the slightest hint of a problem are comforting. I especially like the “Scan core files against repository” function! If a file changes, or an extra one appears, the alarm bells start ringing!

Bullet Proof Security

This is also a robust security plugin application, and I’ve used Bullet Proof Security on 2 sites where the preceding plugins could not be installed. It’s comprehensive, but I personally find its interface to be somewhat daunting – it’s complicated and hard to understand. Maybe it’s just me…

However, it hasn’t ever crashed (unlike BWS) and it hasn’t ever been breached either. On that basis I’d recommend it, but you will need to read the directions!

Secure WordPress

Secure WordPress seems to be at the lower end of the complexity scale and again, I’ve got a couple of sites running it. Installation is neither difficult nor complicated. It’s going to require:

* a (free) account at WebsiteDefender,
* an ‘agent’ file upload to your site that verifies / authorizes the account

WebsiteDefender provides automated scanning of the site for you. Alert notices are emailed, and the 1st scan on one site even picked up on a link from the website to a page which had apparently been compromised!

WordPress Security Plugins Summary

One or other of these four plugins are sure to solve the particular security issues on your WordPress website. They provide a known base from which to start your countermeasures. There are several others that can be trialed.

My pick of the litter is Wordfence – that’s because it’s reliable, has that core code verification feature and notifies you immediately of any plugin upgrades!

Securing WordPress

There are several basic elements that need to be addressed as part of any recommendations on WordPress security.

Secure WordPress User ID

The default WordPress User ID is “Admin” and you should NOT use that on your site. Doing so immediately means half of the “site access equation” is known, and all that’s required is the password! That’s pretty reckless in this day and age…

A secure User ID ought to be a minimum of 10 characters containing a mix of upper and lower case and including numeric and/or special character variations e.g.; $The#1Boss

In addition, you should then assign a User Account “nickname” so that there is no clue as to the Admin identity if you inadvertently use the account to publish any pages or posts! Ideally, you should publish the pages and posts from a “Editor” level account…

Secure Passwords

Most people foolishly use a password related to their life in some guessable way. Phone numbers, wife’s name, child’s name, dog’s name etc. A little bit of research, a bit of trial and error on the part of a smart hacker or competitor and your site is wide-open!

There are several websites specializing in secure password generation:

* PCTools

* Strong Password Generator

* Online Password Generator

USE one of them!

Comment Spam & Bad Links

These contribute negatively to your website’s online profile. Eliminate the majority of potential issues by using the inbuilt automation options;

* Don’t allow registration unless it’s absolutely necessary!
* Don’t allow comments OR trackbacks on pages
* Close comments on posts after 2 – 4 weeks
* Don’t allow trackbacks on posts

Installing and configuring the built-in Akismet anti-spam plugin is not at all difficult and it effectively screens out the worst of the remaining garbage!

Maintaining WordPress & Plugins

It’s extremely important to diligently maintain WordPress and any plugin applications. When a security breach or flaw occurs, fixes are put in place, but word of the potential exploit quickly circulates amongst the hacking community. Hackers immediately start looking for sites that are at risk, and target them!

A ‘once a week’ login to your WordPress Admin should be a standard task, in order to check if there are upgrades available. Install any upgrades immediately! Having a plugin like Wordfence installed ensures you are notified immediately if upgrades available.

How to Deal With WordPress Hacking

Don’t panic, because it won’t help! Usually, the hacking efforts I’ve seen relate to exploits of inherent security weaknesses in:

* JavaScript in plugins
* permissions allowing concealment of phishing (most often bank fraud) code in a sub-directory

The first indication may be:

* an email from Fraudwatch requesting you delete the offending content

* a warning from your hosting company that the site is compromised and in danger of being shut down.

* a tip from a friend or client that Google is displaying malware or virus warnings about your website.

These days, it’s rare to have an overt, immediately obvious hacking occur. It’s mostly an out-of-sight, deeply-planted problem that the hacker hopes won’t be discovered for weeks or months.

Dealing with the problem is usually a straightforward process, as per the next section.

WordPress Tech Support / Help Desk

Usually, the fastest way to deal with a known breach of WordPress is to:

* Use the 1-click update in WordPress Dashboard / Updates to overwrite all core files that may have been compromised.

* Where a plugin is implicated, delete the affected plugin directory, and then upload a new copy.

* Where a Theme is implicated, copy your backup files across to replace the compromised files.

Follow that up by viewing the site’s files in your Control Panel file manager or an FTP application such as Smart FTP, and look for:

* Files and directories that were altered or uploaded and don’t belong.

* Inappropriate file permissions – e.g. directories should usually NEVER be set to 777 permissions, as this gives access to anyone to do anything. The correct directory permissions for most hosting accounts is 755, and some servers generate “Server 500″ errors if permissions are inadvertently set at 777.

* Unexpected items in /uploads/ or /backups/ directories.

* File Modified dates that don’t match up with any edits, uploads or changes you’ve made.

If you are using any of the WordPress Security plugins, run the included Scan option from within the site.

Use more than one online scanning service to examine your website. These all have strengths in different areas, and one may identify issues that another might not spot. Try VirusTotal – scan the Home page URL and get a quick report from multiple sources.

The overriding goal is:

* deleting the compromised files and replacing them with the correct versions.
* ensuring secure permissions across directories and files.
* implementing a security plugin.

That must be followed by immediately by:

* changing the WordPress admin password.
* changing the Cpanel / Plesk / Hsphere admin password.
* changing the FTP access password.
* deleting any “extra” User or FTP accounts that may have been added to provide easy future access for the hackers.

Core File Compromises

If the /wp-config.php has been altered in any way, it is wise to reset the WordPress Database User Account password, and add the new password into the /wp-config.php file. This can be done through the Admin Control Panel access to MySQL Database management. In the case of Cpanel it’s very easy to change the MySQL password.

Backups

Having an automated monthly backup process scheduled, with off-server storage, makes sound business risk management sense.

WordPress Security Conclusions

* Avoiding the problem is not particularly difficult.
* Eliminating the problem is usually straightforward.


Ben Kemp is a WordPress SEO Consultant with more than 25 years of experience in the IT industry, including 15 years as an SEO professional. Clients throughout New Zealand, Australia, the UK & the USA use his comprehensive Annual WordPress Maintenance plan that addresses most of the issues covered in this article.

The SEO Guy (nz)
Email: bjk@TheSEOguy.co.nz
Web: http://www.TheSEOguy.co.nz

14 Responses to “Hacked WordPress Sites & Security Countermeasures — A SPN Exclusive

    avatar Rod Ritchie says:

    Great article.

    I would add Firewall 2 to the list. An excellent plugin.

    Thank you for the exclusive article adding a security plugin is not what we normally do but after reading your post we will now install one as part of our core installation. That said none of our websites have been hacked.

    Thank you for this. It’s a level I haven’t applied yet but I soon will. My sites have been hacked and advertised/listed as hacked several times and in several places. There are long time accounts on YouTube telling hackers how to do it – including free tools etc.

    Why does Google allow them to exist and rate on SERP?

    Anyway, don’t get me started!

    I also add blank html and index.php files into plugin and themes folders, a spoecial .htaccess in wp-admin, use login-lockdown, bad-behavior and chap-secure-login plugins.

    Scanning for problems is really essential as you say.

    The trouble with WP is that you end up using far too many plugins but these hacker jerks are out there in droves, learning from early teens “graffiti” up to serious criminal intent.

    avatar Susan O'Dea says:

    I also like ‘Limit Logins’ and my settings are tough.

    I did have sites hacked a few years ago…but none in the last couple…I have removed and fixed potential problems.

    avatar PsVita Ita says:

    Thank you, I have been using Wordfence for a while now…and I have to admit it is really useful and easy to manage….thanks for the comparison with other plugins!

    avatar Jim Walker says:

    As a back up of some of these recommendations I’ve written a more basic summary here, Security Tips, http://hackrepair.com/blog/hackrepair-com-security-tips-and-hack-notes
    and
    Free website monitoring tools here, http://hackrepair.com/free-website-monitoring-services

    Very nice summary as well. Thanks you.

    avatar Charlie says:

    Another great plugin I use is CodeGuard. Backs up daily and sends an email notification when it detects any changes.
    Great Article

    Charlie

    avatar PCS says:

    I would also highly recommend zbblock

    Its free and in my opinion a must have for wordpress security:

    http://www.spambotsecurity.com/zbblock.php

    This is an excellent list of stuff to do to secure your WordPress site…

    I had some security problems earlier with my WordPress sites, and ended up doing a lot of research into securing WordPress sites…

    I wrote up my experiences in a Security Checklist which can be downloaded for free on http://www.wpsecuritychecklist.com.

    My checklist has a few more items and detailed steps for how to get the job done.

    Hopefully the checklist can help other people securing their WordPress sites…

    Good point with backups turned on by default in my Better WP Security plugin. I’ve gone ahead and fixed that.

    As for the file check… It is a nuisance to override, that I’ll agree on unfortunately there are so many different configurations however that there really aren’t many other good ways to handle the situation.

    Finally, thanks for the donation!!!

    Great list of sites, I’d also recommend our new WordPress Security plugin that’s about to hit the market. From the date of this post, it should be live here in about 1-2 days at most.

    Being able to change your database table prefix on the fly, change your admin username, create a custom login URL (that disables the default wp-admin & wp-login.php URL’s), enable HTTP Authentication and so much more.

    You can get more info at http://lockerpress.com

    avatar DeerMtn says:

    Thank you for this article! I had my site compromised quite a while ago and had to dig to find this information. It is comforting to see that security is getting more attention these days!
    I know I feel a lot more informed!

    avatar Jeff Huckaby says:

    The major item I see in handling WP exploits is the failure to update your site.

    Tools like http://managewp.com can help you maintain multiple sites.

    Also, I would combine any WP security plugins with remote audit tools.

    We currently use nessus as part of our server hardening solutions but current reviewing WPScan which is specifically designed for WordPress.

    Hope to have the results on our blog soon.

    avatar Ira says:

    I would suggest that you sign up for an account with theshosting.com. They provide free malware removal services on anybody hosted on there servers. My site was hacked at blue host and they were able to transfer it from blue host and also remove the malware injection for free!

    They were even able to tell me exactly where the hack originated from as well. They said it came from an outdated timthumb.php file which they were able to update for me.

    They also did a scan of my account and told me all the security vulnerabilities of my account.

    I honestly suggest switching over to them if your website is hacked. They can transfer and remove the hack from your site. Best of all they do this for free.

Submit a Comment

Your email address will not be published. Required fields are marked *






You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please leave these two fields as-is:

Protected by Invisible Defender. Showed 403 to 1,297,906 bad guys.

close

Like our Site?


Link back to us by copying this link code to your website:
<a href="http://www.sitepronews.com" rel="nofollow">SPN - Tech, Social Media & Search Engine News</a>