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.

WP SecurityWhen you are the world’s most popular CMS platform and the preferred online publishing platform used by millions of websites and loved by thousands of website developers and web designers, it’s inevitable that at some point in time, WordPress will become an obvious target for attacks from hackers.

In 2013, WordPress installations around the world were subjected to global-scale brute force attacks.

These attacks were caused by botnets (computer networks infected with viruses and programmed to attack other vulnerable computers).

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

What Is A Brute-Force Attack?

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)

There are many methods hackers use to try and break into WordPress sites. One of these is by trying to guess the site’s administration login username and password. To achieve this, hackers use scripts and software that automatically tries to guess hundreds of possible logins in minutes.

If you’re using obvious usernames and weak passwords that are easy to guess, your site can be easily hacked by a malicious software’s repeated attempts to guess your site’s login details.

This is called a “brute-force” login attack.

What Are Botnets

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 private 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 of this.

Botnets are normally used used to send out mass spam emails.

Below is a screenshot taken from an online security monitoring site showing the locations of the command centers of a botnet that has been actively infecting computer networks all around the world since 2009 called “Zeus” …

The Zeus botnet has been actively compromising computer networks all around the world since 2009.

(ZeuS is a botnet that has been actively compromising computer networks all around the world since 2009. Image source: SecureList.com)

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

Coverage of this worldwide brute force botnet attack was reported by all the major webhosting companies, as well as the leading technology publications, such as Forbes, TechNews Daily, PC Magazine, Tech Crunch, BBC News, and even on the official US Department of Homeland Security website …

Being the world's most popular content management system makes WordPress an obvious target for hacking

(WordPress powers millions of websites and blogs around the world, making it a natural target for hacking attacks)

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

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

To learn why WordPress is a secure web platform, read this article: Are Open Source Web Platforms Like WordPress Secure?

Important Info

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, made this 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)

Preventing Your WordPress Blog From Brute-Force Attacks – 10 Security Points

Every web site with a vulnerability can be an opportunity to hackers. Every website is valuable to hackers. Large, medium and small business sites, personal blogs, government websites … even web sites owned by online security experts can and have been targeted.

If hackers can discover a way to access and control your web site, that website or blog can then be used as part of a larger network of “bots” to target larger and more highly-valued sites.

Additional undesirable effects of having your website hacked include getting blacklisted by search engines, having spammy links advertising things like viagra, discounted fashion, etc. inserted into your content, malicious redirects to phishing sites or other websites, drive-by downloads (adding malicious software on your visitors’ computers), and many other nasties.

The truth is that hackers are trying to hack into your web site right now. Whether they will do this successfully or not, will depend on how difficult or easy you have made it for hackers or bots to continue persisting until they either work out a way to get access, or give up and decide to look for a more vulnerable target.

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

Does your website run on WordPress? If so visit a site like Hackertarget.com and run your website through their WordPress security check …

WP Security Check(Hackertarget – Website Security Check Product image source: https://hackertarget.com/wordpress-security-scan)

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

Hackertarget - Website Security Check

(WP security check results. Image source: Hackertarget.com)

It should be obvious after using the above tool that if you are able to freely access all of this information about your website, then so can hackers.

Hackertarget - WP Security Check(Screenshot source: Blog Defender)

Being able 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 can be potentially useful information to hackers, as this informs them about any holes or weaknesses, especially where the owners haven’t updated their software versions.

If your website runs on WordPress and you are not proactive steps to harden your site, it’s practically guaranteed that, at some point in time, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically targeting WordPress sites around the world!

Whenever a website is compromised, blog owners will find themselves “locked out” of their own site, or notice that their files have been modified or that everything has been entirely wiped out. Often, most sites will be infected with malicious software or viruses without the owner even being aware of it.

To avoid the heartache and aggravation (and potential loss of valuable business data) of discovering that your website has been hacked into, below are 10 simple, yet essential and effective security measures that will help to prevent your WordPress site from being attacked by brute force hackers.

Useful Info

Note: Some of the steps shown below need some technical skills to modify core WordPress or server files. If you have no technical skills, or don’t want to mess around with code on your site, then ask your web host or search for a WordPress service provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Webhosting Service

Get in touch with your web host and ask them what systems have been put into place to protect your site from brute-force attacks, and what they do to ensure that your server files and data are being backed up.

It’s important to make sure that your hosting company regularly backs up your sites and that, if anything goes wrong, 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 Updated

Never rely on your hosting service for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this service done for you and develop a habit of religiously performing a full site maintenance routine on a frequent basis (e.g. weekly, fortnightly, etc …)

A full WordPress maintenance routine ensures that:

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

A full WP site maintenance routine looks like this …

Maintaining your WordPress installation regularly backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website frequently backed up and updated is vitally important for WordPress security. Screenshot source: WPTrainMe.com)

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

If you don’t want to perform manual backups, there are many free and paid WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Backup, Copy And Protect Your WP Websites With Backup Creator Plugin For WordPress

Security Measure #3 – Make Sure That Your Username Is Not “Admin”

the worldwide brute-force attack on WordPress sites was mostly an attempt to compromise site administrator panels by exploiting installations that used “admin” as their account name.

For website security purposes, avoid setting up sites with the username admin. This is the first area of potential vulnerability hackers will test. If your site’s username is admin, change this immediately.

We have created a step-by-step tutorial on how to change your WordPress admin username here: How To Change Your WP Admin Username

Security Measure #4 – Use Strong Passwords

A “brute force” attack occurs when a malicious script continually tries to guess the right combination of username and password characters that will unlock your website.

Unless you put some measure in place to stop the brute force attack (see further below for a couple of simple and effective suggestions for doing this), the “bot” will just persist in attacking your site until it eventually gets access.

Passwords that are easy to guess, therefore, become very easy targets for botnets. Make sure that you change your password to a string that contains at least 8 or 9 characters long, and that includes upper and lowercase letters, and add a few “special” characters (e.g. ^, #, &, etc).

Practical Tip

You can use a password software tool like Roboform to create strong login passwords …

You can use a password software tool like Roboform to create unbreakable passwords(You can use a password management software tool like Roboform to generate passwords)

For a step-by-step tutorial on how to change your admin password, go here: Changing Your Password

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

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

wp-config.php file

(wp-config.php file)

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

In order to protect your WordPress site from being attacked and even being used as part of a bot net, therefore, prevent people getting to 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 Website Installation Files

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

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

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

Hackers are always on the lookout for vulnerabilities they can exploit in earlier WordPress versions, including outdated versions of WordPress themes and plugins.

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

Security Measure #8 – Disable Your Theme Editor

WordPress installations come with a built-in editor that lets site administrators edit plugin and theme code inside the dashboard.

You can access your WordPress Theme Editor by selecting Appearance > Editor in the dashboard menu …

WP Theme Editor Menu

(The WordPress theme editor can be accessed via the WP admin menu)

This allows anyone accessing your site to view and make changes to all of your WP theme template files, or create havoc on your site.

If you want to prevent people from being able to access your WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Prevent Access To The WordPress Uploads Folder

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

By default, this folder is visible to all users online. All a person needs to do to see all of the contents in the “uploads” directory is visit the directory using their browser …

(WordPress uploads directory)

(WordPress uploads directory)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, anyone can upload unauthorized file types to your site.

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 blank file named “index.php”) to your uploads directory, and so on. Again, it’s best to get professional assistance if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

Several WordPress security plugins are available that will address common security issues WordPress website owners face, such as preventing unauthorized users from accessing vital areas of your site, protecting your files from malicious software, preventing unauthorized file uploads, etc.

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

SecureScanPro - security software for WordPress

(SecureScanPro – WP security plugin)

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

Another great plugin you may want to consider using is BlogDefender.

Blog Defender

Blog Defender Security Plugin(Blog Defender Security Solution)

Blog Defender is a suite of WordPress security video tutorials, plugins and tools, plus a WordPress security PDF/DOC file.

BlogDefender scans you website for potential security vulnerabilities …

Blog Defender Security Solution For WordPressAnd then shows you how to fix these quickly and easily …

Blog DefenderIf you don’t want to buy a premium security plugin like SecureScanPro or BlogDefender, you can use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure platform, but neglecting essential maintenance tasks like making sure that your WP software, plugins and themes are kept updated to their latest versions, tightening file and data security and taking other necessary precautions can expose your website to malicious by hackers and bots.

Regardless of the kind of business you run or plan to run online and how small you think your web presence is, securing your web site is something you cannot afford to ignore.

As one last reminder, below is the advice given by an expert on website security to all WordPress users following the global brute force attacks on WordPress in April 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, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, the information in this article has given you 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 consult 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 be notified via email whenever we publish new articles and tutorials on WordPress security and tutorials about new security plugins and solutions.

***

"I have used the tutorials to teach all of my clients and it has probably never been so easy for everyone to learn WordPress ... Now I don't need to buy all these very expensive video courses that often don't deliver what they promise." - Stefan Wendt, Internet Marketing Success Group

***