示例#1
0
    def _advanced_target(self, widg):
        """
        Builds the advanced target widget.

        Before building the widget we verify that the target set in the main
        window is a valid target, this allows us to avoid some issues like

        https://github.com/andresriancho/w3af/issues/2410
        """
        url = self.target.get_text()

        if not self.target.validate():
            msg = 'Invalid target URL: "%s", correct this value to open the'\
                  ' advanced target configuration.'
            dlg = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR,
                                    gtk.BUTTONS_OK, msg % url)
            dlg.run()
            dlg.destroy()
            return

        # overwrite the plugin info with the target url
        configurable_target = self.w3af.target

        # open config
        confpanel.AdvancedTargetConfigDialog(_("Advanced target settings"),
                                             self.w3af, configurable_target,
                                             {"target": url})

        # update the Entry with plugin info
        options = configurable_target.get_options()
        self.target.set_text_wrapper(options['target'].get_value_str())
示例#2
0
    def _advancedTarget(self, widg):
        """Builds the advanced target widget."""
        # overwrite the plugin info with the target url
        configurable_target = self.w3af.target
        url = self.target.get_text()

        # open config
        confpanel.AdvancedTargetConfigDialog(_("Advanced target settings"),
                                             self.w3af, configurable_target,
                                             {"target": url})

        # update the Entry with plugin info
        options = configurable_target.get_options()
        self.target.set_text_wrapper(options['target'].get_value_str())