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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user