views:

524

answers:

2

Hello,

I'm looking to build a small script that can load reCaptcha images from another website. Seeing as the reCaptcha widget works using Javascript, is there anyway for one to capture the image generated using CURL?

+1  A: 

First you have to detail what exactly you want to do a bit more. What is this other website you're getting the reCaptcha from?

Technically, reCaptcha tokens are only valid on the domain that they're registered for. The reasons why are detailed here

Signing up for a reCAPTCHA Key

In order to use reCAPTCHA, you need a public/private API key pair. This key pair helps to prevent an attack where somebody hosts a reCAPTCHA on their website, collects answers from their visitors and submits the answers to your site. You can sign up for a key on the reCAPTCHA Administration Portal.

Key Scope Your reCAPTCHA token is valid only at the domain you sign up for and any subdomains (due to the potential attack mentioned above). Some users require keys for multiple sites, for example, a development server and a production server or simply multiple sites hosted on the same server. Three techniques can be used to work around this:

If one of your servers is "localhost" or "127.0.0.1", reCAPTCHA will not enforce the same-domain rule. Just use the same key as for the production server. Generate a key for a broader scope. For example, if your application is a.example.com and your test server is test.corp.example.com, generate a key for example.com. Generate a different key for each domain.

source : http://recaptcha.net/apidocs/captcha/

This sounds like what you're trying to do, is it your server?

Ian Elliott
A: 

I have writen a script in PHP with cURL that can get the recaptcha image, and the challenge field by parsing the javascripts. Sadly on every submit i just get "incorrect-captcha-sol".

If you would like you can email me, maybe we could solve the last bit together?

sik0ste AT gmail DOT com