From: Jayesh S. <jay...@ce...> - 2005-04-12 16:23:54
|
Hello Even and others, it seems some SPAMbots are able to read the ASCII art CAPTCHA codes. I tried to post this information to the Tavi Wiki, but it seems to have a problem currently as no new articles can be saved. --- BEGIN Message --- It seems the Chinese spammers may have found a way to parse the ASCII art CAPTCHA codes, since this Wiki had four of its pages recently despammed. I have two additional measures that can be added to make it more difficult for SPAMbots to ply their trade: 1) Use preg_match_all to test how many links exist in a given page. Something like: <code> $text = " http://www.yahoo.com http://www.amazon.com?abc=123&cdf=a+f http://www.cnn.com http://www.cnn.com "; $matches = array(); $pattern = "(([a-z]{3,5})://)(([0-9a-z-]+\.)+[0-9a-z]{2,6})((/?[0-9a-z-]*)+?/?([0-9a-z-.]*)+?)"; $num_links = preg_match_all( "#$pattern#i", $text, $matches); if ($num_links > 10) { exit('Error: too many links.'); } else { echo "<p>Success. $num_links links were found.</p>"; } </code> 1a) Modify the regex above to count the number of links from the same domain. This way, some Wiki pages that have more than 10 links to distinct domains will be okay. 2) Ask the users to a word or phrase regarding what the Wiki is about. In the case of this Wiki, the users will be asked to look at the logo in the top right corner, and enter a four lettered word that describes the topic of this Wiki. When a Tavi Wiki is set up, the user will asked to be choose this word or phrase, and hint / question text for it. --- END Message --- Best regards, - Jay Sheth |