Problem with invisible ReCaptcha v2 callback function at Mail.com Sign-up page

#21
EDIT: Now it's working, I managed to execute: window.grecaptcha.execute() after setting my captcha response and it bypassed the captcha!

Thanks Mark for your support and fast reply!
 
#22
No idea unless you provide a link to the website :)
Hey Mark, I'm having a similar issue and would like to ask for your assistance. I'm executing ___grecaptcha_cfg.clients[0]J.J.callback(TOKEN) on Spotify's registration page but it's now saying "javascript error: Cannot read property 'J' of undefined" in my code. Yet, when I go to the registration page and load the console I'm able to find the callback with ___grecaptcha_cfg.clients[0]J.J.callback. Note, this code worked earlier yesterday and the object is still the same on the targeted site.. Do you know why I'm getting this error all of a sudden or what I can do to bypass this? Thanks you so much!
 
#25
Hi guys!
Try to use this code to identify captchas on the page and find callbacks
https://gist.github.com/2captcha/2ee70fa1130e756e1693a5d4be4d8c70
I tried:
__grecaptcha_cfg.clients[0].$.$.callback()
__grecaptcha_cfg.clients[0].$.$.recaptchaCallback()
__grecaptcha_cfg.clients[0].$.$.callback.recaptchaCallback()
Everything "is not a function". I don't know what I'm doing wrong.

1592442432985.png

This is when I put recaptchaCallback in console

1592444116191.png

And this is just endless if I try to go down the tree. If I click the button next to the g() it goes to this function

JavaScript:
function ka(a){var d;a.has("csrfmiddlewaretoken")&&(d=a.get("csrfmiddlewaretoken"));return void 0!==d?d:void 0};function la(a){function d(c,g){g=String(g.getAttribute("data-callback"));"null"!==g&&(window[g]=function(){c.R=!0;c.o()})}var b={name:"",a:"",B:"",P:!1,v:!1,h:!1,O:!1,u:!0,fa:!1,F:!1,na:"",R:!1,N:a,D:function(){b.B=String(a.tagName.toLowerCase());var c=b.da();b.name=null!==c?c:"";b.a=b.name;if("captcha"===a.getAttribute("data-type"))b.F=!0,d(b,a);else{var g=String(a.getAttribute("id")).split("_"),f=g[g.length-1];var e=["day","month","year"];c=!1;if(-1<e.indexOf(f))for(g.pop(),g=g.join("_"),c=!0,e=r(e),f=e.next();!f.done;f=e.next())null===document.querySelector("#"+(g+"_"+f.value))&&(c=!1);c&&(b.fa=!0,c=String(a.getAttribute("id")).split("_"),c.shift(),c.pop(),b.a=c.join("_"))}c=String(a.getAttribute("type"));"checkbox"===c?b.v=!0:"hidden"===c?b.h=!0:"select"===b.B&&"select-multiple"===a.type&&(b.P=!0);b.O=null!==a.getAttribute("disabled");b.M()&&(b.u=!1)},da:function(){if("captcha"===a.getAttribute("data-type")){var c=String(a.getAttribute("id")).split("_");c.shift();c=c.join("_")}else c=a.getAttribute("name");return c},ma:function(){if(!b.h&&!b.F){var c=document.querySelector("#"+b.a+"_spinner");null!==c&&c.classList.remove("formvalidate_hidden")}},ea:function(){var c=document.querySelector("#"+b.a+"_spinner");null!==c&&c.classList.add("formvalidate_hidden")},ca:function(){return String(a.getAttribute("id"))},s:function(){return b.v?a.checked?"on":"":a.value},K:function(){b.u=!1},M:function(){if(b.h)return!1;var c=document.querySelector("."+b.a+"_error");return null!==c&&"none"!==c.style.display?!0:!1},V:function(c,g){b.h||(!0===g&&(b.u=!1),!1===b.u&&(document.querySelector("."+b.a+"_error .error_msg").appendChild(document.createTextNode(c)),c=document.querySelector("."+b.a+"_error"),c.style.display="tr"===String(c.tagName.toLowerCase())?"table-row":"block",c=document.querySelector("."+b.a+"_label"),null!==c&&c.classList.add("formvalidate_error")))},o:function(){if(!b.h){for(var c=document.querySelector("."+b.a+"_error .error_msg");null!==c.firstChild;)c.removeChild(c.firstChild);document.querySelector("."+b.a+"_error").style.display="none";c=document.querySelector("."+b.a+"_label");null!==c&&c.classList.remove("formvalidate_error")}}};b.D();return b}
 
Last edited:

Mark Miller

2Captcha Engineer
#26
I tried:
__grecaptcha_cfg.clients[0].$.$.callback()
__grecaptcha_cfg.clients[0].$.$.recaptchaCallback()
__grecaptcha_cfg.clients[0].$.$.callback.recaptchaCallback()
Everything "is not a function". I don't know what I'm doing wrong.

View attachment 54

This is when I put recaptchaCallback in console

View attachment 55

And this is just endless if I try to go down the tree. If I click the button next to the g() it goes to this function
In your case it is just:
recaptchaCallback('TOKEN')
 

Mark Miller

2Captcha Engineer
#28
I'm trying to figure out recaptcha callback for kijiji.ca but can't find it. This is how the object looks
They store dashed function name there and that's a bit illegal in JS, but you can always access it from window object:
window[___grecaptcha_cfg.clients[0].B.B.callback]
and call the function this way:
window[___grecaptcha_cfg.clients[0].B.B.callback]('TOKEN')
 
#30
Hey mark, when I submit "_grecaptcha.data-callback("Solved Code")" . I got this error which means its not a callback function , then can you help

me to sort out this. 1595013245268.png
 

Mark Miller

2Captcha Engineer
#31
Hey mark, when I submit "_grecaptcha.data-callback("Solved Code")" . I got this error which means its not a callback function , then can you help

me to sort out this. View attachment 61
_grecaptcha.data-callback is an illegal function name in javascript as it is not allowed to use dash symbol in function name, that's hy you receive the error.
But you can always access any illegally named function from window object:
window["_grecaptcha.data-callback"]("TOKEN")
 
#32
Hello I try to solve similar problem, but when I run it like this
JavaScript:
window["__grecaptcha_cfg.clients[0].X.X.callback"]("captcharesponse");
I get TypeError: window['__grecaptcha_cfg.clients[0].X.X.callback'] is not a function

this
JavaScript:
___grecaptcha_cfg.clients[0].X.X.callback("captcharesponse")
works for me in console, but unfortunately does not work for me in ubot in which I create my bot.
 

Mark Miller

2Captcha Engineer
#33
Hello I try to solve similar problem, but when I run it like this
JavaScript:
window["__grecaptcha_cfg.clients[0].X.X.callback"]("captcharesponse");
I get TypeError: window['__grecaptcha_cfg.clients[0].X.X.callback'] is not a function
I think that is not applicable for your case, as this approach is used when the function name is stored in the callback property and that's a rare case.

this
JavaScript:
___grecaptcha_cfg.clients[0].X.X.callback("captcharesponse")
works for me in console, but unfortunately does not work for me in ubot in which I create my bot.
If it works in the console, then it's a proper way to execute the callback.

Unfortunately I can't help you with Ubot as I never use such kind of software, I would recommend to start from https://wiki.ubotstudio.com/wiki/Run_Javascript and ask for help in http://network.ubotstudio.com/forum/
 
#35
I know this thread is a little on the old side but it seems to have the most relevant information for ReCaptcha v2 callback functions. I am running into odd behavior. The call back function is called handleCaptcha. When I perform:

JavaScript:
handleCaptcha("recaptcha_answer")
In the console window the captcha is solved and everything works. I have noticed I can execute this callback without modifying the ReCaptcha text area and it still validates. When I run this command from Selenium:

Python:
log.info("Submitting Captcha")
self.driver.execute_script("document.getElementById('g-recaptcha-response').innerHTML = '{0}';".format(
     recaptcha_answer))

callback_method = self.driver.find_element_by_class_name("g-recaptcha").get_attribute("data-callback")

log.info("Executing Callback")
self.driver.execute_script("{0}(\"{1}\");".format(
     callback_method, recaptcha_answer))
The page refreshes and I get a warning in the console that says:
1606101363699.png
The above code may not be correct I have monitored the process through breakpoints and it seems to be functioning the same. I event tried taking out the line that adds the g-recaptcha-response text and it still doesn't work.

Any ideas on how to get around this problem? It seems like the site is detecting the script execution from Python. Here is a link to the captcha:
https://www.walmart.com/blocked?url...&vid=b2dbe524-2b88-11eb-a61b-0242ac12000f&g=a
 
Last edited:
#36
I know this thread is a little on the old side but it seems to have the most relevant information for ReCaptcha v2 callback functions. I am running into odd behavior. The call back function is called handleCaptcha. When I perform:

JavaScript:
handleCaptcha("recaptcha_answer")
In the console window the captcha is solved and everything works. I have noticed I can execute this callback without modifying the ReCaptcha text area and it still validates. When I run this command from Selenium:

Python:
log.info("Submitting Captcha")
self.driver.execute_script("document.getElementById('g-recaptcha-response').innerHTML = '{0}';".format(
     recaptcha_answer))

callback_method = self.driver.find_element_by_class_name("g-recaptcha").get_attribute("data-callback")

log.info("Executing Callback")
self.driver.execute_script("{0}(\"{1}\");".format(
     callback_method, recaptcha_answer))
The page refreshes and I get a warning in the console that says:
View attachment 136
The above code may not be correct I have monitored the process through breakpoints and it seems to be functioning the same. I event tried taking out the line that adds the g-recaptcha-response text and it still doesn't work.

Any ideas on how to get around this problem? It seems like the site is detecting the script execution from Python. Here is a link to the captcha:
https://www.walmart.com/blocked?url...&vid=b2dbe524-2b88-11eb-a61b-0242ac12000f&g=a
I am having the same issue. The handleCaptcha with token when sent from the dev console is working, but from Python code it is not.
Did you manage to solve this problem?
 
#37
Hi Marcus Philips,

Your post is very useful. I studied much.

I am trying to resolve recaptcha on website Walmart.com. We have a callback function but I fail to bypass it. (see attach img)
Could you pls take a look?

Thanks.
 

Attachments

#38
I know this thread is a little on the old side but it seems to have the most relevant information for ReCaptcha v2 callback functions. I am running into odd behavior. The call back function is called handleCaptcha. When I perform:

JavaScript:
handleCaptcha("recaptcha_answer")
In the console window the captcha is solved and everything works. I have noticed I can execute this callback without modifying the ReCaptcha text area and it still validates. When I run this command from Selenium:

Python:
log.info("Submitting Captcha")
self.driver.execute_script("document.getElementById('g-recaptcha-response').innerHTML = '{0}';".format(
     recaptcha_answer))

callback_method = self.driver.find_element_by_class_name("g-recaptcha").get_attribute("data-callback")

log.info("Executing Callback")
self.driver.execute_script("{0}(\"{1}\");".format(
     callback_method, recaptcha_answer))
The page refreshes and I get a warning in the console that says:
View attachment 136
The above code may not be correct I have monitored the process through breakpoints and it seems to be functioning the same. I event tried taking out the line that adds the g-recaptcha-response text and it still doesn't work.

Any ideas on how to get around this problem? It seems like the site is detecting the script execution from Python. Here is a link to the captcha:
https://www.walmart.com/blocked?url...&vid=b2dbe524-2b88-11eb-a61b-0242ac12000f&g=a



I found a solution. I insert a button to the webpage then click on the button to execute function handleCaptcha
 

Attachments