-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.py
364 lines (297 loc) · 13.3 KB
/
functions.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
"""
╔═════════════════════════════════════════════════════════════════════════════════╗
║ ║
║ Beast Bomber ║
║ Author: ║
║ https://github.com/crut0i ║
║ ║
║ The author of this program is not responsible for its use! ║
║ When posting this code on other resources, please indicate the author! ║
║ ║
║ All rights reserved. ║
║ Copyright (C) 2024 un1ucm ║
║ ║
╚═════════════════════════════════════════════════════════════════════════════════╝
"""
import os
import fade
import re
import json
import ipaddress
import requests
import time
import random
from bs4 import BeautifulSoup
from sys import platform
from colorama import Fore, init
from fake_useragent import UserAgent
init()
def logo_main():
text = """
╔══╗ ╔╗ ╔══╗ ╔╗
║╔╗║ ╔╝╚╗║╔╗║ ║║
║╚╝╚╦══╦══╦═╩╗╔╝║╚╝╚╦══╦╗╔╣╚═╦══╦═╗
║╔═╗║ ═╣╔╗║══╣║ ║╔═╗║╔╗║╚╝║╔╗║ ═╣╔╝
║╚═╝║ ═╣╔╗╠══║╚╗║╚═╝║╚╝║║║║╚╝║ ═╣║
╚═══╩══╩╝╚╩══╩═╝╚═══╩══╩╩╩╩══╩══╩╝
By crut0i
https://t.me/beast_project_team
"""
print(fade.water(text))
def logo_sms():
text = """
╔═══╦═╗╔═╦═══╗
║╔═╗║ ╚╝ ║╔═╗║
║╚══╣╔╗╔╗║╚══╗╔══╦══╦══╦╗╔╗
╚══╗║║║║║╠══╗║║══╣╔╗║╔╗║╚╝║
║╚═╝║║║║║║╚═╝║╠══║╚╝║╔╗║║║║
╚═══╩╝╚╝╚╩═══╝╚══╣╔═╩╝╚╩╩╩╝
║║
╚╝
"""
print(fade.greenblue(text))
def logo_discord():
text = """
╔═══╗ ╔╗
╚╗╔╗║ ║║
║║║╠╦══╦══╦══╦═╦═╝║╔══╦══╦══╦╗╔╗
║║║╠╣══╣╔═╣╔╗║╔╣╔╗║║══╣╔╗║╔╗║╚╝║
╔╝╚╝║╠══║╚═╣╚╝║║║╚╝║╠══║╚╝║╔╗║║║║
╚═══╩╩══╩══╩══╩╝╚══╝╚══╣╔═╩╝╚╩╩╩╝
║║
╚╝
"""
print(fade.fire(text))
def logo_email():
text = """
╔═══╗ ╔╗
║╔══╝ ║║
║╚══╦╗╔╦══╦╣║ ╔══╦══╦══╦╗╔╗
║╔══╣╚╝║╔╗╠╣║ ║══╣╔╗║╔╗║╚╝║
║╚══╣║║║╔╗║║╚╗╠══║╚╝║╔╗║║║║
╚═══╩╩╩╩╝╚╩╩═╝╚══╣╔═╩╝╚╩╩╩╝
║║
╚╝
"""
print(fade.purplepink(text))
def logo_ddos():
text = """
╔═══╦═══╗ ╔═══╗
╚╗╔╗╠╗╔╗║ ║╔═╗║
║║║║║║║╠══╣╚══╗
║║║║║║║║╔╗╠══╗║
╔╝╚╝╠╝╚╝║╚╝║╚═╝║
╚═══╩═══╩══╩═══╝
"""
print(fade.brazil(text))
def logo_telegram():
text = """
╔════╗ ╔╗
║╔╗╔╗║ ║║
╚╝║║╠╩═╣║╔══╦══╦═╦══╦╗╔╗╔══╦══╦══╦╗╔╗
║║║ ═╣║║ ═╣╔╗║╔╣╔╗║╚╝║║══╣╔╗║╔╗║╚╝║
║║║ ═╣╚╣ ═╣╚╝║║║╔╗║║║║╠══║╚╝║╔╗║║║║
╚╝╚══╩═╩══╩═╗╠╝╚╝╚╩╩╩╝╚══╣╔═╩╝╚╩╩╩╝
╔═╝║ ║║
╚══╝ ╚╝
"""
print(fade.greenblue(text))
def logo_settings():
text = """
╔═══╗ ╔╗ ╔╗
║╔═╗║ ╔╝╚╦╝╚╗
║╚══╦═╩╗╔╩╗╔╬╦═╗╔══╦══╗
╚══╗║ ═╣║ ║║╠╣╔╗╣╔╗║══╣
║╚═╝║ ═╣╚╗║╚╣║║║║╚╝╠══║
╚═══╩══╩═╝╚═╩╩╝╚╩═╗╠══╝
╔═╝║
╚══╝
"""
print(fade.greenblue(text))
def logo_proxies():
text = """
╔╗ ╔╗ ╔╗ ╔╗
║║ ║║ ║║ ╔╝╚╗
║║ ║╠══╦═╝╠═╩╗╔╬╦═╗╔══╗╔══╦═╦══╦╗╔╦╦══╦══╗
║║ ║║╔╗║╔╗║╔╗║║╠╣╔╗╣╔╗║║╔╗║╔╣╔╗╠╬╬╬╣ ═╣══╣
║╚═╝║╚╝║╚╝║╔╗║╚╣║║║║╚╝║║╚╝║║║╚╝╠╬╬╣║ ═╬══║
╚═══╣╔═╩══╩╝╚╩═╩╩╝╚╩═╗║║╔═╩╝╚══╩╝╚╩╩══╩══╝
║║ ╔═╝║║║
╚╝ ╚══╝╚╝
"""
print(fade.pinkred(text))
def menu_en():
text = """[0] Exit
[1] SMS spam
[2] Email spam
[3] Telegram spam
[4] Discord spam
[5] DDoS attack
[6] Settings
"""
print(fade.purplepink(text))
def menu_ru():
text = """[0] Выход
[1] СМС спам
[2] Email спам
[3] Telegram спам
[4] Discord спам
[5] DDoS атака
[6] Настройки
"""
print(fade.purplepink(text))
def settings_menu_ru():
text = """[0] Назад
[1] Обновить прокси
[2] Сменить язык
[3] Очистить кэш
"""
print(fade.purplepink(text))
def settings_menu_en():
text = """[0] Back
[1] Update proxies
[2] Change language
[3] Clear cache
"""
print(fade.purplepink(text))
def validate_ip(ip):
try:
parts = list(map(int, ip.split('.')))
return len(parts) == 4 and all(0 <= p <= 255 for p in parts)
except ValueError:
return False
def validate_port(port):
return str(port).isdigit() and 1 <= int(port) <= 65535
def update_proxies():
with open(os.path.abspath('core/config.json'), 'r') as file:
js_file = json.load(file)
lang = js_file["language"]
urls = ['https://raw.githubusercontent.com/mertguvencli/http-proxy-list/main/proxy-list/data.txt',
'https://raw.githubusercontent.com/jetkai/proxy-list/main/online-proxies/txt/proxies-https.txt',
'https://raw.githubusercontent.com/monosans/proxy-list/main/proxies/http.txt',
'https://raw.githubusercontent.com/officialputuid/KangProxy/KangProxy/https/https.txt']
with open(os.path.abspath('input/proxies.txt'), 'w+') as f:
f.seek(0)
f.close()
ua = UserAgent()
user = ua.random
try:
res = requests.get('https://free-proxy-list.net', headers={'User-Agent': user})
soup = BeautifulSoup(res.text, "lxml")
cnt3 = 0
with open(os.path.abspath('input/proxies.txt'), "a", encoding="utf-8") as file:
for child in soup.recursiveChildGenerator():
if child.name == 'td':
if cnt3 == 0:
if not validate_ip(child.text):
break
file.write(f"{child.text}:")
if cnt3 == 1:
file.write(f"{child.text}\n")
cnt3 = (cnt3 + 1) % 8
except requests.exceptions.RequestException as e:
print(f"Error occurred: {e}")
try:
res = requests.get('https://hidemy.name/ru/proxy-list', headers={'User-Agent': user})
soup = BeautifulSoup(res.text, "lxml")
with open(os.path.abspath('input/proxies.txt'), "a", encoding="utf-8") as file:
for child in soup.recursiveChildGenerator():
if child.name == 'td':
if validate_ip(child.text):
file.write(f"{child.text}:")
if validate_port(child.text):
file.write(f"{child.text}\n")
except requests.exceptions.RequestException as e:
print(f"Error occurred: {e}")
try:
with open(os.path.abspath('input/proxies.txt'), "w", encoding="utf-8") as file:
for url in urls:
res = requests.get(url, headers={'User-Agent': user})
proxy_list = res.text.strip().split('\n')
for proxy in proxy_list:
if validate_ip(proxy.split(':')[0]) and validate_port(proxy.split(':')[1]):
file.write(proxy)
file.write('\n')
except requests.exceptions.RequestException as e:
print(f"Error occurred: {e}")
def get_lang():
try:
js_file = ''
with open(os.path.abspath('core/config.json'), 'r') as file:
for line in file:
js_file += str(line)
return json.loads(js_file)["language"]
except:
return 'en'
def get_proxies():
proxies = []
lang = get_lang()
try:
with open(os.path.abspath('input/proxies.txt'), 'r') as file:
for line in file:
proxies.append(line.replace('\n', ''))
except:
if lang == 'ru':
print(Fore.RED + '\nОшибка при попытке открыть файл input/proxies.txt')
else:
print(Fore.RED + '\nError when trying to open a file input/proxies.txt')
return proxies
def generate_email():
lib = 'qwertyuiopasdfhgjklzxcvbnm'
lib2 = ['@gmail.com', '@hotmail.com', '@yahoo.com', '@yandex.ru']
email = ''.join(random.choice(lib) for _ in range(random.randint(10, 25))) + random.choice(lib2)
return email
def randstr(str_len):
lib = '1234567890qwertyuiopasdfghjklzxcvbnm'
text = ''.join(random.choices(lib, k=str_len))
return text
def get_discord_tokens():
tokens = []
lang = get_lang()
try:
with open(os.path.abspath('input/discord_tokens.txt'), 'r') as file:
for line in file:
tokens.append(line.replace('\n', ''))
except:
if lang == 'ru':
print(Fore.RED + '\nОшибка при попытке открыть файл input/discord_tokens.txt')
else:
print(Fore.RED + '\nError when trying to open a file input/discord_tokens.txt')
return tokens
def get_telegram_accounts():
lang = get_lang()
accounts = []
try:
accounts = os.listdir(os.path.abspath('input/telegram_accounts'))
except:
if lang == 'ru':
print(Fore.RED + '\nОшибка при попытке получить Telegram аккаунты из input/telegram_accounts')
else:
print(Fore.RED + '\nError when trying to retrieve Telegram accounts from input/telegram_accounts')
return accounts
def get_email_accounts():
emails = []
lang = get_lang()
try:
with open(os.path.abspath('input/email_accounts.txt'), 'r') as file:
for line in file:
emails.append(line.replace('\n', ''))
except:
if lang == 'ru':
print(Fore.RED + '\nОшибка при попытке открыть файл input/email_accounts.txt')
else:
print(Fore.RED + '\nError when trying to open a file input/email_accounts.txt')
return emails
def change_language():
lang = get_lang()
js_file = os.path.abspath('core/config.json')
with open(os.path.abspath(js_file)) as file:
js = json.load(file)
if lang == "ru":
js["language"] = "en"
with open(os.path.abspath('core/config.json'), 'w') as file:
json.dump(js, ensure_ascii=False, indent=4, fp=file)
else:
js["language"] = "ru"
with open(os.path.abspath('core/config.json'), 'w') as file:
json.dump(js, ensure_ascii=False, indent=4, fp=file)