Skip to content

cysec-don/XSS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SpectreLab - XSS Playground

An intentionally vulnerable web application for learning Cross-Site Scripting (XSS) through hands-on practice β€” with 5 difficulty levels, database reset, progress tracking, and social media sharing.

Author: Cysec Don (cysecdon@gmail.com)


⚠️ DISCLAIMER

This application is INTENTIONALLY VULNERABLE. It is designed for educational purposes only. DO NOT deploy this application on a public-facing server or any network accessible by unauthorized users. Use only in isolated, local environments for security training and research.


What's New in v2.0

πŸ‘» Renamed to SpectreLab

The lab is now SpectreLab β€” because XSS attacks are like ghosts: invisible, persistent, and they haunt your application. New ghost-themed branding with a πŸ‘» logo.

🎚️ 5 Difficulty Levels Per XSS Type

Every vulnerability type has 5 progressive difficulty levels:

Level Name What It Means
L1 😊 Easy No filtering. Raw injection. Just type and win.
L2 πŸ€” Medium Basic keyword/tag blocking. Find an alternative vector.
L3 😰 Hard Multiple filters applied. Think outside the attribute.
L4 πŸ”₯ Expert Aggressive sanitization or context-switching. Exploit edge cases.
L5 πŸ’€ Insane Full CSP + strict sanitization. Only advanced bypasses work.

πŸ—‘οΈ Database Reset

Reset button in the navbar clears all comments and profiles instantly.

πŸ“€ Share Progress to Social Media

Beat a level? Share your achievement directly to:

  • X (Twitter) β€” Tweet your conquest
  • LinkedIn β€” Show your cybersecurity skills to your network
  • Facebook β€” Share with friends
  • Reddit β€” Post to r/cybersecurity or r/netsec
  • WhatsApp β€” Share to your study group
  • Telegram β€” Send to your infosec channel
  • Copy Link β€” Copy your progress text to clipboard

πŸ† Progress Dashboard

A dedicated /progress page shows:

  • Overall completion bar (0/15 levels)
  • Per-type breakdown with level status
  • Quick-share buttons for each level
  • Reset progress option

Quick Start

Option 1: Docker (Recommended)

git clone https://github.com/cysec-don/XSS.git
cd XSS
docker compose up -d

# SpectreLab is now running at http://localhost:3001

Option 2: Node.js (Local)

git clone https://github.com/cysec-don/XSS.git
cd XSS
npm install
npm start

Application Structure

XSS/
β”œβ”€β”€ server.js              # Express server with levels + social sharing
β”œβ”€β”€ package.json           # Node.js project config
β”œβ”€β”€ public/
β”‚   └── css/
β”‚       └── style.css      # Dark theme + level UI + share buttons
β”œβ”€β”€ Dockerfile             # Docker build (renamed to spectrelab)
β”œβ”€β”€ docker-compose.yml     # Docker Compose deployment
β”œβ”€β”€ .dockerignore
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
└── README.md

Difficulty Levels β€” Detailed Breakdown

πŸ” Reflected XSS (Search Page)

Level Name Defense How to Bypass
L1 😊 Easy No filtering <script>alert(1)</script>
L2 πŸ€” Medium "script" keyword blocked <img src=x onerror=alert(1)>
L3 😰 Hard All on* event handlers stripped <a href="javascript:alert(1)"> or <iframe srcdoc>
L4 πŸ”₯ Expert Angle brackets encoded; input also in JS string Break out of JS string: ';alert(1);//
L5 πŸ’€ Insane CSP + encoded brackets + JS escaped JSONP endpoint: /api/callback?cb=alert//

πŸ’¬ Stored XSS (Comments Page)

Level Name Defense How to Bypass
L1 😊 Easy No sanitization <script>alert(1)</script>
L2 πŸ€” Medium <script> stripped <img onerror=...>
L3 😰 Hard <script> + on* stripped <iframe srcdoc='...'>
L4 πŸ”₯ Expert DOMPurify-lite <svg onload=...>
L5 πŸ’€ Insane Full DOMPurify + CSP mXSS / script gadgets

🎯 DOM-Based XSS (Profile Page)

Level Name Defense How to Bypass
L1 😊 Easy innerHTML β€” no filter #<img src=x onerror=...>
L2 πŸ€” Medium Script + on* stripped before innerHTML #<a href="javascript:...">
L3 😰 Hard Angle brackets encoded (broken SVG exception) #<svg onload=...>
L4 πŸ”₯ Expert textContent + eval(calc:...) #calc:alert(1)
L5 πŸ’€ Insane CSP + textContent + postMessage no origin check Send postMessage from another origin

Social Media Sharing

How It Works

  1. Beat a level by successfully executing an XSS payload
  2. Click "βœ… Mark Completed" in the level selector
  3. Click "πŸ“€ Share Progress" to reveal social media buttons
  4. Choose your platform β€” a pre-filled post opens with your achievement
  5. Alternatively, visit the πŸ† Progress page to see all your completions and share from there

Share Text Format

πŸ” SpectreLab | I conquered Reflected XSS Level 3: Hard! πŸš€

Can you beat it? πŸ‘‰ https://github.com/cysec-don/XSS

#SpectreLab #XSS #Cybersecurity #InfoSec #WebSecurity #EthicalHacking

Supported Platforms

Platform Share Method Hashtag Support
X (Twitter) Intent URL with pre-filled text βœ…
LinkedIn Share-offsite URL with summary βœ…
Facebook Sharer dialog with quote βœ…
Reddit Submit with title βœ…
WhatsApp wa.me with pre-filled text βœ…
Telegram t.me share URL with text βœ…
Copy Link Clipboard API with toast notification βœ…

Progress Tracking

Progress is tracked in your browser's localStorage (no server-side tracking). This means:

  • Your progress persists across page refreshes
  • Progress is per-browser (not per-account)
  • Clear your browser data to reset progress
  • Or use the "Reset Progress" button on the Progress page

Vulnerable Pages

Page URL XSS Type
Search /?level=1 Reflected XSS
Comments /comments?level=1 Stored XSS
Profile /profile/user1?level=1 DOM-Based XSS
Admin /admin Privilege Escalation
Progress /progress Progress Dashboard

Technical Details

Ports

Service Port
SpectreLab 3001
BeEF (optional) 3000

Special Endpoints

Endpoint Purpose
/reset POST β€” Clear all data
/progress Progress dashboard
/api/callback?cb=FN JSONP endpoint (Reflected L5)
/dom-widget.html Widget iframe (DOM L5)

Troubleshooting

Port already in use

PORT=8080 npm start
# Or: docker run -d -p 8080:3001 --name spectrelab spectrelab-xss

Progress not showing

Progress uses localStorage. Make sure your browser allows it and you're not in private/incognito mode.


License

MIT License β€” See LICENSE for details.


Author

Cysec Don Email: cysecdon@gmail.com GitHub: https://github.com/cysec-don


Like a spectre, XSS is invisible until it strikes. Learn to see it coming.

About

VulnLab - Intentionally Vulnerable XSS Playground by Cysec Don

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors