基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cdxiaodong/cain-agent --skill open-redirect命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
XSS 测试技能 —— 面向真实业务系统,区分渲染上下文(HTML/属性/JS/CSS/URL),覆盖存储型/反射型/DOM 型,对抗 CSP 与输入过滤,产出可复现 PoC
SSRF 测试技能,覆盖盲 SSRF、内网可达性与七类主流云元数据服务的低影响验证
文件包含检测技能 —— 面向真实业务系统,定位接收文件路径参数的端点(页面渲染/模板加载/配置导入),通过注入路径遍历和 URL 参数探测应用是否未过滤用户输入的文件路径,验证 LFI(本地文件包含)和 RFI(远程文件包含)漏洞,产生可复现 PoC
| name | open-redirect |
| description | 开放重定向检测技能 —— 面向重定向端点,定位未验证目标 URL 参数的端点,通过构造恶意 URL(redirect=//evil.com)诱导用户跳转到钓鱼站点,产生可复现 PoC |
| phase | test |
| severity_focus | medium |
定位:面向重定向功能的开放重定向漏洞,不是简单的外链检测。核心在于「识别哪些参数控制重定向目标」并「证明攻击者可构造 URL 诱导用户跳转到恶意站点」—— 重点检测 URL 参数验证缺失(redirect/url/next/login),而非正常的站内跳转。
开放重定向(Open Redirect)的本质是:Web 应用在执行重定向操作时,直接使用用户输入的 URL 参数作为跳转目标,未验证其是否为合法的站内地址,导致攻击者可构造恶意 URL 诱导用户跳转到钓鱼网站。
redirect、url、next、target、return、return_to、returnUrl、goto、link、destination 等参数,直接使用其值作为 Location 头的值。
/login?redirect=https://evil.com/phishing → Location: https://evil.com/phishing/ 开头(可被 //evil.com 绕过)。/ 开头,攻击者使用 //evil.com(协议相对 URL)绕过检查。target.com),攻击者使用 evil.com?target.com 或 target.com.evil.com 绕过。关键判断依据:提交外部 URL 作为重定向参数后,响应头 Location 指向攻击者控制的域名,且用户访问该 URL 后会被自动跳转到恶意站点。
满足以下任一信号即应进入本技能(侦查阶段 endpoints.json 标注了候选开放重定向端点):
redirect、url、next、return、return_to、returnUrl、goto、link、target、destination、callback、forward、continue、ref。Location 头。window.location=、location.href=、location.replace() 等跳转代码,且跳转目标可由用户输入控制。流程:重定向端点识别 → 参数提取 → 注入测试 URL → 验证 Location 头 → 构造钓鱼 PoC
Location 头。redirect、url、next、return 等)。核心验证动作——证明「参数控制重定向目标」。
测试外部域名:在重定向参数中提交外部域名,观察 Location 头:
?redirect=https://evil.com
?url=http://attacker.com
?next=//evil.com
?return_to=//malicious.site
成功判断:
Location 的值为注入的外部域名。若被拒绝:尝试不同的 Payload 格式(相对路径、协议相对 URL、编码绕过)。
当基础测试被拦截时,尝试绕过方法。
相对路径绕过:
?next=//evil.com
?redirect=/\\/evil.com
?url=/%2Fevil.com
子域名绕过:
?redirect=https://evil.com?target.com
?url=https://target.com.evil.com
?next=https://evil.com#target.com
URL 编码绕过:
?redirect=https://%65%76%69%6c%2e%63%6f%6d
?url=https%3A%2F%2Fevil.com
CRLF 注入(可结合 XSS):
?redirect=https://target.com%0d%0aLocation:%20https://evil.com
@ 符号绕过:
?redirect=https://target.com@evil.com
?url=//evil.com%40target.com
确认漏洞后,构造钓鱼 URL 证明攻击者可诱导用户跳转到恶意站点。
基础钓鱼 URL:
https://target.com/login?redirect=https://evil.com/phishing
隐藏真实目标(使用 URL 缩短服务或域名相似):
https://target.com/login?redirect=https://evil.com/verify-account
https://target.com/logout?next=//evil.com/login
结合 OAuth 诈骗:
https://target.com/oauth/authorize?client_id=attacker&redirect_uri=https://evil.com/steal-token
对齐 DESIGN §3.1:L1 快速筛选候选 → L2 确认可利用 → L3 测试绕过方法
目标:快速识别哪些端点和参数存在开放重定向,不做完整绕过测试。
redirect、url、next 等)。https://evil.com,观察 Location 头是否直接跳转。目标:对 L1 筛选出的候选点,通过多格式 Payload 确认开放重定向存在。
https://evil.com、//evil.com、http://evil.com 等多种格式。目标:当基础检测被拦截时,测试绕过方法。
evil.com?target.com、target.com.evil.com 等格式。# 基础开放重定向检测(跟随重定向)
curl -L 'https://target.com/login?redirect=https://evil.com'
# 查看响应头(不跟随重定向)
curl -I 'https://target.com/login?redirect=https://evil.com'
# 测试多种参数名
curl -I 'https://target.com/logout?next=https://evil.com'
curl -I 'https://target.com/auth?return_to=https://evil.com'
curl -I 'https://target.com/share?url=https://evil.com'
# 测试相对路径绕过
curl -I 'https://target.com/login?next=//evil.com'
curl -I 'https://target.com/continue?redirect=/\\/evil.com'
# 测试 URL 编码绕过
curl -I 'https://target.com/login?redirect=https://%65%76%69%6c%2e%63%6f%6d'
# 测试 @ 符号绕过
curl -I 'https://target.com/login?redirect=https://target.com@evil.com'
# 查看 JavaScript 跳转
curl 'https://target.com/page?link=evil.com' | grep -i 'location'
Location 的值是否为外部域名。Location 头。每个确认的开放重定向漏洞按以下 Finding 结构输出(result 初值 validation_inconclusive,留待校验流水线):
{
"id": "OPEN-REDIRECT-001",
"type": "open-redirect",
"severity": "medium",
"status": "confirmed",
"result": "validation_inconclusive",
"title": "登录接口存在开放重定向漏洞,可诱导用户跳转到钓鱼站点",
"endpoint": "GET /login",
"description": "该端点的 redirect 参数未验证目标 URL 是否为站内地址,攻击者可构造 https://target.com/login?redirect=https://evil.com/phishing 诱导用户跳转到钓鱼网站,窃取用户凭证",
"payload": {
"method": "GET",
"url": "/login",
"parameter": "redirect",
"payload": "https://evil.com/phishing",
"location_header": "https://evil.com/phishing"
什么才算确认开放重定向(禁止仅凭「参数名可疑」下结论,要证明重定向实际发生):
Location 指向外部域名,这是核心判据。//evil.com、子域名绕过),需记录具体的绕过 Payload。