1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-04 13:49:03 +00:00
Commit Graph

44 Commits

Author SHA1 Message Date
david
da51bd5fa8 Include one <nmaprun> element if they don't differ in the input when
verbose (was previously omitted). Refactor a bit.
2011-04-29 03:56:05 +00:00
david
79ae90e80f Add nmaprun information to Ndiff output.
Patch by Daniel Miller.
2011-04-29 03:56:03 +00:00
david
7ddf10f388 Capitalization. 2011-04-28 02:13:19 +00:00
david
ce23a35715 o [Ndiff] The Nmap banner (with the version number and date of the scan)
is not printed unless there were other differences. This makes Nidff
  produce no output when there wre no differences other than the version
  number and date. Dr. Jesus contributed an initial patch. [David]
2011-03-22 18:59:02 +00:00
david
a531183086 Don't show a line for the banner if it hasn't changed, for uniformity
with other diffs, as suggested by Fyodor.
2011-03-05 07:54:54 +00:00
david
173027cf0d Factor out code that formats a script result diffs. 2011-02-03 04:53:04 +00:00
david
98daa69d41 Add support for prerule and postrule scripts to Ndiff. 2011-02-03 04:53:03 +00:00
david
bb07ca0b57 Limit exception catching to IOError; i.e., missing files. I much prefer
to get a stack trace in most situations.
2011-02-03 04:53:01 +00:00
david
4c649d481b Fix ordering of hostscript diff elements when either side of the diff
doesn't have any. Patch by Daniel Miller.
2011-02-03 04:52:59 +00:00
david
d7e555c878 Patch from Daniel Miller: fix an output line that was writing to stdout
even when other output was redirected.
2011-01-28 21:16:18 +00:00
david
3c09069ee4 Show a nicer error message in Ndiff when an input file can't be opened. 2010-01-25 23:07:16 +00:00
david
05e5348b57 Normalize the Ndiff exit codes.
0 if the scans are equal,
	1 if they differ, and
	2 for runtime errors.
Add tests and man page documentation.
2009-07-30 14:40:46 +00:00
david
3a4a181f2d Remove extraports state inference from Ndiff. This was a feature that,
if there was only one extraports state, would create a Port object for
each scanned port that was not listed explictly. So for example, if a
scan of 100 ports had 5 open ports and an extraports of "filtered",
Ndiff would create 95 port records in the "filtered" state in addition
to the 5 "open". If there was more than one extraports state this was
not possible.

This turned out to be a slow operation, out of all proportion to its
utility. Here are times for a diff of random-1.xml and random-2.xml,
before and after:

real    0m11.912s
user    0m10.970s
sys     0m0.249s

real    0m0.773s
user    0m0.726s
sys     0m0.046s

In most cases extraports are not shown in the output, so this was wasted
effort. I know of only one place where it affected the output, when an
extraports in the A scan because a non-extraports in a different state
in the B scan. Then the previous state would be included in the <a>
port, where now it will just be listed without a state.
2009-07-17 19:46:41 +00:00
david
ba53f578b3 Show script output in Ndiff text output. 2009-07-13 05:59:05 +00:00
david
b9f994e71d Add script output to Ndiff XML output. 2009-07-13 05:34:13 +00:00
david
fda75eea6c Move the text output of port diffs from the HostDiff class to the
PortDiff class.
2009-07-13 04:19:21 +00:00
david
5abf361663 Visually simplify the code that builds the port table. 2009-07-11 02:26:02 +00:00
david
a660b37026 Parse script results. 2009-07-10 23:55:29 +00:00
david
98af0bba24 Add an append_raw method to the Table class to add an unformatted string
to a table. This is going to be for script output.
2009-07-10 01:25:39 +00:00
david
f6b10157f7 Fix a bug: in deciding whenther to print the diff for a port, a port in
host B was being check to see if it was an extraport in host A.
2009-07-06 22:27:53 +00:00
david
6e25eff176 Fix a bug I found by reading Daniel Roethlisberger's article at
http://www.linux-magazin.de/Heft-Abo/Ausgaben/2009/06/Alles-inklusive/(offset)/4.
Don't print a "Not shown: " line if there were no extraports.
2009-05-24 18:59:19 +00:00
david
26361a4642 Remove the claim that XML output is not supported from "ndiff -h". That
was left over from when the output was being redesigned.
2009-05-13 00:41:55 +00:00
david
e5d21d371e Oops, don't print the program name twice when reporting an option
parsing error.
2009-05-13 00:40:38 +00:00
david
67c34404f2 Print the "Try -h for help" message when there's an option error in
addition to the error message getopt prints.
2009-05-13 00:39:40 +00:00
david
4c13088d1e Use "Host is up.", not "Host appears to be up." to match Nmap output. 2009-04-10 19:08:48 +00:00
david
c701b9559b Merge from /nmap-exp/david/ndiff-mkii and
/nmap-exp/david/zenmap-ndiff-alt. This is the new Ndiff output format
described in http://seclists.org/nmap-dev/2009/q1/0825.html and
http://seclists.org/nmap-dev/2009/q2/0127.html.
2009-04-10 19:07:39 +00:00
david
72e9a1fd93 Adjust capitalization of "ndiff" to "Ndiff" in a couple of comments. 2009-03-26 01:57:57 +00:00
david
683382bd68 Revert r12572. I remember why I split the element handlers into a helper
function. It was to make it easy to return out of the handler on error and
still have startElement and endElement maintain the element stack.
2009-03-25 16:33:50 +00:00
david
28705df8ac Use substitution to insert the element name in XML parsing error messages. I
had a copy-paste error where a message under "status" referred to the
"extraports" element.
2009-03-25 16:30:26 +00:00
david
99ebbe3d13 Fix variables names in the code that generates XML for the host-hostname-remove
and host-hostname add elements to refer to hostnames and not addresses.
2009-03-25 01:35:26 +00:00
david
9c3cc6458b Add new Ndiff version and OS differencing to CHANGELOG. 2009-03-18 02:07:40 +00:00
david
7ecfe34fe5 Add OS difference reporting to Ndiff. It looks like
Remove OS "Linux 2.6.18 - 2.6.25".
        Remove OS "Linux 2.6.8 - 2.6.20".
        Remove OS "OpenWrt (Linux 2.6.19 - 2.6.21)".
        Add OS "Archos 605 WiFi video player".
        Add OS "Linux 2.6.27 (Ubuntu)".
        Add OS "Linux 2.6.22".
        Add OS "Linux 2.6.27".
2009-03-18 01:21:25 +00:00
david
ccd55623c7 Record OS information in Ndiff. 2009-03-18 00:09:14 +00:00
david
fd41fcd0f7 Include service detection information in Ndiff output. Change the output format
from

	21/tcp is open, was filtered.
	23/tcp is open, was filtered.
	80/tcp is open, was filtered.
	8701/tcp is filtered, was open.

to

	-21/tcp filtered  
	+21/tcp open ftp Netgear broadband router ftpd 1.0
	-23/tcp filtered  
	+23/tcp open telnet Netgear broadband router admin telnetd
	-80/tcp filtered  
	+80/tcp open http Embedded Allegro RomPager webserver 4.07 UPnP/1.0 (ZyXEL ZyWALL 2)
	-8701/tcp open unknown 
	+8701/tcp filtered
2009-03-16 19:53:34 +00:00
david
63d5040557 Remove the startElementAux and endElementAux methods. Just handle the element
stack management in startElement and endElement.
2009-03-13 21:43:33 +00:00
david
91956287c2 Make each possible diff hunk its own class, rather than having them all be in
the DiffHunk class with a type tag. Now output is handled with polymorphism
rather than dispatching with if/else. It also better shows what members each
hunk type has.
2009-03-13 00:17:48 +00:00
david
df7f565cc5 [Ndiff] Added a workaround for a bug in PyXML. The bug would cause a
crash that looked like "KeyError: 0". Fyodor reported the error.
2009-03-10 15:31:27 +00:00
david
4db82f9351 When ndiff gets a command-line option it doesn't understand, print just the
exception message rather than the whole exception tuple. This changes
./ndiff: ('option --foo not recognized', 'foo')
to
./ndiff: option --foo not recognized
2009-01-23 21:03:13 +00:00
david
c4b27a31b4 Don't ignore host state changes when the change is to the state "unknown". This
happens when a host was scanned in the A scan but wasn't scanned in the B scan.
I previously had it ignore such changes using the logic that the diff should be
like scan aggregation: no new information means no state change. But I think
it's more useful to see those changes in which hosts were scanned.

This is analogous to r10263, which did the same thing for port state changes.
2009-01-20 21:02:15 +00:00
david
4b02922b81 Use a more concise definition of render_port_list. 2008-11-25 18:31:03 +00:00
david
c4b60d8b72 Fix a typo in and add an assertion to ndiff. 2008-11-24 05:29:38 +00:00
david
f2782f3e4e Don't elide port state changes when a state changes to "unknown." I originally
did this with the idea of making diffing like scan aggregation, with known
characteristics carrying forward through unknown. But it can be confusing. I
think when you diff
  nmap scanme.nmap.org
and
  nmap -F scanme.nmap.org
you want to see that the gopher port changes from closed to unknown, because
it's not scanned by fast scan.
2008-09-19 00:41:51 +00:00
david
68e326252e Remove "other" from doubly consolidated port state change lines. When all the
ports had the same state change, "other" doesn't make sense.
2008-09-19 00:33:35 +00:00
david
903e91a48b Move /nmap-exp/david/ndiff to /nmap/ndiff. 2008-09-18 23:31:19 +00:00