Posted By

tlp on 07/29/07


Tagged

snipplr bot automation crack


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

basicmagic


Automate the Snipplr spambot protection


 / Published in: PHP
 

Honestly, this is supposed to be a programming site. What person who would be creating a bot for this site wouldn't be able to crack the spambot protection?

Here's my very ugly method of doing so.

  1. <?
  2.  
  3. $q = "What does seven * eight equal?";
  4.  
  5.  
  6. $word_numbers = array("one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen");
  7. $numbers = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
  8.  
  9. $q = str_ireplace($word_numbers, $numbers, $q);
  10.  
  11. $word_signs = array("plus", "minus", "times", "x", "divided");
  12. $signs = array("+", "-", "*", "*", "/");
  13.  
  14. $q = str_ireplace($word_signs, $signs, $q);
  15.  
  16. preg_match("!(\d{1,3}) ([^~]*?) (\d{1,3})!", $q, $out);
  17.  
  18. $first_number = $out[1];
  19. $second_number = $out[3];
  20.  
  21. switch($out[2]) {
  22. case '+' :
  23. $answer = $first_number+$second_number;
  24. break;
  25.  
  26. case '-' :
  27. $answer = $first_number-$second_number;
  28. break;
  29.  
  30. case '*' :
  31. $answer = $first_number*$second_number;
  32. break;
  33.  
  34. case '/' :
  35. $answer = $first_number/$second_number;
  36. break;
  37.  
  38. default :
  39. $answer = "Failed";
  40. break;
  41. }
  42.  
  43. echo $answer;
  44.  
  45. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: tylerhall on July 29, 2007

Clever :)

But what do you do if I turn the text into an image?

Posted By: tlp on July 31, 2007

Then you have a spambot protection system that's not so easily defeated, and I suppose I'll have to do all my hardcore spamming the hard way. :P

But I wouldn't take the route of a genuine captcha unless it's really needed. They just annoy real humans, and spammers can do their dirty work manually.

Anyway, love the site. Keep up the good work. :)

You need to login to post a comment.