From 5d761e86879f734c427c6e89e5b225e72f98d4e0 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Thu, 2 May 2024 20:33:19 +1000 Subject: [PATCH] =?UTF-8?q?Vendors=20update=20work=20v0.1=20#618=20?= =?UTF-8?q?=E2=8F=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/const.py | 3 ++- server/device.py | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/server/const.py b/server/const.py index 482aad4b..80526245 100755 --- a/server/const.py +++ b/server/const.py @@ -17,7 +17,8 @@ apiPath = applicationPath + '/front/api/' reportTemplatesPath = applicationPath + '/front/report_templates/' fullConfPath = applicationPath + confPath fullDbPath = applicationPath + dbPath -vendorsPath = '/usr/share/arp-scan/ieee-oui_all_filtered.txt' +vendorsPath = '/usr/share/arp-scan/ieee-oui.txt' +vendorsPathNewest = '/usr/share/arp-scan/ieee-oui_all_filtered.txt' diff --git a/server/device.py b/server/device.py index 8026ca76..3e393e9b 100755 --- a/server/device.py +++ b/server/device.py @@ -2,10 +2,11 @@ import subprocess import conf +import os import re from helper import timeNowTZ, get_setting, get_setting_value, list_to_where, resolve_device_name_dig, resolve_device_name_pholus, get_device_name_nslookup, check_IP_format from logger import mylog, print_log -from const import vendorsPath +from const import vendorsPath, vendorsPathNewest #------------------------------------------------------------------------------- # Device object handling (WIP) @@ -404,6 +405,11 @@ def check_mac_or_internet(input_str): def query_MAC_vendor (pMAC): pMACstr = str(pMAC) + + filePath = vendorsPath + + if os.path.isfile(vendorsPathNewest): + filePath = vendorsPathNewest # Check MAC parameter mac = pMACstr.replace (':','').lower()