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 websites and blogs worldwide makes WordPress a target for hackers.

In early 2013, WordPress installations around the world were subjected to a worldwide brute-force attack.

These attacks were caused by botnets (infected computer networks programmed to attack other installations with security vulnerabilities).

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 WordPress sites. One of these is by trying to guess the site admin’s login username and password. This can be done using software programs that can work through hundreds of login possibilities in minutes.

If you’re using obvious usernames and weak passwords that are easy to guess, your site can 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)

A “Botnet” is a network of private computers that have been compromised and infected with malicious code, which can then be controlled remotely as a group, often without the computer owners’ knowledge or awareness.

Botnets are typically used to blast out mass spam emails from 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 world since 2009.

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

These ongoing botnet attacks on WordPress sites were highly distributed and well organized. Over 90,000 IP addresses were identified by several hosting companies just 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 attacks then continued, with over 30,000 WordPress sites being hacked per day.

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

WordPress is often the target of malicious attacks by hackers

(WordPress often comes under attack by hackers, due to its popularity)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

We explain what makes WordPress a very secure platform for websites in this article: How Secure Is WordPress? What Every Blog Owner Needs To Know About WordPress

Info

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

Mike Little, the co-founder 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)

How To Prevent Your WordPress Website From Brute-Force Attacks – Ten Security Points

Every web site with a security vulnerability can be seen as a potential opportunity to hackers. A vulnerable site not only presents new hackers opportunities to improve their skills and win “respect” among their peers, but it can also be a valuable resource for launching distributed attacks, distributing malware and information theft.

If a malicious user can find a vulnerability, that site can then be employed as part of a larger network of “bots” to target other valuable web sites.

Additional undesirable impacts of having your site hacked and your site security compromised include getting blacklisted by Google, having stealthy spam links advertising things like viagra, cheap offers on brand names, etc. inserted into your content, redirecting visitors to phishing sites and other websites, drive-by downloads (adding malicious programs on your visitors’ computers), and lots of other nasties.

The harsh reality is that brute-force software bots are very likely searching for weaknesses and trying to hack into your website right now. Whether they can break in successfully or not, will depend on how challenging you can make things for them to keep persisting until they discover a way to break in, 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 WordPress Site?

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

Website Security Scan(Hackertarget – WP Security Scan Screenshot source: Hackertarget.com)

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

WP Security Scan

(WordPress security scan results. Product image: Hackertarget.com)

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

Website Security Check(Image source: BlogDefender.com)

Being able 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 are all useful information to hackers, as this can inform them about any potential holes or weaknesses, especially where site owners haven’t updated their software versions.

If your website is powered by WordPress and you are not proactive steps to bullet-proof your site, it’s practically guaranteed that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these attacks are systematically hitting WordPress sites all the world!

Whenever a website or blog is hacked, 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, compromised sites will be infected with malicious scripts without the owner even being aware of it.

To help avoid the heartache and aggravation (and significant financial loss) that comes with discovering that your website or blog has been hacked into, below are 10 simple, yet essential and effective security measures that will help to protect your WordPress site from being brute-force attacked.

Important

Note: Some of the measures below require some technical skills to modify core WordPress or server files. If you are not technical-minded, or don’t want to mess around with code on your site, then ask your web host or a professional WordPress technical provider for assistance.

***

Security Measure #1 – Contact Your Web Host

Contact your webhosting provider and ask them what security measures they offer to protect your site from being attacked, and what is done to ensure that your server files and data get regularly backed up.

Check that your hosting service backs up your sites and that, if anything happens, you can 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 host for site backups. Instead, learn how to manage your WordPress site or pay someone to get this done for you and maintain a habit of performing a full WordPress site maintenance routine frequently (e.g. weekly, monthly, etc …)

A proper WordPress maintenance routine ensures that:

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

A full WordPress maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WordPress website regularly backed up and up-to-date is. WP site 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 do not want to learn how to do WordPress site maintenance yourself, get someone else to do it but make sure it gets done. Backing up your website is the second most important thing you should do after making sure that your heart is still beating!

If you don’t want to back up your files manually, there are a number of plugins you can use. You can read about a WordPress backup plugin that can automate your site backups here: Backup, Copy And 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 attack on WordPress sites was mostly an attempt to compromise site admin panels by exploiting WP sites using “admin” as their account name.

For security purposes, never set up sites with the username “admin”. This is the first area hackers will test. If your site’s user name is admin, change it immediately.

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

Security Measure #4 – Change Your Password

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

Unless you put some measure in place to prevent the brute-force attack from happening (see further below for a couple of effective suggestions for doing this), the “bot” will just continue to attack your site until it eventually gets access.

Passwords that are easy to guess, therefore, make really easy targets for attacks. Make sure that you change your password to something that is at least 8 characters long, with both upper and lowercase letters, and add a few “special” characters (e.g. %, $, *, etc).

Practical Tip

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

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

We have created a simple tutorial on how to change your WordPress password here: How To Reset Your Password

Security Measure #5 – Prevent Your wp-config.php File From Being Easily Accessed

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

wp-config.php file

(wp-config.php)

If a hacker breaks into your WordPress site, they will typically try to access the wp-config.php file, because this is the file that contains your WordPress database details, 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 people from being able to easily find 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 Site Installation Files

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

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

Security Measure #7 – Keep Your WordPress Site, Plugins & Themes Up-To-Date

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

Make sure to keep all of your installation files, themes, plugins, etc. up-to-date.

Security Measure #8 – Disable Your Theme Editor

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

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

WordPress Theme Editor Menu

(The WordPress theme editor is accessible using the WP admin menu)

This means that anyone logging into your blog can see and make changes to all of your theme templates, or create mayhem on your site.

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

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

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

Normally, 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 navigate to your directory using their browser …

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

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

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

Protecting your directories will prevent online users from accessing 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 named “index.php”) to your uploads directory, and so on. Again, it’s best to consult a professional if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

There are some great security plugins for WordPress available that will address many common security issues faced by WordPress site owners, such as preventing unauthorized users from accessing your site, protecting your files from malicious software, preventing unauthorized file uploads, etc.

Many 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 potential issues that could lead to hackers accessing your files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - WP security plugin

(SecureScanPro – WordPress security software)

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

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

Blog Defender

Blog Defender(Blog Defender)

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

BlogDefender scans you web site for security vulnerabilities …

Blog Defender WordPress Security PluginAnd then shows you how to quickly and easily fix these …

Blog Defender Security Product SuiteIf 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 web platform, but neglecting simple maintenance tasks like updating your WordPress installation, WP plugins and WP themes, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

Regardless of the type 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 simply 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 mass 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, website security is very important if you run a WordPress site. Hopefully, the information in this article will help keep your WordPress site protected from brute force attacks. 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.

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

***

"These tutorials have so much information and are easy to understand. If you use WordPress or plan to in the future these will help you with everything you need to know." - Valisa (Mesa, Arizona)

***

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