Use sudo nmap to allow ARP scan with restricted sudoers
This commit is contained in:
@@ -64,7 +64,7 @@ def scan_subnet(cidr: str) -> list[dict]:
|
||||
"""Run nmap ping scan, return list of {ip, mac, name}."""
|
||||
try:
|
||||
out = subprocess.check_output(
|
||||
["nmap", "-sn", "-PR", "--host-timeout", "5s", cidr],
|
||||
["sudo", "nmap", "-sn", "-PR", "--host-timeout", "5s", cidr],
|
||||
text=True, stderr=subprocess.DEVNULL
|
||||
)
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user