From ce23a357156b1a431de11e49488a92154f766e7a Mon Sep 17 00:00:00 2001 From: david Date: Tue, 22 Mar 2011 18:59:02 +0000 Subject: [PATCH] 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] --- CHANGELOG | 5 +++++ ndiff/ndiff | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e39a06769..3bb717016 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ # Nmap Changelog ($Id$); -*-text-*- +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] + o [Zenmap] Fixed a bug in the option parser: -sN (null scan) was interpreted as -sn (no port scan). This was reported by shitaneddine. [David] diff --git a/ndiff/ndiff b/ndiff/ndiff index d36d3a79d..0891505f0 100755 --- a/ndiff/ndiff +++ b/ndiff/ndiff @@ -461,11 +461,12 @@ class ScanDiff(object): """Print this diff in a human-readable text form.""" banner_a = format_banner(self.scan_a) banner_b = format_banner(self.scan_b) - if banner_a != banner_b: - print >> f, u"-%s" % banner_a - print >> f, u"+%s" % banner_b - elif verbose: - print >> f, u" %s" % banner_a + if self.cost > 0 or verbose: + if banner_a != banner_b: + print >> f, u"-%s" % banner_a + print >> f, u"+%s" % banner_b + elif verbose: + print >> f, u" %s" % banner_a print_script_result_diffs_text("Pre-scan script results", self.scan_a.pre_script_results, self.scan_b.pre_script_results,