From a64a7c414c294e268827055c2440d7ac7b41be1e Mon Sep 17 00:00:00 2001 From: cemaxecuter Date: Sat, 31 Jan 2026 08:17:07 -0500 Subject: [PATCH] Invalidate capabilities cache after monitor mode toggle After enabling/disabling monitor mode, clear the cached capabilities so the next refresh shows the updated interface list (e.g., wlo1mon instead of wlo1). --- intercept_agent.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/intercept_agent.py b/intercept_agent.py index 987dbcc..92dd68e 100644 --- a/intercept_agent.py +++ b/intercept_agent.py @@ -971,6 +971,7 @@ class ModeManager: } self.wifi_monitor_interface = monitor_iface + self._capabilities = None # Invalidate cache so interfaces refresh logger.info(f"Monitor mode enabled on {monitor_iface}") return {'status': 'success', 'monitor_interface': monitor_iface} @@ -984,6 +985,7 @@ class ModeManager: subprocess.run([iw_path, interface, 'set', 'monitor', 'control'], capture_output=True) subprocess.run(['ip', 'link', 'set', interface, 'up'], capture_output=True) self.wifi_monitor_interface = interface + self._capabilities = None # Invalidate cache return {'status': 'success', 'monitor_interface': interface} except Exception as e: return {'status': 'error', 'message': str(e)} @@ -997,6 +999,7 @@ class ModeManager: subprocess.run([airmon_path, 'stop', current_iface], capture_output=True, text=True, timeout=15) self.wifi_monitor_interface = None + self._capabilities = None # Invalidate cache return {'status': 'success', 'message': 'Monitor mode disabled'} except Exception as e: return {'status': 'error', 'message': str(e)} @@ -1006,6 +1009,7 @@ class ModeManager: subprocess.run([iw_path, current_iface, 'set', 'type', 'managed'], capture_output=True) subprocess.run(['ip', 'link', 'set', current_iface, 'up'], capture_output=True) self.wifi_monitor_interface = None + self._capabilities = None # Invalidate cache return {'status': 'success', 'message': 'Monitor mode disabled'} except Exception as e: return {'status': 'error', 'message': str(e)}