Wordpress hack: a way to stop the bots from registering

Posted on the April 1st, 2007 under PHP, [ En ] by Raz

This “hack” is now a fully customizable Wordpress plugin, more info here

Message to my spammers: Why can’t you just ignore my site you stupid f***! What did I ever do to you? Well I’m sure you will not read this message, at least your bots will so fu** them to! You may burn in hell with them!

  After I’ve secured my web site with anti-spam plugins I’ve been assaulted by registering bots who will register an account and then spam me! I think that is a smart bot who reads the mail for the password, that is clever indeed but don’t use it on my site! Bitch! Sorry for my language I’m kind of angry right now but happy at the same time because I’ve managed to “hack” wordpress a little and put a Captcha functionality when registering. Thanks Web 1 Marketing for the QuickCaptcha script. Let’s see if spammers bots are smart enough now!

How to modify your wordpress installation and include a Captcha check? *
The easy way : *
1. Backup your wp-login.php file from your wordpress installation folder
2. Replace your wp-login.php file with the one modified by me: wp-login.zip and upload the wp-captcha.php script file in your wordpress installation folder (download wp-captcha.php)

Step by step way:*
1. Make a backup of your wp-login.php file (located in your installation folder)
2. Open wp-login.php for editing it and replace the call to nocache_headers(); with session_start(); from the top of the file:

3. Search for “case ‘register’ :” and add the image check code:

1
2
3
4
5
6
7
// verify the image
     
         if ($_SESSION['string'] != $_POST['imgver_string'])
          $errors['user_email'] = __('<strong>ERROR</strong>: Invalid verification code.');
       

         //end verify image

4. Scroll down in the wp-login.php file until you see the register form code “registerform” and insert the Captcha check image and fields code:

Free Image Hosting at www.ImageShack.us

1
2
3
4
5
6
7
<!-- verify image -->
<?php  
    echo '<br><img src="wp-captcha.php?rand=' . rand(0,999999) . '" border="0" /></p>
        <p><label for="code"><p>Please enter the code shown above:</label>
        <input class="input" name="imgver_string" id="imgver_string" type="text" size="20" tabindex="10" value="" /></p>'
;
    ?> 
 <!-- end verify image -->

5. Save the wp-login.php file.
6. Download the wp-Captcha.php script and upload it in the same folder as the wp-login.php file
7. That is all. Try it, here is how my Captcha hack looks like : register

* above steps apply to my wordpress version 2.1.1, it may be different for other versions.

My modified wp-login.php [489 downloads]
Donate      Download     Report

29 Responses to 'Wordpress hack: a way to stop the bots from registering'

  1. April 1, 2007 at 8:28 pm
    javi
  2. April 2, 2007 at 7:36 pm
    Raz
  3. April 29, 2007 at 1:48 am
    Pirahna
  4. May 21, 2007 at 9:01 pm
    Richard Silverstein
  5. May 21, 2007 at 10:30 pm
    Raz
  6. June 2, 2007 at 11:41 pm
    Peter
  7. June 13, 2007 at 2:50 pm
    Raz
  8. July 4, 2007 at 9:09 pm
    Will
  9. July 5, 2007 at 8:48 am
    Raz
  10. July 8, 2007 at 7:03 pm
    Sean
  11. July 18, 2007 at 6:38 pm
    Peter
  12. July 19, 2007 at 12:19 am
    Kruma
  13. July 19, 2007 at 8:55 am
    Raz
  14. August 30, 2007 at 11:17 am
    Richard Silverstein
  15. August 30, 2007 at 11:30 am
    Raz
  16. August 30, 2007 at 9:15 pm
    Richard Silverstein
  17. August 31, 2007 at 8:54 am
    Raz
  18. September 4, 2007 at 3:42 pm
    Raz
  19. October 11, 2007 at 1:57 pm
    qwe
  20. October 11, 2007 at 2:01 pm
    qwe
  21. April 21, 2008 at 8:14 am
    Kalina
  22. May 5, 2008 at 7:17 pm
    Prince
  23. November 9, 2008 at 8:11 pm
    ershad
  24. March 30, 2009 at 2:06 pm
    martin
  25. April 11, 2009 at 10:10 pm
    alian
  26. June 9, 2009 at 1:25 pm
    ataşehir evden eve nakliyat
  27. June 11, 2009 at 11:40 pm
    Okey Oyna
  28. August 25, 2009 at 2:03 am
    Evden Eve Nakliyat
  29. May 19, 2010 at 5:17 pm
    Aşk Büyüleri

Leave a Reply

Skip, ignore me





XHTML::
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>