From 1c297f9138fe9e6f2b2bd5600365fe02fcc478bf Mon Sep 17 00:00:00 2001 From: david Date: Fri, 7 Oct 2011 09:51:10 +0000 Subject: [PATCH] Check target.ALLOW_NEW_TARGETS. --- scripts/targets-ipv6-multicast-echo.nse | 4 +++- scripts/targets-ipv6-multicast-invalid-dst.nse | 4 +++- scripts/targets-ipv6-multicast-slaac.nse | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/targets-ipv6-multicast-echo.nse b/scripts/targets-ipv6-multicast-echo.nse index f132d73d3..92aa8e201 100644 --- a/scripts/targets-ipv6-multicast-echo.nse +++ b/scripts/targets-ipv6-multicast-echo.nse @@ -122,7 +122,9 @@ local function single_interface_broadcast(if_nfo, results) if reply.mac_dst == src_mac then local target_str = packet.toipv6(reply.ip6_src) if not results[target_str] then - target.add(target_str) + if target.ALLOW_NEW_TARGETS then + target.add(target_str) + end results[#results + 1] = { address = target_str, mac = format_mac(reply.mac_src), iface = if_nfo.device } results[target_str] = true end diff --git a/scripts/targets-ipv6-multicast-invalid-dst.nse b/scripts/targets-ipv6-multicast-invalid-dst.nse index fb319b2ae..f75c84d53 100644 --- a/scripts/targets-ipv6-multicast-invalid-dst.nse +++ b/scripts/targets-ipv6-multicast-invalid-dst.nse @@ -154,7 +154,9 @@ local function single_interface_broadcast(if_nfo, results) local reply = packet.Packet:new(layer3) local target_str = packet.toipv6(reply.ip6_src) if not results[target_str] then - target.add(target_str) + if target.ALLOW_NEW_TARGETS then + target.add(target_str) + end results[#results + 1] = { address = target_str, mac = format_mac(l2reply.mac_src), iface = if_nfo.device } results[target_str] = true end diff --git a/scripts/targets-ipv6-multicast-slaac.nse b/scripts/targets-ipv6-multicast-slaac.nse index 93dfe5934..080e219ac 100644 --- a/scripts/targets-ipv6-multicast-slaac.nse +++ b/scripts/targets-ipv6-multicast-slaac.nse @@ -200,7 +200,9 @@ local function single_interface_broadcast(if_nfo, results) --A host will send several NS packets with the same interface identifier if it receives several RA packets with different prefix during the discovery phase. local actual_addr_str = packet.toipv6(actual_prefix .. identifier) if not results[actual_addr_str] then - target.add(actual_addr_str) + if target.ALLOW_NEW_TARGETS then + target.add(actual_addr_str) + end results[#results + 1] = { address = actual_addr_str, mac = format_mac(l2reply.mac_src), iface = if_nfo.device } results[actual_addr_str] = true end