From 198cb57ea28ddf0e9c90fc30ed275433db1e67e2 Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 5 Jun 2009 04:06:12 +0000 Subject: [PATCH] Added another case to NmapOps::RawScan() to fix a bug where the "Raw packets sent..." message would not be displayed. --- CHANGELOG | 4 ++++ NmapOps.cc | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6d4b292cd..525055ac7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Nmap Changelog ($Id$); -*-text-*- +o Added another case to NmapOps::RawScan() to cover the case where we are using + a SYN ping scan and issuing raw packets. This fixes a bug wherein nmap would + not display the "Raw packets sent..." message [Josh Marlow] + o Changed the ICMP ping probes to use a random non-zero ICMP id. Some hosts seem to drop probes when ICMP id is 0 [Josh Marlow] diff --git a/NmapOps.cc b/NmapOps.cc index 59bff557b..78412ac49 100644 --- a/NmapOps.cc +++ b/NmapOps.cc @@ -321,15 +321,15 @@ bool NmapOps::UDPScan() { return udpscan; } - /* this function does not currently cover cases such as TCP SYN ping - scan which can go either way based on whether the user is root or - IPv6 is being used. It will return false in those cases where a - RawScan is not neccessarily used. */ bool NmapOps::RawScan() { if (ackscan|finscan|idlescan|ipprotscan|maimonscan|nullscan|osscan|synscan|udpscan|windowscan|xmasscan|sctpinitscan|sctpcookieechoscan) return true; if (pingtype & (PINGTYPE_ICMP_PING|PINGTYPE_ICMP_MASK|PINGTYPE_ICMP_TS|PINGTYPE_TCP_USE_ACK|PINGTYPE_UDP|PINGTYPE_SCTP_INIT)) return true; + /* A SYN scan will only generate raw packets if nmap is running as root and is + not issuing IPv6 packets. Otherwise, it becomes a connect scan. */ + if ((pingtype & PINGTYPE_TCP_USE_SYN) && (af() == AF_INET) && isr00t) + return true; return false; }