Skip to content

Commit

Permalink
Add verbose to get_vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
r4ulcl committed Oct 21, 2023
1 parent 1ca6a36 commit 0d42b6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions utils/oui.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ def load_vendors():
return oui


def get_vendor(oui, mac):
def get_vendor(oui, mac, verbose):
'''Get vendors from mac in oui'''
mac = mac.replace(':', '')[:-3]
while mac not in oui and len(mac) >= 6:
print(mac)
if verbose:
print(mac)
mac = mac[:-1]
return oui.get(mac, 'Unknown')
16 changes: 8 additions & 8 deletions utils/wifi_db_aircrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def parse_netxml(ouiMap, name, database, verbose):
for wireless in raiz:
if wireless.get("type") == "probe":
bssid = wireless.find("BSSID").text
manuf = oui.get_vendor(ouiMap, bssid)
manuf = oui.get_vendor(ouiMap, bssid, verbose)
packets_total = wireless.find("packets").find("total").text
if verbose:
print(bssid, manuf, "W", packets_total)
Expand Down Expand Up @@ -98,7 +98,7 @@ def parse_netxml(ouiMap, name, database, verbose):
)
firstTimeSeen = date_object.strftime("%Y-%m-%d %H:%M:%S")

manuf = oui.get_vendor(ouiMap, bssid)
manuf = oui.get_vendor(ouiMap, bssid, verbose)

if wireless.find("SSID").find("encryption") is not None:
encryption = ""
Expand Down Expand Up @@ -131,7 +131,7 @@ def parse_netxml(ouiMap, name, database, verbose):
clients = wireless.findall("wireless-client")
for client in clients:
client_mac = client.find("client-mac").text
manuf = oui.get_vendor(ouiMap, client_mac)
manuf = oui.get_vendor(ouiMap, client_mac, verbose)

firstTimeSeen_string = client.attrib['first-time']
date_object = datetime.datetime.strptime(
Expand Down Expand Up @@ -190,7 +190,7 @@ def parse_kismet_csv(ouiMap, name, database, verbose):
"%Y-%m-%d %H:%M:%S"
)

manuf = oui.get_vendor(ouiMap, bssid)
manuf = oui.get_vendor(ouiMap, bssid, verbose)

channel = row[5]
freqmhz = 0
Expand Down Expand Up @@ -244,7 +244,7 @@ def parse_csv(ouiMap, name, database, verbose):
firstTimeSeen = row[1]
essid = row[13]
essid = essid.replace("'", "''")
manuf = oui.get_vendor(ouiMap, bssid)
manuf = oui.get_vendor(ouiMap, bssid, verbose)
channel = row[3]
freq = ""
carrier = ""
Expand All @@ -267,7 +267,7 @@ def parse_csv(ouiMap, name, database, verbose):
# print(row[0])
mac = row[0]
firstTimeSeen = row[1]
manuf = oui.get_vendor(ouiMap, mac)
manuf = oui.get_vendor(ouiMap, mac, verbose)
packets = row[4]
# print(mac, manuf)

Expand Down Expand Up @@ -313,7 +313,7 @@ def parse_log_csv(ouiMap, name, database, verbose, fake_lat, fake_lon):
if time != "LocalTime":
if len(row) > 10 and row[10] == "Client":
mac = row[3]
manuf = oui.get_vendor(ouiMap, mac)
manuf = oui.get_vendor(ouiMap, mac, verbose)
signal_rssi = row[4]
lat = row[6]
lon = row[7]
Expand Down Expand Up @@ -341,7 +341,7 @@ def parse_log_csv(ouiMap, name, database, verbose, fake_lat, fake_lon):
lat = fake_lat
if fake_lon != "":
lon = fake_lon
manuf = oui.get_vendor(ouiMap, row[3])
manuf = oui.get_vendor(ouiMap, row[3], verbose)
cloaked = 'False'
mfpc = 'False'
mfpr = 'False'
Expand Down

0 comments on commit 0d42b6c

Please sign in to comment.