def __init__(self, w3af): super(EncodeDecode, self).__init__( w3af, "encodedecode", _("w3af - Encode / Decode"), "Encode_and_Decode") self.w3af = w3af # Splitted panes vpan = entries.RememberingVPaned(w3af, "pane-encodedecode") # Upper pane vbox = gtk.VBox() sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.paneup = SimpleTextView() sw.add(self.paneup) vbox.pack_start(sw, True, True, padding=5) # Middle buttons, left hbox = gtk.HBox() cb = gtk.combo_box_new_text() for (lab, fnc) in _butNameFunc_enc: cb.append_text(lab) b = gtk.Button(lab) cb.set_active(0) hbox.pack_start(cb, False, False, padding=10) b = entries.SemiStockButton( "Encode", gtk.STOCK_GO_DOWN, _("Encode the upper text")) b.connect("clicked", self._encode, cb) hbox.pack_start(b, False, False) # Middle buttons, rigth cb = gtk.combo_box_new_text() for (lab, fnc) in _butNameFunc_dec: cb.append_text(lab) b = gtk.Button(lab) cb.set_active(0) b = entries.SemiStockButton( "Decode", gtk.STOCK_GO_UP, _("Decode the lower text")) hbox.pack_end(b, False, False, padding=10) b.connect("clicked", self._decode, cb) hbox.pack_end(cb, False, False) vbox.pack_start(hbox, False, False, padding=5) vpan.pack1(vbox) # Lower pane sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.panedn = SimpleTextView() sw.add(self.panedn) vpan.pack2(sw) self.vbox.pack_start(vpan, padding=10) self.show_all()
def _initReqResViewer(self, mainvbox): """Create the req/res viewer.""" self._reqResViewer = reqResViewer.reqResViewer(self.w3af, editableRequest=False, editableResponse=False) self._reqResViewer.set_sensitive(False) # Create the req/res selector (when a search with more # than one result is done, this window appears) self._sw = gtk.ScrolledWindow() self._sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) self._sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self._lstore = gtk.ListStore(gobject.TYPE_UINT, gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT, gobject.TYPE_STRING, gobject.TYPE_UINT, gobject.TYPE_STRING, gobject.TYPE_FLOAT) # Create tree view self._lstoreTreeview = gtk.TreeView(self._lstore) self._lstoreTreeview.set_rules_hint(True) self._lstoreTreeview.set_search_column(0) self.__add_columns(self._lstoreTreeview) self._lstoreTreeview.show() self._lstoreTreeview.connect('cursor-changed', self._view_in_req_res_viewer) # Popup menu self._rightButtonMenu = None self._lstoreTreeview.connect('button-press-event', self._popupMenu) # # # Selection # treeselection = self._lstoreTreeview.get_selection() treeselection.set_mode(gtk.SELECTION_MULTIPLE) self._sw.add(self._lstoreTreeview) #self._sw.set_sensitive(False) self._sw.show_all() # I want all sections to be resizable self._vpan = entries.RememberingVPaned(self.w3af, "pane-swandrRV", 100) self._vpan.pack1(self._sw) self._vpan.pack2(self._reqResViewer) self._vpan.show() mainvbox.pack_start(self._vpan)
def _buildExplVuln(self): '''The pane with the exploit list and vulnerabilities tree.''' hpan = entries.RememberingHPaned(self.w3af, "pane-epxlvuln", 300) vpan = entries.RememberingVPaned(self.w3af, "pane-expl-desc", 300) # left-bottom plugin_cfg = ConfigPanel() # left-top exploitlist = ExploitTree(self.w3af, plugin_cfg) scrollwin1 = gtk.ScrolledWindow() scrollwin1.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scrollwin1.add_with_viewport(exploitlist) scrollwin1.show() vpan.pack1(scrollwin1) vpan.pack2(plugin_cfg) vpan.show() # Right vuln_vbox = gtk.VBox() interac = VulnerabList(self.w3af, exploitlist) exploitlist.vulnerabs = interac scrollwin2 = gtk.ScrolledWindow() scrollwin2.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scrollwin2.add_with_viewport(interac) scrollwin2.show() add_button = entries.SemiStockButton("Add...", gtk.STOCK_ADD, "Manually add a new vulnerability") add_button.show() add_button.connect("clicked", self.add_vuln) vuln_vbox.pack_start(scrollwin2) vuln_vbox.pack_start(add_button, False, False) vuln_vbox.show() # pack it all and show hpan.pack1(vpan) hpan.pack2(vuln_vbox) hpan.show() return hpan
def _buildpan(self, profileDescription=None): '''Builds the panel.''' pan = entries.RememberingHPaned(self.w3af, "pane-plugconfigbody", 250) leftpan = entries.RememberingVPaned(self.w3af, "pane-plugconfigleft", 320) self.config_panel = ConfigPanel(profileDescription) # upper left scrollwin1u = gtk.ScrolledWindow() scrollwin1u.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.std_plugin_tree = PluginTree(self.w3af, "standard", self.config_panel) scrollwin1u.add(self.std_plugin_tree) scrollwin1u.show() # lower left scrollwin1l = gtk.ScrolledWindow() scrollwin1l.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.out_plugin_tree = PluginTree(self.w3af, "output", self.config_panel) scrollwin1l.add(self.out_plugin_tree) scrollwin1l.show() # pack the left part leftpan.pack1(scrollwin1u) leftpan.pack2(scrollwin1l) leftpan.show() # rigth scrollwin2 = gtk.ScrolledWindow() scrollwin2.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scrollwin2.add_with_viewport(self.config_panel) scrollwin2.show() # pack it all and show pan.pack1(leftpan) pan.pack2(scrollwin2) pan.show() return pan
def _buildInteraction(self): '''The pane with the shells and proxies list.''' pan = entries.RememberingVPaned(self.w3af, "pane-explinteraction") # left shells = Shells(self.w3af) scrollwin1 = gtk.ScrolledWindow() scrollwin1.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scrollwin1.add_with_viewport(shells) scrollwin1.show() # rigth proxies = Proxies() scrollwin2 = gtk.ScrolledWindow() scrollwin2.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scrollwin2.add_with_viewport(proxies) scrollwin2.show() # pack it all and show pan.pack1(scrollwin1) pan.pack2(scrollwin2) pan.show() return pan
def __init__(self, w3af): super(KBBrowser, self).__init__(w3af, "pane-kbbrowser", 250) # Internal variables: # # Here I save the request and response ids to be used in the page control self.req_res_ids = [] # This is to search the DB and print the different request and responses as they are # requested from the page control, "_pageChange" method. self._historyItem = HistoryItem() # the filter to the tree filterbox = gtk.HBox() self.filters = {} def make_but(label, signal, initial): but = gtk.CheckButton(label) but.set_active(initial) but.connect("clicked", self.type_filter, signal) self.filters[signal] = initial but.show() filterbox.pack_start(but, expand=False, fill=False, padding=2) make_but("Vulnerabilities", "vuln", True) make_but("Informations", "info", True) filterbox.show() # the kb tree self.kbtree = FullKBTree(w3af, self, self.filters) # all in the first pane scrollwin21 = gtk.ScrolledWindow() scrollwin21.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scrollwin21.add(self.kbtree) scrollwin21.show() # the filter and tree box treebox = gtk.VBox() treebox.pack_start(filterbox, expand=False, fill=False) treebox.pack_start(scrollwin21) treebox.show() # the explanation explan_tv = gtk.TextView() explan_tv.set_editable(False) explan_tv.set_cursor_visible(False) explan_tv.set_wrap_mode(gtk.WRAP_WORD) self.explanation = explan_tv.get_buffer() explan_tv.show() scrollwin22 = gtk.ScrolledWindow() scrollwin22.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scrollwin22.add_with_viewport(explan_tv) scrollwin22.show() # The request/response viewer self.rrV = reqResViewer.reqResViewer(w3af, withAudit=False) self.rrV.set_sensitive(False) # Create the title label to show the request id self.title0 = gtk.Label() self.title0.show() # Create page changer to handle info/vuln objects that have MORE THAN ONE # related request/response self.pagesControl = entries.PagesControl(w3af, self._pageChange, 0) self.pagesControl.deactivate() self._pageChange(0) centerbox = gtk.HBox() centerbox.pack_start(self.pagesControl, True, False) # Add everything to a vbox vbox_rrv_centerbox = gtk.VBox() vbox_rrv_centerbox.pack_start(self.title0, False, True) vbox_rrv_centerbox.pack_start(self.rrV, True, True) vbox_rrv_centerbox.pack_start(centerbox, False, False) # and show vbox_rrv_centerbox.show() self.pagesControl.show() centerbox.show() # And now put everything inside the vpaned vpanedExplainAndView = entries.RememberingVPaned( w3af, "pane-kbbexplainview", 100) vpanedExplainAndView.pack1(scrollwin22) vpanedExplainAndView.pack2(vbox_rrv_centerbox) vpanedExplainAndView.show() # pack & show self.pack1(treebox) self.pack2(vpanedExplainAndView) self.show()
def __init__(self, w3af, initial_request=None): super(export_request, self).__init__(w3af, "exportreq", "w3af - Export Requests", "Export_Requests") self.w3af = w3af # different ways of exporting data self._exporters = [('HTML', html_export), ('Ajax', ajax_export), ('Python', python_export), ('Ruby', ruby_export)] # splitted panes vpan = entries.RememberingVPaned(w3af, "pane-exportrequests") # upper pane that shows HTTP request vbox = gtk.VBox() sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.http_request = SimpleTextView() sw.add(self.http_request) vbox.pack_start(sw, True, True, padding=5) # middle widgets that show the export method table = gtk.Table(1, 6, homogeneous=True) cb = gtk.combo_box_new_text() for (lab, fnc) in self._exporters: cb.append_text(lab) b = gtk.Button(lab) cb.set_active(0) table.attach(cb, 2, 3, 0, 1) b = entries.SemiStockButton("Export", gtk.STOCK_GO_DOWN, _("Export the request")) b.connect("clicked", self._export, cb) table.attach(b, 3, 4, 0, 1) vbox.pack_start(table, False, False, padding=5) vpan.pack1(vbox) # lower pane with exported data and save button vbox = gtk.VBox() sw = gtk.ScrolledWindow() sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.exported_text = SimpleTextView() sw.add(self.exported_text) vbox.pack_start(sw, True, True, padding=5) b = entries.SemiStockButton("Save request as...", gtk.STOCK_SAVE_AS, _("Save request as...")) b.connect("clicked", self._save_as) vbox.pack_start(b, False, False, padding=5) vpan.pack2(vbox) # Show the data if initial_request is None: self.http_request.set_text(export_request_example) else: (request_header, request_body) = initial_request self.http_request.set_text(request_header + '\n\n' + request_body) func = self._exporters[0][1] self.exported_text.set_text(func(self.http_request.get_text())) self.vbox.pack_start(vpan, padding=10) self.show_all()