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

Dynamic Captcha and Webrequest

Discussion in 'Visual Basic .NET' started by Etanor, Jun 16, 2015.

  1. Etanor

    Etanor Junior Member

    Joined:
    Mar 12, 2013
    Messages:
    183
    Likes Received:
    25
    Location:
    France
    Hello guys, I am facing a problem :

    I want to register on a website but the problem is that the captcha is dynamic.

    Here is what I did : I send my first webrequest on the register page (www(dot)jeuxvideo(dot)com/sso/register(dot)php) like this :

    Code:
    Dim tempCookies As New CookieContainer '
    
            Dim Http As HttpWebRequest = DirectCast(HttpWebRequest.Create("http://www(dot)jeuxvideo(dot)com/sso/register(dot)php"), HttpWebRequest) 
                Http.AutomaticDecompression = DecompressionMethods.Deflate
                Http.AutomaticDecompression = DecompressionMethods.GZip
                With Http
                .Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
                .UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0" 
                .Headers.Add("Accept-Language", "fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3") 'l'en tĂȘte "Accept-Language" 
                .Headers.Add("Accept-Encoding", "gzip, deflate")
                    .CookieContainer = tempCookies 
                    .KeepAlive = True 
                    .Method = "GET" 
                '  .Proxy = prxy

    In the response, I can get the captcha adress here :

    Code:
    <div class="form-group captcha-boot-jv">
                            <label for="code_captcha" class="col-sm-4 control-label">Recopier le code :</label>
                            <div class="col-md-2">
                                <img src="/captcha/ccode.php?bnTSWYiIvOAGLYiAAXKNhAaIaDSC5NiHMvMCKyXon_Zy5B6-OKWTUbxmdVvamdn9FPXKWWeTPUi0oGTXRhPwkg:nVXI9sRSwTtrnLQmIsxkww:3Ma8v8UV0sTdV2WOfTfFdA" alt="Captcha" />
    
    
    But when I send another request to http://www(dot)jeuxvideo(dot)com/ca...nVXI9sRSwTtrnLQmIsxkww:3Ma8v8UV0sTdV2WOfTfFdA, the captcha is not the same.

    Is there a way to grab the captcha directly via the response of the first request or I'll have to use the webbrowser?
     
  2. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,925
    Likes Received:
    1,942
    Home Page:
    Make sure that you are using the same cookie container on the post request, also that you are scraping the correct captcha code from the register page on the first request & then calling the image with the same cookies also, then download the image to your hard drive & process within the software / a captcha breaker & then when posting the registration data you will also need to set the fs_signature to the same code & scrape the dynamic fs_ variables beforehand to include with the request.
     
    • Thanks Thanks x 1
  3. Etanor

    Etanor Junior Member

    Joined:
    Mar 12, 2013
    Messages:
    183
    Likes Received:
    25
    Location:
    France

    Thanks, it was a cookie problem :eek:
     
  4. rusul

    rusul Newbie

    Joined:
    Jun 3, 2009
    Messages:
    3
    Likes Received:
    0
    how get image from solvemedia using webrequest

    Thanks