-
Notifications
You must be signed in to change notification settings - Fork 1
/
shadowCL.py
178 lines (139 loc) · 5.68 KB
/
shadowCL.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
from conf.config import conf_param
from tqdm import tqdm
import argparse
import requests
import logging
import random
import time
import os
def banner():
print("\033[95m"+r" _____ __ __ ________ "+"\033[0m")
print("\033[95m"+r" / ___// /_ ____ _____/ /___ _ __/ ____/ / "+"\033[0m")
print("\033[95m"+r" \__ \/ __ \/ __ `/ __ / __ \ | /| / / / / / "+"\033[0m")
print("\033[95m"+r" ___/ / / / / /_/ / /_/ / /_/ / |/ |/ / /___/ /___"+"\033[0m")
print("\033[95m"+r"/____/_/ /_/\__,_/\__,_/\____/|__/|__/\____/_____/"+"\033[0m")
print("")
print("\033[97m"+r" https://github.com/natekali"+"\033[0m")
print("")
def chooser(src_filename):
with open(src_filename, 'r', encoding='utf-8') as file:
lines = file.readlines()
return random.choice(lines).strip()
def formatter(country):
username = chooser('src/user.txt')
password = chooser('src/pass.txt')
if country == 'worldwide':
domain = chooser('src/dom.txt')
elif country == 'fr':
domain = chooser('src/country/FR_dom.txt')
elif country == 'uk':
domain = chooser('src/country/UK_dom.txt')
elif country == 'pl':
domain = chooser('src/country/PL_dom.txt')
elif country == 'ru':
domain = chooser('src/country/RU_dom.txt')
elif country == 'ch':
domain = chooser('src/country/CH_dom.txt')
elif country == 'us':
domain = chooser('src/country/US_dom.txt')
elif country == 'mix':
domain = chooser('src/country/MIX_dom.txt')
else:
print('\r')
print('\033[91m[x]\033[0m When using -c, you must provide a valid country code (mix, fr, uk, pl, ru, ch, us)')
print('')
exit(0)
payload = f"{username}@{domain}:{password}"
return payload
def writer(payload, dst_filename):
with open(dst_filename, 'a') as file:
file.write(payload + '\n')
def help(parser):
parser.print_help()
print("")
def webhook(webhook_url, message):
payload = {'content': message}
requests.post(webhook_url, json=payload)
def pixeldrain(filename):
pixeldrain_url = 'https://pixeldrain.com/api/file/'
with open(filename, 'rb') as file:
files = {'file': (os.path.basename(filename), file)}
response = requests.post(pixeldrain_url, files=files)
return response.json()
def setup_logs():
logging.basicConfig(filename='logs/logs.txt', level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-l', '--length', type=int, help='desired number of entries (required)')
parser.add_argument('-o', '--output', type=str, default='result.txt', help='desired output filename or filepath')
parser.add_argument('-c', '--country', type=str, default='worldwide', help='desired mail domain by country (mix, fr, uk, pl, ru, ch, us)')
parser.set_defaults(func=help)
args = parser.parse_args()
if args.length:
x = 0
dst_filename = args.output
country = args.country
length = args.length
start_time = time.time()
setup_logs()
logging.info(f'ShadowCL generation started ({dst_filename})')
with tqdm(total=length, desc="Generating", unit="line") as pbar:
while x < length:
payload = formatter(country)
writer(payload, dst_filename)
x += 1
pbar.update(1)
time.sleep(0.01)
logging.info(f'ShadowCL generation finished ({dst_filename})')
end_time = time.time()
print('')
print(f'\033[92m[✓]\033[0m {dst_filename} successfully created')
print('')
total_exec = end_time - start_time
if total_exec < 60:
time_unit = 'seconds'
formatted_time = total_exec
elif total_exec < 3600:
time_unit = 'minutes'
formatted_time = total_exec / 60
else:
time_unit = 'hours'
formatted_time = total_exec / 3600
logging.info(f'Total execution time : {formatted_time:.2f} {time_unit} ({dst_filename})')
webhook_url = conf_param['discord_webhook_url']
user_id = conf_param['discord_user_id']
pixeldrain_resp = pixeldrain(dst_filename)
if pixeldrain_resp.get('success', True):
pixeldrain_id = pixeldrain_resp.get('id')
pixeldrain_link = f'https://pixeldrain.com/u/{pixeldrain_id}'
msg = f'{user_id} \r{dst_filename} generation completed ! \rlength : {length} \rcountry : {country} \rlink : {pixeldrain_link}'
webhook(webhook_url, msg)
os.remove(dst_filename)
else:
msg = f'{user_id} \r{dst_filename} generation completed ! \rlength : {length} \rcountry : {country} \rupload to pixeldrain failed :/'
webhook(webhook_url, msg)
exit(0)
elif args.output != 'result.txt' and not args.length:
print('\033[91m[x]\033[0m When using -o, you must also provide -l for the desired number of entries')
print('')
exit(0)
elif args.country != 'worldwide' and not args.length:
print('\033[91m[x]\033[0m When using -c, you must also provide -l for the desired number of entries')
print('')
exit(0)
if hasattr(args, 'func'):
args.func(parser)
exit(0)
if __name__ == "__main__":
try:
banner()
main()
except Exception as e:
logging.error(f'Error : {e}')
print('')
print('\033[91m[x]\033[0m Error :', e)
print('')
except KeyboardInterrupt:
logging.info('ShadowCL aborted by user')
print('')
exit('\033[91m[x]\033[0m ShadowCL stopped')