From 848ad2a96aacf5c49407d6b416145dba3c952d21 Mon Sep 17 00:00:00 2001 From: fyodor Date: Fri, 3 Mar 2006 23:12:14 +0000 Subject: [PATCH] Nmap 4.02Alpha1 release for Everdream --- CHANGELOG | 28 ++++++++++++++ Makefile.in | 2 +- NmapOps.cc | 16 +++----- configure | 3 +- configure.ac | 2 +- docs/nmap.1 | 46 +++++++++++----------- docs/nmap.usage.txt | 12 +++--- idle_scan.cc | 4 ++ nmap-os-fingerprints | 3 +- nmap.cc | 11 ++++-- nmap.h | 1 - nmap_dns.cc | 20 +++++----- nmap_winconfig.h | 2 +- osscan.cc | 3 ++ output.cc | 2 +- scan_engine.cc | 11 ++++-- service_scan.cc | 8 ++-- tcpip.cc | 90 +++++++++++++++++++++++++------------------- utils.cc | 16 ++++---- 19 files changed, 164 insertions(+), 116 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 92e8fc9dc..f5edc88c9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,32 @@ # Nmap Changelog ($Id$); -*-text-*- +Nmap 4.02ALPHA1 + +o Fixed a flaw in the scan engine which could (in rare cases) + lead to a deadlock situation that prevents a scan from completing. + Thanks to Ganga Bhavani (GBhavani(a)everdreamcorp.com) for reporting + and helping to debug the problem. + +o If the pcap_open_live() call (initiates sniffing) fails, Nmap now + tries up to two more times after waiting a little while. This is + attempt to work around a rare bug on Windows in which the + pcap_open_live() fails for unknown reasons. + +o Fixed a flaw in the runtime interaction in which Nmap would include + hosts currently being scanned in the number of hosts "completed" + statistic. + +o Fixed a crash in OS scan which could occur on Windows when a DHCP + lease issue causes the system to lose its IP address. Nmap still + quits, but at least it gives a proper error message now. Thanks to + Ganga Bhavani (GBhavani(a)everdreamcorp.com) for the patch. + +o Applied more than half a dozen small code cleanup patches from + Kris Katterjohn (kjak(a)ispwest.com). + +o Modified the configure script to accept CXX when specified as an + absolute path rather than just the executable name. Thanks to + Daniel Roethlisberger (daniel(a)roe.ch) for this patch. + Nmap 4.01 o Fixed a bug that would cause bogus reverse-DNS resolution on diff --git a/Makefile.in b/Makefile.in index 83636970e..115af9c5a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -export NMAP_VERSION = 4.01 +export NMAP_VERSION = 4.02Alpha1 NMAP_NAME= Nmap NMAP_URL= http://www.insecure.org/nmap/ NMAP_PLATFORM=@host@ diff --git a/NmapOps.cc b/NmapOps.cc index c56df19e6..0ab43fdfd 100644 --- a/NmapOps.cc +++ b/NmapOps.cc @@ -177,17 +177,13 @@ void NmapOps::Initialize() { char tmpxsl[MAXPATHLEN]; setaf(AF_INET); -#ifndef WIN32 -# ifdef __amigaos__ - isr00t = 1; -# else - if (getenv("NMAP_PRIVILEGED")) - isr00t = 1; - else - isr00t = !(geteuid()); -# endif // __amigaos__ -#else +#if defined WIN32 || defined __amigaos__ isr00t = 1; +#else + if (getenv("NMAP_PRIVILEGED")) + isr00t = 1; + else + isr00t = !(geteuid()); #endif debugging = DEBUGGING; verbose = DEBUGGING; diff --git a/configure b/configure index ab18c0fb7..4a8d447f3 100755 --- a/configure +++ b/configure @@ -2649,7 +2649,8 @@ else ac_cv_prog_CXXPROG="$CXXPROG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +as_dummy=""$PATH":/" +for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. diff --git a/configure.ac b/configure.ac index bc933af66..f2814dfd3 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ AC_PROG_CXX if test -n "$GXX"; then CXXFLAGS="$CXXFLAGS -Wall " fi -AC_CHECK_PROG(CXXPROG, "$CXX", "AVAILABLE", "MISSING") +AC_CHECK_PROG(CXXPROG, "$CXX", "AVAILABLE", "MISSING", "$PATH":/) if test $CXXPROG = "MISSING"; then AC_MSG_ERROR([Could not locate a C++ compiler. If it exists, add it to your PATH or give configure the CXX=path_to_compiler argument. Otherwise, install a C++ compiler such as g++ or install a binary package of Nmap (see http://www.insecure.org/nmap/nmap_download.html ))]) fi diff --git a/docs/nmap.1 b/docs/nmap.1 index b1f9a50b6..6cb716443 100644 --- a/docs/nmap.1 +++ b/docs/nmap.1 @@ -2,7 +2,7 @@ .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1). .\" Instead of manually editing it, you probably should edit the DocBook XML .\" source for it and then use the DocBook XSL Stylesheets to regenerate it. -.TH "NMAP" "1" "02/16/2006" "" "Nmap Reference Guide" +.TH "NMAP" "1" "03/02/2006" "" "Nmap Reference Guide" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -362,12 +362,12 @@ Tells Nmap to \fIalways\fR do reverse DNS resolution on the target IP addresses. Normally this is only performed when a machine is found to be alive. .TP -\fB\-\-system_dns\fR (Use system DNS resolver) +\fB\-\-system\-dns\fR (Use system DNS resolver) By default, Nmap resolves IP addresses by sending queries directly to the name servers configured on your host and then listening for responses. Many requests (often dozens) are performed in parallel for performance. Specify this option if you wish to use your system resolver instead (one IP at a time via the getnameinfo() call). This is slower and rarely useful unless there is a bug in the Nmap DNS code \-\- please contact us if that is the case. The system resolver is always used for IPv6 scans. .TP -\fB\-\-dns_servers \fR (Servers to use for reverse DNS queries) +\fB\-\-dns\-servers \fR (Servers to use for reverse DNS queries) Normally Nmap will try to determine the DNS servers from your resolv.conf file (UNIX) or the registry (Win32). Alternatively, you may use this option to specify your own servers. This option is not honored if you are using -\fB\-\-system_dns\fR +\fB\-\-system\-dns\fR or an IPv6 scan. Using multiple DNS servers is often faster than querying just one. .SH "PORT SCANNING BASICS" .PP @@ -744,6 +744,16 @@ When Nmap is unable to detect a perfect OS match, it sometimes offers up near\-m One of my highest Nmap development priorities has always been performance. A default scan (\fBnmap \fR\fB\fIhostname\fR\fR) of a host on my local network takes a fifth of a second. That is barely enough time to blink, but adds up when you are scanning tens or hundreds of thousands of hosts. Moreover, certain scan options such as UDP scanning and version detection can increase scan times substantially. So can certain firewall configurations, particularly response rate limiting. While Nmap utilizes parallelism and many advanced algorithms to accelerate these scans, the user has ultimate control over how Nmap runs. Expert users carefully craft Nmap commands to obtain only the information they care about while meeting their time constraints. .PP Techniques for improving scan times include omitting non\-critical tests, and upgrading to the latest version of Nmap (performance enhancements are made frequently). Optimizing timing parameters can also make a substantial difference. Those options are listed below. +.PP +Some options accept a +time +parameter. This is specified in milliseconds by default, though you can append \(oqs\(cq, \(oqm\(cq, or \(oqh\(cq to the value to specify seconds, minutes, or hours. So the +\fB\-\-host\-timeout\fR +arguments +900000, +900s, and +15m +all do the same thing. .TP \fB\-\-min\-hostgroup \fR; \fB\-\-max\-hostgroup \fR (Adjust parallel scan group sizes) Nmap has the ability to port scan or version scan multiple hosts in parallel. Nmap does this by dividing the target IP space into groups and then scanning one group at a time. In general, larger groups are more efficient. The downside is that host results can't be provided until the whole group is finished. So if Nmap started out with a group size of 50, the user would not receive any reports (except for the updates offered in verbose mode) until the first 50 hosts are completed. @@ -770,14 +780,10 @@ option is sometimes set to one to prevent Nmap from sending more than one probe \fB\-\-scan\-delay\fR (discussed later), although the latter usually serves the purpose well enough by itself. .TP -\fB\-\-min_rtt_timeout