Last active
September 25, 2025 02:22
-
-
Save ronsen/4b9ef468f4da41f7ff9423f4cc5b7b64 to your computer and use it in GitHub Desktop.
sending random email and password to a certain url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import argparse | |
| import random | |
| import requests | |
| import secrets | |
| import string | |
| from faker import Faker | |
| parser = argparse.ArgumentParser(description='Attack') | |
| parser.add_argument('--url', default='http://localhost:8000/', help='Target URL.') | |
| parser.add_argument('--email', default='email', help='Email field.') | |
| parser.add_argument('--password', default='password', help='Password field.') | |
| args = parser.parse_args() | |
| url = args.url | |
| email_field = args.email | |
| password_field = args.password | |
| def main(url): | |
| fake = Faker() | |
| while True: | |
| length = random.randint(2, 4) | |
| number = random.randint(10 ** (length -1 ), 10 ** length - 1) | |
| email = fake.first_name().lower() + str(number) + '@gmail.com'; | |
| alphabet = string.ascii_letters + string.digits | |
| password = ''.join(secrets.choice(alphabet) for i in range(20)) | |
| print(email, password) | |
| params = { | |
| email_field: fake.email(), | |
| password_field: password | |
| } | |
| response = requests.post(url, data=params) | |
| if response.status_code != 200: | |
| print('Request failed with status code:', response.status_code) | |
| if __name__ == '__main__': | |
| main(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment