1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-21 15:09:02 +00:00
Commit Graph

4571 Commits

Author SHA1 Message Date
david
2db9068013 Combine some common tests. 2009-11-04 22:29:32 +00:00
david
5cc0f838b2 Add SCTP vtag matching for ping probe replies too. 2009-11-04 22:16:13 +00:00
david
a38d7db2cf Merge r15998 from /nmap-exp/david/nmap-token, SCTP vtag matching. 2009-11-04 22:12:27 +00:00
david
8f6485bbcc Combine a lot of similar loops in the matching of ICMP replies for ping
probes, the same way as is done for normal probes.
2009-11-04 22:09:55 +00:00
david
7399cd7fec Do the same thing as r16000 (IP ID matching only after other tests pass)
for ping probe replies too.
2009-11-04 21:37:02 +00:00
david
af8f151972 Move the IP ID test after the tests for source ports, etc., because
every false attempt degrades the IP ID filter. We only want to to call
it when we're pretty sure we have a match.
2009-11-04 21:33:53 +00:00
david
d00a574ae0 Fix a messed-up patch in NMAP_MODIFICATIONS. 2009-11-04 18:50:55 +00:00
david
637774e960 Remove the dummy grammar.c and scanner.c rules after the all rule, so
that they are not the default, remove duplicate dummy fules for them,
and combine the modification with an existing one for Flex/Bison removal
in NMAP_MODIFICATIONS.
2009-11-04 18:49:07 +00:00
fyodor
84a3d71200 Note host latency in XML suggestion from Andrew Smith 2009-11-04 06:32:21 +00:00
david
1a87380b44 Merge the difference between this branch at r15954 and
/nmap-exp/david/nmap-token. This brings in the following changes:

Use a strict tryno equality test in check_tryno_pingseq. This appears to
have no effect in the current code, because the way we traverse the
probe list backwards ensures that probes with a higher tryno are tried
first. However this protects against matching the wrong tryno if that
behavior is ever changed.

Factor out the code that checks for a match of a TCP packet.

Add some extra checks when matching up TCP probes, to avoid confusing
responses to SYN and ACK probes when they are sent to the same host on
the same port, with the same tryno and pingseq, in a ping scan that
includes both -PS and -PA. I think this is the only case where there can
be confusion. The new rules are: A SYN/ACK can only be matched to a SYN
probe. A RST/ACK can only be matched to a SYN or FIN. A bare RST cannot
be matched to a SYN or FIN.

Make an important change in the way the tryno and pingseq are encoded
for TCP probes with the ACK flag set when --source-port is in effect.
According to RFC 793, responses to ACK packets on an unestablished
connection (CLOSED and LISTEN states in particular) should send a RST
response with a SEQ value the same as the received ACK value. So for
example, if it's in the CLOSED state and wants to send a RST, it sends
        <SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
if the received packet does not have the ACK flag set, but
        <SEQ=SEG.ACK><CTL=RST>

This caused a problem because in the second case, the response does not
reflect our sent SEQ value, which is where the tryno and pingseq are
encoded. The response's acknowledgement number, while not valid because
the ACK flag is not set, is typically 0. Decoding this with seq32_decode
would result in a decoding error, leading to a
        Bad Sequence number from host
message. In this case the probe was allowed to match any TCP probe with
the same ports and address, even though the pingseq and tryno might be
off or the probe is a different kind of probe entirely (like a SYN
probe).

Here's a summary of what has changed, with <tryno,pingseq> standing for
an encoded tryno and pingseq.
Before:
        Non-ACK probes sent with SEQ=<tryno,pingseq>, ACK=0.
        ACK probes sent with SEQ=<tryno,pingseq>, ACK=random
        Probes matched against ACK and ACK - 1.
Now:
        Non-ACK probes sent with SEQ=<tryno,pingseq>, ACK=0.
        ACK probes sent with SEQ=0, ACK=<tryno,pingseq>.
        Probes matched against ACK, ACK - 1, and SEQ.

Matching against the SEQ field may also help in some other weird cases.
In the LISTEN state, the receiving TCP is supposed to check that "the
security/compartment on the incoming segment does not exactly match the
security/compartment in the TCB," and if it doesn't, return
        <SEQ=SEG.ACK><CTL=RST>
just like in the ACK case. I don't know how common that sort of thing is.
2009-11-04 01:52:59 +00:00
fyodor
0524b9b926 David already fixed the 'make install' bug issue I added to TODO about half an hour ago 2009-11-03 23:48:47 +00:00
fyodor
d1fad07f35 TODO changes from chat w/David 2009-11-03 23:28:05 +00:00
fyodor
a759174b84 Added dummy rules to inhibit GNU Make's implicit yacc/lex creation of scanner.c and grammar.c - was causing trouble with the new upgraded libpcap 2009-11-03 21:41:43 +00:00
tomsellers
1eb02ba70d Added xml version prolog to nmap.xsl to enhance standards compliance. This is an optional tag.
See http://www.w3.org/TR/xml/#sec-prolog-dtd
2009-10-31 19:43:46 +00:00
david
0b715fd28c Fix some indentation. 2009-10-29 00:46:55 +00:00
david
bef983abdd Make packet.in_cksum more efficient by not making lots of substring
copies.
2009-10-29 00:28:29 +00:00
david
9817ee470d Make packet.in_cksum work for data with an odd length. 2009-10-29 00:15:04 +00:00
david
2b8b5e2f6a o [Zenmap] There is a new command-line option, --confdir, which allows
setting the per-user configuration directory. Its value defaults to
  $HOME/.zenmap. This was suggested by Jesse McCoppin.
2009-10-28 20:36:52 +00:00
fyodor
0bcdc60f85 Some changes after discussion w/David 2009-10-28 00:06:45 +00:00
david
1445ab46a9 Always print out the "Host is up" line with latency, even without
verbosity.
2009-10-27 22:57:50 +00:00
david
779b6cec2e Don't print out a "Host not scanned" line when doing list scan. 2009-10-27 22:49:23 +00:00
david
f7ea96b349 svn:ignore some files. 2009-10-27 22:45:40 +00:00
david
0b1816c0ff Pregenerate lex and yacc files and remove the build dependency on those
programs.
2009-10-27 22:43:09 +00:00
david
3889091495 Add a cast to silence a compiler warning. 2009-10-27 19:42:19 +00:00
david
9a1ec98da3 Upgrade libpcap to version 1.0.0. 2009-10-27 19:33:50 +00:00
david
a56ff60c50 Add to CHANGELOG:
o Nmap now prefers to display the hostname supplied by the user instead
  of the reverse-DNS name in most places. If a reverse DNS record
  exists, and it differs from the user-supplied name, it is printed
  like this:
    Nmap scan report for www.google.com (74.125.53.103)
    rDNS record for 74.125.53.103: pw-in-f103.1e100.net
  See http://seclists.org/nmap-dev/2009/q4/199 for a summary of other
  minor changes to output. [David]
2009-10-27 15:46:35 +00:00
david
f1dabda17c Fix some pointer declarations messed up by indent. 2009-10-27 15:41:22 +00:00
david
bf29b139bd Only print the first warning that a name resolves to multiple addresses
(the one that happens right after then name is resolved) with -vv. That
information is also printed out above the ports table later.
2009-10-27 06:16:22 +00:00
david
398e53b3de Keep trace of the list of addresses a name resolved to, and print out
how many there were if there were more than one.
2009-10-27 06:08:04 +00:00
david
030411ffd8 Don't repeat the host name and IP address in "Host is up/down" messages.
Don't print the "Nmap scan report" header if there's nothing to put
under it.
2009-10-27 05:26:40 +00:00
david
cb9222bd20 Fix TargetGroup::is_resolved_address. It was actually checking against
the address that was the start of a netmask range.
2009-10-27 05:08:05 +00:00
david
c9fb13b4bb Add methods to TargetGroup to record the name or address that was the
"base address" from which a group of addresses were derived, for example
in "scanme.nmap.org/24", "scanme.nmap.org" would be the base address.
Use these methods to set the target name of that one host even when
addresses come from a netmask.
2009-10-26 23:15:43 +00:00
david
e33810abae Make the argument to Target::setTargetName const. 2009-10-26 23:12:20 +00:00
david
d837d751bc Don't print an rDNS record if it is blank. 2009-10-26 21:17:13 +00:00
david
01f70c5432 Write an "Nmap scan report" heading before scan results. It includes the
reverse DNS if it differs from the forward hostname.
2009-10-26 19:09:56 +00:00
david
d09218c755 Use targetname, the forward DNS name, in Target::NameIP if it is
available, in preference to hostname, the reverse DNS name. NameIP is
used to represent the host in output messages.
2009-10-26 18:17:08 +00:00
fyodor
7f62aa5196 Add a task for standardizing on Zenmap source code file header comments 2009-10-26 06:18:18 +00:00
fyodor
36ff94f9b1 Made some changes suggested by Jah at http://seclists.org/nmap-dev/2009/q4/173, but I didn't make all of them because the file has also been changed by Rob and I'm not sure which still apply 2009-10-25 23:45:51 +00:00
fyodor
cef7b83a8a Delete WanPacket.dll as it is apparently no longer used 2009-10-25 23:42:27 +00:00
fyodor
9cd76905a1 Applied Winpcap installer patch from Rob Nicholls which:
o UPgrades to latest version of WinPcap (4.1.1)

o corrects a long-standing bug in our WinPcap installer (we surrounded
  the install path in the registry with double quotes, which meant we
  wouldn't uninstall our older versions during an install)

o removed the GUI option to select where the WinPcap files are
  installed (all of the important ones end up in the Windows directory
  anyway).  WinPcap folder is installed in the same Program Files
  location on x64 platforms as the official WinPcap installer uses
  (although we're not sure that is the best place)

o Rob notes that he's successfully tested the installer on XP SP3,
  2003 SP2 x86, Vista SP2 x86 and Windows 7 x64
2009-10-25 23:26:40 +00:00
david
7ef692bf52 Credit Matt Selsky for noticing the SSL certificate date parsing bug. 2009-10-24 05:19:52 +00:00
david
c6a3d03dcd FIx SSL certificate date parsing to subtract 1 from the month to fit the
convention of a struct tm. The bug was reported by Matt Selsky.
2009-10-24 05:18:20 +00:00
david
719d9c9442 Add the user's specified host name to XML output, if available. It looks
like this:

<hostnames>
<hostname name="openbsd.org" type="user"/>
<hostname name="cvs.openbsd.org" type="PTR"/>
</hostnames>
2009-10-24 01:01:08 +00:00
david
f037a4828c Remove some dead code. 2009-10-23 23:48:14 +00:00
david
c66cf4f568 Fix some output I missed cleaning up after indent. 2009-10-23 23:45:55 +00:00
david
6ac2ec8a77 Reindent output.cc. 2009-10-23 23:44:17 +00:00
fyodor
1b8c512f50 We really need to integrate OS and version detection submissions and corrections which are piling up 2009-10-23 06:19:26 +00:00
fyodor
3736ed1b92 Changes from chat with David today 2009-10-23 06:14:58 +00:00
david
91478be449 Don't use the AI_NUMERICSERV flag, which isn't available on OS X, in the
getaddrinfo call in l_nsock_bind. We always use decimal port numbers anyway.
2009-10-21 18:04:15 +00:00
fyodor
b32e147878 Add tasks for upgrading our Winpcap and Libpcap to latest versions 2009-10-20 23:50:17 +00:00