From bca346ac5ad27625ad022fae979e56036aa3fc34 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Fri, 2 May 2025 11:50:18 -0500 Subject: [PATCH] Add debug logging for MAC vendor lookup process --- listener.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/listener.py b/listener.py index 1653c8b..76472dc 100755 --- a/listener.py +++ b/listener.py @@ -323,8 +323,9 @@ def main(): def get_mac_vendor(mac): prefix = mac.upper()[0:8].replace(":", "-") - print(f"[+] Looking up vendor for {prefix}...") + print(f"[DEBUG] Looking up prefix: {prefix}") if prefix in vendor_cache: + print(f"[DEBUG] Cached hit: {vendor_cache[prefix]}") return vendor_cache[prefix] try: if not os.path.exists("oui.txt"): @@ -336,12 +337,15 @@ def get_mac_vendor(mac): for line in f: if line.strip().endswith("(hex)"): parts = line.split() - if len(parts) >= 3 and parts[0] == prefix: - vendor = " ".join(parts[2:]).replace("(hex)", "").strip() - vendor_cache[prefix] = vendor - return vendor + if len(parts) >= 3: + print(f"[DEBUG] Checking line: {parts}") + if parts[0] == prefix: + vendor = " ".join(parts[2:]).replace("(hex)", "").strip() + vendor_cache[prefix] = vendor + print(f"[DEBUG] Vendor found: {vendor}") + return vendor except Exception as e: - pass + print(f"[ERROR] Vendor lookup failed: {e}") vendor_cache[prefix] = "Unknown" return "Unknown"