params of recaptcha v2 / recaptcha v2 invisible solve task
a. websiteURL
b. websiteKey
c. recaptchaDataSValue
d. isInvisible
params of recaptcha v2 Enterprise solve task
a. websiteURL
b. websiteKey
c. pageAction
d. enterprisePayload
e. isInvisible
params of recaptcha v3 / recaptcha v3 Enterprise solve task
a. websiteURL
b. websiteKey
c. pageAction
如何区分企业版和普通版
a. 打开浏览器控制台并找到以“anchor”结尾的“www.google.com/recaptcha”请求
b. 检查网址是否包含 Enterprise
c. 这是企业版或普通版的 recaptcha类型
如何找到“websiteKey”
a. 打开浏览器控制台并找到以“anchor”结尾的“www.google.com/recaptcha”请求
b. “k”的有效载荷是目标网站密钥
如何找到“recaptchaDataSValue”
a. 打开浏览器控制台并找到以“anchor”结尾的“www.google.com/recaptcha”请求
b. `s` 的 payload 是目标 recaptcha 网站 `recaptchaDataSValue`
如何发现和区分“看不见”
a. 打开浏览器控制台并找到以“anchor”结尾的“www.google.com/recaptcha”请求
b. `size` 的有效载荷是目标 recaptcha 网站的 `isInvisible` 值
如何找到 recaptcha `pageAction`
a. `getMessageFallback` called for how-to-find-the-params-of-recaptcha-solve-task.list5-
b. 在`___grecaptcha_cfg.clients`中找到它
function getRecaptchaWidgetInfo(widget) {
let info = {
captchaType: "recaptcha",
widgetId: widget.id,
version: "v2",
sitekey: null,
action: null,
s: null,
callback: null,
enterprise: window?.grecaptcha?.enterprise ? true : false,
containerId: null,
bindedButtonId: null,
};
/*
* Check if is badge
*/
let isBadge = false;
mainLoop: for (let k1 in widget) {
if (typeof widget[k1] !== "object") continue;
for (let k2 in widget[k1]) {
if (widget[k1][k2] && widget[k1][k2].classList && widget[k1][k2].classList.contains("grecaptcha-badge")) {
isBadge = true;
break mainLoop;
}
}
}
/*
* 1. Look for version
*/
if (isBadge) {
info.version = "v3";
for (let k1 in widget) {
let obj = widget[k1];
if (typeof obj !== "object") continue;
for (let k2 in obj) {
if (typeof obj[k2] !== "string") continue;
if (obj[k2] == "fullscreen") info.version = "v2_invisible";
}
}
}
/*
* 2. Look for containerId
*/
let n1;
for (let k in widget) {
if (widget[k] && widget[k].nodeType) {
if (widget[k].id) {
info.containerId = widget[k].id;
} else if (widget[k].dataset.sitekey) {
widget[k].id = "recaptcha-container-" + Date.now();
info.containerId = widget[k].id;
} else if (info.version == 'v2') {
if (!n1) {
n1 = widget[k];
continue;
}
if (widget[k].isSameNode(n1)) {
widget[k].id = "recaptcha-container-" + Date.now();
info.containerId = widget[k].id;
break;
}
}
}
}
/*
* 3. Look for sitekey, action, s and callback
*/
for (let k1 in widget) {
let obj = widget[k1];
if (typeof obj !== "object") continue;
for (let k2 in obj) {
if (obj[k2] === null) continue;
if (typeof obj[k2] !== "object") continue;
if (obj[k2].sitekey === undefined) continue;
if (obj[k2].action === undefined) continue;
for (let k3 in obj[k2]) {
if (k3 === "sitekey") info.sitekey = obj[k2][k3];
if (k3 === "action") info.action = obj[k2][k3];
if (k3 === "s") info.s = obj[k2][k3];
if (k3 === "callback") info.callback = obj[k2][k3];
if (k3 === "bind" && obj[k2][k3]) {
if (typeof obj[k2][k3] === "string") {
info.bindedButtonId = obj[k2][k3];
} else {
let button = obj[k2][k3];
if (button.id === undefined) {
button.id = "recaptchaBindedElement" + widget.id;
}
info.bindedButtonId = button.id;
}
}
}
}
}
/*
* 4. Prepare callback
*/
if (typeof info.callback === "function") {
let callbackKey = "reCaptchaWidgetCallback" + widget.id;
window[callbackKey] = info.callback;
info.callback = callbackKey;
}
return info;
}