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 leading CMS platform in the world and the preferred online publishing platform used by millions of businesses and loved by thousands of web developers and web designers, it’s inevitable that at some point in time, WordPress will come under attack by hackers.

In early 2013 a mass brute force attack hit WordPress installations on virtually every host server in existence around the world.

These attacks were caused by botnets (computer networks infected with malware and programmed to attack other sites).

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 a WordPress site. One of these is by trying to guess the site admin’s login username and password. This is achieved using software programs that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re not using strong usernames or unguessable passwords, your website can be easily hacked by repeated attempts to guess your site’s login details.

This is called a “brute-force” 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/botnet)

”Botnets” are networks of computers that have been compromised and infected with malicious software, which are then controlled remotely as a group, typically without the computer owners’ knowledge or awareness.

Botnets are often used to send out mass spam emails from computers of unsuspecting users.

Below is a screenshot taken from a site that monitors online security 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 world since 2009.

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

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

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

WordPress is the world's most used CMS which makes it a target for hacking

(Being the world’s most popular CMS makes WordPress an obvious target for hacker attacks)

Does This Mean We Should Stop Using WordPress?

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

To learn what makes WordPress a very secure platform for websites, see this article: How Secure Is WordPress?

Info

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

Mike Little, one of the co-founders of WordPress, said this about the brute-force 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)

How To Prevent Your WordPress Website From Being Brute Force Attacked – Ten Security Checks

You may think that your website is of no interest to hackers, but the reality is that to a hacker, every website provides an opportunity to gain some advantage at your expense.

If a hacker can find a way to take over and control your website, the website or blog can then be employed as a “bot” in a planned cyberattack against other valued sites.

Additional undesirable effects of having your website hacked and your site security compromised include getting blacklisted by search engines, having spammy links promoting things like gambling, porn, etc. in your content, malicious redirects to phishing sites and other websites, drive-by downloads (adding malware on your visitors’ computers), and many other nasty things.

The harsh reality is that hackers are trying to hack into your blog at this very moment. Whether they can hack into your site successfully depends on how difficult you can make things for hackers to continue persisting until they work out a way to get access, or are forced to give up and decide to look for a more vulnerable target.

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

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

WordPress Security Check(Hackertarget – WordPress Security Scan Image source: https://hackertarget.com/wordpress-security-scan)

You will see that the check will yield various results and details about your WordPress site …

WordPress Security Scan

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

It should be obvious after using the tool shown above that if you can freely access all of this information about your WordPress site, hackers can too.

Hackertarget - WP Security Check(Screenshot: Blog Defender)

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 in your site can be potentially useful information to hackers, as this informs them about potentially exploitable security weaknesses, especially in older versions.

If your site or blog is driven by WordPress and you are not preventive steps to harden your site, we can practically guarantee that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these brute-force attacks are systematically targeting WordPress sites all the world!

When a site gets compromised, webmasters will find themselves “locked out” of their own site, or notice that their files have been vandalized or that everything has been entirely wiped out. Often, sites will become infected with malicious scripts without the owner’s knowledge or awareness.

To avoid the heartache (and significant financial loss) that comes with discovering that your web site has been hacked into, we have listed below ten simple, yet essential and effective security checks that will help to protect your WordPress site from being brute force attacked.

Useful Info

Note: A few of the recommended 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 – Get In Touch With Your Hosting Company

Get in touch with your hosting company and ask them what systems they have put in place to protect your site from brute-force attacks, and what is done to ensure that your files and data get regularly backed up.

Check that your hosting service provider is backing up your sites and that, if anything goes wrong, you can easily recover your files.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Website Or Blog Regularly Up-To-Date

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

A complete WordPress maintenance routine ensures that:

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

A complete WordPress maintenance routine looks like this …

Maintaining your WP website frequently backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website or blog completely backed up and up-to-date is vitally important for WordPress security. Screenshot: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WordPress installation frequently backed up and updated is. WP maintenance is not hard or time-consuming, but it must be done to ensure the security of your website. If you do not want to learn how to do WordPress maintenance yourself, get someone else to do it but make sure it gets done. Backing up your website is the next most important thing you must do after making sure that your heart is still beating!

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

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

The large scale brute force botnet attack on WordPress sites was mostly attempting to compromise site admin panels by exploiting WP sites that used “admin” as their user name.

For security reasons, avoid setting up WordPress sites with the username “admin”. This is the first area hackers will test. If your site’s username is admin, you need to change this immediately.

We have created a step-by-step tutorial for admin users that shows you how to change your username here: How To Change Your WordPress User Name From Admin To A Different Username

Security Measure #4 – Choose Strong Passwords

A “brute force” attack occurs when malicious software continually tries to guess the right combination of username and password characters that will give them entry to your website.

Unless some measure is put into place to block the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just persist in attacking your site until it eventually works out the combination.

Weak passwords, therefore, make really easy targets for hackers. Make sure that you change your password to something that contains at least eight characters long, and that includes upper and lowercase letters, combined with “special” characters (e.g. %, #, @, etc).

Practical Tip

Roboform is a password management software you can use to generate secure login passwords …

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

We have created a tutorial for non-technical WordPress users on how to change your admin password here: How To Change Your Password

Security Measure #5 – Prevent Access To Your wp-config.php File

The wp-config.php file allows WordPress to communicate with the database to store and retrieve data and is used to define advanced options for WordPress.

WP Config file

(WordPress WP Config file)

If a hacker breaks into your WordPress website, they will normally try to access your wp-config.php file, because this file contains important information about your site’s database, security keys, etc. Getting access to this information would allow someone 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 attacks and even being used as part of a bot net, therefore, you must prevent your wp-config.php file from being easily accessed. This requires knowing how to edit database information, move files around in your server and changing access permissions.

Security Measure #6 – Rename Or Delete Unnecessary Installation Files

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

You can remove these files after installation. If you don’t want to delete these files, then just rename them.

Security Measure #7 – Upgrade Your WordPress Site, Plugins And Themes To Their Latest Version

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

Make sure to always keep your WordPress files, plugins, themes, etc. up-to-date.

Security Measure #8 – Disable Your Theme Editor

WordPress installations come with a built-in editor feature that lets the administrator edit theme and plugin files from the dashboard area.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor using the main menu)

This means that anyone logging into your blog’s admin area can view and edit your WordPress files, and create havoc on your site.

To prevent unauthorized 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 – Prevent Access To Your Site’s Uploads Folder

The “uploads” folder stores all the media files that get uploaded to your site.

By default, this folder is visible to online users. All someone has to do to see the contents stored in your “uploads” folder is navigate to your directory using a web browser …

(WordPress uploads directory)

(WordPress uploads folder)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, anyone could upload unauthorized file types to your site.

Protecting your directories will prevent online users from viewing your ‘uploads’ folder and other important directories. This can be done using plugins, setting file permissions, adding a blank index.php file (this is literally a file with nothing in it called “index.php”) to your uploads directory, and so on. Again, it’s best to get professional assistance if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

A number of WordPress security plugins are available that specifically address common security issues WordPress site owners face, such as preventing hackers from gaining access to vital information about your site, protecting your website from malicious exploits, preventing unauthorized file uploads, etc.

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

SecureScanPro - total security software for WordPress

(SecureScanPro – complete security software for WordPress)

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

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

Blog Defender Security Product Suite

Blog Defender(Blog Defender)

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

BlogDefender scans you web site for security weaknesses …

Blog DefenderAnd then shows you how to easily fix these …

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

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting essential maintenance tasks like making sure that your WP installation, WP plugins and WordPress themes are kept updated to their latest versions, tightening file and data security 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 simply cannot ignore the importance of web security.

As one last reminder, below is the advice given by a security expert to all WordPress users after the large-scale brute force attacks by botnets 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 provided you with the initial steps you need to take to keep your WordPress site protected from brute force attacks. If you need any further help or assistance with WordPress security, please consult a professional WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified via email whenever we publish new tips on WordPress security and tutorials about WordPress security plugins.

***

"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie

***