From 0138a40d8714b6e02d9a085264396eda7f728541 Mon Sep 17 00:00:00 2001 From: noahcoolboy <46800081+noahcoolboy@users.noreply.github.com> Date: Mon, 18 Sep 2023 17:27:21 +0200 Subject: [PATCH] Fix detection --- lib/api.js | 4 ++-- lib/fingerprint.js | 11 ++++++----- src/api.ts | 4 ++-- src/fingerprint.ts | 13 +++++++------ test/roblox.js | 1 + 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/api.js b/lib/api.js index 1fc1550..b1cee39 100644 --- a/lib/api.js +++ b/lib/api.js @@ -20,7 +20,7 @@ async function getToken(options) { options.headers["sec-fetch-mode"] = "cors"; if (options.site) { options.headers["Origin"] = options.surl; - options.headers["Referer"] = `${options.surl}/v2/${options.pkey}/1.5.4/enforcement.${util_1.default.random()}.html`; + options.headers["Referer"] = `${options.surl}/v2/${options.pkey}/1.5.5/enforcement.fbfc14b0d793c6ef8359e0e4b4a91f67.html`; } let ua = options.headers[Object.keys(options.headers).find(v => v.toLowerCase() == "user-agent")]; let res = await (0, http_1.default)(options.surl, { @@ -31,7 +31,7 @@ async function getToken(options) { public_key: options.pkey, site: options.site ? new URL(options.site).origin : undefined, userbrowser: ua, - capi_version: "1.5.2", + capi_version: "1.5.5", capi_mode: "inline", style_theme: "default", rnd: Math.random().toString(), diff --git a/lib/fingerprint.js b/lib/fingerprint.js index 1d03580..1e0e789 100644 --- a/lib/fingerprint.js +++ b/lib/fingerprint.js @@ -233,7 +233,7 @@ let baseEnhancedFingerprint = { "webgl_fsf_params": "23,127,127,23,127,127,23,127,127", "webgl_fsi_params": "0,31,30,0,31,30,0,31,30", "webgl_hash_webgl": null, - "user_agent_data_brands": "Not/A)Brand,Google Chrome,Chromium", + "user_agent_data_brands": "Chromium,Not)A;Brand,Google Chrome", "user_agent_data_mobile": null, "navigator_connection_downlink": null, "navigator_connection_downlink_max": null, @@ -262,13 +262,13 @@ let baseEnhancedFingerprint = { "window__tree_index": [ 0 ], - "window__tree_structure": "[[]]", - "window__location_href": "https://roblox-api.arkoselabs.com/v2/1.5.4/enforcement.cd12da708fe6cbe6e068918c38de2ad9.html#476068BF-9607-4799-B53D-966BE98E2B81", + "window__tree_structure": "[[],[[]]]", + "window__location_href": "https://roblox-api.arkoselabs.com/v2/1.5.5/enforcement.fbfc14b0d793c6ef8359e0e4b4a91f67.html#476068BF-9607-4799-B53D-966BE98E2B81", "client_config__sitedata_location_href": "https://www.roblox.com/arkose/iframe", "client_config__surl": "https://roblox-api.arkoselabs.com", "client_config__language": null, "navigator_battery_charging": true, - "audio_fingerprint": (124.04347527516074 + Math.random() * 0.001 - 0.0005).toString(), + "audio_fingerprint": "124.04347527516074" }; function getEnhancedFingerprint(fp, ua, opts) { let fingerprint = { ...baseEnhancedFingerprint }; @@ -286,13 +286,14 @@ function getEnhancedFingerprint(fp, ua, opts) { fingerprint.media_query_dark_mode = Math.random() > 0.9; fingerprint.webgl_hash_webgl = (0, murmur_1.default)(Object.entries(fingerprint).filter(([k, v]) => k.startsWith("webgl_") && k != "webgl_hash_webgl").map(([k, v]) => v).join(","), 0); fingerprint.client_config__language = opts.language || null; - fingerprint.window__location_href = `${opts.surl}/v2/1.5.4/enforcement.cd12da708fe6cbe6e068918c38de2ad9.html#${opts.pkey}`; + fingerprint.window__location_href = `${opts.surl}/v2/1.5.5/enforcement.fbfc14b0d793c6ef8359e0e4b4a91f67.html#${opts.pkey}`; if (opts.site) { fingerprint.document__referrer = opts.site; fingerprint.window__ancestor_origins = [opts.site]; fingerprint.client_config__sitedata_location_href = opts.site; } fingerprint.client_config__surl = opts.surl || "https://client-api.arkoselabs.com"; + fingerprint.audio_fingerprint = (124.04347527516074 + Math.random() * 0.001 - 0.0005).toString(); return Object.entries(fingerprint).map(([k, v]) => ({ key: k, value: v })); } exports.default = { diff --git a/src/api.ts b/src/api.ts index 262cfa0..6582750 100644 --- a/src/api.ts +++ b/src/api.ts @@ -54,7 +54,7 @@ export async function getToken( if (options.site) { options.headers["Origin"] = options.surl - options.headers["Referer"] = `${options.surl}/v2/${options.pkey}/1.5.4/enforcement.${util.random()}.html` + options.headers["Referer"] = `${options.surl}/v2/${options.pkey}/1.5.5/enforcement.fbfc14b0d793c6ef8359e0e4b4a91f67.html` } let ua = options.headers[Object.keys(options.headers).find(v => v.toLowerCase() == "user-agent")] @@ -69,7 +69,7 @@ export async function getToken( public_key: options.pkey, site: options.site ? new URL(options.site).origin : undefined, userbrowser: ua, - capi_version: "1.5.2", + capi_version: "1.5.5", capi_mode: "inline", style_theme: "default", rnd: Math.random().toString(), diff --git a/src/fingerprint.ts b/src/fingerprint.ts index c2c1dc6..4fd43f4 100644 --- a/src/fingerprint.ts +++ b/src/fingerprint.ts @@ -244,8 +244,8 @@ let baseEnhancedFingerprint = { "webgl_vsi_params": "0,31,30,0,31,30,0,31,30", "webgl_fsf_params": "23,127,127,23,127,127,23,127,127", "webgl_fsi_params": "0,31,30,0,31,30,0,31,30", - "webgl_hash_webgl": null, // TODO - "user_agent_data_brands": "Not/A)Brand,Google Chrome,Chromium", + "webgl_hash_webgl": null, + "user_agent_data_brands": "Chromium,Not)A;Brand,Google Chrome", "user_agent_data_mobile": null, "navigator_connection_downlink": null, "navigator_connection_downlink_max": null, @@ -274,13 +274,13 @@ let baseEnhancedFingerprint = { "window__tree_index": [ 0 ], - "window__tree_structure": "[[]]", - "window__location_href": "https://roblox-api.arkoselabs.com/v2/1.5.4/enforcement.cd12da708fe6cbe6e068918c38de2ad9.html#476068BF-9607-4799-B53D-966BE98E2B81", + "window__tree_structure": "[[],[[]]]", + "window__location_href": "https://roblox-api.arkoselabs.com/v2/1.5.5/enforcement.fbfc14b0d793c6ef8359e0e4b4a91f67.html#476068BF-9607-4799-B53D-966BE98E2B81", "client_config__sitedata_location_href": "https://www.roblox.com/arkose/iframe", "client_config__surl": "https://roblox-api.arkoselabs.com", "client_config__language": null, "navigator_battery_charging": true, - "audio_fingerprint": (124.04347527516074 + Math.random() * 0.001 - 0.0005).toString(), + "audio_fingerprint": "124.04347527516074" } function getEnhancedFingerprint(fp: typeof baseFingerprint, ua: string, opts: any) { let fingerprint = { ...baseEnhancedFingerprint }; @@ -300,7 +300,7 @@ function getEnhancedFingerprint(fp: typeof baseFingerprint, ua: string, opts: an fingerprint.webgl_hash_webgl = x64hash128(Object.entries(fingerprint).filter(([k, v]) => k.startsWith("webgl_") && k != "webgl_hash_webgl").map(([k, v]) => v).join(","), 0); fingerprint.client_config__language = opts.language || null; - fingerprint.window__location_href = `${opts.surl}/v2/1.5.4/enforcement.cd12da708fe6cbe6e068918c38de2ad9.html#${opts.pkey}` + fingerprint.window__location_href = `${opts.surl}/v2/1.5.5/enforcement.fbfc14b0d793c6ef8359e0e4b4a91f67.html#${opts.pkey}` if (opts.site) { fingerprint.document__referrer = opts.site; fingerprint.window__ancestor_origins = [opts.site]; @@ -308,6 +308,7 @@ function getEnhancedFingerprint(fp: typeof baseFingerprint, ua: string, opts: an } fingerprint.client_config__surl = opts.surl || "https://client-api.arkoselabs.com"; + fingerprint.audio_fingerprint = (124.04347527516074 + Math.random() * 0.001 - 0.0005).toString(); return Object.entries(fingerprint).map(([k, v]) => ({ key: k, value: v })); } diff --git a/test/roblox.js b/test/roblox.js index 269701f..822e532 100644 --- a/test/roblox.js +++ b/test/roblox.js @@ -60,6 +60,7 @@ undici.request("https://auth.roblox.com/v2/login", { "mismatched-jigsaw", "stairs_walking", "reflection", + "numericalmatch" ].includes(challenge.variant) ) ) {