#!/usr/bin/env python3 import re from typing import Optional from wordlists import get_wordlists def detect_xss_pattern(input_string: str) -> bool: if not input_string: return False wl = get_wordlists() xss_pattern = wl.attack_patterns.get('xss_attempt', '') if not xss_pattern: xss_pattern = r'( str: xss_detected = False reflected_content = [] for key, value in input_data.items(): if detect_xss_pattern(value): xss_detected = True reflected_content.append(f"

{key}: {value}

") if xss_detected: html = f""" Submission Received

Thank you for your submission!

We have received your information:

{''.join(reflected_content)}

We will get back to you shortly.

""" return html return """ Submission Received

Thank you for your submission!

Your message has been received and we will respond soon.

"""