WordPress brute force attacks

Some one is misbehaving on the internet right now and¬†trying to brute force wordpress accounts. I would highly recommend putting in some IP restrictions for those of you who use wordpress and haven’t already done so.

It’s pretty simple to do:

  1. Open the .htaccess file for your wordpress site (usually located in the sites root directory)
  2. At the bottom of your file put in the following:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/wp-login.php(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^/wp-admin$
    RewriteCond %{REMOTE_ADDR} !^123.123.123.123$
    RewriteRule ^(.*)$ - [R=403,L]
    </IfModule>
    
  3. For the line: RewriteCond %{REMOTE_ADDR} !^123.123.123.123$ replace the 123 numbers with your IP address if it is static or the network portion of your address if it is dynamic. As an example for a dynamic address: RewriteCond %{REMOTE_ADDR} !^10.20.$

  4. Save the file and exit.

Now if anyone from outside the specified IP range tries to access the admin login page they’ll be redirected to a big ‘ol 403 - Access denied.

comments powered by Disqus