forked from Crypt0s/airview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathairview_web.py
executable file
·65 lines (53 loc) · 1.44 KB
/
airview_web.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
#!/usr/bin/python
import web
from web import form
web.config.debug = True
import json
import md5
import time
import Tool80211
import sys
# Testing mode imports
import pdb
import wifiobjects
import random
import threading
urls = (
'/','view_test'
)
class view_test:
def GET(self):
def POST(self):
pass
class server:
def __init__(self,card):
airmonitor = Tool80211.Airview(card)
airmonitor.start()
while True:
self.dict = {}
bss = airmonitor.apObjects
clients = airmonitor.clientObjects
for client in clients.keys():
if clients[client].bssid is not None:
del clients[client]
else:
m = md5.new()
clients[client]
m.update(str(client.fts)+client.mac)
self.dict[m.hexdigest()] = client.__dict__
for i in bss.keys():
m = md5.new()
ap = bss[i]
m.update(str(ap.fts)+ap.bssid)
self.dict[m.hexdigest()] = ap.__dict__
def GET():
return self.dict
if __name__ == "__main__":
if len(sys.argv)<=1:
print "Usage: ./airview_web.py [wifi_interface]"
exit()
app = web.application(urls,globals())
app.run()
# WSGI Deployment shit for Apache.
app = web.application(urls, globals(), autoreload=False)
application = app.wsgifunc()