Check if the request is coming from an AP client (192.168.4.x)
()
| 4554 | |
| 4555 | |
| 4556 | def run_targeted_arp_scan(ip, interface=DEFAULT_ARP_SCAN_INTERFACE): |
| 4557 | command = ['sudo', 'arp-scan', f'--interface={interface}', ip] |
| 4558 | logger.info(f"Running targeted arp-scan for {ip}: {' '.join(command)}") |
| 4559 | try: |
| 4560 | result = subprocess.run(command, capture_output=True, text=True, check=False, timeout=60) |
| 4561 | hosts = _parse_arp_scan_output(result.stdout) |
| 4562 | entry = hosts.get(ip) |
| 4563 | return entry.get('mac', '') if entry else '' |
| 4564 | except FileNotFoundError: |
| 4565 | logger.warning(f"arp-scan command not found when resolving MAC for {ip}") |
| 4566 | return '' |
no test coverage detected