const LessonModule = require('../base/LessonModule');
/**
* Comprehensive XSS Lesson
* Demonstrates both reflected XSS (URL parameters) and stored XSS (forum comments)
* Features: Variant discovery tracking, hint system, time limits
*/
class XSSComprehensiveLesson extends LessonModule {
constructor(config) {
super(config);
// Track discovered variants per participant
this.discoveredVariants = new Map(); // participantId -> Set of variant types
// Track step start times per participant
this.stepStartTimes = new Map(); // participantId -> timestamp
// Track hints used per participant
this.hintsUsed = new Map(); // participantId -> { stepId: count }
// Maximum time to earn points (15 minutes)
this.MAX_TIME_FOR_POINTS = 15 * 60 * 1000;
// Point deduction per hint
this.HINT_PENALTY = 5;
// Total XSS variants to discover
this.TOTAL_VARIANTS = 9;
}
/**
* XSS variant patterns to discover
*/
getVariantPatterns() {
return [
{ regex: / oder
',
'Tipp 4: Andere Varianten: