mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
o [NSE] Check the link type of the interface before sending the multicast host discovery probe.
This commit is contained in:
parent
fbd74b9d46
commit
f1ef57e961
3 changed files with 18 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue