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

结果

总结

相关推荐
傻乐u兔2 小时前
C语言初阶————调试实用技巧1
c语言·开发语言
dagouaofei2 小时前
AI PPT 工具怎么选?5个维度对比6款产品
人工智能·python·powerpoint
深蓝电商API2 小时前
Scrapy日志系统详解与生产环境配置
爬虫·python·scrapy
Sammyyyyy2 小时前
Gemini CLI 进阶:构建安全的MCP连接与验证策略
开发语言·ai·ai编程·servbay
Irene.ll2 小时前
DAY25 异常处理
python
老蒋每日coding2 小时前
驾驭并发之力:Go语言构建高可用微服务完全指南
开发语言·微服务·golang
努力学习的小洋2 小时前
Python训练打卡Day4:缺失值处理
开发语言·python
郝学胜-神的一滴2 小时前
Python类属性与实例属性详解及MRO算法演进
开发语言·python·程序人生·算法
一颗青果2 小时前
短线重连代码实现
开发语言·网络·c++