Пример #1
0
 def _initOptions(self):
     '''Init options.'''
     self.like_initial = True
     self.pref = ConfigOptions(self.w3af, self, 'proxy_options')
     # Proxy options
     proxyOptions = optionList()
     proxyOptions.add(Option('ipport', "localhost:8080", "IP:port","ipport"))
     proxyOptions.add(Option('trap', ".*", _("URLs to trap"), "regex"))
     proxyOptions.add(Option('methodtrap', "GET,POST", _("Methods to trap"), "list"))
     proxyOptions.add(Option("notrap",
         ".*\.(gif|jpg|png|css|js|ico|swf|axd|tif)$", _("URLs not to trap"), "regex"))
     proxyOptions.add(Option("fixlength", True, _("Fix content length"), "boolean"))
     proxyOptions.add(comboOption("trap_view", ['Splitted', 'Tabbed'], _("View of Intercept tab"), "combo"))
     proxyOptions.add(comboOption("home_tab", ['Intercept', 'History', 'Options'], _("Home tab"), "combo"))
     self.pref.addSection('proxy', _('Proxy Options'), proxyOptions)
     # HTTP editor options
     editorOptions = optionList()
     editorOptions.add(Option("wrap", True, _("Wrap long lines"), "boolean"))
     editorOptions.add(Option("highlight_current_line", True, _("Highlight current line"), "boolean"))
     editorOptions.add(Option("highlight_syntax", True, _("Highlight syntax"), "boolean"))
     editorOptions.add(Option("display_line_num", True, _("Display line numbers"), "boolean"))
     self.pref.addSection('editor', _('HTTP Editor Options'), editorOptions)
     # Load values from configfile
     self.pref.loadValues()
     self.pref.show()
Пример #2
0
    def getOptions( self ):
        '''
        @return: A list of option objects for this plugin.
        '''        
        d1 = 'A comma separated list of URLs'
        o1 = option('target', ','.join(str(tar) for tar in 
                                       cf.cf.getData('targets')), d1, 'list')
        
        d2 = 'Target operating system ('+ '/'.join(self._operatingSystems) +')'
        h2 = 'This setting is here to enhance w3af performance.'
        # This list "hack" has to be done becase the default value is the one
        # in the first position on the list
        tmpList = self._operatingSystems[:]
        tmpList.remove( cf.cf.getData('targetOS') )
        tmpList.insert(0, cf.cf.getData('targetOS') )
        o2 = comboOption('targetOS', tmpList, d2, 'combo', help=h2)

        d3 = 'Target programming framework ('+ '/'.join(self._programmingFrameworks) +')'
        h3 = 'This setting is here to enhance w3af performance.'
        # This list "hack" has to be done becase the default value is the one
        # in the first position on the list
        tmpList = self._programmingFrameworks[:]
        tmpList.remove( cf.cf.getData('targetFramework') )
        tmpList.insert(0, cf.cf.getData('targetFramework') )
        o3 = comboOption('targetFramework', tmpList, d3, 'combo', help=h3)
        
        ol = optionList()
        ol.add(o1)
        ol.add(o2)
        ol.add(o3)
        return ol
Пример #3
0
    def getOptions(self):
        """
        @return: A list of option objects for this plugin.
        """
        d1 = "A comma separated list of URLs"
        o1 = option("target", ",".join(cf.cf.getData("targets")), d1, "list")

        d2 = "Target operating system (" + "/".join(self._operatingSystems) + ")"
        h2 = "This setting is here to enhance w3af performance."
        # This list "hack" has to be done becase the default value is the one
        # in the first position on the list
        tmpList = self._operatingSystems[:]
        tmpList.remove(cf.cf.getData("targetOS"))
        tmpList.insert(0, cf.cf.getData("targetOS"))
        o2 = comboOption("targetOS", tmpList, d2, "combo", help=h2)

        d3 = "Target programming framework (" + "/".join(self._programmingFrameworks) + ")"
        h3 = "This setting is here to enhance w3af performance."
        # This list "hack" has to be done becase the default value is the one
        # in the first position on the list
        tmpList = self._programmingFrameworks[:]
        tmpList.remove(cf.cf.getData("targetFramework"))
        tmpList.insert(0, cf.cf.getData("targetFramework"))
        o3 = comboOption("targetFramework", tmpList, d3, "combo", help=h3)

        ol = optionList()
        ol.add(o1)
        ol.add(o2)
        ol.add(o3)
        return ol