MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / get_current_network_id

Method get_current_network_id

network_intelligence.py:145–167  ·  view source on GitHub ↗

Get current network identifier

(self)

Source from the content-addressed store, hash-verified

143 self.logger.error(f"Error saving intelligence data: {e}")
144
145 def get_current_network_id(self) -> Optional[str]:
146 """Get current network identifier"""
147 try:
148 # Try to get SSID from WiFi manager
149 if (hasattr(self.shared_data, 'ragnar_instance') and
150 hasattr(self.shared_data.ragnar_instance, 'wifi_manager')):
151
152 wifi_mgr = self.shared_data.ragnar_instance.wifi_manager
153 if hasattr(wifi_mgr, 'current_ssid') and wifi_mgr.current_ssid:
154 return self.create_network_id(wifi_mgr.current_ssid)
155
156 # Fallback to get_current_ssid method
157 if hasattr(wifi_mgr, 'get_current_ssid'):
158 ssid = wifi_mgr.get_current_ssid()
159 if ssid:
160 return self.create_network_id(ssid)
161
162 # If no WiFi manager or SSID, return default network
163 return "default_network"
164
165 except Exception as e:
166 self.logger.error(f"Error getting current network ID: {e}")
167 return "default_network"
168
169 def create_network_id(self, ssid: str) -> str:
170 """Create a stable network identifier from SSID"""

Callers 10

add_vulnerabilityMethod · 0.95
add_credentialMethod · 0.95
confirm_findingMethod · 0.95
resolve_findingMethod · 0.95
get_network_summaryMethod · 0.95
_send_host_updateMethod · 0.80

Calls 3

create_network_idMethod · 0.95
get_current_ssidMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected