1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Interacting with reCAPTCHA using httpwebrequest/webresponse

Discussion in 'Visual Basic .NET' started by Homer Simpson72, Dec 12, 2015.

  1. Homer Simpson72

    Homer Simpson72 Newbie

    Joined:
    Dec 6, 2015
    Messages:
    23
    Likes Received:
    0
    I have tried creating this thread before but I was unable to post it due to the content restrictions guidelines. I am trying to process by hand a reCaptcha form which is processed using the httpwebrequest/httpwebresponse classes and I get an "ERROR: Invalid domain for site key" when I try to post the CAPTCHA without a response. When I tried posting this thread with code the content restrictions did not allow me to submit the thread. Any help would be appreciated.
     
  2. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,925
    Likes Received:
    1,942
    Home Page:
    The "ERROR: Invalid domain for site key" error means that your site key ?k=xxxxx is malformed. Have you made sure to include an & before the next variable? Post your code onto pastebin & put the pastebin.com?link up if you have some sample code.

    Or cross reference with this code, note that I am using other http classes & functions, just check the URL calls:
    [​IMG]
     
    • Thanks Thanks x 1
  3. Homer Simpson72

    Homer Simpson72 Newbie

    Joined:
    Dec 6, 2015
    Messages:
    23
    Likes Received:
    0
    Thanks for your reply. I can't show my code because I am a newbie and BHW will not allow me to post links or my code. You did point me in the right direction with your code, however
     
  4. Homer Simpson72

    Homer Simpson72 Newbie

    Joined:
    Dec 6, 2015
    Messages:
    23
    Likes Received:
    0
    Do you happen to know how to work with the reCaptcha boxes that require the "I am not a robot" checkbox? As it is right now with your code, the first exception is thrown. Here is my code. I found a way to insert it vbcode.png
     
    Last edited: Dec 17, 2015
  5. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,925
    Likes Received:
    1,942
    Home Page:
    Recaptcha V2 uses different site keys setup for V2 & also has different URL calls. This is something you will have to track the headers of yourself to fully understand & put it to use, V2 is a right pain in the ass!
     
  6. Homer Simpson72

    Homer Simpson72 Newbie

    Joined:
    Dec 6, 2015
    Messages:
    23
    Likes Received:
    0
    Would this involve sniffing for packets with Fiddler and figuring out what information to send from that?
     
  7. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,925
    Likes Received:
    1,942
    Home Page:
    Yes, use an old browser, E.g. iPhone 3 or similar (Using a user agent switcher plugin) & you will be shown the 1-9 images of 'street signs' or similar instead of the checkbox. If you want to click the checkbox instead then I wish you luck, that is not an easy task at all!
     
    • Thanks Thanks x 1
  8. Homer Simpson72

    Homer Simpson72 Newbie

    Joined:
    Dec 6, 2015
    Messages:
    23
    Likes Received:
    0
    Thank you so much for your help and kind words. Having this class in my toolbox would make me a very valuable bot coder indeed!
     
  9. Homer Simpson72

    Homer Simpson72 Newbie

    Joined:
    Dec 6, 2015
    Messages:
    23
    Likes Received:
    0
    I have managed to debug this program to where I download the reCAPTCHA image. Attached is a screencap of the error I get, which is a 400 Bad request from google's Recaptcha V2 servers.

    EDIT: My newbie status makes it difficult to post code.
     
    Last edited: Dec 19, 2015