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 most popular CMS platform in the world and the online publishing platform of choice for millions of websites and loved by thousands of web developers and web designers, it’s inevitable that at some point in time, WordPress will come under attack from hackers wanting to score a “big win”.

In early 2013 a mass brute-force attack hit WordPress installations on virtually every WP host server in existence around the world.

These attacks were caused by computers infected with malware and programmed to attack other vulnerable sites (called “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. To achieve this, hackers use software programs that automatically tries to guess hundreds of login permutations in minutes.

If you’re using predictable user names and predictable passwords, your website 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/botnet)

”Botnets” are networks of private computers that have been compromised and infected with malicious code or software, which are then controlled remotely as a group, typically without the computer owners even being aware that this is taking place.

Botnets are regularly used to send 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 compromising 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.

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

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

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

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

(WordPress often comes under attack by hackers)

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

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

To learn why WordPress is a secure platform for websites, see this article: Why WordPress Is A Secure Platform For Websites –

Important Info

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

Mike Little, one of the co-founders 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)

Preventing Your WordPress Blog From Brute Force Attacks – Ten Security Measures

Every website or blog with a vulnerability provides some type of opportunity to hackers. A compromised website not only offers hackers opportunities to improve their skills and win “respect” from their peers, but it can also be a valuable platform for denial of service attacks, distributing malware and participating in information theft.

If a malicious user can hack and gain access and control of your site, the blog can then be used as part of a larger network of “bots” to target more highly-valued web sites.

Additional undesirable effects of having your site hacked and your site security compromised include getting blacklisted by Google, having stealthy spam links advertising things like gambling, discounted fashion, etc. inserted into your content, malicious redirects to phishing sites or other websites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasty things.

The harsh reality is that brute-force software bots are probably searching for security weaknesses and trying to hack into your website or blog at this very moment. Whether they will achieve this or not, will depend on how difficult you will make things for them to continue trying until they find how to break in, or decide to look for a less secure target.

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

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

Hackertarget - Website Security Scan(Hackertarget – Website Security Scan Product image: https://hackertarget.com/wordpress-security-scan)

You will see that the test will return a number of results and information about your website …

WP Security Check

(WordPress security scan results. Source: Hackertarget.com)

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

WP Security Scan(Source: BlogDefender website)

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

If your site or blog is driven by WordPress and you are not proactive steps to toughen up your site, we can practically guarantee that, at some point in time, someone will attempt to hack your installation, because these attacks are systematically hitting WordPress installations all the world!

Typically, whenever a site is broken into, webmasters can find themselves “locked out” of their own site, or notice that their content has been modified or that everything has been entirely wiped out. Typically, sites will become infected with malicious software or viruses without the owner even being aware that a security breach has happened.

To help avoid the heartache that comes with discovering that your website has been hacked into, below are 10 essential and effective security measures that will help to prevent your WordPress site from brute-force botnet attacks.

Disclaimer

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

***

Security Measure #1 – Contact Your Web Host

Contact your hosting provider and ask them what precautions they offer to help prevent your site from being attacked, and what is done to ensure that your WordPress sites get backed up.

Make sure that your host regularly backs up your server files 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 Site Regularly Updated

You should never rely just on your web host for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this service done for you and develop a habit of religiously performing a full WordPress 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 data and files are free of errors, optimized and backed up,
  • All WordPress themes, plugins and software components are up-to-date,
  • etc …

A full WP maintenance routine looks like this …

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

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

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 fully automate your site backups here: Backup, Clone And Keep Your WP Website Protected With Backup Creator WordPress Plugin

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

the worldwide brute force botnet attack on WordPress sites was mostly attempting to compromise website administrator panels by exploiting WordPress sites with “admin” as their account name.

For reasons of website security, 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 step-by-step tutorial for WordPress users that shows you how to change your admin username, go here: Changing Your Admin User Name In WordPress

Security Measure #4 – Choose Strong Passwords

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

Unless some measure is put into place to block the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just persist in attacking your site until it eventually breaks into your admin area.

Weak passwords, therefore, become really easy targets for botnets. Make sure that you change your password to a string that contains at least 8 characters long, and that includes upper and lowercase letters, combined with a few “special” characters (%^#$@&*).

Tip

You can use a password management software tool like Roboform to generate passwords …

Roboform is a password tool you can use to generate different secure passwords(Roboform is a password management program you can use to help you generate different secure passwords)

For a tutorial created especially for non-technical WordPress admin users that shows you how to change your WordPress admin password, go here: How To Change Passwords

Security Measure #5 – Secure Your wp-config.php File

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

WordPress WP Config file

(wp-config.php)

If a hacker breaks into your site, they will look for 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 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 – Rename Or Delete Unnecessary Website 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 Blog, Themes And Plugins To Their Latest Version

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress installations come with a built-in editor that lets administrators edit plugin and theme code inside the dashboard.

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

WP Theme Editor Menu

(The WordPress theme editor can be accessed using the WP dashboard menu)

This means that anyone logging into your site can view and edit all of your files, or cause mayhem on your site.

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

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

The WordPress “uploads” directory stores all the media that gets uploaded to your website.

Normally, this folder is visible to anyone online. All someone has to do to view all of the contents in your “uploads” directory is navigate to your directory using their browser …

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

(WordPress uploads directory)

If any directories in your website have vulnerabilities that can be exploited by malicious users, this could threaten the security of your website.

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

Security Measure #10 – WordPress Security Plugins

There are several WordPress security plugins available that specifically address common security issues faced by WordPress website owners, such as preventing hackers from gaining access to vital information about 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 WordPress plugin that seems to do a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your website files and causing damage to your site is SecureScanPro.

SecureScanPro - complete security software solution for WordPress

(SecureScanPro – complete security plugin for WordPress)

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

Another plugin you may want to consider using is BlogDefender.

Blog Defender

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

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

BlogDefender scans you website for potential security holes …

Blog Defender Security SuiteAnd lets you quickly and easily fix these …

Blog Defender Security PluginIf you don’t want to invest in 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 platform, but neglecting basic maintenance tasks like keeping your WP core files, plugins and themes up-to-date, tightening file and data protection and taking other necessary precautions can expose your site to malicious by hackers and bots.

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

As one last reminder, below is the advice given by an expert on web security to all WordPress users following the large-scale 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, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, the above article has provided you with the initial guidelines and help 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 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 information on WordPress security and tutorials about new 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

***

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