Hack Forums
[.NET] Get Captcha from ANY page - Google - Hotmail - Whathever.... - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Get Captcha from ANY page - Google - Hotmail - Whathever.... (/showthread.php?tid=3608022)

Pages: Pages 1 2 3 4 5


* - LethalNET - Jul 9, 2013

Good thread, This will help alot of people making bots


* - ident - Jul 9, 2013

(Jul 9, 2013 09:25 AM)C3ol Wrote:  haha u are funny 🤝 dono why u think i hate u
anyway simple way
Code
Dim Wb As New WebBrowser
  Wb.Navigate("https://accounts.google.com/SignUp?continue=https%3A%2F%2Fencrypted.google.com%2F&hl=en")
  While Not Wb.ReadyState = WebBrowserReadyState.Complete
    Application.DoEvents()
  End While
  For Each Cap As HtmlElement In Wb.Document.Images
    If Cap.GetAttribute("src").Contains("recaptcha") Then
    PictureBox1.ImageLocation = Cap.GetAttribute("src")
    End If
Next

Never ever call application.doevents inside a loop.


* - barukoru - Jul 9, 2013

Very, very nice as always, great work man. 🎉


* - 1n9i9c7om - Jul 9, 2013

Wow... I did it more complicated when I was doing it for a minecraft server voter... :/
Thanks for this way anyways, could be helpful for me soon.


* - ScΛrƒΛc3_ - Jul 9, 2013

(Jul 9, 2013 12:09 PM)1n9i9c7om ツ Wrote:  Wow... I did it more complicated when I was doing it for a minecraft server voter... :/
Thanks for this way anyways, could be helpful for me soon.

im sure will work nice olso for you.... 🤝

[img]http://img811.imageshack.us/img811/763/nhi4.jpg[/img]


* - XmysteriousX - Jul 11, 2013

nice share of source really helped me thanks


* - ScΛrƒΛc3_ - Jul 13, 2013

(Jul 11, 2013 02:12 PM)frannk Wrote:  nice share of source really helped me thanks

No problem....glad to help you out 🤝


* - shock_y0 - Jul 13, 2013

nice source. thanks for sharing.

regards
shocK


* - Kawop - Jul 17, 2013

Hi guy, starting to create an SpeedPseudo bot for an another forum (Nothing like HF don't be affraid)

I've just start like this an Button called refresh navigate with the Webbrowser to the webpage and it acess to the captcha and fill the picturebox with it

But i want to do that :

I type the captcha in a textbox and when i click on a button post on the programm he fill the html input:

I've used that code :

Code
WebBrowser1.Document.GetElementById("recaptcha_response_field").SetAttribute("", (captcha.Text))

And the Html code :

PHP Code

<?php 
<input id="recaptcha_response_field" type="text" placeholder="Saisissez les deux mots " autocapitalize="off" autocorrect="off" name="recaptcha_response_field" autocomplete="off"></input> 

What's wrong with my code ? when i click on the button nothing happen ❓

Thanks for your help 👍


* - ScΛrƒΛc3_ - Jul 17, 2013

(Jul 17, 2013 04:27 AM)Kawop Wrote:  Hi guy, starting to create an SpeedPseudo bot for an another forum (Nothing like HF don't be affraid)

I've just start like this an Button called refresh navigate with the Webbrowser to the webpage and it acess to the captcha and fill the picturebox with it

But i want to do that :

I type the captcha in a textbox and when i click on a button post on the programm he fill the html input:

I've used that code :

Code
WebBrowser1.Document.GetElementById("recaptcha_response_field").SetAttribute("", (captcha.Text))

And the Html code :

PHP Code

<?php 
<input id="recaptcha_response_field" type="text" placeholder="Saisissez les deux mots " autocapitalize="off" autocorrect="off" name="recaptcha_response_field" autocomplete="off"></input> 

What's wrong with my code ? when i click on the button nothing happen ❓

Thanks for your help 👍

Try with this....

PHP Code

<?php 
Try
    
Dim ElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
    For 
Each currentElement As HtmlElement In ElementCollection
    Dim ControlName 
As String = currentElement.GetAttribute("id").ToString
    
If ControlName = "recaptcha_response_field" Then
    currentElement
.SetAttribute("Value", captcha.Text)
    
End If
    
Next
Catch
End Try 

BTW, better you open another thread for personal issues... 🤝

EDIT:
Your problem has been solved sir...sent you a PM

[img]http://img855.imageshack.us/img855/3563/34tf.jpg[/img]

🤝


* - Gr0wlit - Jul 18, 2013

Instead of using a webbrowser, you should use requests. They are faster than a webbrowser and are more professional


* - velox - Jul 21, 2013

Holy hell dude it fucking works! Nice job. +3 to you

Edit: will deliver rep when I can give more haha


* - Fafaffy - Jul 21, 2013

Hey, can I join in this parade?

Sorry it's in C#, but it doesn't use a web browser <3

Spoiler (Click to View)

Spoiler (Click to View)

PHP Code

<?php 
try
    {
    
String getPublicKey = "\"([^\"]+)\",\"captchaContainer";
    
String getChallenge = "challenge : '([^']+)',";
    
String baseURL = "http://www.google.com/recaptcha/api/image?c=";
    
String backupOption = "\"((http)?s?(://)?(www\\.)?google\\.com/recaptcha/[^\"]+)\"";
    
//Obviously, we don't HAVE to create those strings, but just for the sake of making the code cleaner, I made them here.

    
WebClient temp = new WebClient();
    
//WebClient FTW

    
String tempSource = temp.DownloadString(textBox1.Text);
    
//Used in case the google image is actually just lying there in the source

    
String publicKey = Regex.Match(tempSource, getPublicKey).Groups[1].Value;
    
//We need the public key to get the image of the captcha

    
if(String.IsNullOrEmpty(publicKey)){
    
//If we don't have a public key (probably because they're already showing the image in the source), just try to find the image
    
pictureBox1.ImageLocation = Regex.Match(tempSource, backupOption).Groups[1].ToString();
    }else{
    
String url = String.Format("{0}{1}", baseURL, Regex.Match(temp.DownloadString(String.Format("http://www.google.com/recaptcha/api/challenge?k={0}", publicKey)), getChallenge).Groups[1].ToString());
    
//Now we need the challenge key USING the public key
    //God google, wai you gotta complicate my life?

    
pictureBox1.ImageLocation = url;
    
//Ta-MOTHERFUCKING-DA
    
}

    }
    catch (
Exception)
    {
    
MessageBox.Show("An error has occured, but I was too lazy to tell you what it is.");
    } 
http://pastebin.com/Ju04bVwW


* - StarZ - Jul 21, 2013

(Jul 21, 2013 09:45 AM)Fafaffy Wrote:  Hey, can I join in this parade?

Sorry it's in C#, but it doesn't use a web browser <3

Spoiler (Click to View)

Spoiler (Click to View)

PHP Code

<?php 
try
    {
    
String getPublicKey = "\"([^\"]+)\",\"captchaContainer";
    
String getChallenge = "challenge : '([^']+)',";
    
String baseURL = "http://www.google.com/recaptcha/api/image?c=";
    
String backupOption = "\"((http)?s?(://)?(www\\.)?google\\.com/recaptcha/[^\"]+)\"";
    
//Obviously, we don't HAVE to create those strings, but just for the sake of making the code cleaner, I made them here.

    
WebClient temp = new WebClient();
    
//WebClient FTW

    
String tempSource = temp.DownloadString(textBox1.Text);
    
//Used in case the google image is actually just lying there in the source

    
String publicKey = Regex.Match(tempSource, getPublicKey).Groups[1].Value;
    
//We need the public key to get the image of the captcha

    
if(String.IsNullOrEmpty(publicKey)){
    
//If we don't have a public key (probably because they're already showing the image in the source), just try to find the image
    
pictureBox1.ImageLocation = Regex.Match(tempSource, backupOption).Groups[1].ToString();
    }else{
    
String url = String.Format("{0}{1}", baseURL, Regex.Match(temp.DownloadString(String.Format("http://www.google.com/recaptcha/api/challenge?k={0}", publicKey)), getChallenge).Groups[1].ToString());
    
//Now we need the challenge key USING the public key
    //God google, wai you gotta complicate my life?

    
pictureBox1.ImageLocation = url;
    
//Ta-MOTHERFUCKING-DA
    
}

    }
    catch (
Exception)
    {
    
MessageBox.Show("An error has occured, but I was too lazy to tell you what it is.");
    } 
http://pastebin.com/Ju04bVwW

Beautiful. Simply Beautiful. Kudos Fafaffy. Kudos.


* - ScΛrƒΛc3_ - Jul 21, 2013

@Abstergo
Thanks for appreciating, im sure anyone will get any captcha with this.

@Fafaffy
Thanks for improving my thread with your C# version but....have you tested olso on Hotmail ? Google is not a problem at all it does not change the capcha when you try to get it.

Any of you can improve, you can use webrequests or webbrowser....this code has the purpose to show you how to take advantage of the Microsoft.HTML Object Library.