1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00
Commit Graph

248 Commits

Author SHA1 Message Date
kris
7ac1b98cb4 Of course, after I commit the big patch I find a possible bug :) In case we can't findHost() on a packet received doing the IPProto Ping 2007-10-28 00:30:19 +00:00
kris
1b1fcc753b Adding a new ping type: IPProto Ping. It's used with '-PO'. I've changed references to -P0 (zero) to -PN throughout the source code and refguide.xml 2007-10-28 00:05:03 +00:00
kris
51c7cdb4c9 Fixing reason code based on ICMP response (during host discovery) 2007-10-24 18:31:51 +00:00
kris
dfc9eba4db enable --ttl support for connect() scans 2007-10-14 14:37:56 +00:00
david
515d45ab9d Reduce the congestion control increment cap back to 50. 50 seems to be good
enough for host discovery, and 100 doesn't give much benefit because the probe
timeouts increase to slow the scan down. While it's faster in some cases, it
also increases the variance in scan times. For more analysis see
http://www.bamsoftware.com/wiki/Nmap/PerformanceGraphs#timeouts.
2007-10-02 19:35:34 +00:00
david
6306350106 Try doubling perf->cc_scale_max to 100. 2007-10-02 07:30:25 +00:00
david
0f396a5b3a Merge from /nmap-exp/david/nmap-massping-migration. This is the change that
scales per-host congestion control increments in the same way those for the
group already are. This speeds scanning in some cases (particularly with few
hosts, when the group congestion control is not the limiting factor). I'm going
to experiment with raising the increment cap to allow this to have more of an
effect.

Scale host congestion control variables similarly to the way group congestion
control is scaled. For the rationale see
http://www.bamsoftware.com/wiki/Nmap/PerformanceGraphs#host-scaled.

Host cc_scale should use (numprobes_sent + numpings_sent), not (numprobes_sent + numprobes_sent).
2007-10-02 06:58:12 +00:00
kris
48dec59470 just fixing some typos in some comments and an error string 2007-09-19 19:43:23 +00:00
david
e75780b503 Increase some debugging thresholds to make them more like they used to be. This means that -d3 is needed for making graphs now. 2007-09-18 06:43:22 +00:00
david
2d91914394 Remove the packet_ratio debugging output. 2007-09-18 06:35:38 +00:00
david
eddc2b0839 Merge r5733:5850 from /nmap-exp/david/nmap-massping-migration.
Remove special-purpose log functions for graphing congestion control and other t
hings. There's enough information provided by -d3.

Update the congestion control graph program and add a program for graphing probe
s and drops.

Increase the initial ccthresh from 50 to 75.

Change how much the congestion threshold drops on packet drops.

Print group timing stats with -d2 and individual host timing stats with -d3.

Bump up the cc-graph.sh y axis limit to 80.

Put graphs in the same directory as their log file.

Go ahead and adjust timing for ICMP destination unreachables. I'm going to commi
t and experimental change to the congestion control that doesn't rely on this an
y more.

Scale group congestion control increments by the inverse of the packet
receipt ratio. This gives great performance without ignoring ICMP
destintation unreachable drops. This may be the breakthrough we've been
looking for.
I'll probably send a message about this later today. For information and        
graphs right now, see
http://www.bamsoftware.com/wiki/Nmap/ResponseRateScaledCongestionControl.
Sorry it's only in my nmap-massping-migration branch for now, but please
give it a try.

Only -d2 is now needed for cc-graph.sh.

Put a cap of 50 on the cwnd scaling factor.

Fix up the order of things in the packet_ratio debugging output.

Move the packet_ratio debugging output to printAnyStats and rearrange the order 
in which things are printed.

Put a header with the scan args at the top of the probes-graph.sh data files.

Add a function pcap_print_stats that shows the number of received and dropped pa
ckets for a descriptor.

Call pcap_print_stats after a run of ultra_scan.

Increase the congestion window less aggressively than before with -T4 and -T5 (s
till more aggressivly than with lesser timing values).
2007-09-18 06:34:33 +00:00
david
f5337b670c Re-commit r5835 without the whitespace changes. 2007-09-17 20:49:09 +00:00
david
144ed4dfb4 Back out r5835, the fix for TCP connect scans on Windows. I didn't realize
until now that Visual C++ made a bunch of whitespace changes in an otherwise
small diff. I'll re-commit the changes in a moment without the whitespace
changes.
2007-09-17 20:47:51 +00:00
david
3f8f42d9d1 Fix TCP connect scans on Windows. Previously, one iterator was used to traverse both the incomplete and completed hosts lists, and Visual C++ didn't like that. Now there are separate iterators for each list. 2007-09-14 19:28:41 +00:00
david
1b41c049fc Merge r5771:5778 from /nmap-exp/david/nmap-massping-migration.
Print group timing stats with -d2 and individual host timing stats with -d3.

Change how much the congestion threshold drops on packet drops.

Increase the initial ccthresh from 50 to 75.
2007-09-05 04:57:36 +00:00
david
9c3ca90f1b Merge r5775 from /nmap-exp/david/nmap-massping-migration.
Print group timing stats with -d2 and individual host timing stats with -d3.
2007-09-04 21:38:44 +00:00
david
0e56b11fc8 Add a timestamp to the timing stats that are printed with -d3 to facilitate making graphs. 2007-09-04 21:10:48 +00:00
fyodor
4dc8618965 capitalization changes 2007-09-03 02:55:01 +00:00
david
cde0b41cc0 Merge r5744 from /nmap-exp/david/nmap-massping-migration.
Add a handler for EACCES on initial connect.
2007-08-31 05:02:25 +00:00
david
695b1a3a2d Merge r5728:5733 from /nmap-exp/david/nmap-massping-migration.
Increase PING_GROUP_SZ to 4096.                                                 

Remove a broken test for wierd_responses (subnet broadcast addresses) and write a note that a working test is needed.
2007-08-30 06:30:29 +00:00
david
c0c4ab055f Remove the real-time "appears to be up" message. I realized I shouldn't have
made such a big UI change with no discussion. Anyway, the message should have
gone within the ((hss->target->flags & HOST_UP) == 0) block so that the message
is printed only once per target.
2007-08-30 03:36:56 +00:00
david
b005b9dea7 Make the "Moving to completed hosts list" message require o.debugging > 1. This was somehow missed in the merge. 2007-08-30 03:24:52 +00:00
david
1c9700464b Merge r5711:5724 from /nmap-exp/david/nmap-massping-migration.
Show up hosts in real time in verbose mode, like what's done with open ports.   
                                                                                
Make some debugging messages less visible.
2007-08-30 02:42:25 +00:00
kris
3b0b8af098 Changing some snprintf()s from the massping migration to Snprintf()s 2007-08-29 20:33:33 +00:00
david
a4dcf90911 Merge r5693:5712 from /nmap-exp/david/nmap-massping-migration.
Always update srtt, rttvar, and timeout for every response, even if we don't adjust congestion control or send delay variables.

Be more careful about checking gstats->sendOK when sending retransmits.
Previously, it was only checked once per traversal of the incomplete
hosts list, which meant that enough probes could be sent in a round to
exceed the congestion window. Explanatory pictures are at
http://www.bamsoftware.com/wiki/Nmap/PerformanceGraphs#retransmit-sendOK.

This needs some more testing to see what effect it has on scan times. My
instinct says it will slow them down, because retransmits will be sent
no faster than before, and retransmits will be more likely to be
responded to, leading to more drops. On the other hand, correctly
detecting a drop and marking a host up is better than blasting
retransmits faster than they can be responded to.
2007-08-29 05:54:29 +00:00
kris
a2cbf0cef4 Fixing a syntax problem (from the massping migration). 'and' was used instead of '&&' in scan_engine.cc, and failed on Windows. 2007-08-28 21:37:52 +00:00
david
433917fc46 Tidy up the message that we're moving a host to the completed list a bit. This is good for release now. 2007-08-28 00:28:24 +00:00
david
bf7f48ebf7 Remove debugging from the default DBGFLAGS and remove some debugging messages. 2007-08-28 00:16:38 +00:00
david
302547375b Look out, world, here comes the Nmap massping migration!
This is the merging of the code that was previously in
/nmap-exp/david/nmap-massping-migration. These are all the big changes
that get rid of massping in favor of doing host discovery using
ultra_scan.

For now, there is a toggle that turns these new changes off. Undefine
NEW_MASSPING in targets.cc to go back to the old code. All of that will
be deleted eventually.

There are likely a few more changes that will be made to this system in
the near future. Those will be made in
/nmap-exp/david/nmap-massping-migration and merged back.

Don't release this just yet, because I'm going to make a few more
commits real quick to remove some debugging stuff.

(Note to self: this merge back was from r5693 in
/nmap-exp/david/nmap-massping-migration.)
2007-08-27 23:58:23 +00:00
kris
d073a19105 Change reason.cc/h to portreasons.cc/h. This is because of a reason.h on Windows which causes compilation problems. A workaround was employed, but this is incase it pops up again. I also changed the recent CHANGELOG entry mentioning reason.h so there's no confusion 2007-08-15 19:26:26 +00:00
kris
0b50c16b38 Adding Snprintf() and Vsnprintf() to nbase/nbase_str.c. This is because of Windows' stupid implementation where it doesn't write a NULL byte at the end of the buffer if the result is truncated. I would've just #defined snprintf and vsnprintf to some wrapper function for Windows, but this doesn't work as libdnet and libpcap (and libpcap includes under mswin32) define snprintf to _snprintf and vsnprintf to _vsnprintf like we do, and through the many defines they end up being available in the Nmap sources. Vsnprintf() uses vsnprintf() (and writes a NULL byte at the end if truncated), and Snprintf uses Vsnprintf(). 2007-08-14 06:46:54 +00:00
fyodor
a788bd1a46 merge soc07 r5322:5360 - fix a problem with RPCGrind time estimates -- the lines sometimes included junk chars on Windows because Windows snprintf doesn't always nul-terminate the strings 2007-08-11 06:12:14 +00:00
fyodor
03b4dc0ec5 merge soc07 r5233 - Changed perror()s with hardcoded function names to Nmap's gh_perror() and __func__, changed perror()s followed by exit()s to Nmap's pfatal(), and removed newlines from perror()s because it breaks the line after that and before the colon and error string, which doesn't make sense 2007-08-11 05:57:54 +00:00
fyodor
6c06f51bd7 merge soc07 r5100 - Changing fprintf(stderr, )'s to error()'s (or fatal() if followed by and exit()). Besides providing consistency, this also allows more errors to actually be logged with --log-errors. 2007-08-11 05:16:56 +00:00
fyodor
8dc9673928 merge soc07 r5085 - Changing bare printf()s to log_write(LOG_PLAIN,)s because these were always printed even when things like XML and greppable output were sent to stdout (e.g. -oX -). This also adds o.scriptTrace() to make --script-trace behave more like --packet-trace and --version-trace. Nsock tracing was done unconditionally in NSE, and that has been changed to only be done when o.scriptTrace() is true. 2007-08-11 05:13:16 +00:00
fyodor
0c123a1056 merge soc07 r4918 - changing a couple more hardcoded function names 2007-08-11 04:21:22 +00:00
fyodor
f2e0ddb40a merge soc07 r4916 - If we get a ICMP Protocol Unreachable from a host other than our target, we set the state to 'filtered' rather than 'closed'. Now it works like Port Unreachables and UDP. 2007-08-11 04:20:48 +00:00
fyodor
8d74bbcd8a merge soc07 r4871:4884 and r4888 - renaming __FUNCTION__ to __func__ and changing hardcoded func names to __func__ 2007-08-11 04:06:09 +00:00
fyodor
47dd05d4d9 merge soc07 r4866 - Fix reason reporting again. I accidentally broke it in r4862 while fixing a memory allocation error. Now the memory error is fixed and reasons work again. 2007-08-11 04:01:05 +00:00
fyodor
87840c36de merge soc07 r4862 - Rearrange some reason-setting code to avoid using deallocated memory. 2007-08-11 03:59:45 +00:00
fyodor
58522c59f6 merge soc07 r4822 - Reduce the number of build dependencies. 2007-08-11 03:35:46 +00:00
fyodor
58f46706e5 merge soc07 r4751 - UDP traceroute hop distance and port state reason feature 2007-08-11 03:15:24 +00:00
kris
aff1d727ef Merging in r4769:4773 from /nmap-exp/soc07/nmap 2007-05-23 22:51:25 +00:00
kris
c0bb3fa376 Just removing a few empty private access specifiers ('private:' is there, but it's not specifying anything) 2007-02-04 01:07:36 +00:00
kris
395b4d2150 Staying on the safe side when matching TCP flags on one part in scan_engine.cc. Instead of testing th_flags == TH_SYN|TH_ACK, it tests if (th_flags & TH_SYN|TH_ACK) == TH_SYN|TH_ACK. It's looks like it's done 'correctly' everywhere else. I can't really think of a real situation where we'd recieve any extra flags when doing a SYN scan, but we could (and it's better than having a false negative anyway). 2007-02-03 04:15:18 +00:00
kris
7d778b51c9 Just fixing a couple typos in comments in scan_engine.cc 2007-02-03 03:57:35 +00:00
kris
5036877865 Remove some duplication in get_pcap_result() in scan_engine.cc. probe->protocol() is all ready checked against ip2->ip_p earlier (the two I'm removing indirectly check against ip2->ip_p: look at the removed part and what ip2->ip_p is tested against in the surrounding if()s). Then a little lower in the function, that whole if() block can be removed because it's the same as what's done in that switch() block. The same error() and hdump() are used in the default case. I could've kept the if(), but this keeps is simple. 2007-02-02 02:33:20 +00:00
kris
76c8efc086 Removing the IPIP header sending with -sO from r4403. This turned out to be less useful than I originally found it to be. 2007-01-29 18:02:28 +00:00
kris
c2427f32d3 Fixed IPProto Scan on localhost when using --data-length to add at least 8 bytes of data. There is a check to see if the packet is at least 28 bytes long (IP header and 8 bytes of data), and if it's at least that big it's considered good. So if the protocol matches, it's considered open. The problem was we didn't check for our own probes, so if we scan localhost with --data-length >=8, everything was labeled open. 2007-01-28 02:25:27 +00:00
kris
6d4ef2aa7e Fix the IPProto scan for UDP. Now we check for ICMP Port Unreachable and call it open if we get one. This was coming up open|filtered, and sometimes filtered before. 2007-01-27 20:09:14 +00:00