Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Captchas becomming obsolete
Closed Thread
Old 08-17-2008, 01:48 PM   #1 (permalink)
 
Newb Techie

Join Date: Jul 2008

Posts: 30

Rex100 is on a distinguished road

Default Captchas becomming obsolete

I was reading about this antispam plug in
Math Comment Spam Protection Plugin — Software Guide

but I think it's overkill - encryption? why? spam bots can't think, let alone read and comprehend ans answer what it can't read and comprehend.

Can you give me the code to compare an input value to 8 (or any constant), and if the input is 8 continue, and if it doesn't = 8 go to Website Hosting - Mysite.com (reload the page)

I'll try to start it:

<form method="get" action="???">
<label for="s">5+3= (Required - protects site from spam bots)</label>
<input type="text" value="" name="s" id="answer" />
<input name="sa" value="enter answer" type="submit" />
<div class="clearfix"></div>
</form>

If "answer" does not = 8, go to mysite.com or something to throw the bots off course or have it erase the inutted answer and ready for another answer/try.

If "answer"=8 then go to next line.

I know my programming is bad, but I don't believe it's that hard to outsmart spam bots.

Thanks,

Rex
Rex100 is offline  
Old 08-17-2008, 02:21 PM   #2 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,688

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Captchas becomming obsolete

Actually, bots can read and think. They can read captchas with image-to-text software. That's why captchas are always hard as **** to read, it makes the software less effective.

As for your solution, I'm not sure if that would work. I haven't done much work with anti-spam stuff. Sounds logical, but I'm just not sure the capabilities of some of the more advanced bots.

But, here's your script in PHP:

bot.php
PHP Code:
<?php

if (isset ($_POST['submit'])) {
    
$answer $_POST['answer'];

    if (!empty (
$answer)) {
        if (
$answer == 8) {
            
// answer IS 8
            
header ('location: http://yoursite.com');
        } else {
            
// answer is NOT 8
            
header ('location: http://google.com');
        }
    } else {
        
// no answer was given
        
echo 'You must enter the Answer!';
    }
} else {
    echo 
'<form method="POST" action="bot.php">
    <label for="answer">5+3= (Required - protects site from spam bots)</label>
    <input type="text" value="" name="answer" id="answer" />
    <input name="submit" value="enter answer" type="submit" />
    <div class="clearfix"></div>
    </form>'
;
}

?>

__________________

Need website help? PM me!
CrazeD is offline  
Old 08-18-2008, 07:01 AM   #3 (permalink)
 
Newb Techie

Join Date: Jul 2008

Posts: 30

Rex100 is on a distinguished road

Default Re: Captchas becomming obsolete

CrazeD,
Thanks for the code. I'll let you know how the strategy works out. I think the bots can be confused further by having it deal with a more complicated question like - "Answer one of the following: 5+3 or sqare root of 64 or 2 x 2 x2 or or four short of a dozen"
You could run into problems if you or your visitor forgets to do multiplication and division first and use something like 14 - 2 x 3, of course you could always remind the visitor: "Answer one of the following (do multiplication and division first).
You may be able to ask a non math question that uses a number and has a non numerical answer like "What is the 5th month of the year.", only if the "=" in your PHP compares strings and not numbers. Are those "=" in your code comparing strings or numbers? I think strings because of the $ in front of the variable "answer".

Thanks for the help,

Roscoe
Rex100 is offline  
Old 08-18-2008, 05:39 PM   #4 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,688

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Captchas becomming obsolete

Hmm, be careful though. If you make this too complicated where users have to actually do work to register, they will lose interest and move on. Something as simple as: "What color is this image?" then make 4 or 5 different boxes that are randomly shown.

The $answer variable in that code takes the variable from the form, which is the $_POST['answer'].

This code takes it one step further and makes sure its a number:

bot.php
PHP Code:
<?php

if (isset ($_POST['submit'])) {
    
$answer $_POST['answer'];

    if (!empty (
$answer)) {
        if (
is_numeric ($answer)) {
            if (
$answer == 8) {
                
// answer IS 8
                
header ('location: http://yoursite.com');
            } else {
                
// answer is NOT 8
                
header ('location: http://google.com');
            }
        } else {
            
// answer is not a number
            
echo 'Your Answer is not a number';
        }
    } else {
        
// no answer was given
        
echo 'You must enter the Answer!';
    }
} else {
    echo 
'<form method="POST" action="bot.php">
    <label for="answer">5+3= (Required - protects site from spam bots)</label>
    <input type="text" value="" name="answer" id="answer" />
    <input name="submit" value="enter answer" type="submit" />
    <div class="clearfix"></div>
    </form>'
;
}

?>

__________________

Need website help? PM me!
CrazeD is offline  
Old 08-31-2008, 09:17 PM   #5 (permalink)
 
Newb Techie

Join Date: Jul 2008

Posts: 30

Rex100 is on a distinguished road

Default Re: Captchas becomming obsolete

CrazeD,

I still like this code you wrote best (bot.php)
<?php

if (isset ($_POST['submit'])) {
$answer = $_POST['answer'];

if (!empty ($answer)) {
if ($answer == 8) {
// answer IS 8
header ('location: http://yoursite.com');
} else {
// answer is NOT 8 ........................



In this code is "8" and integer or a string? Someone advised me to use a word for an answer - so can I change all the 8s to "water" in this code? If not what would I need to change - this way (string) I can have the answer be a string or a number in the form of a string.

Thanks CrazeD,

Rex
Rex100 is offline  
Old 08-31-2008, 09:22 PM   #6 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,688

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Captchas becomming obsolete

It is a string. PHP doesn't have to specify what data type the string is.

Just change the 8 to your word, but make sure you have single or double quotes, like...$answer == 'water'.

Numbers don't require quotes, any other character does.
__________________

Need website help? PM me!
CrazeD is offline  
Old 09-02-2008, 08:25 AM   #7 (permalink)
 
Newb Techie

Join Date: Jul 2008

Posts: 30

Rex100 is on a distinguished road

Default Re: Captchas becomming obsolete

CrazeD,
One last thing before I work this into my site. If I don't code for if/when spam bots skip the field for the answer to the question, will the spam bots be able to skip to the next field and successfully place their spam? (I'm assuming here that the question and question filed are first, before name, email, url, comments. I don't see any advantage to placing the question anywhere else.)

Thanks,

Rex
Rex100 is offline  
Old 09-02-2008, 08:54 AM   #8 (permalink)
Trotter's Avatar
 

Join Date: Jan 2005

Location: The South

Posts: 19,938

Trotter is a name known to allTrotter is a name known to allTrotter is a name known to allTrotter is a name known to allTrotter is a name known to allTrotter is a name known to all

Default Re: Captchas becomming obsolete

Bots don't have to read to beat CAPTCHA. there are several places online that sell CAPTCHA solutions. They pay people in India little of nothing to sit and decode tham all day, every day.

Inside India’s CAPTCHA solving economy | Zero Day | ZDNet.com
__________________
R.I.P. Danny L. Trotter , 14 Nov 1945 - 4 Sept 2009




DFI LanParty-UT SLI-D - Windows 7 64-bit - AMD Athlon X2 4200+ w/CNPS9500
4GB RAM(4x1GB) - Razer Lachesis - EVGA GTX 260 Core 216 896MB


>>>> I am looking for donated DDR2 (link) <<<<

< < < < < If I've been helpful, rep me. . . .
Trotter is offline  
Old 09-02-2008, 10:04 AM   #9 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,688

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Captchas becomming obsolete

Quote:
Originally Posted by Rex100 View Post
CrazeD,
One last thing before I work this into my site. If I don't code for if/when spam bots skip the field for the answer to the question, will the spam bots be able to skip to the next field and successfully place their spam? (I'm assuming here that the question and question filed are first, before name, email, url, comments. I don't see any advantage to placing the question anywhere else.)

Thanks,

Rex
Sorry, I don't understand your question. Do you mean if they leave the captcha answer empty, will they be able to process the form still? You can easily code for that, just do

PHP Code:
if (empty ($answer)) {
// answer is empty, dont process
} else {
// answer is filled out, process

Quote:
Originally Posted by Trotter View Post
Bots don't have to read to beat CAPTCHA. there are several places online that sell CAPTCHA solutions. They pay people in India little of nothing to sit and decode tham all day, every day.

Inside India’s CAPTCHA solving economy | Zero Day | ZDNet.com
How can that possibly work...captchas are usually randomly generated strings, how can you "solve" this?
__________________

Need website help? PM me!
CrazeD is offline  
Old 09-02-2008, 01:56 PM   #10 (permalink)
 
Newb Techie

Join Date: Jul 2008

Posts: 30

Rex100 is on a distinguished road

Default Re: Captchas becomming obsolete

CrazeD,
Thanks !! I really think this is going to work. I think Ill rename the file they target also. I'll be sure let let you know what I find. I'll keep track of the number of spam bots my site gets for the next few days, by then I'll install this code and see if the spam traffic has been reduced.

Rex
Rex100 is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is AMD Now Obsolete????? mcovalt Building, Buying, or Upgrading High Performance PC Systems 74 01-13-2008 05:17 PM