Index: ipidseq.nse =================================================================== --- ipidseq.nse (revision 22788) +++ ipidseq.nse (working copy) @@ -30,6 +30,8 @@ require 'bin' require 'packet' +require 'nmap' +require 'stdnse' local NUMPROBES = 6 @@ -193,10 +195,14 @@ end nmap.registry['ipidseq']['rootfail'] = true if nmap.verbosity() > 0 then - nmap.log_write("stdout", "IPIDSEQ: not running for lack of privileges") + stdnse.print_debug("%s not running for lack of privileges, abort!", SCRIPT_NAME) end return false end + if nmap.address_family() ~= 'inet' then + stdnse.print_debug("%s is IPv4 compatible only, abort!", SCRIPT_NAME) + return false + end if not host.interface then return false end Index: qscan.nse =================================================================== --- qscan.nse (revision 22788) +++ qscan.nse (working copy) @@ -53,6 +53,7 @@ require 'bin' require 'packet' require 'tab' +require 'nmap' -- defaults local DELAY = 0.200 @@ -374,10 +375,14 @@ end nmap.registry['qscan']['rootfail'] = true if nmap.verbosity() > 0 then - nmap.log_write("stdout", "QSCAN: not running for lack of privileges") + stdnse.print_debug("%s not running for lack of privileges, abort!", SCRIPT_NAME) end return false end + if nmap.address_family() ~= 'inet' then + stdnse.print_debug("%s is IPv4 compatible only, abort!", SCRIPT_NAME) + return false + end if not host.interface then return false end Index: dhcp-discover.nse =================================================================== --- dhcp-discover.nse (revision 22788) +++ dhcp-discover.nse (working copy) @@ -148,6 +148,11 @@ end action = function(host, port) + if(nmap.address_family() ~= 'inet') then + stdnse.print_debug("%s is IPv4 compatible only, abort!", SCRIPT_FAMILY) + return nil + end + local status, results = go(host, port) Index: firewalk.nse =================================================================== --- firewalk.nse (revision 22788) +++ firewalk.nse (working copy) @@ -57,7 +57,9 @@ -- --- 12/29/2010: initial version +-- 11/29/2010: initial version +-- 03/28/2011: added IPv4 check and standized error messages + author = "Henri Doreau" license = "Same as Nmap--See http://nmap.org/book/man-legal.html" @@ -416,12 +418,17 @@ nmap.registry['firewalk']['rootfail'] = true if nmap.verbosity() > 0 then - nmap.log_write("stdout", SCRIPT_NAME .. ": not running for lack of privileges") + stdnse.print_debug("%s not running for lack of privileges, abort!", SCRIPT_NAME) end return false end + if nmap.address_family() ~= 'inet' then + stdnse.print_debug("%s is IPv4 compatible only, abort!", SCRIPT_NAME) + return false + end + if not host.interface then return false end @@ -468,7 +475,7 @@ nmap.registry['firewalk']['traceroutefail'] = true if nmap.verbosity() > 0 then - nmap.log_write("stdout", SCRIPT_NAME .. ": requires unavailable traceroute informations") + stdnse.print_debug("%s requires unavailable traceroute informations, abort!", SCRIPT_NAME) end return nil Index: path-mtu.nse =================================================================== --- path-mtu.nse (revision 22788) +++ path-mtu.nse (working copy) @@ -38,6 +38,8 @@ require 'bin' require 'packet' +require 'nmap' +require 'stdnse' local IPPROTO_ICMP = packet.IPPROTO_ICMP local IPPROTO_TCP = packet.IPPROTO_TCP @@ -274,10 +276,14 @@ end nmap.registry['pathmtu']['rootfail'] = true if nmap.verbosity() > 0 then - nmap.log_write("stdout", "PATH-MTU: not running for lack of privileges") + stdnse.print_debug("%s not running for lack of privileges, abort!", SCRIPT_NAME) end return false end + if nmap.address_family() ~= 'inet' then + stdnse.print_debug("%s is IPv4 compatible only, abort!", SCRIPT_NAME) + return false + end if not (host.interface and host.interface_mtu) then return false end Index: sniffer-detect.nse =================================================================== --- sniffer-detect.nse (revision 22788) +++ sniffer-detect.nse (working copy) @@ -21,7 +21,8 @@ host.mac_addr ~= nil and host.mac_addr_src ~= nil and host.interface ~= nil and - nmap.get_interface_link(host.interface) == 'ethernet' + nmap.get_interface_link(host.interface) == 'ethernet' and + nmap.address_family() == 'inet' end local function check (layer2)