XSS (Cross-Site Scripting) is a type of security vulnerability that allows an attacker to inject malicious code (usually JavaScript) into a website or web application. This code then runs in the browser of other users who visit the site.
Because it lets attackers:
- Steal cookies, session tokens, or personal data
- Trick users into clicking fake buttons or links (phishing)
- Deface the website or redirect users elsewhere
- Hijack user accounts or perform actions on their behalf
It usually happens when a website:
-
Takes user input (like in a search box or comment field)
-
Displays it back on the page without properly cleaning it
-
So an attacker can input something like:
<script>alert('XSS')</script>
and get xss triggered!
This project is a hands-on web security lab designed to help learners understand and exploit the three major types of Cross-Site Scripting (XSS) vulnerabilities: 🔁 Reflected, 🗃️ Stored, and 🧠 DOM-Based XSS.
🚀 Project Structure TRY NOW!
The lab is divided into diffrent escalating levels of difficulty:
Focus: Introduces how unfiltered user input is executed as code.
-
Users can enter simple scripts like:
<script>alert(87)</script>
-
Demonstrates:
- Basic reflected XSS (via query parameters or form input)
- Stored XSS (through input saved and re-displayed)
- A basic example of DOM-based XSS
-
Suitable for beginners to understand how careless input handling results in direct script execution.
Focus: Teaches bypassing more complex filters and escaping HTML contexts.
-
Requires crafted payloads such as:
"><script>alert(87)</script>
-
Demonstrates:
- How XSS works when injection occurs inside HTML attributes, tags, or JS contexts
- DOM manipulation vulnerabilities where user input is processed via JavaScript (e.g.,
location.hash,innerHTML,document.write)
-
Helps learners practice breaking out of quotes, attributes, or tags — simulating real-world attack scenarios.
By completing these labs, users will:
- Understand the differences between Reflected, Stored, and DOM-based XSS
- Learn to identify vulnerable input/output handling
- Gain hands-on experience with payload crafting and context-based escaping
- Improve awareness of secure coding best practices
This lab is intended strictly for educational purposes. Do not attempt these techniques on any live websites or systems without explicit permission.
We’re building this XSS Lab for learners, web security explorers, and curious minds — and you can help make it even better!
- Add new XSS levels or challenges (Reflected / Stored / DOM-based)
- Suggest new payloads or bypass techniques
- Fix bugs or write better explanations
- Fork the project on GitHub
- Make your changes
- Submit a Pull Request
- We’ll review and merge!
💡 No idea is too small. Whether it’s a typo fix or a new lab — every contribution counts.
This project was crafted with ⚔️ passion and 💻 precision by:
We built this lab to help others learn, break, and secure — because the best way to defend the web is to understand how it’s broken.
🙏 Special thanks to the community of web security explorers and learners who inspire us to push boundaries, ask better questions, and share knowledge freely.