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

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

These attacks were caused by computers infected with malware and programmed to attack other vulnerable installations, 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)

There are many ways hackers try to break into a WordPress site. One of these is by trying to guess the site admin’s login username and password. To achieve this, hackers use scripts and tools that automatically tries to guess hundreds of login permutations in minutes.

If you’re using obvious login details, your site could be an easy target for hackers.

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

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

Botnets are regularly used to blast out mass spam emails from the infected computers of unsuspecting users.

The screenshot below was taken from a site that monitors online security showing the locations of the command centers of a botnet that has been actively compromising computer networks all around the world since 2009 called “Zeus” …

The Zeus botnet has been actively infecting computer networks all around the globe since 2009.

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

These were highly distributed and well organized attacks. Over 90,000 IP addresses were identified by a number of webhosting companies in the initial attack alone, when millions of attempts to force their way into WordPress user admin areas occurred. The large-scale attack continued after this, with over 30,000 WordPress blogs being hacked each day.

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

WordPress powers millions of websites around the world, which makes it a natural target for attempted attacks by hackers

(Powering millions of sites worldwide makes WordPress an obvious target for malicious attempts by hackers)

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

No. In fact, there are lots of very good reasons why you should use WordPress if you are concerned at all about the security of your web presence.

To understand why WordPress is a secure web platform, see this article: Is WordPress Secure?

Useful Information

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

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

How To Protect Your WordPress Site From Brute Force Attacks – Ten Security Checks

Every blog with a vulnerability provides some degree of opportunity to hackers. If you think that your site is of no interest to hackers, think again. Large, medium and small business sites, personal blogs, government web sites … even web sites owned by web security experts can and have been targeted.

If someone can discover a software flaw in your security that allows them to gain remote control of your website or blog, the website can then be used as a “bot” in a planned cyber attack against larger and more valued web sites.

Additional undesirable results of having your site hacked and your site security compromised include getting blacklisted by search engines, having stealthy spam links promoting things like viagra, discounted fashion, etc. inserted in your content and meta data, redirecting visitors to phishing sites and other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasties.

The harsh reality is that software-driven bots are looking for exploits and trying to break into your site right now. Whether they can hack in successfully depends on how difficult you can make it for them to continue persisting until they work out a way to break in, or give up and go look for a more vulnerable target.

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

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

WP Security Check(Hackertarget – WordPress Security Check Image source: Hackertarget.com)

You will see that the scan will display a number of results and information about your WordPress setup …

Hackertarget - WP Security Check

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

It should be obvious after using the tool shown above that if you are able to access all of this information, hackers can too.

WP Security Scan(Screenshot source: BlogDefender.com)

Being able to see what 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 be useful information to hackers, as this informs them about any exploitable security weaknesses, especially in older versions.

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

Whenever a website is compromised, webmasters will find themselves “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, compromised sites will be infected with malicious scripts without the owner’s knowledge or awareness.

To avoid the heartache of discovering that your web site has been hacked into, we have listed below 10 simple, yet essential and effective security measures that will help to prevent your WordPress site from brute force attacks.

Note

Note: Some of the recommended measures shown below require some technical skills to modify core WordPress and/or server files. If you are not technical, or don’t want to mess around with code on your site, then ask your web host or search for a WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Webhosting Provider

Get in touch with your hosting company and ask them what measures are in place to help prevent your site from brute force attacks, and what they do to ensure that your server files and data get regularly backed up.

Make sure that your host regularly backs up your sites and that, if disaster strikes, you can quickly and easily recover your files and data.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Website Frequently Maintained

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

A full WordPress maintenance routine ensures that:

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

A full WP maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WordPress site regularly backed up and updated is. WP site maintenance is not hard 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 site maintenance yourself, pay someone to do it but make sure this gets done. Backing up your site is the second most important thing you must do after making sure that you still have a pulse!

If you don’t want to back up your data manually, there are a number of plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Backup, Copy & Keep Your WP Websites And Blogs Protected With Backup Creator Plugin For WP

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

The brute-force botnet attack on WordPress is mostly attempting to compromise site admin panels by exploiting WP installations with “admin” as the username.

For website security purposes, avoid installing sites with the username “admin”. This is the first area of potential vulnerability hackers will test. If your blog’s user name is “admin”, then make sure you change it immediately.

For a simple tutorial that shows you how to change your WordPress username, go here: Changing Your WordPress Admin Username

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when malicious software continually hits a login or password field with different character strings trying to guess the right login combination that will give the hacker access to your website.

Unless you put some measure in place to block the brute force attack from happening (see further below for a couple of simple and effective ways to do this), the “bot” will just keep attacking your site until it eventually works out the combination.

Weak passwords, therefore, become very easy targets for bot attacks. Make sure that you change your password combination to something containing at least eight or nine characters long, and that includes upper and lowercase letters, and add a few “special” characters (e.g. ^, #, &, etc).

Tip

If you have trouble coming up with strong passwords or you are reluctant to set up different passwords for all of your online logins, then use a password management software tool like Roboform …

Roboform is a password tool that lets you generate different strong passwords(Roboform is a password management program that lets you create strong login passwords)

We have created a detailed tutorial that shows you how to change your login password here: What To Do If You Need To Change Your Password In WordPress

Security Measure #5 – Protect 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.

WordPress WP Config file

(wp-config.php file)

If a hacker breaks into your site, they will normally look for your wp-config.php file, because this is the file that contains important information about your site’s database, 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 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 Blog Installation Files

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

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

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

Hackers are always on the lookout for vulnerabilities they can exploit in previous versions of WordPress, including out-of-date versions of WP plugins and themes.

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

Security Measure #8 – Disable Your Theme Editor

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

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

WordPress Theme Editor Menu

(The WordPress theme editor is accessible via the admin menu)

The WordPress theme editor feature allows anyone accessing your blog to view and make changes to your WordPress 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 adding code to your wp-config.php file.

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

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

By default, this folder is visible to online users. All someone has to do to see all of the contents stored in your site’s “uploads” directory is visit the directory using their web browser …

(WordPress uploads folder)

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

If any directories in your website have vulnerabilities that can be exploited by hackers, this can seriously threaten 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, 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 get professional assistance if you are not sure about what to do.

Security Measure #10 – Install Security Plugins

There are a number of great security plugins for WordPress available that will address most security issues faced by WordPress site owners, such as preventing unauthorized users from gaining access to vital information about your site, protecting your site from malicious scripts, preventing unauthorized file uploads, etc.

Many WordPress plugins address some but not all areas of WordPress security. One plugin that does 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 - security software solution for WordPress

(SecureScanPro – total security software for WordPress)

SecureScanPro is easy to install and easy to use, and does a great job of addressing most of the security issues that WordPress users need to address.

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

Blog Defender

Blog Defender WordPress Security Suite(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 shows you where potential security weaknesses in your WordPress site are …

Blog DefenderAnd lets you quickly fix these …

Blog DefenderIf you don’t want to invest in a 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 secure web platform, but neglecting simple maintenance tasks like ensuring that your WP installation, plugins and themes are kept updated to their latest versions, tightening file and data protection and taking other necessary precautions can expose your site to malicious by hackers and bots.

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

As a final reminder of the importance of keeping your websites protected, below is the advice given by an expert on website security to all WordPress users following the global 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, website 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 seek help from 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 when we publish new articles and tutorials on WordPress security and tutorials about WordPress security plugins and solutions.

***

"Learning WordPress has been a huge stumbling block for me. I've been looking for something that covers absolutely everything but doesn't cost an arm and a leg. Thank you so much ... you have just provided me with what I have been looking for! Truly appreciated!" - Tanya

***