通过代理服务器破解 HCaptcha 谜题
Hcaptcha 开发人员将其人机验证谜题称为“Recaptcha 的短期替代品”。我们尝试在我们的 API 中创建同样的任务,以使任务属性与 RecaptchaV2Task 中的任务属性完全相同,除了“type”属性。
用户代理值相关重要通知。以前可对任务指定自己的用户代理值,但现在不一样了。我们转而提供工作人员的用户代理值,需要用该值绕过付费版 Hcaptcha 谜题。作此改动是因为现在几乎不可能在另一平台上模拟外来用户代理值,例如在 Firefox 中模拟 Chrome 用户代理值。除了 navigator.userAgent,浏览器还有大量辅助人造工具,专属于一个或另一个平台。
人机验证谜题示例
任务对象
属性 | 类型 | 必须使用 | 用途 | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type | 字符串 | 是 | HCaptchaTask | ||||||||||||||||||||||||
websiteURL | 字符串 | 是 | 目标网页的地址。可位于网站中的任何位置,甚至可位于会员区中。我们的工作人员不会转到该位置,而是会模拟其访问操作。 | ||||||||||||||||||||||||
websiteKey | 字符串 | 是 | hCaptcha 网站密钥 | ||||||||||||||||||||||||
proxyType | 字符串 | 是 | 代理服务器类型 http - 普通的 http/https 代理服务器 socks4 - socks4 代理服务器 socks5 - socks5 代理服务器 | ||||||||||||||||||||||||
proxyAddress | 字符串 | 是 | ipv4/ipv6 代理服务器 IP 地址。禁止使用主机名或本地网络中的 IP 地址。 | ||||||||||||||||||||||||
proxyPort | 整数 | 是 | 代理服务器端口 | ||||||||||||||||||||||||
proxyLogin | 字符串 | 是 | 用于需要授权(基本授权)的代理服务器的登录名 | ||||||||||||||||||||||||
proxyPassword | 字符串 | 是 | 代理服务器密码 | ||||||||||||||||||||||||
已停用。请改用通过我们工作人员获得的用户代理值,该值由“getTaskResult”方法返回。 | |||||||||||||||||||||||||||
isInvisible | 布尔值 | 否 | 指定 Hcaptcha 谜题是否不可见。这会向我们的工作人员呈现相应小组件。 | ||||||||||||||||||||||||
isEnterprise | 布尔值 | 否 | 如果要用 Hcaptcha 分数最高的工作人员破解 Hcaptcha 谜题,请使用此参数。请注意,这会使破解费用增加两倍。 | ||||||||||||||||||||||||
enterprisePayload | 对象 | 否 | 新增参数,我们会将其用于实现企业版 Hcaptcha 小组件。
|
请求示例
Python
Javascript
Go
PHP
Java
C#
bash
#pip3 install anticaptchaofficial
from anticaptchaofficial.hcaptchaproxyon import *
solver = hCaptchaProxyon()
solver.set_verbose(1)
solver.set_key("YOUR_API_KEY_HERE")
solver.set_website_url("https://hcaptcha.com/")
solver.set_website_key("00000000-0000-0000-0000-000000000000")
solver.set_proxy_address("PROXY_ADDRESS")
solver.set_proxy_port(1234)
solver.set_proxy_login("proxylogin")
solver.set_proxy_password("proxypassword")
solver.set_user_agent("Mozilla/5.0")
solver.set_cookies("test=true")
# tell API that Hcaptcha is invisible
#solver.set_is_invisible(1)
# tell API that Hcaptcha is Enterprise
#solver.set_is_enterprise(1)
# set here parameters like rqdata, sentry, apiEndpoint, endpoint, reportapi, assethost, imghost
#solver.set_enterprise_payload({
# "rqdata": "rq data value from target website",
# "sentry": True
#})
# Specify softId to earn 10% commission with your app.
# Get your softId here: https://anti-captcha.com/clients/tools/devcenter
solver.set_soft_id(0)
g_response = solver.solve_and_return_solution()
if g_response != 0:
print("g-response: "+g_response)
print("user-agent, use it to post the form: ", solver.get_user_agent())
print("respkey, if any: ", solver.get_respkey())
else:
print("task finished with error "+solver.error_code)
任务处理结果对象
属性 | 类型 | 用途 |
---|---|---|
gRecaptchaResponse | 字符串 | 与目标网站中的提交窗体互动所需的标记字符串。 |
respKey | 字符串 | “window.hcaptcha.getRespKey()”函数(如果可用)的输出信息。某些网站用这些信息进行更多验证。 |
userAgent | 字符串 | 工作人员浏览器的用户代理值。可在提交响应标记时使用。 |
响应示例
{
"errorId":0,
"status":"ready",
"solution":
{
"gRecaptchaResponse":"3AHJ_VuvYIBNBW5yyv0zRYJ75VkOKvhKj9_xGBJKnQimF72rfoq3Iy-DyGHMwLAo6a3......",
"respKey":"E0_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjoiQk5vb1JuZ0FPSHBCM2EyWURSSC......",
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
},
"cost":"0.001500",
"ip":"46.98.54.221",
"createTime":1472205564,
"endTime":1472205570,
"solveCount":"0"
}