मुख्य सामग्री पर जाएँ
Skillpedia
टेस्टिंग35k · #8381

testing-cors-misconfiguration

यह क्या करती है

यह टूल वेबसाइट्स में उन सुरक्षा खामियों को ढूंढता है जिनमें कोई साइट दूसरी साइटों को अपना डेटा एक्सेस करने देती है। यह जांचता है कि क्या कोई साइट गलत तरीके से संवेदनशील जानकारी दूसरी साइटों को दे रही है, जिससे डेटा या credentials चुराए जा सकते हैं।

कब इस्तेमाल करें

  • ✓वेबसाइट APIs की सुरक्षा टेस्ट करते समय।
  • ✓जब कोई वेबसाइट अलग-अलग domains के बीच access permissions इस्तेमाल करती हो।
  • ✓यह जांचने के लिए कि क्या यूज़र का डेटा दूसरी वेबसाइटों से चोरी हो सकता है।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-cors-misconfiguration/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“जांचो कि क्या मेरी वेबसाइट का API दूसरी साइटों को user profile का डेटा पढ़ने देता है, भले ही cookies मौजूद हों।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह टूल दूसरी वेबसाइटों की तरफ़ से टारगेट साइट पर रिक्वेस्ट भेजने की नकल करता है और जवाबों को देखता है। यह ऐसी गलत settings ढूंढता है जिनसे वह डेटा खुल जाता है जो सार्वजनिक नहीं होना चाहिए।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Testing CORS Misconfiguration

When to Use

  • During authorized penetration tests when assessing API endpoints for cross-origin access controls
  • When testing single-page applications that make cross-origin API requests
  • For evaluating whether sensitive data can be exfiltrated from a victim's browser session
  • When assessing microservice architectures with multiple domains sharing data
  • During security audits of applications using CORS headers for cross-domain communication

Prerequisites

  • Authorization: Written penetration testing agreement for the target
  • Burp Suite Professional: For intercepting and modifying Origin headers
  • Browser with DevTools: For observing CORS behavior in real browser context
  • Attacker web server: For hosting CORS exploitation PoC pages
  • curl: For manual CORS header testing
  • Python HTTP server: For hosting exploit pages locally

Workflow

Step 1: Identify CORS Configuration on Target Endpoints

Check all API endpoints for CORS response headers.

# Test with a foreign Origin header
curl -s -I \
  -H "Origin: https://evil.example.com" \
  "https://api.target.example.com/api/user/profile"

# Check for CORS headers in response:
# Access-Control-Allow-Origin: https://evil.example.com  (BAD: reflects any origin)
# Access-Control-Allow-Origin: *  (BAD if with credentials)
# Access-Control-Allow-Credentials: true  (allows cookies)
# Access-Control-Allow-Methods: GET, POST, PUT, DELETE
# Access-Control-Allow-Headers: Authorization, Content-Type
# Access-Control-Expose-Headers: X-Custom-Header

# Test multiple endpoints
for endpoint in /api/user/profile /api/user/settings /api/transactions \
  /api/admin/users /api/account/balance; do
  echo "=== $endpoint ==="
  curl -s -I \
    -H "Origin: https://evil.example.com" \
    "https://api.target.example.com$endpoint" | \
    grep -i "access-control"
  echo
done

Step 2: Test Origin Reflection and Validation Bypass

Determine how the server validates the Origin header.

# Test 1: Arbitrary origin reflection
curl -s -I -H "Origin: https://evil.com" \
  "https://api.target.example.com/api/user/profile" | grep -i "access-control-allow-origin"

# Test 2: Null origin
curl -s -I -H "Origin: null" \
  "https://api.target.example.com/api/user/profile" | grep -i "access-control-allow-origin"

# Test 3: Subdomain matching bypass
curl -s -I -H "Origin: https://evil.target.example.com" \
  "https://api.target.example.com/api/user/profile" | grep -i "access-control-allow-origin"

# Test 4: Prefix/suffix matching bypass
curl -s -I -H "Origin: https://target.example.com.evil.com" \
  "https://api.target.example.com/api/user/profile" | grep -i "access-control-allow-origin"

curl -s -I -H "Origin: https://eviltarget.example.com" \
  "https://api.target.example.com/api/user/profile" | grep -i "access-control-allow-origin"

# Test 5: Protocol downgrade
curl -s -I -H "Origin: http://target.example.com" \
  "https://api.target.example.com/api/user/profile" | grep -i "access-control-allow-origin"

# Test 6: Special characters in origin
curl -s -I -H "Origin: https://target.example.com%60.evil.com" \
  "https://api.target.example.com/api/user/profile" | grep -i "access-control-allow-origin"

# Test 7: Wildcard with credentials check
curl -s -I -H "Origin: https://evil.com" \
  "https://api.target.example.com/api/public" | grep -iE "access-control-allow-(origin|credentials)"
# Wildcard (*) + credentials (true) is invalid per spec but some servers misconfigure

Step 3: Test Preflight Request Handling

Assess how the server handles OPTIONS preflight requests.

# Send preflight request
curl -s -I -X OPTIONS \
  -H "Origin: https://evil.example.com" \
  -H "Access-Control-Request-Method: PUT" \
  -H "Access-Control-Request-Headers: Authorization, Content-Type" \
  "https://api.target.example.com/api/user/profile"

# Check:
# Access-Control-Allow-Methods: should only list needed methods
# Access-Control-Allow-Headers: should only list needed headers
# Access-Control-Max-Age: preflight cache duration (long = risky)

# Test if dangerous methods are allowed
curl -s -I -X OPTIONS \
  -H "Origin: https://evil.example.com" \
  -H "Access-Control-Request-Method: DELETE" \
  "https://api.target.example.com/api/user/profile" | \
  grep -i "access-control-allow-methods"

# Test if preflight is cached too long
curl -s -I -X OPTIONS \
  -H "Origin: https://evil.example.com" \

…
अक्सर पूछे जाने वाले सवाल

CORS क्या है?

CORS (Cross-Origin Resource Sharing) एक ऐसा तरीका है जिससे कोई वेबसाइट दूसरे domain से resources (जैसे API का डेटा) मांग सकती है। यह सुरक्षा के लिए बना है, लेकिन इसकी settings गलत हो सकती हैं।

'misconfiguration' का क्या मतलब है?

इसका मतलब है गलत setting। CORS के मामले में इसका मतलब है कि साइटों के बीच access के नियम ज़रूरत से ज़्यादा ढीले रखे गए हैं, जिससे सुरक्षा में छेद बन जाते हैं।

CORS misconfiguration के क्या खतरे हैं?

हमलावर इस कमज़ोरी से यूज़र की संवेदनशील जानकारी चुरा सकता है, जैसे authentication tokens, निजी डेटा या credentials, और यूज़र को इसका पता भी नहीं चलता।

जानकारी

लेखक का मूल विवरण

Identifying and exploiting Cross-Origin Resource Sharing misconfigurations that allow unauthorized cross-domain data access and credential theft during security assessments.

repo: mukul975/Anthropic-Cybersecurity-Skills

लोकप्रियता

GitHub स्टार
35k
रैंकिंग में स्थान
#8381
लाइसेंस
Apache-2.0
अपडेट की गई
31/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills