How To Protect Your WordPress Site From A Brute-Force Attack

Learn how to protect your WordPress site from being brute-force attacked, or having its security compromised by hackers or bots.

WordPress SecurityPowering millions of sites around the world makes WordPress an obvious target for attempted hacker attacks.

In April 2013, WordPress installations around the world were subjected to worldwide brute force attacks.

These attacks were caused by computers infected with viruses and programmed to attack other vulnerable computers, also commonly known as “botnets”.

How To Protect Your WordPress Site From A Brute-Force Attack

About Brute-Force Attacks

A brute-force attack is a technique used to break an encryption or authentication system by trying all possibilities.

(Source: Chinese University Of Hong Kong)

One of the many ways hackers use to try and break into WordPress sites is by trying to guess the site’s administration login username and password. This can be achieved using scripts and software tools that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re using easy-to-guess usernames and passwords, your website can be easily hacked by a malicious software’s persistent attempts to guess your site’s login details.

This is called a “brute-force” attack.

Botnet – What Is This?

A botnet is a number of Internet-connected computers communicating with other similar machines in an effort to complete repetitive tasks and objectives. This can be as mundane as keeping control of an Internet Relay Chat (IRC) channel, or it could be used to send spam email or participate in distributed denial-of-service attacks. The word botnet is a combination of the words robot and network.

(Source: Wikipedia)

”Botnets” are networks of computers that have been compromised and infected with malicious code or software, which can then be controlled remotely as a group, often without the computer owners even being aware that this is happening.

Botnets are normally used used to send mass spam emails from computers of compromised user accounts.

The screenshot below was taken from an internet security monitoring site showing the locations of the command centers of a botnet that has been actively infecting computer networks all around the globe since 2009 called “Zeus” …

ZeuS is a botnet that has been actively infecting computer networks all around the globe since 2009.

(ZeuS is a botnet that has been actively infecting computer networks all around the globe since 2009. Screenshot image: SecureList.com)

These were highly distributed and well organized botnet attacks on WordPress sites. Over 90,000 IP addresses were identified by several webhosting companies in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress site administration areas. The large-scale attack continued after this, with over 30,000 WordPress sites and blogs being hacked each day.

News of this brute-force botnet attack was widely reported in all the major webhosting companiesand leading technology media publications, such as Forbes, TechNews Daily, PC Magazine, Tech Crunch, BBC News, and even on the official US Department of Homeland Security website …

WordPress is the world's most popular content management system making it an obvious target for hacking

(WordPress is the world’s most used CMS making it a natural target for attacks by malicious users)

Does This Mean WordPress Is Not Secure And We Should Stop Using It?

No. In fact, there are many good reasons why you should choose WordPress if you are concerned about the security of your web presence.

We explain what makes WordPress a very secure web platform in this article: WordPress Security What Every Website Owner Needs To Know

Info

It’s important to understand that, in the case of April 2013 worldwide brute-force attack described above, no specific WordPress vulnerability was being exploited (the same script was also targeting sites built using other applications like Joomla).

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, made the following comment about the botnet attacks:

It is a “simple” script that attempts to login using the admin login and a generated password. So if your password is too short or based on dictionary words it will be guessed and then the script can login legitimately and do whatever it wants including installing scripts (as plugins) or editing files. The attack tries to guess your password, if it succeeds, the most secure site in the world is wide open because they have your password.

(MikeLittle.org)

Protecting Your WordPress Website From Being Brute-Force Attacked – Ten Security Measures

Every web site with a vulnerability provides some degree of opportunity to hackers. If you think that your website is of little value to hackers, think again. Business web sites, personal blogs, government websites … even sites owned by web security and anti-hacking experts can and have been targeted.

If a malicious user can exploit a security weakness that allows them to gain remote control of your website, that website or blog can then be employed as part of a larger network of “bots” to target more valued web sites.

Additional undesirable results of being hacked include getting blacklisted by search engines, having stealthy spam links advertising things like gambling, porn, etc. inserted into your content, redirecting visitors to phishing sites, drive-by downloads (adding malicious programs on your visitors’ computers), and many other nasty things.

The truth is that software-driven bots are most likely trying to hack into your web site while you are reading this page. Whether they will do this successfully depends on how hard or easy you have made things for them to keep persisting until they either find how to break in, or give up and go look for an easier target.

How Much Information Are You Broadcasting To Hackers About Your Site?

If you visit Hackertarget.com and run your website through their WordPress security check …

Website Security Scan(Hackertarget – WP Security Scan Screenshot source: https://hackertarget.com/wordpress-security-scan)

You will see that the check will yield a number of results and information about your website setup …

WordPress Security Scan

(website security scan results. Screenshot image: Hackertarget.com)

It should be obvious after using this tool that if you are able to see all of this information about your WordPress website, hackers can too.

Hackertarget - WP Security Scan(Screenshot: BlogDefender.com)

The ability to see which version of WordPress you are using, which plugins and themes you have installed on your site, and which files have been uploaded to certain directories on your server can all be useful information to hackers, as this informs them about potentially exploitable holes or weaknesses, especially where the owners haven’t updated their sites.

If your website is powered by WordPress and you are not proactive steps to bullet-proof your site, then it’s practically guaranteed that, at some point, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically hitting WordPress installations around the world!

Whenever a website or blog gets compromised, webmasters will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been altered or even that their content has been completely wiped out. Often, most sites will be infected with malicious software or viruses without the owner even being aware that this has occurred.

To avoid the heartache and frustration (and potential loss of valuable business data) that comes with having your website or blog being hacked into, we have listed below 10 essential and effective security checks that will help to protect your WordPress site from brute force attacks.

Disclaimer

Note: A few of the recommended measures below require some technical skills to modify core WordPress and server files. If you have no technical skills, or don’t want to mess around with file code, then ask your web host or a professional WordPress service provider for assistance.

***

Security Measure #1 – Contact Your Webhosting Service Provider

Contact your webhosting service and ask them what security precautions they offer to help prevent your site from being attacked, and what they are doing to ensure that your site files get backed up.

Check that your host is regularly backing up your server files and that, if disaster strikes, you can quickly and easily get back your files and data.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Or Blog Regularly Maintained

You should never rely just on your webhosting service provider for your site backups. Instead, learn how to manage your WordPress site or get this done for you and develop a habit of religiously performing a complete site maintenance routine frequently (e.g. daily, weekly, monthly, etc …)

A proper WordPress maintenance routine ensures that:

  • All unnecessary data and files are deleted,
  • All files and data are free of errors, optimized and backed up,
  • All software, plugins and themes are up-to-date,
  • etc …

A full WordPress maintenance routine looks like this …

Maintaining your WP website or blog fully backed up and updated is vitally important for WordPress security.(Maintaining your WP website or blog regularly backed up and updated is vitally important for WordPress security. Image: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WP web site backed up and updated. WordPress maintenance is not hard to do or time-consuming, but it must be done to ensure the security of your website or blog. If you don’t want to learn how to do WP maintenance yourself, pay someone to do it but make sure this gets done. Backing up your site is the next most important thing you must do after making sure that you are still breathing!

If you don’t want to back up your files manually, there are many free and paid WordPress plugins you can use. You can read about a WordPress backup plugin that can automate your site backups here: Back Up, Duplicate And Keep Your WordPress Site Protected With Backup Creator WordPress Plugin

Security Measure #3 – Do Not Use “Admin” As A Username

the worldwide brute-force botnet attack on WordPress sites was mostly attempting to compromise website administrator panels and gain access to the site by exploiting WP sites using “admin” as the user name.

For website security reasons, don’t install WordPress sites with the username “admin”. This is the first area hackers will test. If your blog’s username is admin, change this immediately.

We have created a detailed step-by-step tutorial created especially for WordPress users that shows you how to change your username here: How To Change Your WP User Name From Admin To A More Secure User Name

Security Measure #4 – Make Sure Your Password Is Hard To Guess

A “brute force” attack occurs when malicious software persistently hits a username and password field with different strings of characters in an attempt to guess the right combination that will give the hacker entry to your website.

Unless you put some measure in place to prevent the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just keep attacking your site until it eventually “cracks” the code.

Weak passwords, therefore, are really easy targets for botnets. Make sure that you change your password to something containing at least eight characters long, with both upper and lowercase letters, and “special” characters (^%$#&@*).

Useful Tip

You can use a password program like Roboform to help you generate very secure passwords …

You can use a password management program like Roboform to help you generate strong login passwords(You can use a password software tool like Roboform to generate passwords)

For a simple tutorial created especially for non-technical WordPress admin users on how to change your admin password, go here: Changing Your Password In WordPress

Security Measure #5 – Secure Your wp-config.php File

The wp-config.php file contains information about your blog’s database and is used to define advanced options for WordPress.

WP Config file

(WP Config file)

If hackers break into your website, they will typically look for your wp-config.php file, because this file contains your WordPress database details, security keys, etc. Getting access to this information would allow them to change anything in your database, create a user account, upload files and take control of your site.

To protect your WordPress site from attacks and even being used as part of a bot net, therefore, prevent people from accessing your wp-config.php file. This requires knowing how to edit database information, move files around in your server and changing access permissions.

Security Measure #6 – Delete Or Rename Unnecessary Installation Files

Rename or delete your install.php, upgrade.php and readme.html files.

These files can be removed after installation. If you don’t want to delete these files, then just rename them.

Security Measure #7 – Upgrade Your WordPress Blog, Plugins And Themes

Hackers search for vulnerabilities they can exploit in outdated WordPress versions, including out-of-date versions of WP themes and plugins.

Ensure that all of your installation files, themes, plugins, etc. are always up to date.

Security Measure #8 – Disable The Theme Editor

WordPress comes with a built-in editor that allows the site administrator to edit plugin and theme code from the dashboard area.

In WordPress, you can access the WordPress Theme Editor by selecting Appearance > Editor in the main menu …

WP Theme Editor Menu

(Accessing the WordPress theme editor via the WP dashboard menu)

The WordPress theme editor lets anyone accessing your blog’s admin view and modify your WordPress theme template files, and cause havoc on your site.

To prevent people from accessing the WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Protect The Site’s Uploads Directory

The WordPress “uploads” folder contains all the media that gets uploaded to your site.

Normally, this folder is visible to online users. All someone has to do to view the contents in your “uploads” folder is visit your directory using their browser …

(WordPress uploads folder)

(WordPress uploads directory)

If any directories in your website have vulnerabilities that can be exploited by hackers or malicious users, this could become a serious threat to the security of your website.

Protecting your directories will prevent unauthorized people from accessing your ‘uploads’ folder and other important directories. This can be done using plugins, setting file permissions, uploading a blank index.php file (this is literally a file with nothing in it named “index.php”) to your uploads directory, and so on. Again, it’s best to seek professional help if you are not sure about what to do.

Security Measure #10 – Security Plugins

Several security plugins for WordPress are available that specifically address common security issues faced by WordPress website owners, such as preventing hackers from accessing your site, protecting your website from malicious exploits, preventing injections of code into files, etc.

Most WordPress plugins address some but not all areas of WordPress security. One security plugin that seems to do a comprehensive job of scanning, fixing and preventing issues that could lead to hackers accessing your site files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - WP security software solution

(SecureScanPro – complete security plugin for WordPress)

SecureScanPro is easy to install and easy to use, and addresses most of the security areas that WordPress users need to address.

Another great security plugin you may want to look at using is BlogDefender.

Blog Defender

Blog Defender Security Product Suite(Blog Defender Security Suite)

This product is a package of WordPress security video tutorials, plugins and tools, plus WordPress security documentation in PDF and DOC formats.

BlogDefender scans you website for potential security vulnerabilities …

Blog DefenderAnd then shows you how to quickly fix these …

Blog Defender Security Plugin For WordPressIf you don’t want to invest in a premium security plugin like SecureScanPro or BlogDefender, then use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting basic maintenance tasks like updating your WordPress software, plugins and WordPress themes, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

No matter what type of business you run or plan to run online and how small you think your web presence is, you cannot afford to ignore the importance of securing your website or blog.

As a final reminder of the importance of website security, below is the advice given by a security expert to all WordPress users after the mass brute force attacks on WordPress in 2013 …

Owners of websites based on WordPress CMS must improve at least basic security settings and implement best practices such as the use of robust passwords and the accurate management of “admin” accounts.

Pierluigi Paganini, Chief Information Security Officer, Security Affairs

***

As you can see, website security is very important if you run a WordPress site. Hopefully, the information in this article has provided you with the initial steps you need to take to prevent brute-force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please seek help from a professional WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications whenever we publish new information on WordPress security and tutorials about new security plugins.

***

"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now

***

Originally published as How To Protect Your WordPress Site From A Brute-Force Attack.