Export a wardriving session as WiGLE CSV or KML.
(session_id)
| 8257 | logger.error(f"Could not read netkb data for MAC enrichment: {e}") |
| 8258 | |
| 8259 | if network_data: |
| 8260 | ip_to_mac = {} |
| 8261 | enrichment_map = {} |
| 8262 | for row in netkb_data: |
| 8263 | ip = _extract_value(row, ("IPs", "IP", "ip")) |
| 8264 | mac = _extract_value(row, ("MAC Address", "MAC", "mac")) |
| 8265 | vuln_summary = _extract_value(row, ("Nmap Vulnerabilities", "nmap_vulnerabilities")) |
| 8266 | vuln_status = _extract_value(row, ("NmapVulnScanner", "nmap_vuln_scanner")) |
| 8267 | |
| 8268 | enrichment_payload = { |
| 8269 | 'Nmap Vulnerabilities': vuln_summary or '', |
| 8270 | 'NmapVulnScanner': vuln_status or '' |
| 8271 | } |
| 8272 | |
| 8273 | if ip and mac and mac.upper() not in {"UNKNOWN", "STANDALONE"}: |
| 8274 | ip_to_mac[ip] = mac |
| 8275 | |
| 8276 | if mac: |
| 8277 | enrichment_map[("mac", mac.lower())] = enrichment_payload |
| 8278 | if ip: |
| 8279 | enrichment_map[("ip", ip)] = enrichment_payload |
| 8280 | |
| 8281 | for entry in network_data: |
| 8282 | mac = _extract_value(entry, ("MAC Address", "MAC", "mac")) |
| 8283 | ip = _extract_value(entry, ("IPs", "IP", "ip")) |
| 8284 | if not mac or mac.upper() in {"UNKNOWN", "STANDALONE", "00:00:00:00:00:00"}: |
| 8285 | fallback_mac = ip_to_mac.get(ip) |
| 8286 | if fallback_mac: |
| 8287 | mac = fallback_mac |
| 8288 | |
| 8289 | mac = mac or '' |
| 8290 | entry['MAC Address'] = mac |
nothing calls this directly
no test coverage detected