-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclientProbes.py
More file actions
executable file
·65 lines (43 loc) · 1.35 KB
/
clientProbes.py
File metadata and controls
executable file
·65 lines (43 loc) · 1.35 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Python 3
# Program to strip the APs that devices are reaching out to from a csv generated by airodump-ng
# By ariakis
import sys, os, csv
# Initialise variables
separator = "Station MAC"
doPrints = False
counter = 1
# Navigate to the correct directory and open files for read/write
inpFilename = os.path.abspath(os.path.dirname( __file__ )) + "/" + sys.argv[1]
inputFile = open(inpFilename,"r")
def maclookup(mac,ouiFile):
mac = mac.replace(':','')
mac = mac[0:6]
with open(ouiFile,'r') as ouis:
for line in ouis:
if line[12:19] == 'base 16':
# print("Device mac:",mac,"-","Vendor mac:",line[0:6])
if line[0:6] == mac:
vendor = line[22:-1]
return vendor
return 'n/a'
# Scroll to clients
reader = csv.reader(inputFile)
for row in reader:
if len(row) > 0: # if line not blank to prevent errs (first line is blank always)
if row[0] == separator: # only scan APs, not clients
break
# Main read loop
APList = []
for row in reader:
rowlength = len(row)
if rowlength > 6 and row[6] != '': # if line not blank
APs = row[6:rowlength]
# print("Client reaching for " + str(len(APs)))
for AP in APs:
if AP not in APList:
station = row[0]
vendor = maclookup(station,'oui.txt')
print(str(counter)+': ' + row[1] + ' - ' + station + ' (' + vendor + ')' + ' - ' + AP)
APList.append(AP)
counter += 1
inputFile.close()