From 7d9e33e9ead693415c2df28961d97ff779a0d44f Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Thu, 1 May 2025 10:28:55 -0500 Subject: [PATCH] Fix regex in get_connected_bssid to match MAC addresses case-insensitively and ensure consistent formatting. --- listener.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/listener.py b/listener.py index 0ff3c9a..b525054 100755 --- a/listener.py +++ b/listener.py @@ -153,9 +153,9 @@ def reset_interface(interface): def get_connected_bssid(interface): try: out = subprocess.check_output(["iw", interface, "link"]).decode() - match = re.search(r"Connected to ([0-9a-f:]{17})", out.lower()) + match = re.search(r"Connected to ([0-9A-Fa-f:]{17})", out, re.MULTILINE) if match: - return match.group(1) + return match.group(1).lower() print("[!] No valid MAC address found in iw link output.") return None except Exception as e: