Nmap Development mailing list archives

[PATCH] allow --host-timeout to be specified in days


From: Sven Klemm <sven () c3d2 de>
Date: Sun, 12 Oct 2008 13:36:08 +0200

Hi everyone,

currently the documentation about --host-timeout is ambigous. Some
places state 'd' is valid while other places do not mention it:

nmap localhost --host-timeout 7d
--host-timeout is specified in milliseconds unless you qualify it by
appending 's', 'm', 'h', or 'd'.  The value must be greater than 1500
milliseconds
QUITTING!

The attached patch adds 'd' as valid qualifier and adjusts the
documentation to mention it in those places where it isn't mentioned yet.

Cheers,
Sven
Index: nmap.cc
===================================================================
--- nmap.cc     (revision 10592)
+++ nmap.cc     (working copy)
@@ -268,7 +268,7 @@
        "  --osscan-guess: Guess OS more aggressively\n"
        "TIMING AND PERFORMANCE:\n"
        "  Options which take <time> are in milliseconds, unless you append 's'\n"
-       "  (seconds), 'm' (minutes), or 'h' (hours) to the value (e.g. 30m).\n"
+       "  (seconds), 'm' (minutes), 'h' (hours), or 'd' (days) to the value (e.g. 30m).\n"
        "  -T[0-5]: Set timing template (higher is faster)\n"
        "  --min-hostgroup/max-hostgroup <size>: Parallel host scan group sizes\n"
        "  --min-parallelism/max-parallelism <time>: Probe parallelization\n"
Index: docs/refguide.xml
===================================================================
--- docs/refguide.xml   (revision 10592)
+++ docs/refguide.xml   (working copy)
@@ -2160,8 +2160,8 @@
 
 <para>Some options accept a <literal>time</literal> parameter.  This
 is specified in milliseconds by default, though you can append
-&lsquo;s&rsquo;, &lsquo;m&rsquo;, or &lsquo;h&rsquo; to the value to
-specify seconds, minutes, or hours. So the
+&lsquo;s&rsquo;, &lsquo;m&rsquo;, &lsquo;h&rsquo;, or &lsquo;d&rsquo; to the value to
+specify seconds, minutes, hours, or days. So the
 <option>--host-timeout</option> arguments <literal>900000</literal>,
 <literal>900s</literal>, and <literal>15m</literal> all do the same thing.</para>
 
Index: nbase/nbase_misc.c
===================================================================
--- nbase/nbase_misc.c  (revision 10592)
+++ nbase/nbase_misc.c  (working copy)
@@ -218,6 +218,7 @@
     return l * 60000;
   }
   if (*endptr == 'h' || *endptr == 'H') return l * 3600000;
+  if (*endptr == 'd' || *endptr == 'D') return l * 86400000;
   return -1;
 }
 
Index: zenmap/share/zenmap/misc/wizard.xml
===================================================================
--- zenmap/share/zenmap/misc/wizard.xml (revision 10592)
+++ zenmap/share/zenmap/misc/wizard.xml (working copy)
@@ -90,7 +90,7 @@
                <option_check option="--max-retries" label="Max Retries" arg_type="int" short_desc="Try sending a probe 
to each port no more than this many times before giving up." example="10"/>
        </Other>
        <Timing label="Timing and performance">
-               <option_check option="--host-timeout" label="Max time to scan a target" arg_type="int" short_desc="Give 
up on a host if it has not finished being scanning in this long. Time is in milliseconds, unless followed by a suffix 
of 's' for seconds, 'm' for minutes, or 'h' for hours." example="1s; 4m; 2h; 1d"/>
+               <option_check option="--host-timeout" label="Max time to scan a target" arg_type="int" short_desc="Give 
up on a host if it has not finished being scanning in this long. Time is in milliseconds, unless followed by a suffix 
of 's' for seconds, 'm' for minutes, 'h' for hours, or 'd' for days." example="1s; 4m; 2h; 1d"/>
                <option_check option="--max-rtt-timeout" label="Max probe timeout" arg_type="int" short_desc="Wait no 
longer than this for a probe response before giving up or retransmitting the probe. Time is in milliseconds, unless 
followed by a suffix of 's' for seconds, 'm' for minutes, or 'h' for hours." example="1s; 4m; 2h; 1d"/>
                <option_check option="--min-rtt-timeout" label="Min probe timeout" arg_type="int" short_desc="Wait at 
least this long for a probe response before giving up or retransmitting the probe. Time is in milliseconds, unless 
followed by a suffix of 's' for seconds, 'm' for minutes, or 'h' for hours." example="1s; 4m; 2h; 1d"/>
                <option_check option="--initial-rtt-timeout" label="Initial probe timeout" arg_type="int" 
short_desc="Use the time given as the initial estimate of round-trip time. This can speed up scans if you know a good 
time for the network you're scanning." example="1s; 4m; 2h; 1d"/>
Index: zenmap/share/zenmap/misc/profile_editor.xml
===================================================================
--- zenmap/share/zenmap/misc/profile_editor.xml (revision 10592)
+++ zenmap/share/zenmap/misc/profile_editor.xml (working copy)
@@ -90,7 +90,7 @@
                <option_check option="--max-retries" label="Max Retries" short_desc="Try sending a probe to each port 
no more than this many times before giving up." example="10"/>
        </Other>
        <Timing label="Timing and performance">
-               <option_check option="--host-timeout" label="Max time to scan a target" short_desc="Give up on a host 
if it has not finished being scanning in this long. Time is in milliseconds, unless followed by a suffix of 's' for 
seconds, 'm' for minutes, or 'h' for hours." example="1s; 4m; 2h; 1d"/>
+               <option_check option="--host-timeout" label="Max time to scan a target" short_desc="Give up on a host 
if it has not finished being scanning in this long. Time is in milliseconds, unless followed by a suffix of 's' for 
seconds, 'm' for minutes, 'h' for hours, or 'd' for days." example="1s; 4m; 2h; 1d"/>
                <option_check option="--max-rtt-timeout" label="Max probe timeout" short_desc="Wait no longer than this 
for a probe response before giving up or retransmitting the probe. Time is in milliseconds, unless followed by a suffix 
of 's' for seconds, 'm' for minutes, or 'h' for hours." example="1s; 4m; 2h; 1d"/>
                <option_check option="--min-rtt-timeout" label="Min probe timeout" short_desc="Wait at least this long 
for a probe response before giving up or retransmitting the probe. Time is in milliseconds, unless followed by a suffix 
of 's' for seconds, 'm' for minutes, or 'h' for hours." example="1s; 4m; 2h; 1d"/>
                <option_check option="--initial-rtt-timeout" label="Initial probe timeout" short_desc="Use the time 
given as the initial estimate of round-trip time. This can speed up scans if you know a good time for the network 
you're scanning." example="1s; 4m; 2h; 1d"/>

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: