Results 1 to 15 of 15
  1. #1
    silentrunner2's Avatar
    Join Date
    Jun 2008
    Gender
    male
    Posts
    629
    Reputation
    110
    Thanks
    2,870
    My Mood
    Busy

    Grabbing Captcha

    Hey guys doing another one of my account creators, have everything finished except the captcha hopefully one of you can save my a*s lol you will get creds of course.

    So heres the captcha source
    Code:
    <img src="/captcha/?n=register&amp;t=4dda987287daf" id="keycode" alt="keycode" width="208"></td>
    			<td class="reg_form_msg"></td>
    And heres my code.
    Code:
    PictureBox1.ImageLocation = WebBrowser1.Document.GetElementById("keycode").GetAttribute("src")
    Basically it shows show a little X in the picturebox like it cant load the image, im trying to do this for the gamerfirst website btw incase you need to check the whole page source. doing it this way has always worked for me so im alittle confused.
    Last edited by silentrunner2; 05-23-2011 at 12:44 PM.
    My Projects


    Don't Ask For Thanks Earn It
    You: "Please Give Thanks"
    Me: "...................No"

  2. #2
    hustelboy's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Underground Cave System Posts: 4,435,765
    Posts
    312
    Reputation
    28
    Thanks
    39
    @silentrunner2

    because the captcha is protected

  3. #3
    silentrunner2's Avatar
    Join Date
    Jun 2008
    Gender
    male
    Posts
    629
    Reputation
    110
    Thanks
    2,870
    My Mood
    Busy
    Quote Originally Posted by hustelboy View Post
    @silentrunner2

    because the captcha is protected
    is there no way around it?
    My Projects


    Don't Ask For Thanks Earn It
    You: "Please Give Thanks"
    Me: "...................No"

  4. #4
    hustelboy's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Underground Cave System Posts: 4,435,765
    Posts
    312
    Reputation
    28
    Thanks
    39
    idk so,
    bacause if u change the url and the Id
    url nexon.net register
    Then it works
    I gonna look, maby just a wrong ID u have

  5. #5
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,117
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Wait, I can access the image from my web browser, so yea, just try to get the image using IO.Stream ...
    Code:
            Dim req As Net.HttpWebRequest = Net.HttpWebRequest.Create("https://www.gamersfirs*****m/captcha/?n=register&amp;t=4dda987287daf")
            Dim res As Net.HttpWebResponse = req.GetResponse()
            Dim Sr As IO.Stream = res.GetResponseStream()
            Dim i As Image = Image.FromStream(Sr)
            PictureBox1.Image = i

  6. #6
    hustelboy's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Underground Cave System Posts: 4,435,765
    Posts
    312
    Reputation
    28
    Thanks
    39
    Quote Originally Posted by Horatio Caine View Post
    Wait, I can access the image from my web browser, so yea, just try to get the image using IO.Stream ...
    Code:
            Dim req As Net.HttpWebRequest = Net.HttpWebRequest.Create("https://www.gamersfirs*****m/captcha/?n=register&amp;t=4dda987287daf")
            Dim res As Net.HttpWebResponse = req.GetResponse()
            Dim Sr As IO.Stream = res.GetResponseStream()
            Dim i As Image = Image.FromStream(Sr)
            PictureBox1.Image = i
    U will always get the same captcha then

  7. #7
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,117
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Quote Originally Posted by hustelboy View Post
    U will always get the same captcha then
    It will work?
    Captcha is just for verifying that you aren't a bot, if the image is the same doesn't matter.

  8. #8
    hustelboy's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Underground Cave System Posts: 4,435,765
    Posts
    312
    Reputation
    28
    Thanks
    39
    yes is does..
    Everytime u generator a new account.
    The page should be reloaded of webbbrowser
    then a new captcha will come and the new 1 and the 1 that is always the same wont match
    So then the captcha will be wrong

  9. #9
    silentrunner2's Avatar
    Join Date
    Jun 2008
    Gender
    male
    Posts
    629
    Reputation
    110
    Thanks
    2,870
    My Mood
    Busy
    Quote Originally Posted by Horatio Caine View Post
    Wait, I can access the image from my web browser, so yea, just try to get the image using IO.Stream ...
    Code:
            Dim req As Net.HttpWebRequest = Net.HttpWebRequest.Create("https://www.gamersfirs*****m/captcha/?n=register&amp;t=4dda987287daf")
            Dim res As Net.HttpWebResponse = req.GetResponse()
            Dim Sr As IO.Stream = res.GetResponseStream()
            Dim i As Image = Image.FromStream(Sr)
            PictureBox1.Image = i
    does not work, just says the server returned an error (500) :/ thanks for helping so far buddy.
    My Projects


    Don't Ask For Thanks Earn It
    You: "Please Give Thanks"
    Me: "...................No"

  10. #10
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    Cause of this : /captcha/?n=register&amp;t=4dda987287daf


    The picture box image must be = website + /captcha/?n=register&amp;t=4dda987287daf

    Its something like:

    Code:
    PictureBox1.ImageLocation = "Websitehere" & WebBrowser1.Document.GetElementById("keycode").GetAttribute("src")
    Last edited by Lyoto Machida; 05-23-2011 at 06:13 PM.

  11. #11
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by Horatio Caine View Post


    It will work?
    Captcha is just for verifying that you aren't a bot, if the image is the same doesn't matter.
    Of course it won't work |:


    Quote Originally Posted by silentrunner2 View Post
    Hey guys doing another one of my account creators, have everything finished except the captcha hopefully one of you can save my a*s lol you will get creds of course.

    So heres the captcha source
    Code:
    <img src="/captcha/?n=register&amp;t=4dda987287daf" id="keycode" alt="keycode" width="208"></td>
    			<td class="reg_form_msg"></td>
    And heres my code.
    Code:
    PictureBox1.ImageLocation = WebBrowser1.Document.GetElementById("keycode").GetAttribute("src")
    Basically it shows show a little X in the picturebox like it cant load the image, im trying to do this for the gamerfirst website btw incase you need to check the whole page source. doing it this way has always worked for me so im alittle confused.
    You've got a relative URL there. an imagebox will try to load the captcha at "/captcha/?n=register&amp;t=4dda987287daf"... Which is nowhere, an invalid URL, so the red box with a cross comes up.

    Fix this by adding the root info. For example, rather than just
    Code:
    "/captcha/?n=register&amp;t=4dda987287daf";
    , you'd add
    Code:
    "https://example.com" + "/captcha/?n=register&amp;t=4dda987287daf"

  12. #12
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by freedompeace View Post


    Of course it won't work |:




    You've got a relative URL there. an imagebox will try to load the captcha at "/captcha/?n=register&amp;t=4dda987287daf"... Which is nowhere, an invalid URL, so the red box with a cross comes up.

    Fix this by adding the root info. For example, rather than just
    Code:
    "/captcha/?n=register&amp;t=4dda987287daf";
    , you'd add
    Code:
    "https://example.com" + "/captcha/?n=register&amp;t=4dda987287daf"
    As far as I can remember the webbrowser control usually returns an absolute URL when you access any attributes containing a relative URL, but then again, I could be thinking of something completely different

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  13. #13
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,662
    My Mood
    Breezy
    None of these codes will work as everytime you load the links it will generate a new image. In this case however, it seems to generate the same letters but in a different pattern I guess. I had a problem with ReCaptcha where it'd generate a new image all the time and here is how to get the image object with the usage of a web browser control:

    [highlight=vb.net]'You must add a reference to Microsoft.mshtml from the .NET tab
    'If you are smart, you would know what goes in the stars. MPGH seems to be censoring some words.
    Imports System****ntime.InteropServices

    <ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown ), Guid("3050F669-98B5-11CF-BB82-00AA00BDCE0B")> _
    Interface IHTMLElementRenderFixed
    Sub DrawToDC(ByVal hdc As IntPtr)
    Sub SetDocumentPrinter(<MarshalAs(UnmanagedType.BStr)> ByVal bstrPrinterName As String, ByVal hdc As IntPtr)
    End Interface

    Private Function GetCaptchaImage(ByRef wb As WebBrowser, ByVal captchaSubString As String, ByRef imageLocation As String, ByRef foundCaptchaImage As Boolean) As Image
    For Each imgElem As HtmlElement In WebBrowser1.Document.Images
    Dim currentImageURL As String = imgElem.GetAttribute("src")
    If currentImageURL.Contains(captchaSubString) Then
    Dim bmp As Image = HTMLElementToImage(imgElem)
    imageLocation = currentImageURL
    foundCaptchaImage = True
    Return bmp
    End If
    Next
    foundCaptchaImage = False
    Return Nothing
    End Function

    Private Function HTMLElementToImage(ByVal elem As HtmlElement) As Image
    Dim imgElem As mshtml.IHTMLImgElement = CType(elem.DomElement, mshtml.IHTMLImgElement)
    Dim imgRender As IHTMLElementRenderFixed = CType(imgElem, IHTMLElementRenderFixed)
    Dim bmp As New Bitmap(imgElem.width, imgElem.height)
    Dim g As Graphics = Graphics.FromImage(bmp)
    Dim hdc As IntPtr = g.GetHdc
    imgRender.DrawToDC(hdc)
    g.ReleaseHdc(hdc)
    g.Dispose()
    Return bmp
    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim captchaSucess As Boolean
    Dim imageLocation As String = String.Empty
    Dim captchaImage As Image = GetCaptchaImage(WebBrowser1, "recaptcha/api", imageLocation, captchaSucess)
    If captchaSucess = False Then
    MsgBox("Captcha image could not be found!")
    Else
    MsgBox("Captcha image found: " & imageLocation)
    PictureBox1.Image = captchaImage
    End If
    End Sub[/highlight]

    It should be self explanatory.
    wb is the reference to your WebBrowser control.
    The captchaSubString is a String which contains the substring of the image link. In this example, all ReCaptcha captcha image links contained 'recpatcha/api' in all of them so I used that there. In your case it'd probably be: 'captcha/?n=register&amp;t=' but you can use whatever you want.
    imageLocation is a reference to a String where the image link location will be stored after the function has completed.
    foundCaptchaImage is a reference to a Boolean where a value which tells whether the function suceeded or not which will be stored after the function has completed.

    Why this code is different is because it reads the image links dynamically from what is being seen on the document. I'm still trying to find a way to directly convert the HTMLElement to an Image without having to download the image from the 'src' value.

    EDIT - Found a way, code updated. This will convert the image element seen on screen DIRECTLY ensuring that the image matches the one seen and not something that is different. Spent ages looking for methods and found one example in managed C++ but it was pretty easy to convert. I've split the code into two parts so the HTMLElementToImage function can be reused for you guys. Just make sure the element is actually an image otherwise it'd screw up. You can use it like this and it will return the Image:
    [highlight=vb.net]Dim someLogo As Image = HTMLElementToImage(WebBrowser1.Document.GetElement ByID("some-image"))[/highlight]

    If you use this code, please give credits to me and ildjarn. I know this uses unsafe code @Chooka so don't rage at me.
    Last edited by master131; 05-24-2011 at 03:21 AM.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  14. #14
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,662
    My Mood
    Breezy
    For Each imgElem As HtmlElement In WebBrowser1.Document.Images

    That should be: For Each imgElem As HtmlElement In wb.Document.Images

    Sorry for double post btw.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  15. #15
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Release yo COM objects
    [highlight=vb.net]
    Private Sub releaseCOM(ByVal comObject As Object)
    Try
    comObject = Nothing
    System****ntime.InteropServices.Marshal.ReleaseCom Object(comObject)
    Catch ex As Exception
    Finally
    GC.Collect()
    End Try
    End Sub
    [/highlight]
    Last edited by Jason; 05-25-2011 at 02:25 AM.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  16. The Following User Says Thank You to Jason For This Useful Post:

    [MPGH]master131 (05-25-2011)