diff --git a/NmapOps.cc b/NmapOps.cc index fd7a68013..ff3139c83 100644 --- a/NmapOps.cc +++ b/NmapOps.cc @@ -195,6 +195,7 @@ void NmapOps::Initialize() { #endif debugging = 0; verbose = 0; + min_packet_send_rate = 0.0; /* Unset. */ randomize_hosts = 0; sendpref = PACKET_SEND_NOPREF; spoofsource = 0; diff --git a/NmapOps.h b/NmapOps.h index 5d3f8db94..f9b0590a7 100644 --- a/NmapOps.h +++ b/NmapOps.h @@ -178,6 +178,8 @@ class NmapOps { bool openOnly() { return open_only; } void setOpenOnly(bool oo) { open_only = oo; } int verbose; + /* The requested minimum packet sending rate, or 0.0 if unset. */ + float min_packet_send_rate; int randomize_hosts; int spoofsource; /* -S used */ int fastscan; diff --git a/docs/refguide.xml b/docs/refguide.xml index dbf2751c8..0f639732b 100644 --- a/docs/refguide.xml +++ b/docs/refguide.xml @@ -2300,6 +2300,44 @@ threshold based intrusion detection and prevention systems (IDS/IPS). + + + + (Specify a minimum scanning rate) + --min-rate + + + +Nmap's dynamic timing does a good job of finding an appropriate +speed at which to scan. Sometimes, however, you may happen to know an +appropriate speed for a network, or you may have to guarantee that a +scan will be finished by a certain time. When the + is given Nmap will do its best to send +packets as fast or faster than the given rate. The argument is a +positive real number representing a packet rate in packets per second. +For example, using --min-rate 300 will ensure that +the packet sending rate doesn't fall below 300 packets per second. +Specifying a minimum rate does not keep Nmap from going faster if +conditions warrant. + +There are two conditions when the actual scanning rate may fall +below the specified minimum. The first is if the minimum is faster than +the fastest rate at which Nmap can send, which is dependent on hardware. +In this case Nmap will send packets as fast a possible, but be aware +that such high rates are likely to cause a loss of accuracy. The second +case is when Nmap has nothing to send, for example at the end of a scan +when the last probes have been sent and Nmap is waiting for them to time +out or be responded to. It's normal to see the scanning rate drop at the +end of a scan or in between groups of hosts. + +The option is global, affecting an +entire scan, not individual hosts. It only affects port and host +discovery scans. Other features like OS detection implement their own +timing. + + + + --defeat-rst-ratelimit diff --git a/nmap.cc b/nmap.cc index c130f9807..5d2e66f5f 100644 --- a/nmap.cc +++ b/nmap.cc @@ -278,6 +278,7 @@ printf("%s %s ( %s )\n" " --max-retries : Caps number of port scan probe retransmissions.\n" " --host-timeout