mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 13:09:02 +00:00
Add checks for nmap.address_family == "inet" to scripts that require
that. Patch by Henri Doreau.
This commit is contained in:
@@ -67,7 +67,14 @@ require 'shortport'
|
|||||||
require 'stdnse'
|
require 'stdnse'
|
||||||
|
|
||||||
-- We want to run against a specific host if UDP/67 is open
|
-- We want to run against a specific host if UDP/67 is open
|
||||||
portrule = shortport.portnumber(67, "udp")
|
function portrule(host, port)
|
||||||
|
if nmap.address_family() ~= 'inet' then
|
||||||
|
stdnse.print_debug("%s is IPv4 compatible only.", SCRIPT_NAME)
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
return shortport.portnumber(67, "udp")(host, port)
|
||||||
|
end
|
||||||
|
|
||||||
-- We will want to run as a prerule any time
|
-- We will want to run as a prerule any time
|
||||||
--prerule = function()
|
--prerule = function()
|
||||||
|
|||||||
@@ -57,7 +57,9 @@ firewalk tool.
|
|||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
-- 12/29/2010: initial version
|
-- 11/29/2010: initial version
|
||||||
|
-- 03/28/2011: added IPv4 check
|
||||||
|
|
||||||
author = "Henri Doreau"
|
author = "Henri Doreau"
|
||||||
|
|
||||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||||
@@ -422,6 +424,11 @@ hostrule = function(host)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if nmap.address_family() ~= 'inet' then
|
||||||
|
stdnse.print_debug("%s is IPv4 compatible only.", SCRIPT_NAME)
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
if not host.interface then
|
if not host.interface then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ categories = {"safe", "discovery"}
|
|||||||
|
|
||||||
require 'bin'
|
require 'bin'
|
||||||
require 'packet'
|
require 'packet'
|
||||||
|
require 'nmap'
|
||||||
require 'stdnse'
|
require 'stdnse'
|
||||||
|
|
||||||
local NUMPROBES = 6
|
local NUMPROBES = 6
|
||||||
@@ -198,6 +199,10 @@ hostrule = function(host)
|
|||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
if nmap.address_family() ~= 'inet' then
|
||||||
|
stdnse.print_debug("%s is IPv4 compatible only.", SCRIPT_NAME)
|
||||||
|
return false
|
||||||
|
end
|
||||||
if not host.interface then
|
if not host.interface then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ categories = {"safe", "discovery"}
|
|||||||
|
|
||||||
require 'bin'
|
require 'bin'
|
||||||
require 'packet'
|
require 'packet'
|
||||||
|
require 'nmap'
|
||||||
require 'stdnse'
|
require 'stdnse'
|
||||||
|
|
||||||
local IPPROTO_ICMP = packet.IPPROTO_ICMP
|
local IPPROTO_ICMP = packet.IPPROTO_ICMP
|
||||||
@@ -279,6 +280,10 @@ hostrule = function(host)
|
|||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
if nmap.address_family() ~= 'inet' then
|
||||||
|
stdnse.print_debug("%s is IPv4 compatible only.", SCRIPT_NAME)
|
||||||
|
return false
|
||||||
|
end
|
||||||
if not (host.interface and host.interface_mtu) then
|
if not (host.interface and host.interface_mtu) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ require 'stdnse'
|
|||||||
require 'bin'
|
require 'bin'
|
||||||
require 'packet'
|
require 'packet'
|
||||||
require 'tab'
|
require 'tab'
|
||||||
|
require 'nmap'
|
||||||
|
|
||||||
-- defaults
|
-- defaults
|
||||||
local DELAY = 0.200
|
local DELAY = 0.200
|
||||||
@@ -378,6 +379,10 @@ hostrule = function(host)
|
|||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
if nmap.address_family() ~= 'inet' then
|
||||||
|
stdnse.print_debug("%s is IPv4 compatible only.", SCRIPT_NAME)
|
||||||
|
return false
|
||||||
|
end
|
||||||
if not host.interface then
|
if not host.interface then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ categories = {"discovery", "intrusive"}
|
|||||||
|
|
||||||
-- okay, we're interested only in hosts that are on our ethernet lan
|
-- okay, we're interested only in hosts that are on our ethernet lan
|
||||||
hostrule = function(host)
|
hostrule = function(host)
|
||||||
|
if nmap.address_family() ~= 'inet' then
|
||||||
|
stdnse.print_debug("%s is IPv4 compatible only.", SCRIPT_NAME)
|
||||||
|
return false
|
||||||
|
end
|
||||||
return host.directly_connected == true and
|
return host.directly_connected == true and
|
||||||
host.mac_addr ~= nil and
|
host.mac_addr ~= nil and
|
||||||
host.mac_addr_src ~= nil and
|
host.mac_addr_src ~= nil and
|
||||||
|
|||||||
Reference in New Issue
Block a user