Hyper Solutions SDK -用于Bot保护绕过的TypeScript/JavaScript库(Akamai, Incapsula, Kasada, DataDome)
一个强大的 打印稿/ JavaScript SDK 绕过现代机器人保护系统,包括 Akamai Bot Manager, Incapsula, 卡萨达, DataDome. 生成有效的cookie,解决反机器人挑战,并轻松自动化受保护的端点。
完美的 网页抓取, 自动化, 数据收集 从受保护的网站。
🔑获取API访问
在使用此SDK之前,您需要Hyper Solutions提供的API密钥:
- 访问 hypersolutions.co 创建您的帐户
- 选择你的计划:
- 💳 现收现付制:适合测试和小规模使用
- 📊 订阅计划:高容量应用的成本效益
- 获取API密钥 从仪表板上
- 开始绕过机器人保护 使用这个SDK!
🚀快速入门
import { Session, SensorInput, generateSensorData } from 'hyper-sdk-js';
const session = new Session("your-api-key");
// Generate Akamai sensor data
const result = await generateSensorData(session, new SensorInput(
// sensor input fields
));
console.log(`Generated sensor data: ${result.payload}`);
console.log(`Sensor context: ${result.context}`);
每一个 generate* 函数解析为结果对象(SensorResult, SbsdResult),因此API稍后添加的字段不会破坏您的代码。
客户端提示(Accept-CH)
Sensor, SBSD, Reese84, Kasada payload和DataDome结果携带 clientHints: sec-ch-*, device-memory, dpr, viewport-width, ect, rtt 和 downlink 生成有效负载的设备的标头,由小写标头名称键入,并准备逐字发送。只发送那些网站要求在其 Accept-CH 响应头:
const requested = (response.headers.get("accept-ch") ?? "")
.split(",").map((h) => h.trim().toLowerCase()).filter(Boolean);
const hints = Object.fromEntries(
requested.filter((name) => result.clientHints?.[name] !== undefined)
.map((name) => [name, result.clientHints![name]])
);
clientHints 是 undefined 当API不返回时(Safari用户代理和远程浏览器构建的有效负载)。
✨特性
- 🛡️ Akamai Bot Manager:生成传感器数据,处理像素挑战,验证cookie
- 🔒 Incapsula保护:生成Reese84传感器和UTMVC cookie
- ⚡ 卡萨达绕过:生成有效负载数据(CT)和POW令牌(CD)
- 🎯 DataDome解决方案:解决标签,滑动条验证码和插页挑战
- 🔧 轻松集成简单的TypeScript/JavaScript API,支持async/await
- ⚙️ 灵活的配置:自定义HTTP客户端和会话管理
📦安装
为Node.js/TypeScript安装Hyper Solutions SDK:
npm install hyper-sdk-js
📋目录
🔧基本用法
创建会话
使用API密钥初始化SDK以绕过僵尸程序保护:
import { Session } from 'hyper-sdk-js';
// Basic session
const session = new Session("your-api-key");
// Advanced session with custom configuration
const session = new Session(
"your-api-key",
"your-jwt-key",
"your-app-key",
"your-app-secret",
customRequestOptions
);
检查使用情况
getUsage 返回密钥的现收现付余额和每个计划的剩余请求。它不被算作使用。
import { getUsage } from 'hyper-sdk-js';
const usage = await getUsage(session);
console.log(`balance: €${usage.balanceEuro}`);
for (const plan of usage.plans) {
console.log(`${plan.product}: ${plan.requestsRemaining} of ${plan.requestsQuota} left, expires ${plan.expiresAt}`);
}
🛡️Akamai Bot Manager
绕过 Akamai Bot Manager 保护传感器数据生成,cookie验证和挑战解决。
生成传感器数据
生成有效的传感器数据 Akamai饼干 机器人检测绕过:
import { SensorInput, generateSensorData } from 'hyper-sdk-js';
const result = await generateSensorData(session, new SensorInput(
// sensor input fields
));
解析脚本路径
从HTML中提取Akamai Bot Manager脚本路径:
import { parseAkamaiPath } from 'hyper-sdk-js';
const scriptPath = parseAkamaiPath(htmlContent);
处理Sec-Cpt挑战
解决 sec-cpt挑战 内置解析和有效负载生成:
import { parseChallengeHTML, parseChallengeJSON } from 'hyper-sdk-js';
// Parse sec-cpt challenge from HTML
const challenge = parseChallengeHTML(htmlContent);
// Or parse from JSON response
const challenge = parseChallengeJSON(jsonResponse);
// Generate challenge response payload
if (challenge?.cryptoChallenge) {
const payload = challenge.cryptoChallenge.generatePayload(secCptCookie);
}
// Handle challenge timing requirements
await challenge?.wait();
Cookie验证
验证 Akamai - abback饼干 session表示:
import { isAkamaiCookieValid, isAkamaiCookieInvalidated } from 'hyper-sdk-js';
// Check if cookie is valid for the current request count
const isValid = isAkamaiCookieValid(cookieValue, requestCount);
// Check if cookie has been invalidated and needs refresh
const needsRefresh = isAkamaiCookieInvalidated(cookieValue);
解决像素挑战
处理 Akamai像素挑战 对于高级机器人检测旁路:
import {
PixelInput,
generatePixelData,
parsePixelHtmlVar,
parsePixelScriptUrl,
parsePixelScriptVar
} from 'hyper-sdk-js';
// Parse pixel challenge data
const htmlVar = parsePixelHtmlVar(htmlContent);
const scriptUrls = parsePixelScriptUrl(htmlContent);
const scriptVar = parsePixelScriptVar(scriptContent);
// Generate pixel data
const result = await generatePixelData(session, new PixelInput(
// pixel input fields
));
// result.payload is the pixel data
解决SBSD挑战
为专门的Akamai挑战生成SBSD数据;
import { SbsdInput, generateSbsdPayload } from 'hyper-sdk-js';
const result = await generateSbsdPayload(session, new SbsdInput(
// sbsd input fields; the optional last argument, scriptUrl, is the
// absolute src of the SBSD script tag, query included
));
// POST result.payload; pass result.context in the next SbsdInput instead of the script.
// A hard block (an SBSD POST with a `t` parameter) always sends the script with an
// empty context, never one from an earlier request.
🔒Incapsula Protection
绕过 胶囊机器人检测 与Reese84传感器和UTMVC cookie生成。
生成Reese84传感器
创建 Reese84传感器数据 Incapsula旁路治疗:
import { Reese84Input, generateReese84Sensor } from 'hyper-sdk-js';
const result = await generateReese84Sensor(session, new Reese84Input(
// reese84 input fields
));
// result.payload is the sensor, result.clientHints the Accept-CH headers
UTMVC Cookie生成
生成 UTMVC饼干 用于Incapsula保护旁路:
import { UtmvcInput, generateUtmvcCookie } from 'hyper-sdk-js';
const result = await generateUtmvcCookie(session, new UtmvcInput(
// utmvc input fields
));
const utmvcCookie = result.payload;
const swhanedl = result.swhanedl;
脚本路径解析
解析 UTMVC脚本路径 并生成提交路径:
import {
parseUtmvcScriptPath,
generateUtmvcScriptPath,
getSessionIds,
isSessionCookie
} from 'hyper-sdk-js';
// Parse script path from content
const scriptPath = parseUtmvcScriptPath(scriptContent);
// Generate unique submit path
const submitPath = generateUtmvcScriptPath();
// Extract session IDs from cookies
const sessionIds = getSessionIds(cookies);
动态Reese脚本解析
从中断页面解析动态Reese84脚本路径:
import { parseDynamicReeseScript } from 'hyper-sdk-js';
const result = parseDynamicReeseScript(htmlContent, "https://example.com");
console.log(result.sensorPath, result.scriptPath);
⚡Kasada旁路
失败 Kasada Bot经理 有效载荷生成和POW求解。
生成有效载荷数据(CT)
创建 x-kpsdk-ct令牌 Kasada旁路:
import { KasadaPayloadInput, generateKasadaPayload } from 'hyper-sdk-js';
const result = await generateKasadaPayload(session, new KasadaPayloadInput(
// kasada payload input fields; the optional last argument, strict, refuses
// a payload built on a signal the API cannot identify yet instead of
// returning one built on a guess (off by default)
));
// POST the base64-decoded result.payload to /tl with the x-kpsdk-* values in result.headers.
// result.clientHints are the Accept-CH headers: send only the ones the site asked for.
战俘数据生成(CD)
解决 卡萨达Proof-of-Work x-kpsdk-cd令牌的挑战:
import { KasadaPowInput, generateKasadaPow } from 'hyper-sdk-js';
const result = await generateKasadaPow(session, new KasadaPowInput(
// kasada pow input fields
));
// result.payload is the x-kpsdk-cd value
脚本路径提取
提取 Kasada脚本路径 从阻塞页面(HTTP 429):
import { parseKasadaPath } from 'hyper-sdk-js';
const scriptPath = parseKasadaPath(blockedPageHtml);
// Returns: /ips.js?timestamp=...
移动用户代理生成
生成 卡萨达移动 user-agent 在原生应用流上发送的值。移动SDK将其派生为的小写十六进制MD5 "<osVersion> / <bundleId> <appVersion>":
import { generateKasadaUserAgent } from 'hyper-sdk-js';
const userAgent = generateKasadaUserAgent({
osVersion: '18.0.1', // iOS: UIDevice.systemVersion; Android: Build.VERSION.SDK_INT
bundleId: 'com.example.app', // iOS: CFBundleIdentifier; Android: package name
appVersion: '9.15.0',
});
// Returns: 7016adc4ba8d433533954ebad33be424
可以在 hyper-sdk-js 4.1.0及更高版本。
移动x-kpsdk-dv一代
在iOS上,Kasada SDK (x-kpsdk-v 我2。X)也发送一个 x-kpsdk-dv 使用与user-agent相同的值,加上模型标识符,并传递与 dv 在有效载荷请求上,所以有效载荷是在带有该型号屏幕和iOS版本的iPhone上生成的:
import { KasadaPayloadInput, generateKasadaDv, generateKasadaUserAgent } from 'hyper-sdk-js';
const device = {
osVersion: '18.0.1',
hardwareId: 'iPhone13,2', // utsname.machine: "iPhone13,2" is an iPhone 12
bundleId: 'com.example.app',
appVersion: '9.15.0',
};
const userAgent = generateKasadaUserAgent(device);
const dv = generateKasadaDv(device);
const result = await generateKasadaPayload(session, new KasadaPayloadInput(
userAgent, ipsLink, script, ip, 'en-US,en;q=0.9',
false, // strict
dv, // the x-kpsdk-dv value you send to the site
));
可以在 hyper-sdk-js 5.2.0及更高版本。
🎯DataDome Solutions
解决 DataDome验证码 包括滑块挑战和插页。
解决间隙挑战
绕过 DataDome插页:
import {
InterstitialInput,
generateInterstitialPayload,
parseInterstitialDeviceCheckUrl
} from 'hyper-sdk-js';
// Parse device check URL
const deviceUrl = parseInterstitialDeviceCheckUrl(htmlContent, datadomeCookie, refererUrl);
// Generate interstitial payload
const result = await generateInterstitialPayload(session, new InterstitialInput(
// interstitial input fields
));
// POST result.payload to https://geo.captcha-delivery.com/interstitial/
// result.clientHints are the Accept-CH headers for the device
滑块验证码解决
解决 DataDome滑块验证码 自动:
import {
SliderInput,
generateSliderPayload,
parseSliderDeviceCheckUrl
} from 'hyper-sdk-js';
// Parse device check URL
const parseResult = parseSliderDeviceCheckUrl(htmlContent, datadomeCookie, refererUrl);
if (parseResult.isIpBanned) {
console.log("IP is banned");
} else {
// Generate slider payload
const result = await generateSliderPayload(session, new SliderInput(
// slider input fields
));
// GET request to result.payload (the check URL)
// result.clientHints are the Accept-CH headers for the device
}
挑战脚本
DataDome有时会在自己的文件中提供带有挑战脚本的挑战页面,而不是 将其内联到页面中:
<script defer src="https://ct.captcha-delivery.com/interstitial.1.33.0.202609141.js"></script>
它根据每个请求在两个表单之间切换,因此检查每个挑战页面而不是
配置一次。当页面使用它自己的文件时,使用您自己的客户端获取该URL
请求保留您的代理,TLS指纹和头,然后传递响应体作为结尾
script 论点。SDK不会为你获取它。
import {
InterstitialInput,
generateInterstitialPayload,
parseChallengeScriptUrl
} from 'hyper-sdk-js';
let script: string | undefined;
const scriptUrl = parseChallengeScriptUrl(htmlContent);
if (scriptUrl !== null) {
script = await (await fetch(scriptUrl)).text();
}
const result = await generateInterstitialPayload(session, new InterstitialInput(
userAgent, deviceUrl, htmlContent, ip, acceptLanguage,
script // leave it out when the page inlines the script
));
相同的帮助器覆盖滑动条验证码页面,其中 script 后面的参数是
SliderInput. 它在两者中都是可选的,因此现有代码保持不变。
标签有效载荷生成
生成 DataDome标记有效负载:
import { TagsInput, generateTagsPayload } from 'hyper-sdk-js';
const result = await generateTagsPayload(session, new TagsInput(
// tags input fields
));
// result.payload is the tags payload
📖文档
有关如何使用SDK的详细文档,包括示例和API参考,请访问我们的文档网站:
https://docs.hypersolutions.co/
得到帮助
🤝贡献
如果您发现任何问题或有改进建议,请打开issue或提交pull request。
📄许可证
本SDK在 麻省理工学院的许可。
关键字: TypeScript SDK, JavaScript SDK, Node.js, bot保护绕过,网页抓取,Akamai绕过,Incapsula绕过,Kasada绕过,DataDome绕过,反bot, captcha求解器,自动化,逆向工程,bot检测,web自动化