diff --git a/CHANGELOG b/CHANGELOG index 58c9dfdb1..204f58e1c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o [Zenmap] It is now possible to compare scans having the same name or + command line. [Jah, David Fifield] + o [NSE] Added rdp-vuln-ms12-020.nse by Aleksandar Nikolic. This tests for two Remote Desktop vulnerabilities, including one allowing remote code execution, that were fixed in the MS12-020 advisory. diff --git a/zenmap/zenmapGUI/DiffCompare.py b/zenmap/zenmapGUI/DiffCompare.py index 800d94a04..2970f0449 100644 --- a/zenmap/zenmapGUI/DiffCompare.py +++ b/zenmap/zenmapGUI/DiffCompare.py @@ -122,10 +122,10 @@ class ScanChooser(HIGVBox): "changed": (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ()) } - def __init__(self, scan_dict, title): + def __init__(self, scans, title): self.__gobject_init__() self.title = title - self.scan_dict = scan_dict + self.scan_dict = {} # Setting HIGVBox self.set_border_width(5) @@ -138,8 +138,8 @@ class ScanChooser(HIGVBox): self._set_text_view() self._set_open_button() - for scan in scan_dict: - self.list_scan.append([scan]) + for scan in scans: + self.add_scan(scan.scan_name or scan.get_nmap_command(), scan) self.combo_scan.connect('changed', self.show_scan) self.combo_scan.connect('changed', lambda x: self.emit('changed')) @@ -272,11 +272,8 @@ The parsing error that occurred was\n%s") % str(e)) class DiffWindow(gtk.Window): def __init__(self, scans): - """scans in the format: {"scan_title":parsed_scan} - """ gtk.Window.__init__(self) self.set_title(_("Compare Results")) - self.scans = scans self.ndiff_process = None # We allow the user to start a new diff before the old one has finished. # We have to keep references to old processes until they finish to avoid @@ -284,16 +281,6 @@ class DiffWindow(gtk.Window): self.old_processes = [] self.timer_id = None - self._create_widgets() - self._pack_widgets() - self._connect_widgets() - - self.set_default_size(-1, 500) - - # Initial Size Request - self.initial_size = self.get_size() - - def _create_widgets(self): self.main_vbox = HIGVBox() self.diff_view = DiffView() self.diff_view.set_size_request(-1, 100) @@ -301,8 +288,16 @@ class DiffWindow(gtk.Window): self.progress = gtk.ProgressBar() self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE) self.hbox_selection = HIGHBox() - self.scan_chooser_a = ScanChooser(self.scans, _(u"A Scan")) - self.scan_chooser_b = ScanChooser(self.scans, _(u"B Scan")) + self.scan_chooser_a = ScanChooser(scans, _(u"A Scan")) + self.scan_chooser_b = ScanChooser(scans, _(u"B Scan")) + + self._pack_widgets() + self._connect_widgets() + + self.set_default_size(-1, 500) + + # Initial Size Request + self.initial_size = self.get_size() def _pack_widgets(self): self.main_vbox.set_border_width(6) diff --git a/zenmap/zenmapGUI/MainWindow.py b/zenmap/zenmapGUI/MainWindow.py index 0eabc367b..733b5bb02 100644 --- a/zenmap/zenmapGUI/MainWindow.py +++ b/zenmap/zenmapGUI/MainWindow.py @@ -840,22 +840,7 @@ running at the background.\nWhat do you want to do?')) def _load_diff_compare_cb (self, widget=None, extra=None): """Loads all active scans into a dictionary, passes it to the DiffWindow constructor, and then displays the 'Compare Results' window.""" - # We must change this test dict - # This dict has the following syntax: - # key = Scan name - # value = nmap output in string format - dic = {} - - for parsed in self.scan_interface.inventory.get_scans(): - if parsed.scan_name: - scan_name = parsed.scan_name - else: - scan_name = parsed.get_nmap_command() - - dic[scan_name] = parsed - - self.diff_window = DiffWindow(dic) - + self.diff_window = DiffWindow(self.scan_interface.inventory.get_scans()) self.diff_window.show_all() def show_help():