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 SecurityWordPress is the world’s most used CMS which makes it a target for hacking.

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

These attacks were caused by networks of infected computers programmed to attack other vulnerable computers, 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 methods hackers use to try and break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. This can be done using scripts and software that can guess hundreds of possible logins in minutes.

If you’re using obvious usernames and passwords that are easy to guess, your website could be easily hacked by repeated attempts to guess your site’s login details.

This is called a “brute-force” attack.

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 private computers that have been infected with malicious scripts or code, which are then controlled remotely as a group, typically without the unsuspecting computer owners’ knowledge or awareness.

Botnets are often used to blast out mass spam emails.

Below is a screenshot taken from an internet security monitoring site 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 compromising computer networks all around the world since 2009.

(The Zeus botnet has been actively infecting computer networks all around the globe since 2009. Screenshot image: SecureList.com)

These botnet attacks are well organized and highly distributed. Over 90,000 IP addresses were identified by several webhosting 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 worldwide brute force attacks continued after this, with over 30,000 WordPress blogs being hacked every day.

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

WordPress powers millions of websites worldwide, making it a natural target for hacking attacks

(Being the world’s most used CMS makes WordPress an obvious target for hacking)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

We explain why WordPress is a secure platform for websites in this article: Is WordPress A Secure Platform For Websites?

Important

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 attacking sites built using other web platforms like Joomla).

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

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

Every website with a vulnerability offers some value to hackers. A vulnerable blog not only offers wannabe hackers opportunities to improve their hacking skills and claim “bragging rights” amongst their peers, but it can also be a platform for distributed attacks, spreading malware and as a source of information theft.

If a hacker can hack and gain remote access of your web site, that website can then be used as a “bot” to attack other highly-valued websites.

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

The harsh reality is that malicious bots are looking for vulnerabilities and trying to hack into your website or blog as you are reading this page right now. Whether they can break into your site or not, will depend on how hard you have made it for them to keep persisting until they either can work out a way to get in, or decide to look for an easier target.

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

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

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

You will see that the check will return a number of results and details about your website setup …

Hackertarget - Website Security Scan

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

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

Hackertarget - WP Security Check(Screenshot: BlogDefender site)

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 can be valuable information to hackers, as this informs them about any exploitable holes or weaknesses, especially in older versions.

If your site or blog is driven by WordPress and you are not taking steps to toughen up your site, then 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 installations worldwide!

When a website or blog is broken into, site owners can find themselves completely “locked out” of their own site, or notice that their files have been interfered with or that everything has been entirely wiped out. Typically, most compromised sites will be infected with malicious software or viruses without the owner’s knowledge or awareness.

To avoid the heartache 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 botnet attacks.

Important

Note: A few of the recommended measures listed below require 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 code on your site, then ask your web host or search for a professional WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Web Host

Get in touch with your hosting service provider and ask them what systems have been put into place to protect your site from being attacked, and what is done to make sure that your server files get backed up.

Check that your hosting company regularly backs up your server files and that, if disaster strikes, you can easily recover your site.

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

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

A complete WordPress maintenance routine ensures that:

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

A proper WordPress site maintenance routine looks like this …

Maintaining your WP site backed up and updated is vitally important for WordPress security.(Maintaining your WP website backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WordPress web site frequently backed up and updated. 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 don’t want to learn how to do WordPress site maintenance yourself, pay a professional 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 are still breathing!

If you don’t want to perform manual backups, there are a number of plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Back Up, Clone And Protect Your WordPress Web Sites With Backup Creator Plugin For WordPress

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

The brute force attack on WordPress is mostly attempting to compromise website administrator panels and gain access to the site by exploiting sites that used “admin” as the account name.

For reasons of website security, don’t install WordPress sites with the username admin. This is the first area hackers will test. If your site’s username is “admin”, then make sure you change this immediately.

We have created a tutorial that shows you how to change your login username here: Changing Your Admin Username In WordPress To A Different User Name

Security Measure #4 – Choose Strong Passwords

A “brute force” attack occurs when malicious software continually and persistently hits a login or password field with different character strings in an attempt to guess the right login combination that will unlock your site.

Unless some measure is put into place to block the brute-force attack (see further below for a couple of simple and effective ways to do this), the “bot” will just persist in attacking your site until it eventually “cracks” the code.

Passwords that are easy to guess, therefore, make really easy targets for hacking attacks. Make sure that you change your password to something containing at least 8 characters long, with upper and lowercase letters, combined with “special” characters (%^#$@&*).

Useful Tip

You can use a password program like Roboform to help you generate unbreakable passwords …

Roboform is a password management tool you can use to create different strong passwords(You can use a password management program like Roboform to generate strong login passwords)

For a detailed tutorial for admin users that shows you how to change your login password, go here: What To Do If You Need To Reset Your WordPress Password

Security Measure #5 – Secure Your WP Config File

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

WordPress WP Config file

(wp-config.php file)

If hackers break into your WordPress website, they will normally look for your wp-config.php file, because this is the file that contains your database information, 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 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 – Delete Or Rename Unnecessary WP 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, just rename them.

Security Measure #7 – Update Your WordPress Installation, Plugins & Themes To Their Latest Version

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

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

Security Measure #8 – Disable Your Theme Editor

WordPress installations come with a built-in editor feature that allows the site administrator to edit theme and plugin code inside the dashboard.

You can access your WordPress Theme Editor by selecting Appearance > Editor from your admin menu …

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the WP dashboard menu)

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

If you want to prevent people from accessing the 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 – Remove Access To Your Site’s Uploads Folder

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

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

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

(WordPress has an uploads directory where media content is stored)

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

Protecting your directories will prevent unauthorized people 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 an empty file named “index.php”) to your uploads directory, and so on. Again, it’s best to get professional help if you are not sure about what to do.

Security Measure #10 – Security Plugins

There are a number of WordPress security plugins available that specifically address most security issues faced by WordPress website owners, such as preventing unauthorized users from accessing vital areas of your site, protecting your site from malicious exploits, preventing injections of code into files, etc.

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

SecureScanPro - complete security software solution for WordPress

(SecureScanPro – WordPress security plugin)

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

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

Blog Defender

Blog Defender Security Product Suite For WordPress(Blog Defender Security Solution For WordPress Websites & Blogs)

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

BlogDefender scans you WordPress site for potential security holes …

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

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 web platform, but neglecting basic maintenance tasks like ensuring that your WordPress core files, plugins and WordPress themes are kept updated to their latest versions, 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, you cannot afford to ignore the importance of securing your web sites.

As one last reminder of the importance of website security, below is the advice given by an expert on website security to all WordPress users following the mass brute-force attacks 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, 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 seek help from a WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

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

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***