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

结果

总结

相关推荐
AI探索者2 小时前
LangGraph StateGraph 实战:状态机聊天机器人构建指南
python
AI探索者2 小时前
LangGraph 入门:构建带记忆功能的天气查询 Agent
python
FishCoderh3 小时前
Python自动化办公实战:批量重命名文件,告别手动操作
python
躺平大鹅3 小时前
Python函数入门详解(定义+调用+参数)
python
曲幽5 小时前
我用FastAPI接ollama大模型,差点被asyncio整崩溃(附对话窗口实战)
python·fastapi·web·async·httpx·asyncio·ollama
两万五千个小时8 小时前
落地实现 Anthropic Multi-Agent Research System
人工智能·python·架构
哈里谢顿10 小时前
Python 高并发服务限流终极方案:从原理到生产落地(2026 实战指南)
python
用户8356290780511 天前
无需 Office:Python 批量转换 PPT 为图片
后端·python
markfeng81 天前
Python+Django+H5+MySQL项目搭建
python·django
GinoWi1 天前
Chapter 2 - Python中的变量和简单的数据类型
python