【问题标题】:Bypassing a hCaptcha with callback?用回调绕过 hCaptcha?
【发布时间】:2021-07-03 14:01:51
【问题描述】:

你好,所以我试图在一个名为“stake.games”的网站上使用 2captcha 绕过来绕过 hCaptcha,但它似乎不起作用。我正在获取绕过代码,但是当我在“grecaptcha-response”和“hcaptcha-response”中输入它并单击检查按钮时,它不接受绕过代码并要求我再次进行验证码。发生这种情况时,我去了 2captchas 支持并问他为什么。他说该网站使用“回调”并给了我一个代码来获取回调函数(我相信?)。这是他给我的代码:

window.myInterval = setInterval(() => {
    if (window.hcaptcha) {
        console.log('hcaptcha available, lets redefine render method')
        // if hcaptcha object is defined, we save the original render method into window.originalRender
        window.originalRender = hcaptcha.render
        // then we redefine hcaptcha.render method with our function
        window.hcaptcha.render = (container, params) => {
            console.log(container)
            console.log(params)
            // storing hcaptcha callback globally
            window.hcaptchaCallback = params.callback 
            // returning the original render method call
            return window.originalRender(container, params)
        }
        clearInterval(window.myInterval)
    } else {
        console.log('hcaptcha not available yet')
    }
}, 500)

结果是:

{
    "sitekey": "12c3f8c6-a15c-4b83-8767-8050ee30fb70",
    "size": "invisible",
    "theme": "dark",
    "hl": "en"
}

callback and others

所以我什么都不懂,在他们在他们的网站中提供的 python 项目中再次输入了 sitekey、url 以绕过 hCaptcha,但它没有再次绕过 hCaptcha。

我试图绕过 hCaptcha 的代码:

import sys
import os

sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))

from twocaptcha import TwoCaptcha

api_key = os.getenv('APIKEY_2CAPTCHA', '52aec93fb7d4c1b0e99c6c0f614a11ce')

solver = TwoCaptcha(api_key)

try:
    result = solver.hcaptcha(
        sitekey='12c3f8c6-a15c-4b83-8767-8050ee30fb70',
        url='https://stake.games/settings/offers?code=xd&modal=redeemBonus&type=drop',
    )

except Exception as e:
    sys.exit(e)

else:
    sys.exit('solved: ' + str(result))

所以基本上我在问如何使用回调函数解决 hCaptcha?我的英语不是很好,但我希望我能够描述我的问题。

如果您想浏览该网站但不想在这里注册一个测试帐户:

账户ID:testaccount1 账户密码:123456789Oo 站点:stake.games 在哪里测试?:https://stake.games/settings/offers?code=xd&modal=redeemBonus&type=drop

【问题讨论】:

    标签: javascript python captcha 2captcha hcaptcha


    【解决方案1】:

    只是window.hcaptchaCallback,但您可能需要传递令牌:

    window.hcaptchaCallback(token)
    

    【讨论】:

    • 我现在又试了一次。我明白这次发生了什么。我尝试使用验证码来查看响应,当我尝试绕过 python 中的验证码时,代码似乎比预期的要短。我相信它有效,但我将如何获得我想要的绕过代码?我试图绕过第一个代码,但它似乎不像我描述的那样工作
    猜你喜欢
    • 2021-06-09
    • 2021-08-25
    • 1970-01-01
    • 1970-01-01
    • 2022-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-22
    相关资源
    最近更新 更多