1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-27 01:49:03 +00:00

Restore a check for nmap.is_privileged to targets-sniffer.nse. I asked

Nick to remove this, but it turns out nmap.pcap_open has a bad failure
mode when you're not root. It sleeps for several seconds then throws an
error. So rather than tackle that I'll add this check back to the
script.
This commit is contained in:
david
2011-04-05 06:12:03 +00:00
parent d0bcacd18a
commit f43ca1ae27

View File

@@ -58,7 +58,8 @@ local function get_ip_addresses(layer3)
end
prerule = function()
return stdnse.get_script_args("targets-sniffer.iface") or nmap.get_interface()
return nmap.is_privileged() and
(stdnse.get_script_args("targets-sniffer.iface") or nmap.get_interface())
end