From cf0b55788f3074b94230a1ed3be444fd4d701edb Mon Sep 17 00:00:00 2001 From: david Date: Sat, 6 Oct 2012 21:26:30 +0000 Subject: [PATCH] Enable IPv6 traceroute only for TCP and ICMPv6. The other protocols that are implemented for IPv4 are not implemented for IPv6, leading to an assertion failure. nmap: traceroute.cc:749: virtual unsigned char* UDPProbe::build_packet(const sockaddr_storage*, u32*) const: Assertion `source->ss_family == 2' failed. This was noticed by Pierre Emeriaud. http://seclists.org/nmap-dev/2012/q4/36 --- CHANGELOG | 7 +++++++ traceroute.cc | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 09c3be034..3f9b055e7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,12 @@ # Nmap Changelog ($Id$); -*-text-*- +o Fixed an assertion failure with IPv6 traceroute trying to use an + unsupported protocol: + nmap: traceroute.cc:749: virtual unsigned char* + UDPProbe::build_packet(const sockaddr_storage*, u32*) const: Assertion + `source->ss_family == 2' failed. + This was reported by Pierre Emeriaud. [David Fifield] + o [NSE] Added oracle-brute-stealth which exploits CVE-2012-3137, a weakness in the Oracle O5LOGIN authentication scheme. [Dhiru Kholia] diff --git a/traceroute.cc b/traceroute.cc index 33fa5b351..d0351c248 100644 --- a/traceroute.cc +++ b/traceroute.cc @@ -555,10 +555,13 @@ struct probespec HostState::get_probe(const Target *target) { struct probespec probe; probe = target->pingprobe; - if (probe.type == PS_TCP || probe.type == PS_UDP || probe.type == PS_ICMP || - probe.type == PS_SCTP || probe.type == PS_ICMPV6) { + if (target->af() == AF_INET && + (probe.type == PS_TCP || probe.type == PS_UDP || probe.type == PS_SCTP || probe.type == PS_ICMP)) { /* Nothing needed. */ - } else if (probe.type == PS_PROTO) { + } else if (target->af() == AF_INET6 && + (probe.type == PS_TCP || probe.type == PS_ICMPV6)) { + /* Nothing needed. */ + } else if (target->af() == AF_INET && probe.type == PS_PROTO) { /* If this is an IP protocol probe, fill in some fields for some common protocols. We cheat and store them in the TCP-, UDP-, SCTP- and ICMP-specific fields. */