diff --git a/CHANGELOG b/CHANGELOG index 428ba39fb..9e8d6e5cd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ # Nmap Changelog ($Id$); -*-text-*- +o Allow the -4 option for Nmap to indicate IPv4 address family. This is the + default, and using the option doesn't change anything, but does make it more + explicit which address family you want to scan. Using -4 with -6 is an error. + [Daniel Miller] + o [NSE] Added rusers script to get logged-on users info from the rusersd RPC service. [Daniel Miller] @@ -113,6 +118,9 @@ o [NSE] [GH#226] Added http-vuln-cve2014-3704 for detecting and exploiting the o [NSE] [GH#242] Fix multiple false-positive sources in http-backup-agent. [Tom Sellers] +o [Zenmap] [GH#247] Remember window geometry (position and size) from the + previous time Zenmap was run. [isjing] + Nmap 7.01 [2015-12-09] o Switch to using gtk-mac-bundler and jhbuild for building the OS X installer. diff --git a/nmap.cc b/nmap.cc index 5d5b1594d..bcd1299cb 100644 --- a/nmap.cc +++ b/nmap.cc @@ -502,6 +502,7 @@ public: this->pre_max_retries = -1; this->pre_host_timeout = -1; this->iflist = false; + this->af = AF_UNSPEC; } // Pre-specified timing parameters. @@ -517,6 +518,7 @@ public: char *exclude_spec, *exclude_file; char *spoofSource; const char *spoofmac; + int af; std::vector verbose_out; void warn_deprecated (const char *given, const char *replacement) { @@ -1033,13 +1035,19 @@ void parse_options(int argc, char **argv) { case '4': /* This is basically useless for now, but serves as a placeholder to * ensure that -4 is a valid option */ - o.setaf(AF_INET); + if (delayed_options.af == AF_INET6) { + fatal("Cannot use both -4 and -6 in one scan."); + } + delayed_options.af = AF_INET; break; case '6': #if !HAVE_IPV6 fatal("I am afraid IPv6 is not available because your host doesn't support it or you chose to compile Nmap w/o IPv6 support."); #else - o.setaf(AF_INET6); + if (delayed_options.af == AF_INET) { + fatal("Cannot use both -4 and -6 in one scan."); + } + delayed_options.af = AF_INET6; #endif /* !HAVE_IPV6 */ break; case 'A': @@ -1453,6 +1461,9 @@ void apply_delayed_options() { struct sockaddr_storage ss; size_t sslen; + // Default IPv4 + o.setaf(delayed_options.af == AF_UNSPEC ? AF_INET : delayed_options.af); + if (o.verbose > 0) { for (std::vector::iterator it = delayed_options.verbose_out.begin(); it != delayed_options.verbose_out.end(); ++it) { error("%s", it->c_str());