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 leading content management system and the online publishing platform of choice used by millions of businesses and loved by thousands of website developers and web designers, it’s inevitable that at some point in time, WordPress will become a prime target for attacks from hackers wanting to score a “big win”.

In 2013 a mass brute force attack began hitting WordPress installations on almost every WP hosting server in existence.

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

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 will attempt to break into a WordPress site is by trying to guess the site admin’s login username and password. This can be achieved using software programs that can guess hundreds of login possibilities in minutes.

If you’re not using strong usernames or unguessable passwords, your site could be easily hacked by the malicious script’s repeated attempts to work out your site’s login details.

This is called a “brute force” attack.

What Is A Botnet?

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)

A “Botnet” is a network of computers that have been compromised and infected with malicious code, which are then controlled remotely as a group, typically without the unsuspecting computer owners even being aware that this is taking place.

Botnets are regularly used to blast out mass spam emails.

Below is a screenshot taken from a site that monitors online security showing the locations of the command centers of ZeuS – a botnet that has been actively infecting computer networks all around the globe since 2009 …

The Zeus botnet 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. Image source: SecureList.com)

These were highly distributed and well organized botnet attacks. 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 users admin areas took place. The worldwide brute-force attacks continued after this, with over 30,000 WordPress blogs being hacked each day.

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

WordPress is often the target of malicious attacks by hackers, due to its global popularity

(WordPress powers millions of sites around the world, making it a frequent target for malicious attacks by hackers)

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

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

To learn why WordPress is a secure web platform, see this article: Can You Build A Secure Business Online Using WordPress?

Useful Information

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

Mike Little, the co-founder of WordPress with Matt Mullenweg, made the following comment 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)

Preventing Your WordPress Site From Being Brute-Force Attacked – 10 Security Points

Every web site with a security vulnerability offers some value to hackers. A compromised website not only provides hackers opportunities to improve their skills and win “respect” from their peers, but it can also acts as a valuable platform for distributed denial of service (DDoS) attacks, distributing malware and participating in information theft.

If hackers can find a security vulnerability that allows them to gain any form of control of your site, your website or blog can then be used as a “bot” in a planned cyber attack against larger and more valuable websites.

Additional undesirable consequences of having your site hacked and your site security compromised include being blacklisted by Google, having spammy links advertising things like casinos, discounted fashion, etc. inserted in your content and page title and descriptions, malicious redirects to phishing sites or other websites, drive-by downloads (adding malware on your visitors’ computers), and lots of other nasty things.

The reality is that software-driven bots are very likely trying to hack into your website as you are reading this page. Whether they can be successful or not, depends on how hard or easy you will make it for hackers or botnets to keep persisting until they can find a way to get access, or decide to look for a less secure target.

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

Do you own a WordPress site? If so, visit Hackertarget.com and run your website through their WordPress security check …

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

You will see that the scan will return various results and information about your website setup …

WP Security Check

(WordPress security check results. Screenshot image: Hackertarget.com)

It should be obvious after using the above tool that if you can access all of this information, so can hackers.

WP Security Check(Source: BlogDefender website)

The ability to see what version of WordPress you are using, which plugins and themes you have installed, and which files have been uploaded to certain directories can all be potentially valuable information to hackers, as this informs them about any potential vulnerabilities, especially in older versions.

If your website runs on WordPress and you are not taking appropriate steps to toughen up your site, it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your site, because these attacks are systematically hitting WordPress sites around the world!

Typically, whenever a site is compromised, blog owners will find themselves “locked out” of their own site, or notice that their content has been altered or that everything has been entirely wiped out. Often, most sites will become infected with malicious software without the owner even being aware that this has occurred.

To avoid the heartache (and significant financial loss) of having your site being hacked into, below are 10 essential and effective security measures that will help to prevent your WordPress site from brute force attacks.

Note

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

***

Security Measure #1 – Contact Your Webhosting Service

Contact your hosting company and ask them exactly what measures are in place to help prevent your site from being attacked, and what is done to make sure that your site files are being regularly backed up.

Check that your webhosting provider backs up your sites and that, if anything happens, you can quickly and easily recover your files.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Site Frequently Updated

Never rely just on your webhosting provider for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this service done for you and maintain a habit of performing a full WordPress site maintenance routine on a frequent basis (e.g. daily, weekly, fortnightly, 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 WordPress software, themes and plugins are up-to-date,
  • etc …

A complete WordPress maintenance routine looks like this …

Maintaining your WP web site fully backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress website completely backed up and up-to-date is vitally important for WordPress security. Source: WPTrainMe.com)

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

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

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

The brute-force botnet attack on WordPress sites was mostly attempting to compromise website administrator panels and gain access to sites by exploiting sites with “admin” as their account name.

For reasons of website security, avoid installing a WordPress site with the username “admin”. This is the first area of potential vulnerability hackers will test. If your blog’s user name is admin, change this immediately.

We have created a simple step-by-step tutorial on how to change your WordPress username here: Changing Your WP Username From Admin To A Different Username

Security Measure #4 – Make Sure Your Password Is Secure

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

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, make really easy targets for brute-force attacks. Make sure that you change your password to a string that is at least 8 or 9 characters long, with both upper and lowercase letters, and “special” characters (%^#$@&*).

Useful Tip

You can use a password software tool like Roboform to help you generate strong passwords …

Roboform is a password management software that lets you easily create really secure passwords(You can use a password management software tool like Roboform to help you generate really secure passwords)

We have created a simple step-by-step tutorial for non-technical WordPress admin users that shows you how to change your admin password here: Changing Your WordPress Password

Security Measure #5 – Secure 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 WordPress options.

wp-config.php file

(WP Config file)

If a hacker breaks into your site, they will typically search for the 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 a hacker to change anything in your database, create a user account, upload files and take control of your site.

To protect your WordPress site from being attacked and even being used as part of a bot net, therefore, prevent your wp-config.php file from being accessed. 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 Site Installation Files

Delete or rename your install.php, upgrade.php and readme.html files.

These files are not required after installation. If you don’t want to delete these files, then just rename them.

Security Measure #7 – Upgrade Your WordPress Files, Plugins & Themes To Their Latest Version

Hackers search for vulnerabilities in previous versions of WordPress that they can exploit, including outdated versions of WordPress themes and plugins.

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

Security Measure #8 – Disable Your Theme Editor

WordPress installations come with a built-in editor feature that allows you to edit plugin and theme files from the dashboard.

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

WP Theme Editor Menu

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

This means that anyone logging into your blog can view and edit your theme template files, or cause havoc on your site.

To prevent people from being able to access 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 The WordPress Uploads Directory

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

By default, this folder is visible to online users. All a person needs to do to view the contents in the “uploads” directory is navigate to your directory using their web browser …

(WordPress uploads folder)

(WordPress has an uploads folder where all of your media files are stored)

If any files stored in his folder have vulnerabilities that can be exploited by malicious users, someone can upload unauthorized file types or compromise the security of 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 blank file called “index.php”) to your uploads directory, and so on. Again, it’s best to ask help from someone who knows what they are doing if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

There are some great WordPress security plugins available that specifically address common security issues WordPress site owners face, such as preventing hackers from accessing your site, protecting your website from malicious software, preventing unauthorized file uploads, etc.

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

SecureScanPro - WP total security plugin

(SecureScanPro – WordPress security software)

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

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

Blog Defender WordPress Security Product Suite

Blog Defender Security Solution(Blog Defender Security Suite For WordPress Web Sites)

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

BlogDefender shows you where the security weaknesses in your WordPress installation are …

Blog Defender WordPress Security SuiteAnd then shows you how to easily fix these …

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

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting simple maintenance tasks like keeping your WP installation, plugins and WordPress themes up-to-date, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

No matter what kind of business you run or plan to run online and how small you think your web presence is, web security is something you cannot ignore.

As a final reminder, below is the advice given by an expert on website security to all WordPress users after the global brute-force attacks by botnets 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 of the utmost importance if you run a WordPress site. Hopefully, the above 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 WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

Also, please subscribe to WPCompendium.org to be notified whenever we publish new articles on WordPress security and tutorials about new security plugins.

***

"I was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com

***