国外验证码|使用EZCAPTCHA打码平台过掉hcaptcha验证码

关注它,不迷路。       

本文章中所有内容仅供学习交流,不可用于任何商业用途和非法用途,否则后果自负,如有侵权,请联系作者立即删除!

1.平台地址

https://dashboard.ez-captcha.com/#/register?inviteCode=ArTRhaGRJkp

点击左下角的 阅读原文 可以直达。

2.hcaptcha验证码demo

demo地址:

https://accounts.hcaptcha.com/demo

3.抓包分析

弹出验证码后,点击相应的图片,通过它的验证再抓包:

307f4007d605d0be7287354ccc0c4427.png

验证通过后,点击 Submit 按钮:

c63ba698f6b66818456ab1661febf062.png

发现提交了这些参数:

6d80b64dedc02d65997b39f4510d5b02.png

email字段为空,而 g-recaptcha-response 字段 和 h-captcha-response 字段 提交的内容是一样的。它的响应是这样的:

af0751e1c2eb1ed09e1014ecb23ff26b.png

4.打码平台需要提交的参数

可以访问下面的地址查看详细介绍:

https://ezcaptcha.atlassian.net/wiki/spaces/IS/pages/13860865/HCaptcha

与用户相关的其实只有 "websiteURL" 和 "websiteKey" 字段。

 "websiteURL"其实就是它的一级域名:

https://accounts.hcaptcha.com

而  "websiteKey" 字段 可以通过抓包得知:

539855952520cedc12f6e63c80231374.png

它这个网站返回的  "websiteKey" 好像都一样:

"a5f74b19-9e45-40e0-b45d-47ff91b7a6c2"

5.请求源码

下面的代码由打码平台的技术提供,在此感谢:

import random
import threading
import time


import requests


cap_key = "你的客户端密钥"
requests.packages.urllib3.disable_warnings()




def cap_create_task(websiteURL, websiteKey, taskType, isInvisible=False) -> str:
    url = "https://api.ez-captcha.com/createTask"
    data = {
        "clientKey": cap_key,
        "task": {
            "websiteURL": websiteURL,
            "websiteKey": websiteKey,
            "type": taskType,
        }
    }
    try:
        result = requests.post(url, json=data, verify=False, timeout=8)
        result = result.json()
        #print(result)
        taskId = result.get('taskId')
        if taskId is not None:
            return taskId


    except Exception as e:
        print(e)




def cap_get_response(taskID: str):
    times = 0
    start_time = time.time()
    while times < 120:
        try:
            url = "https://api.ez-captcha.com/getTaskResult"
            data = {
                "clientKey": cap_key,
                "taskId": taskID
            }
            print ("结果获取中.....")
            result = requests.post(url, json=data, verify=False, timeout=8).json()
            solution = result.get('solution', {})
            if solution:
                response = solution.get('token')
                if response:
                    #print(f"消耗时间 {time.time()-start_time}s", response)
                    return response
        except Exception as e:
            print(e)
        times += 1
        time.sleep(1)
    return ""




def demo():
    sitekey = "a5f74b19-9e45-40e0-b45d-47ff91b7a6c2"
    url = "https://accounts.hcaptcha.com"
    type = "HcaptchaTaskProxyless"
    taskId = cap_create_task(url, sitekey, type, False)
    res = cap_get_response(taskId)
    if res != "":
        data = {"email":"","g-recaptcha-response":res,"h-captcha-response":res}
        url = "https://accounts.hcaptcha.com/demo"


        result = requests.post(url, data=data, verify=False, timeout=8)


        print(result.text)








if __name__ == '__main__':
    demo()

请求结果如图:

8e75db94ba7278b15ce6321026f68c2e.png

初次请求,可能在10s-20s以内,属正常情况,后面再请求就比较快了。

今天的文章就分享到这里,后续分享更多的技巧,敬请期待。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值