vercel 安全检测逆向 x-vercel-challenge-solution

声明:

本文章中所有内容仅供学习交流使用,不用于其他任何目的,抓包内容、敏感网址、数据接口等均已做脱敏处理,严禁用于商业用途和非法用途,否则由此产生的一切后果均与作者无关!
部分python代码

复制代码
def get_headers_via_subprocess(token):
    """
    通过 subprocess 调用 Node.js 脚本获取 headers
    """
    try:
        # 运行 Node.js 脚本
        result = subprocess.run(
            ['node', 'run.js', token],
            capture_output=True,
            text=True,
            timeout=30  # 设置超时
        )

        # 检查执行结果
        if result.returncode == 0:
            # 解析 JSON 输出
            output = json.loads(result.stdout.strip())
            return output['result']
        else:
            print(f"Error: {result.stderr}")
            return None

    except subprocess.TimeoutExpired:
        print("Subprocess execution timed out")
        return None
    except Exception as e:
        print(f"Failed to execute subprocess: {e}")
        return None


solution = get_headers_via_subprocess(token)

print(solution)
status_code = self._submit_solution(url, token, solution)
复制代码
base_url = url.rstrip('/')
self.session.headers.update({
    'accept': '*/*',
    'connection': 'keep-alive',
    'origin': base_url,
    'referer': f'{base_url}/.well-known/vercel/security/static/challenge.v2.min.js',
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'same-origin',
    'x-vercel-challenge-solution': solution,
    'x-vercel-challenge-token': token,
    'x-vercel-challenge-version': '2',
})
response = self.session.post(f'{base_url}/.well-known/vercel/security/request-challenge')
return response.status_code

结果

总结

相关推荐
hoiii1873 分钟前
CSTR反应器模型的Simulink-PID仿真(MATLAB实现)
开发语言·matlab
王夏奇9 分钟前
python中的__all__ 具体用法
java·前端·python
王夏奇13 分钟前
pycharm中3种不同类型的python文件
ide·python·pycharm
炘爚35 分钟前
C++ 右值引用与程序优化
开发语言·c++
小陈的进阶之路1 小时前
Selenium 滑动 vs Appium 滑动
python·selenium·测试工具·appium
Mike_6661 小时前
txt_json和xml_json
xml·python·json
si莉亚1 小时前
ROS2安装EVO工具包
linux·开发语言·c++·开源
清心歌1 小时前
CopyOnWriteArrayList 实现原理
java·开发语言
zyq99101_11 小时前
DFS算法实战:经典例题代码解析
python·算法·蓝桥杯·深度优先
数据知道1 小时前
claw-code 源码分析:从 TypeScript 心智到 Python/Rust——跨栈移植时类型、边界与错误模型怎么对齐?
python·ai·rust·typescript·claude code·claw code