1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

Use the SCRIPT_NAME prefix on the "interface" arg.

This commit is contained in:
david
2011-09-02 04:11:02 +00:00
parent a0e4664f21
commit 5f217dee0a
3 changed files with 9 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ Do a very fast host discovery on link-local IPv6 network.
-- @usage
-- ./nmap -6 --script=targets-ipv6-multicast-echo.nse --script-args 'newtargets,interface=eth0,ipv6.src=2001:da8:215:3320:223:aeff:fe5d:3b10' -sL
-- @args newtargets If true, add discovered targets to the scan queue.
-- @args interface The interface to use for host discovery.
-- @args targets-ipv6-multicast-echo.interface The interface to use for host discovery.
-- @args ipv6.src The source IPv6 address in the probe packets.
author = "David and Weilin"
@@ -23,7 +23,7 @@ local bit = require 'bit'
prerule = function()
return nmap.is_privileged() and
(stdnse.get_script_args("interface") or nmap.get_interface())
(stdnse.get_script_args(SCRIPT_NAME .. ".interface") or nmap.get_interface())
end
catch = function()
@@ -50,7 +50,7 @@ local function get_identifier(ip6_addr)
end
action = function()
local if_name = stdnse.get_script_args("targets-ipv6-multicast.interface") or nmap.get_interface()
local if_name = stdnse.get_script_args(SCRIPT_NAME .. ".interface") or nmap.get_interface()
local if_nfo = get_ipv6_interface_info_by_name(if_name)
if not if_nfo then
stdnse.print_debug("Invalid interface: " .. if_name)

View File

@@ -7,7 +7,7 @@ Do a very fast host discovery on link-local IPv6 network.
-- @usage
-- ./nmap -6 --script=targets-ipv6-multicast-invalid-dst.nse --script-args 'newtargets,interface=eth0,ipv6=2001:da8:215:3320:223:aeff:fe5d:3b10' -sP
-- @args newtargets If true, add discovered targets to the scan queue.
-- @args interface The interface to use for host discovery.
-- @args targets-ipv6-multicast-invalid-dst.interface The interface to use for host discovery.
-- @args ipv6.src The source IPv6 address in the probe packets.
author = "David and Weilin"
@@ -23,7 +23,7 @@ local bit = require 'bit'
prerule = function()
return nmap.is_privileged() and
(stdnse.get_script_args("interface") or nmap.get_interface())
(stdnse.get_script_args(SCRIPT_NAME .. ".interface") or nmap.get_interface())
end
catch = function()
@@ -61,7 +61,7 @@ local function build_invalid_extension_header(nxt_hdr)
end
action = function()
local if_name = stdnse.get_script_args("targets-ipv6-multicast.interface") or nmap.get_interface()
local if_name = stdnse.get_script_args(SCRIPT_NAME .. ".interface") or nmap.get_interface()
local if_nfo = get_ipv6_interface_info_by_name(if_name)
if not if_nfo then
stdnse.print_debug("Invalid interface: " .. if_name)

View File

@@ -6,6 +6,7 @@ Do a very fast host discovery on link-local IPv6 network.
---
-- @usage
-- ./nmap -6 --script=slaac_host_discovery.nse --script-args 'newtargets,interface=eth0,ipv6="2001:da8:215:3320:223:aeff:fe5d:3b10"' -sP
-- @args targets-ipv6-multicast-slaac.interface The interface to use for host discovery.
author = "David and Weilin"
@@ -21,7 +22,7 @@ require "math"
prerule = function()
return nmap.is_privileged() and
(stdnse.get_script_args("targets-ipv6-multicast.interface") or nmap.get_interface())
(stdnse.get_script_args(SCRIPT_NAME .. ".interface") or nmap.get_interface())
end
catch = function()
@@ -88,7 +89,7 @@ local function build_router_advert(mac_src,prefix,prefix_len,valid_time,preferre
end
action = function()
local if_name = stdnse.get_script_args("targets-ipv6-multicast.interface") or nmap.get_interface()
local if_name = stdnse.get_script_args(SCRIPT_NAME .. ".interface") or nmap.get_interface()
local if_nfo = get_ipv6_interface_info_by_name(if_name)
if not if_nfo then
stdnse.print_debug("Invalid interface: " .. if_name)