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

Captcha solving Tutorial?

Discussion in 'Visual Basic .NET' started by zacatictac, Dec 10, 2010.

  1. zacatictac

    zacatictac Power Member

    Joined:
    May 2, 2010
    Messages:
    598
    Likes Received:
    755
    Occupation:
    SEO
    Location:
    Metaverse
    Hey guy. Im a fairly newb programmer. I have a lot of great ideas for bots but i have one thing standing in my way....the dreaded Captcha. Ive been able to have a captcha solved by using death by captchas simple api. The problem is the image already is on my computer. I cant seem to figure out how to download and save captchas and THEN upload them to be solved. Is there a tutorial or anything to show me the basics of implementing captcha solving apis? Decaptcher would be awesome but their api is a nightmare. any help is appreciated. just need someone to point me in the right direction. Right now im looking into screen capping certain areas of the webroweser.
     
    Last edited: Dec 10, 2010
  2. cooooookies

    cooooookies Senior Member

    Joined:
    Oct 6, 2008
    Messages:
    1,008
    Likes Received:
    216
    Your question is maybe to generic. I would understand it like "I tried it, but it didn't work". Post some source code and explain in detail your problem.

    I am for instance using the decaptcher api w/o any problem. Actually, I am pretty sure that other captcha solvers also provide good documentation, right?
     
  3. MaDeuce

    MaDeuce Newbie

    Joined:
    Oct 24, 2008
    Messages:
    45
    Likes Received:
    16
    Location:
    Austin, TX
    It sounds like you have the potentially more troublesome part handled OK. The challenge captcha is just an image. For example, when creating a Yahoo account, the captcha URL is embedded in javascript and looks something like this:
    Code:
        cURL: "hXXps://ab{dot}login{dot}yahoo.com/img/nAx5q.JZFemZ23gnCphj6lPwJtOtoTqkvEBy.VFVpa7CxXsOPaNTsgTAyCkcBxy4n80nb.vUBcyPodFmjkoLYotfeiCnD53cBZnghGo-.jpg",
    You need to figure out how the URL is specified in your situation, then write code to get a copy of the image. Send the answer off to your captcha service and get the answer. Then send the answer text back to your target.

    In the case of my Yahoo example, the answer goes in a field that is then POSTed back to Yahoo. That's it.

    You may run into some other nuances that you'll have to deal with. For example, no human can fill in ten fields on a submit in 0.5sec. Some sites will have timers to check for this, and other obvious things, to try to screen out bots.

    More specifics (e.g., language, etc.) will probably get you a more specific answer.

    --Ma
     
  4. Gr33nHat

    Gr33nHat Jr. VIP Jr. VIP

    Joined:
    Dec 21, 2009
    Messages:
    430
    Likes Received:
    150
    Occupation:
    Death By Captcha Co-Founder
    Location:
    Behind a Proxy near you
    What scripting language are you using?
    Our programmers in Death by Captcha can give you a hand with what you need.

    Regards,
     
  5. audio

    audio Junior Member

    Joined:
    Sep 27, 2008
    Messages:
    157
    Likes Received:
    115
    Just use the HTTP API that Decaptcher has
     
  6. Senotaru

    Senotaru Registered Member

    Joined:
    Jan 17, 2011
    Messages:
    67
    Likes Received:
    11
    Hey man, how's it going.

    You can use their http api and upload things using httpwebrequest. All you need to do is format your strings and write them to the request stream as a byte array, and then do the same with your images.

    Sorry if that's a crappy description. This should get you started on the right path.

    Code:
    
            private HttpWebRequest buildMultiPost(HttpWebRequest Request, List<KeyValuePair<string, string>> postData,
                List<KeyValuePair<string, string>> images)
            {
                String boundary = "----------------------------" + DateTime.Now.Ticks.ToString("x");
                Stream stream = Request.GetRequestStream();
                Request.ContentType = "multipart/form-data; boundary=" + boundary;
    
                if (postData != null)
                {
                    byte[] postInformation = Encoding.UTF8.GetBytes(buildMultiPostString(postData, boundary).ToString());
                    stream.Write(postInformation, 0, postInformation.Length);
                }
                
                if (images != null) {
                    byte[] attachedImage = attachImage(images, boundary).ToArray();
                    stream.Write(attachedImage, 0, attachedImage.Length);
                }
                byte[] footerText = Encoding.UTF8.GetBytes("--" + boundary + "--");
                stream.Write(footerText, 0, footerText.Length);
    
                return Request;
            }
    
    This is in C#.net but it should be easy enough for you to switch over.
     
    • Thanks Thanks x 1