mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Fix location of try/catch. The pcap/dnet variables were not in scope.
This commit is contained in:
parent
a83ed012fd
commit
2dcb08a590
3 changed files with 18 additions and 18 deletions
|
|
@ -35,12 +35,6 @@ prerule = function()
|
|||
return nmap.is_privileged()
|
||||
end
|
||||
|
||||
catch = function()
|
||||
dnet:ethernet_close()
|
||||
pcap:pcap_close()
|
||||
end
|
||||
try = nmap.new_try(catch)
|
||||
|
||||
local function get_interfaces()
|
||||
local interface_name = stdnse.get_script_args(SCRIPT_NAME .. ".interface")
|
||||
or nmap.get_interface()
|
||||
|
|
@ -92,6 +86,12 @@ local function single_interface_broadcast(if_nfo, results)
|
|||
local dnet = nmap.new_dnet()
|
||||
local pcap = nmap.new_socket()
|
||||
|
||||
local function catch ()
|
||||
dnet:ethernet_close()
|
||||
pcap:pcap_close()
|
||||
end
|
||||
local try = nmap.new_try(catch)
|
||||
|
||||
try(dnet:ethernet_open(if_nfo.device))
|
||||
pcap:pcap_open(if_nfo.device, 128, false, "icmp6 and ip6[6:1] = 58 and ip6[40:1] = 129")
|
||||
|
||||
|
|
|
|||
|
|
@ -37,12 +37,6 @@ prerule = function()
|
|||
return nmap.is_privileged()
|
||||
end
|
||||
|
||||
catch = function()
|
||||
dnet:ethernet_close()
|
||||
pcap:pcap_close()
|
||||
end
|
||||
try = nmap.new_try(catch)
|
||||
|
||||
--- Build an IPv6 invalid extension header.
|
||||
-- @param nxt_hdr integer that stands for next header's type
|
||||
local function build_invalid_extension_header(nxt_hdr)
|
||||
|
|
@ -110,6 +104,12 @@ local function single_interface_broadcast(if_nfo, results)
|
|||
local dnet = nmap.new_dnet()
|
||||
local pcap = nmap.new_socket()
|
||||
|
||||
local function catch ()
|
||||
dnet:ethernet_close()
|
||||
pcap:pcap_close()
|
||||
end
|
||||
local try = nmap.new_try(catch)
|
||||
|
||||
try(dnet:ethernet_open(if_nfo.device))
|
||||
pcap:pcap_open(if_nfo.device, 128, false, "icmp6 and ip6[6:1] = 58 and ip6[40:1] = 4")
|
||||
|
||||
|
|
|
|||
|
|
@ -51,12 +51,6 @@ prerule = function()
|
|||
return nmap.is_privileged()
|
||||
end
|
||||
|
||||
catch = function()
|
||||
dnet:ethernet_close()
|
||||
pcap:pcap_close()
|
||||
end
|
||||
try = nmap.new_try(catch)
|
||||
|
||||
local function get_identifier(ip6_addr)
|
||||
return string.sub(ip6_addr, 9, 16)
|
||||
end
|
||||
|
|
@ -152,6 +146,12 @@ local function single_interface_broadcast(if_nfo, results)
|
|||
local dnet = nmap.new_dnet()
|
||||
local pcap = nmap.new_socket()
|
||||
|
||||
local function catch ()
|
||||
dnet:ethernet_close()
|
||||
pcap:pcap_close()
|
||||
end
|
||||
local try = nmap.new_try(catch)
|
||||
|
||||
try(dnet:ethernet_open(if_nfo.device))
|
||||
pcap:pcap_open(if_nfo.device, 128, true, "src ::0/128 and dst net ff02::1:0:0/96 and icmp6 and ip6[6:1] = 58 and ip6[40:1] = 135")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue