Ejemplo n.º 1
0
    def __init__(self, w3af):
        super(ScanRunBody, self).__init__()
        self.w3af = w3af
        self.helpChapter = ("Browsing_the_Knowledge_Base",
                            "Site_structure", "Requests_and_Responses")
        self.connect("switch-page", self.changed_page)

        # KB Browser
        # this one does not go inside a scrolled window, because that's handled
        # in each widget of itself
        kbbrowser = KBBrowser(w3af)
        l = gtk.Label(_("KB Browser"))
        self.append_page(kbbrowser, l)

        # urlstree, the tree
        pan = entries.RememberingHPaned(w3af, "pane-urltreegraph")
        urlsgraph = URLsGraph(w3af)
        urlstree = URLsTree(w3af, urlsgraph)
        scrollwin1 = gtk.ScrolledWindow()
        scrollwin1.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        scrollwin1.add_with_viewport(urlstree)
        scrollwin1.show()
        pan.pack1(scrollwin1)
        pan.pack2(urlsgraph)
        pan.show()
        l = gtk.Label("URLs")
        self.append_page(pan, l)

        # Request Response navigator
        httplog = httpLogTab.httpLogTab(w3af)
        l = gtk.Label(_("Request/Response navigator"))
        self.append_page(httplog, l)

        self.show()
Ejemplo n.º 2
0
    def __init__(self, w3af):
        super(ScanRunBody, self).__init__()
        self.w3af = w3af
        self.helpChapter = ("Browsing_the_Knowledge_Base", "Site_structure",
                            "Requests_and_Responses")
        self.connect("switch-page", self.changed_page)

        # KB Browser
        # this one does not go inside a scrolled window, because that's handled
        # in each widget of itself
        kbbrowser = KBBrowser(w3af)
        l = gtk.Label(_("KB Browser"))
        self.append_page(kbbrowser, l)

        # urlstree, the tree
        pan = entries.RememberingHPaned(w3af, "pane-urltreegraph")
        urlsgraph = URLsGraph(w3af)
        urlstree = URLsTree(w3af, urlsgraph)
        scrollwin1 = gtk.ScrolledWindow()
        scrollwin1.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        scrollwin1.add_with_viewport(urlstree)
        scrollwin1.show()
        pan.pack1(scrollwin1)
        pan.pack2(urlsgraph)
        pan.show()
        l = gtk.Label("URLs")
        self.append_page(pan, l)

        # Request Response navigator
        httplog = httpLogTab.httpLogTab(w3af)
        l = gtk.Label(_("Request/Response navigator"))
        self.append_page(httplog, l)

        self.show()
Ejemplo n.º 3
0
    def __init__(self, w3af):
        """Constructor."""
        super(ProxiedRequests, self).__init__(w3af,
                                              'proxytool',
                                              _('w3af - Proxy'),
                                              'Using_the_Proxy',
                                              onDestroy=self._close)
        self.w3af = w3af

        self.def_padding = 5

        self._uimanager = gtk.UIManager()
        accelgroup = self._uimanager.get_accel_group()
        self.add_accel_group(accelgroup)
        actiongroup = gtk.ActionGroup('UIManager')
        actiongroup.add_actions([
            ('Help', gtk.STOCK_HELP, _('_Help'), None,
             _('Help regarding this window'), self.open_help),
            ('Drop', gtk.STOCK_CANCEL, _('_Drop Request'), None,
             _('Drop request'), self._drop),
            ('Send', gtk.STOCK_YES, _('_Send Request'), None,
             _('Send request'), self._send),
            ('Next', gtk.STOCK_GO_FORWARD, _('_Next Request'), None,
             _('Move to the next request'), self._next),
        ])
        actiongroup.add_toggle_actions([
            # xml_name, icon, real_menu_text, accelerator, tooltip,
            # callback, initial_flag
            ('TrapReq', gtk.STOCK_JUMP_TO, _('_Trap Requests'), None,
             _('Trap requests'), self._toggle_trap, False),
        ])
        # Finish the toolbar
        self._uimanager.insert_action_group(actiongroup, 0)
        self._uimanager.add_ui_from_string(ui_proxy_menu)
        toolbar = self._uimanager.get_widget('/Toolbar')
        self.bt_drop = toolbar.get_nth_item(2)
        self.bt_send = toolbar.get_nth_item(3)
        self.bt_next = toolbar.get_nth_item(4)
        self.bt_next.set_sensitive(False)
        self.bt_send.set_sensitive(False)
        self.bt_drop.set_sensitive(False)
        separat = toolbar.get_nth_item(5)
        separat.set_draw(False)
        separat.set_expand(True)
        self.vbox.pack_start(toolbar, False)
        self.vbox.show()
        toolbar.show()
        # Request-response viewer
        self._init_options()
        self._prev_ip_port = None
        # We need to make widget (split or tabbed) firstly
        self._layout = self.pref.get_value('proxy', 'trap_view')
        self.reqresp = ReqResViewer(
            w3af, [self.bt_drop.set_sensitive, self.bt_send.set_sensitive],
            editableRequest=True,
            layout=self._layout)
        self.reqresp.set_sensitive(False)
        vbox = gtk.VBox()
        vbox.pack_start(self.reqresp, True, True)
        vbox.show()

        # Notebook
        self.nb = gtk.Notebook()
        tabs = []

        # Intercept
        tmp = gtk.Label(_("_Intercept"))
        tmp.set_use_underline(True)
        self.nb.append_page(vbox, tmp)
        tabs.append('Intercept')

        # History
        self.httplog = httpLogTab.httpLogTab(w3af, time_refresh=True)
        tmp = gtk.Label(_("_History"))
        tmp.set_use_underline(True)
        self.nb.append_page(self.httplog, tmp)
        tabs.append('History')

        # Options
        tmp = gtk.Label(_("_Options"))
        tmp.set_use_underline(True)
        self.nb.append_page(self.pref, tmp)
        tabs.append('Options')
        self.vbox.pack_start(self.nb, True, True, padding=self.def_padding)
        self.nb.show()

        # Go to Home Tab
        self.nb.set_current_page(
            tabs.index(self.pref.get_value('proxy', 'home_tab')))

        # Status bar for messages
        self.status_bar = StatusBar()
        self.vbox.pack_start(self.status_bar, False, False)
        self.status_bar.show()

        self.proxy = None

        # Finish it
        self.fuzzable = None
        self.waiting_requests = False
        self.keep_checking = False
        self.reload_options()

        gobject.timeout_add(200, self._supervise_requests)
        self.show()