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

结果

总结

相关推荐
张3蜂13 小时前
Gunicorn深度解析:Python WSGI服务器的王者
服务器·python·gunicorn
睡美人的小仙女12718 小时前
Threejs加载环境贴图报错Bad File Format: bad initial token
开发语言·javascript·redis
rayufo18 小时前
【工具】列出指定文件夹下所有的目录和文件
开发语言·前端·python
RANCE_atttackkk18 小时前
[Java]实现使用邮箱找回密码的功能
java·开发语言·前端·spring boot·intellij-idea·idea
缺点内向19 小时前
C#编程实战:如何为Word文档添加背景色或背景图片
开发语言·c#·自动化·word·.net
一起养小猫19 小时前
Flutter for OpenHarmony 实战:记账应用数据统计与可视化
开发语言·jvm·数据库·flutter·信息可视化·harmonyos
zhougl99619 小时前
Java 所有关键字及规范分类
java·开发语言
Python 老手19 小时前
Python while 循环 极简核心讲解
java·python·算法
java1234_小锋19 小时前
Java高频面试题:MyISAM索引与InnoDB索引的区别?
java·开发语言
2501_9445255420 小时前
Flutter for OpenHarmony 个人理财管理App实战 - 支出分析页面
android·开发语言·前端·javascript·flutter