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 SecurityBeing the world’s most popular CMS makes WordPress an obvious target for hacking attacks.

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

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

How To Protect Your WordPress Site From A Brute-Force Attack

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 WordPress sites is by trying to guess the site admin’s login username and password. To attempt this, hackers use software tools that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re using predictable user names and passwords, your website could be easily hacked by persistent 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 code or software, which are then controlled remotely as a group, typically without the unsuspecting computer owners’ knowledge.

Botnets are typically used to send out mass spam emails.

The screenshot below was taken from an internet security monitoring site showing the locations of the command centers of ZeuS – a botnet that has been actively infecting computer networks all around the globe since 2009 …

ZeuS is a botnet that has been actively infecting computer networks all around the globe since 2009.

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

These were well organized and highly distributed attacks on WordPress. Over 90,000 IP addresses were identified by several hosting companies in the initial attack alone, when the web was flooded with millions of attempts to force their way into WordPress users administration areas. The large-scale attack then continued, with over 30,000 WordPress blogs being hacked per day.

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

Being the world's most popular content management system makes WordPress a target for hackers

(WordPress is often the target of attacks by hackers)

Does This Mean We Shouldn’t Use WordPress Anymore?

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 website.

We explain why WordPress is a secure web platform in this article: WordPress Security What Every Business Owner Needs To Know

Important Info

It’s important to understand that, in the case of April 2013 large-scale 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, the co-founder of WordPress with Matt Mullenweg, 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)

Protecting Your WordPress Blog From Being Brute-Force Attacked – Ten Security Measures

You may think that your site offers no value to hackers, but the reality is that to a hacker, every website is an opportunity to benefit or profit at your expense.

If a hacker can find a vulnerability, your website can then be used as part of a larger network of “bots” to target more highly-valued web sites.

Additional undesirable consequences of being hacked include being blacklisted by search engines, having spammy links promoting things like casinos, discounted fashion, etc. inserted into your content and meta data, malicious redirects to phishing sites or other websites, drive-by downloads (adding malware on your visitors’ computers), and many other nasty things.

The truth is that hackers are very likely trying to hack into your website or blog at this very moment. Whether they can break in successfully will depend on how challenging you have made things for hackers to keep persisting until they can discover how to get in, or are forced to give up and decide to look for a less secure target.

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

Does your website run on WordPress? If so visit a site like Hackertarget.com and run your website through their WordPress security check …

Hackertarget - WP Security Scan(WordPress Security Scan Product image source: Hackertarget.com)

You will see that the test will display a number of results and details about your WordPress site …

Hackertarget - WordPress Security Scan

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

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

Hackertarget - Website Security Scan(Image source: Blog Defender)

Being able 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 can all be potentially useful information to hackers, as this can inform them about potential vulnerabilities, especially where the owners haven’t updated their files.

If your site or blog runs on WordPress and you are not preventive steps to bullet-proof your site, it’s practically guaranteed that, at some point in time, your site will be hacked, or at least targeted by bots, because these attacks are systematically targeting WordPress sites around the world!

Typically, when a website or blog gets compromised, blog owners will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been modified or even that their content has been completely wiped out. Typically, most sites will be infected with malicious scripts or viruses without the owner even being aware that this has occurred.

To help avoid the heartache and aggravation (and significant financial loss) that comes with discovering that your site has been hacked into, below are 10 simple, yet essential and effective security checks that will help to prevent your WordPress site from brute force attacks.

Note

Note: A few of the recommended steps 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 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 Host

Contact your hosting provider and ask them what security systems they have put in place to help prevent your site from being attacked, and what they do to ensure that your server files and data are being backed up.

Check that your hosting provider regularly backs up your sites and that, if disaster strikes, you can easily recover your files.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Or Blog Frequently Updated

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

A complete WordPress maintenance routine ensures that:

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

A complete WordPress maintenance routine looks like this …

Maintaining your WP site frequently backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress website regularly backed up and up-to-date is vitally important for WordPress security. Screenshot image: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WordPress installation 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 WordPress maintenance yourself, pay someone to do it but make sure this gets done. Backing up your site is the second most important thing you should do after making sure that you are still breathing!

If you don’t want to perform manual backups, there are many plugins you can use. Learn about a WordPress backup plugin that can fully automate your site backups here: Back Up, Copy And Protect Your WordPress Websites With Backup Creator Plugin For WordPress

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

the worldwide brute-force attack on WordPress is mostly an attempt to compromise website administrator panels by exploiting sites with “admin” as their account name.

For reasons of website security, avoid setting up WordPress sites with the username admin. This is the first area hackers will test. If your blog’s user name is admin, change this immediately.

For a step-by-step tutorial that shows you how to change your login username, go here: How To Change Your WP User Name From Admin To A More Secure Username

Security Measure #4 – Use Strong Passwords

A “brute force” attack occurs when a malicious script persistently tries to guess the right password and username character string that will unlock your site.

Unless you put some measure in place to stop the brute force attack from happening (see further below for a couple of effective suggestions for doing this), the “bot” will just keep attacking your site until it eventually “cracks” the code.

Passwords that are easy to guess, therefore, are very easy targets for hackers. Make sure that you change your password to a string containing at least 8 characters long, and that includes upper and lowercase letters, and “special” characters (^%$#&@*).

Practical Tip

You can use a password program like Roboform to create unbreakable passwords …

Roboform is a password tool that lets you easily create different secure passwords(Roboform is a password tool that lets you easily generate 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 Reset Your Password

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.

WP Config file

(wp-config.php)

If hackers break into your WordPress site, they will typically try to access the 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.

In order to protect your WordPress site from attacks and even being used as part of a bot net, therefore, you must prevent people viewing 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 – Rename Or Delete Unnecessary Installation Files

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

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

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

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

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

Security Measure #8 – Disable The Theme Editor

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

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor via the main menu)

The WordPress theme editor feature allows anyone accessing your site’s admin area to view and edit your WP 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 adding code to your wp-config.php file.

Security Measure #9 – Prevent Access To The Site’s Uploads Directory

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

By default, this folder is visible to all users online. All a person needs to do to see all of the contents in your site’s “uploads” directory is navigate to your directory using their browser …

(WordPress uploads directory)

(WordPress uploads folder)

If any files stored in his folder 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 online users from accessing 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 seek professional help if you are unsure about what to do.

Security Measure #10 – Use Security Plugins

There are a number of security plugins for WordPress available that will address many common security issues faced by WordPress website owners, such as preventing unauthorized users from gaining access to vital information about your site, protecting your files from malicious scripts, preventing injections of code into files, etc.

Many 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 - security software for WordPress

(SecureScanPro – total security software solution for WordPress)

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 great plugin you may want to consider using is BlogDefender.

Blog Defender Security Product Suite

Blog Defender(Blog Defender Security Product Suite For WordPress)

This product 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 website are …

Blog Defender Security Product Suite For WordPressAnd lets you fix these quickly …

Blog Defender WordPress Security SuiteIf 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 very secure web platform, but neglecting essential maintenance tasks like keeping your WordPress installation, WP plugins and themes up-to-date, tightening file and data protection and taking other necessary precautions can expose your site to attacks 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, web security is something you cannot afford to ignore.

As one last reminder, below is the advice given by a website security expert to all WordPress users after the large-scale 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, website security is of the utmost importance if you run a WordPress site. Hopefully, the information in this article has given you the initial guidelines and direction you need to prevent brute-force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please consult a WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

Also, don’t forget to subscribe to WPCompendium.org to be notified whenever we publish new articles and tutorials on WordPress security and reviews of WordPress security plugins and solutions.

***

"This is AMAZING! I had learnt about how to use WordPress previously, but this covers absolutely everything and more!! Incredible value! Thank you!" - Monique, Warrior Forum

***

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