Having trouble using Google's ReCaptcha?
That's O.K! I had trouble too. That's why I created CFCAPTCHA.
With CFCAPTCHA, spam prevention is as easy as 1, 2, 3!
Step 1: Image embed!
Change mysite.com to your domain.
<img src="http://www.cfagency.org/captcha/img.php?domain=mysite.com" />
Step 2: Have user input code.
<input type="text" name="captchaCode" />
Step 3: Validate user input!
Check the md5 signature of the user's input against the ckey cookie.
if (md5($_POST["captchaCode"]) == $_COOKIE["ckey"]) {
// go on
}
else {
die("Incorrect code!");
}Also, to use custom text, embed this image: http://www.cfagency.org/captcha/text.php?text=your%20text%20here
Last edited by GeonoTRON2000 (2012-05-10 10:27:27)
Offline
Nice. I checked out of few of the codes it makes and most of them are easier than ReCaptcha, etc, but every once in a while I got one like this:
If I look really close, I can see an F there, but it's nearly invisible.
Offline
The letters could be easily spotted by an OCR...
Offline
LS97 wrote:
The letters could be easily spotted by an OCR...
This. They're not different or obscured enough.
Offline
veggieman001 wrote:
LS97 wrote:
The letters could be easily spotted by an OCR...
This. They're not different or obscured enough.
Easily fixed.
I added some elipses and set the line thickness to 5.
Also, I made a black and white version.
Offline
Found another problem, actually two and I'm afraid this one is pretty serious.
1. First, you can just press Back and try the same CAPTCHA again. Convenient for me, but it also gives a spammer unlimited tries. This shouldn't be too hard to prevent but...
2. Since the ckey cookie is on my computer, so I can change it to anything I want! For example if I change it to "445a0aadad9b9505d6277348cd05da2c" and answer "SCRATCH", that will be accepted as correct.
Offline
ManaUser wrote:
Found another problem, actually two and I'm afraid this one is pretty serious.
1. First, you can just press Back and try the same CAPTCHA again. Convenient for me, but it also gives a spammer unlimited tries. This shouldn't be too hard to prevent but...
2. Since the ckey cookie is on my computer, so I can change it to anything I want! For example if I change it to "445a0aadad9b9505d6277348cd05da2c" and answer "SCRATCH", that will be accepted as correct.
1. Easy to fix, just add an onload to the body element which reloads the image.
<script type="text/javascript">
function imgReload(img) {
var thSrc = img.src;
var qpos = thSrc.indexOf("?");
if (qpos != -1) {
if (thSrc.indexOf("&t=") != -1)
thSrc = thSrc.substr(0, thSrc.indexOf("&t="));
if (thSrc.indexOf("?t=") != -1)
thSrc = thSrc.substr(0, qpos);
thSrc += "&t="+Math.ceil(Math.random()*10000);
}
else {
thSrc += "?t="+Math.ceil(Math.random()*10000);
}
img.src = thSrc;
}
</script>
</head>
<body onload="imgReload(document.getElementById('captchaIMG'));">2. Can't help you there, unless you have some idea of how to fix this.
Offline
Make it not be on the user's computer.
Offline
veggieman001 wrote:
Make it not be on the user's computer.
Perhaps a text file?
Offline
I don't know but don't store it in a cookie where it easily can be changed.
Offline
For the second issue, there's an easy fix.
You can append a secret password to the two strings to be checked. Since md5 is not reversible, nobody will be able to crack it.
Let me make an example, in the case of the word SCRATCH:
- set the cookie to md5('SCRATCH' . 'secretpassword')
- when the user submits the form, check if
cookie == md5(captchaCode . 'secrectpassword')
Trust me, it works, and if you make the pass long enough, it's uncrackable.
Offline
LS97 wrote:
For the second issue, there's an easy fix.
You can append a secret password to the two strings to be checked. Since md5 is not reversible, nobody will be able to crack it.
I thought of that, but there's one catch. The website and cfagency need to share the password somehow. This could be done ahead of time, but it still complicates things somewhat.
Offline
ManaUser wrote:
LS97 wrote:
For the second issue, there's an easy fix.
You can append a secret password to the two strings to be checked. Since md5 is not reversible, nobody will be able to crack it.I thought of that, but there's one catch. The website and cfagency need to share the password somehow. This could be done ahead of time, but it still complicates things somewhat.
Oh, for some reason I thought the PHP code for the image was also on the site itself.
Then this means you either have to provide a PHP-compatible API to verify results (remember then to have different appended passwords for each site or the whole thing could be easily cracked), or just don't use the host site at all, meaning the forms submit directly to cfagency and then cfargency redirects you back
Offline
GeonoTRON2000 wrote:
Also, to use custom text, embed this image: http://www.cfagency.org/captcha/text.php?text=your%20text%20here
http://www.cfagency.org/captcha/text.ph … mage?%20:P
Last edited by scimonster (2012-05-10 13:29:22)
Offline
scimonster wrote:
GeonoTRON2000 wrote:
Also, to use custom text, embed this image: http://www.cfagency.org/captcha/text.php?text=your%20text%20here
Offline
This is a bit problematic, as a lot of bots are able to read CAPTCHAs. It also annoys legitimate users.
You should try my technique, which does not annoy users and is a bit better at preventing bots.
Offline