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

Function get_wifi_interfaces

webapp_modern.py:11129–11158  ·  view source on GitHub ↗

Get available Wi-Fi interfaces

()

Source from the content-addressed store, hash-verified

11127 log_path = os.path.join(attack_log_dir, log_file)
11128 try:
11129 with open(log_path, 'r', encoding='utf-8') as f:
11130 logs = json.load(f)
11131 all_logs.extend(logs)
11132
11133 for entry in logs:
11134 parsed_time = _parse_attack_timestamp(entry.get('timestamp'))
11135 if parsed_time and (latest_log_time_all is None or parsed_time > latest_log_time_all):
11136 latest_log_time_all = parsed_time
11137 except Exception as e:
11138 logger.error(f"Error reading attack log file {log_file}: {e}")
11139 continue
11140
11141 # Collect all unique network SSIDs across all logs (before filtering)
11142 available_networks = sorted(set(
11143 log.get('network_ssid') or 'unknown'
11144 for log in all_logs
11145 ))
11146
11147 # Apply filters
11148 filtered_logs = all_logs
11149
11150 if ip_filter:
11151 filtered_logs = [log for log in filtered_logs if log.get('target_ip') == ip_filter]
11152
11153 if attack_type_filter:
11154 filtered_logs = [log for log in filtered_logs if log.get('attack_type') == attack_type_filter]
11155
11156 if status_filter:
11157 filtered_logs = [log for log in filtered_logs if log.get('status') == status_filter]
11158
11159 if network_filter:
11160 filtered_logs = [log for log in filtered_logs if (log.get('network_ssid') or 'unknown') == network_filter]
11161

Callers

nothing calls this directly

Calls 5

_gather_wifi_interfacesFunction · 0.85
_get_wifi_ifaceFunction · 0.85
get_state_payloadMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected