I want to post method a website which has recaptcha. I use website for web filter category suggesstion. I want to make an automation and automatically make post request. My code is below.
string fortiwebGetUrl = "https://www.fortiguard.com/faq/wfratingsubmit";
string fortiWebFilterPostUrl = "https://www.fortiguard.com/faq/wfratingsubmit";
using (var wb = new WebClient())
{
var GetResponse = wb.DownloadString(fortiwebGetUrl); //first, i make GET, I tried to get captcha value, no impact.
var data = new NameValueCollection();
data["url"] = "testwebsite.com";
data["categorysuggestion"] = "category";
data["name"] = "myname";
data["email"] = "myemail";
data["company"] = "mycompany";
var response = wb.UploadValues(fortiWebFilterPostUrl, "POST", data);
string responseInString = Encoding.UTF8.GetString(response);
}
Response returns a HTML and shortly it says "Empty captcha". Web site is using recaptcha, but when I use website from browser, i dont have to enter or fill captcha bar, it automaticaly takes capctha value. It is hidden type html code. Sure, the web site puts capctha for security and my purpose is not to cause a security issue, but I want to make post request via my code. How can I handle on it? I accept any Javascript (AJAX etc.) solutions. Thanks.
Indeed if you find a way to bypass Google captcha you should inform Google and get a bounty.
Saying that, the hidden captcha will only display if google suspects you.
I managed to to get a new captcha and send the form outside the browzer doing the following:
Look for
_GRECAPTCHA. Then extract the value you need: E.g.:09APYnBZUPrCBVN9yqF_oKPvleUsvQ8L-6sU6NxsXA-9x3ZhBcgFDI4cUYB8-ob86cEhbmf7B_g7LCJrZeZtB58JUyou need the6sU6NxsXA-9x3ZhBcgFDI4cUYB8-ob86cEhbmf7BNow, request a new captcha to google, you have to do a POST request and change the k value with the value you capture from the cookie:
E.g.: /recaptcha/api2/reload?k=6sU6NxsXA-9x3ZhBcgFDI4cUYB8-ob86cEhbmf7B
You also have to pass you "id" or whatever Google calculate, you can capture that doing a "legit" post from the browzer.
E.g.:
Now, from the response "rresp" read the captcha value.
E.g.:
Finally, add the captcha value to your post resquest:
E.g.:
And happy days, do that until 1. Google decides you're no longer legit or 2. The site owner decides to change the captcha type..