-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpage.py
More file actions
45 lines (40 loc) · 1.28 KB
/
page.py
File metadata and controls
45 lines (40 loc) · 1.28 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
38
39
40
41
42
43
44
45
#!/usr/local/bin/python
__author__ = 'randy'
import pythonAir
from flask import Flask, render_template, request,redirect, url_for
import time
app = Flask(__name__)
@app.route("/")
@app.route("/index")
def index():
adapters,monitored = pythonAir.wirelessInterface()
return render_template('index.html',adapters=adapters, monitored=monitored)
@app.route("/putMonitored", methods=['POST'])
def putMonitored():
adapter = request.form['adapter']
pythonAir.PutMonitorMode(adapter)
time.sleep(5)
return redirect(url_for('index'))
@app.route('/startScan',methods=['POST'])
def startScan():
adapter = request.form['mon']
pythonAir.StartScanningAP(adapter)
time.sleep(5)
return redirect(url_for('viewScan'))
@app.route('/viewScan')
def viewScan():
file = pythonAir.getNewFile()
bssid, clients = pythonAir.ViewScan(file)
return render_template('scan.html',bssid = bssid, clients = clients)
@app.route("/stopMonitored", methods=['POST'])
def stopMonitored():
adapter = request.form['mon']
pythonAir.stopMonitorMode(adapter)
time.sleep(5)
return redirect(url_for('index'))
@app.route("/stopScan")
def stopScan():
pythonAir.stopScanning()
return redirect(url_for('index'))
if __name__=="__main__":
app.run(host='0.0.0.0',debug = True)