How to manually call (find) the ReCaptcha Callback function?

眉间皱痕 提交于 2019-12-12 09:54:41

问题


I'm currently experimenting with captcha solving, and have decided to use the popular 2captcha service to do so. Their approach is to send them the recaptcha values (google recaptcha key & site thread), then they solve it and send me back the finished value that is supposed to be sent to google to check that the captcha have been solved.

I'm stuck on the last step; using the returned solved value and send it to google. As the docs https://2captcha.com/2captcha-api#callback explain, I find no "submit" button hence need to find the recaptcha callback function myself, so I can call it. I do however have a hard time finding the function since everything seems obfuscated. I explored all their methods to find a callback function but have been unable to do so. The closest I think I've been is finding the obfuscated recaptcha-en.js (located at sources>webworker.js>www.gstatic.com>recaptcha/api2/v1519325468512) https://pastebin.com/VgtJUftm which contains some callback searchwords, though due the obfuscation I don't know what to call. Tried some deobfuscation tools without luck.

So; how do I find and fire the ReCaptcha Callback function, when the recaptcha isn't hosted on my own website? Thanks in advance


回答1:


Managed to solve my problem, successfully solving captchas, though I did not manage to ever find out how to call the recaptcha callback function. After I had inserted the returned captcha solve-value into my "g-recaptcha-response" field, I simply used javascript to submit the form as described here http://www.deathbycaptcha.com/user/api/newtokenrecaptcha#how-use-token.

Selenium with Java:

    JavascriptExecutor js = (JavascriptExecutor) driver;
System.out.println("Executing js set-recaptcha-response script");
js.executeScript("document.getElementById(\"g-recaptcha-response\").innerHTML=\"" + responseToken + "\";");
System.out.println("Executing js submit-form script");
js.executeScript("document.getElementsByName('post')[0].submit();");


来源:https://stackoverflow.com/questions/48974605/how-to-manually-call-find-the-recaptcha-callback-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!