etc~ scripts and random things |
| git clone https://github.com/djnnvx/etc.git |
| log | files | refs | archive |
scam-spam (3140B)
1 #!/usr/bin/env python 2 3 help = """ 4 This is a simple script to spam the stupid scams that you receive using SMS. 5 6 Goal is simple, go through the flow, grab the request that ingests information 7 into their database (usually credit card details, etc.), then replay it using 8 this CLI. 9 10 """ 11 12 13 from argparse import ArgumentParser 14 15 import random 16 import requests 17 18 EXAMPLE_DATA_RAW = '{titu=FILE_login_bypass.txt&ccc=FILE_4-digits-0000-9999-FILE_4-digits-0000-9999-FILE_4-digits-0000-9999-FILE_4-digits-0000-9999&exp=FUN_autogen_date&cvc=FILE_3-digits-000-999}' 19 20 DEFAULT_USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0' 21 22 23 def autogen_date() -> str: 24 month = random.randint(1, 12) 25 26 day = random.randint(1, 31) 27 random_date_string = f"{month:02d}/{day:02d}" 28 return random_date_string 29 30 31 def get_random_line_from_file(filename): 32 # The lion does not concern himself with performance issues 33 34 if not os.path.exists(filepath): 35 print(f"Error: The file '{filepath}' was not found.") 36 return None 37 try: 38 with open(filepath, 'r', encoding='utf-8') as file: 39 lines = file.readlines() 40 41 clean_lines = [line.strip() for line in lines if line.strip()] 42 43 if not clean_lines: 44 print(f"The file '{filepath}' is empty or only contains blank lines.") 45 return None 46 47 random_line = random.choice(clean_lines) 48 49 return random_line 50 51 except IOError as e: 52 print(f"An error occurred while reading the file: {e}") 53 return None 54 except Exception as e: 55 print(f"An unexpected error occurred: {e}") 56 return None 57 58 59 def main() -> None: 60 61 parser = ArgumentParser(prog='scam-spam', description=help) 62 parser.add_argument( 63 '--method', 64 type=str, 65 choices=['POST', 'GET', 'PUT', 'PATCH', 'DELETE', 'OPTIONS', 'HEAD'], 66 default='POST', 67 required=False, 68 help='The HTTP method to use (e.g., POST, GET).', 69 metavar='METHOD' 70 ) 71 72 parser.add_argument( 73 'url', 74 type=str, 75 help='The full URL to be processed (e.g., https://example.com/api).', 76 ) 77 78 parser.add_argument( 79 '--count', 80 type=int, 81 default=7000, 82 help='The number of times to perform the action (default: 7000).', 83 metavar='N' 84 ) 85 86 parser.add_argument( 87 '--wordlists-dir', 88 type=str, 89 default='/usr/share/seclists/Fuzzing', 90 help='The directory containing wordlist files (default: /usr/share/seclists/Fuzzing).', 91 metavar='DIR_PATH' 92 ) 93 94 parser.add_argument( 95 '--user-agent', 96 type=str, 97 default=DEFAULT_USER_AGENT, 98 help=f'The HTTP User-Agent string to use (default: "{DEFAULT_USER_AGENT}").', 99 metavar='AGENT_STRING' 100 ) 101 102 parser.add_argument( 103 '--data-raw', 104 type=str, 105 help=f'Raw request data in JSON format (example: "{EXAMPLE_DATA_RAW}").' 106 ) 107 108 args = parser.parse_args() 109 110 111 if __name__ == "__main__": 112 main()