mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 05:09:00 +00:00
Make use of -4 with -6 illegal.
This commit is contained in:
@@ -1,5 +1,10 @@
|
|||||||
# Nmap Changelog ($Id$); -*-text-*-
|
# 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
|
o [NSE] Added rusers script to get logged-on users info from the rusersd RPC
|
||||||
service. [Daniel Miller]
|
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.
|
o [NSE] [GH#242] Fix multiple false-positive sources in http-backup-agent.
|
||||||
[Tom Sellers]
|
[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]
|
Nmap 7.01 [2015-12-09]
|
||||||
|
|
||||||
o Switch to using gtk-mac-bundler and jhbuild for building the OS X installer.
|
o Switch to using gtk-mac-bundler and jhbuild for building the OS X installer.
|
||||||
|
|||||||
15
nmap.cc
15
nmap.cc
@@ -502,6 +502,7 @@ public:
|
|||||||
this->pre_max_retries = -1;
|
this->pre_max_retries = -1;
|
||||||
this->pre_host_timeout = -1;
|
this->pre_host_timeout = -1;
|
||||||
this->iflist = false;
|
this->iflist = false;
|
||||||
|
this->af = AF_UNSPEC;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pre-specified timing parameters.
|
// Pre-specified timing parameters.
|
||||||
@@ -517,6 +518,7 @@ public:
|
|||||||
char *exclude_spec, *exclude_file;
|
char *exclude_spec, *exclude_file;
|
||||||
char *spoofSource;
|
char *spoofSource;
|
||||||
const char *spoofmac;
|
const char *spoofmac;
|
||||||
|
int af;
|
||||||
std::vector<std::string> verbose_out;
|
std::vector<std::string> verbose_out;
|
||||||
|
|
||||||
void warn_deprecated (const char *given, const char *replacement) {
|
void warn_deprecated (const char *given, const char *replacement) {
|
||||||
@@ -1033,13 +1035,19 @@ void parse_options(int argc, char **argv) {
|
|||||||
case '4':
|
case '4':
|
||||||
/* This is basically useless for now, but serves as a placeholder to
|
/* This is basically useless for now, but serves as a placeholder to
|
||||||
* ensure that -4 is a valid option */
|
* 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;
|
break;
|
||||||
case '6':
|
case '6':
|
||||||
#if !HAVE_IPV6
|
#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.");
|
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
|
#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 */
|
#endif /* !HAVE_IPV6 */
|
||||||
break;
|
break;
|
||||||
case 'A':
|
case 'A':
|
||||||
@@ -1453,6 +1461,9 @@ void apply_delayed_options() {
|
|||||||
struct sockaddr_storage ss;
|
struct sockaddr_storage ss;
|
||||||
size_t sslen;
|
size_t sslen;
|
||||||
|
|
||||||
|
// Default IPv4
|
||||||
|
o.setaf(delayed_options.af == AF_UNSPEC ? AF_INET : delayed_options.af);
|
||||||
|
|
||||||
if (o.verbose > 0) {
|
if (o.verbose > 0) {
|
||||||
for (std::vector<std::string>::iterator it = delayed_options.verbose_out.begin(); it != delayed_options.verbose_out.end(); ++it) {
|
for (std::vector<std::string>::iterator it = delayed_options.verbose_out.begin(); it != delayed_options.verbose_out.end(); ++it) {
|
||||||
error("%s", it->c_str());
|
error("%s", it->c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user