1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 12:19:02 +00:00

o [NSE] Check the link type of the interface before sending the multicast host discovery probe.

This commit is contained in:
weilin
2011-09-03 12:57:37 +00:00
parent fbd74b9d46
commit f1ef57e961
3 changed files with 18 additions and 6 deletions

View File

@@ -41,9 +41,13 @@ end
action = function()
local if_name = stdnse.get_script_args(SCRIPT_NAME .. ".interface") or nmap.get_interface()
local if_nfo = nmap.get_interface_info(if_name)
local if_nfo, err = nmap.get_interface_info(if_name)
if not if_nfo then
stdnse.print_debug("Invalid interface: %s", if_name)
stdnse.print_debug(err)
return false
end
if if_nfo.link ~= "ethernet" then
stdnse.print_debug("Not a Ethernet link.")
return false
end
local src_mac = if_nfo.mac

View File

@@ -58,9 +58,13 @@ end
action = function()
local if_name = stdnse.get_script_args(SCRIPT_NAME .. ".interface") or nmap.get_interface()
local if_nfo = nmap.get_interface_info(if_name)
local if_nfo, err = nmap.get_interface_info(if_name)
if not if_nfo then
stdnse.print_debug("Invalid interface: %s", if_name)
stdnse.print_debug(err)
return false
end
if if_nfo.link ~= "ethernet" then
stdnse.print_debug("Not a Ethernet link.")
return false
end
local src_mac = if_nfo.mac

View File

@@ -92,9 +92,13 @@ end
action = function()
local if_name = stdnse.get_script_args(SCRIPT_NAME .. ".interface") or nmap.get_interface()
local if_nfo = nmap.get_interface_info(if_name)
local if_nfo, err = nmap.get_interface_info(if_name)
if not if_nfo then
stdnse.print_debug("Invalid interface: %s", if_name)
stdnse.print_debug(err)
return false
end
if if_nfo.link ~= "ethernet" then
stdnse.print_debug("Not a Ethernet link.")
return false
end
local src_mac = if_nfo.mac