From cec2dd7816f56e47f56670a4ef37245929030a4e Mon Sep 17 00:00:00 2001 From: patrik Date: Sat, 5 May 2012 19:44:46 +0000 Subject: [PATCH] Fixed a bug reported by Josh Greenwood that would incorrectly detect a host having IP forwarding enabled if the scanned host was the same as the probe target. --- scripts/ip-forwarding.nse | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/ip-forwarding.nse b/scripts/ip-forwarding.nse index d1912cf9a..0ae222a9b 100644 --- a/scripts/ip-forwarding.nse +++ b/scripts/ip-forwarding.nse @@ -101,6 +101,10 @@ action = function(host) target = arg_target end + if ( target == host.ip ) then + return ("\n ERROR: Target can not be the same as the scanned host") + end + if (icmpEchoRequest(ifname, host, target)) then return ("\n The host has ip forwarding enabled, tried ping against (%s)"):format(arg_target) end