Пример #1
0
 def _para_list(self, params, part):
     l = len(params)
     if l == 0:
         return suggest(self._children.keys(), part)
     if l == 1:
         return suggest(['all', 'enabled', 'disabled'], part)
     return []
Пример #2
0
 def _para_list(self, params, part):
     l = len(params)
     if l == 0:
         return suggest(self._children.keys(), part)
     if l == 1:
         return suggest(['all', 'enabled', 'disabled'], part)
     return []
Пример #3
0
    def suggest_params(self, command, params, part):
        if command in self.get_commands():
            return menu.suggest_params(self, command, params, part)

        alreadySel = [s.lstrip('!') for s in [command] + params]

        plugins = self._plugins.keys()
        return suggest(plugins, part.lstrip('!'), alreadySel)
Пример #4
0
    def _para_details(self, params, part):
        if len(params):
            return []

        all_edata = self._w3af.exception_handler.get_all_exceptions()
        suggestions = [str(i) for i in xrange(len(all_edata))]

        return suggest(suggestions, part)
Пример #5
0
    def suggest_params(self, command, params, part):
        if command in self.get_commands():
            return menu.suggest_params(self, command, params, part)

        alreadySel = [s.lstrip('!') for s in [command] + params]

        plugins = self._plugins.keys()
        return suggest(plugins, part.lstrip('!'), alreadySel)
Пример #6
0
    def _para_details(self, params, part):
        if len(params):
            return []

        all_edata = self._w3af.exception_handler.get_all_exceptions()
        suggestions = [str(i) for i in xrange(len(all_edata))]

        return suggest(suggestions, part)
Пример #7
0
    def suggest_commands(self, part='', onlyLocal=False):

        first, rest = splitPath(part)

        if rest is None:
            # the command must be in the current menu
            result = suggest(self.get_commands(onlyLocal), part)
            if self.get_children() is not None:
                result += suggest(self.get_children(), part)
            return result
        else:
            try:
                # delegate to the children
                subMenu = self.get_children()[first]
                return subMenu.suggest_commands(rest, True)
            except:
                return []
Пример #8
0
    def _para_set(self, params, part):
        if len(params) == 0:
            result = suggest([i.get_name() for i in self._options], part)
            return result
        elif len(params) == 1:
            paramName = params[0]
            if paramName not in self._options:
                return []

            opt = self._options[paramName]
            paramType = opt.get_type()
            if paramType == 'boolean':
                values = [opt.get_default_value(
                ) == 'True' and 'False' or 'True']
            else:
                values = self._memory[paramName]

            return suggest(values, part)
        else:
            return []
Пример #9
0
    def _para_set(self, params, part):
        if len(params) == 0:
            result = suggest([i.get_name() for i in self._options], part)
            return result
        elif len(params) == 1:
            paramName = params[0]
            if paramName not in self._options:
                return []

            opt = self._options[paramName]
            paramType = opt.get_type()
            if paramType == 'boolean':
                values = [
                    opt.get_default_value() == 'True' and 'False' or 'True'
                ]
            else:
                values = self._memory[paramName]

            return suggest(values, part)
        else:
            return []
Пример #10
0
    def _para_add(self, params, part):
        if len(params):
            return []

        return suggest(get_template_names(), part)
Пример #11
0
    def _para_list(self, params, part):
        if len(params):
            return []

        return suggest(self._w3af.plugins.get_plugin_types(), part)
Пример #12
0
 def _para_list(self, params, part=''):
     if len(params) == 0:
         return suggest(['enabled', 'all', 'disabled'], part)
     return []
Пример #13
0
    def _para_config(self, params, part):
        if len(params) > 0:
            return []

        return suggest([p for p in self._plugins.keys()
                        if self._plugins[p] > 0], part)
Пример #14
0
    def _para_list(self, params, part):
        if len(params):
            return []

        return suggest(self.__getters.keys(), part)
Пример #15
0
 def _para_help(self, params, part):
     if len(params) == 0:
         return suggest(self._help.get_items(), part)
     else:
         return []
Пример #16
0
 def _para_list(self, params, part=''):
     if len(params) == 0:
         return suggest(['enabled', 'all', 'disabled'], part)
     return []
Пример #17
0
    def _para_config(self, params, part):
        if len(params) > 0:
            return []

        return suggest(
            [p for p in self._plugins.keys() if self._plugins[p] > 0], part)
Пример #18
0
    def _para_desc(self, params, part):
        if len(params) > 0:
            return []

        return suggest(self._plugins.keys(), part)
Пример #19
0
    def _para_list(self, params, part):
        if len(params):
            return []

        return suggest(self.__getters.keys(), part)
Пример #20
0
 def _para_use(self, params, part):
     if not params:
         return suggest(self._profiles.keys(), part)
     return []
Пример #21
0
 def suggest_commands(self, part, *skip):
     return suggest(self._plugins.keys() + ['all'], part.lstrip('!')) + \
         suggest(self.get_commands(), part)
Пример #22
0
    def _para_list(self, params, part):
        if len(params):
            return []

        return suggest(self._w3af.plugins.get_plugin_types(), part)
Пример #23
0
 def suggest_commands(self, part, *skip):
     return suggest(self._plugins.keys() + ['all'], part.lstrip('!')) + \
         suggest(self.get_commands(), part)
Пример #24
0
 def _para_help(self, params, part):
     result = menu._para_help(self, params, part)
     result.extend(suggest(self._optDict, part))
     return result
Пример #25
0
    def _para_desc(self, params, part):
        if len(params) > 0:
            return []

        return suggest(self._plugins.keys(), part)
Пример #26
0
 def _para_help(self, params, part):
     result = menu._para_help(self, params, part)
     result.extend(suggest(self._optDict, part))
     return result
Пример #27
0
    def _para_add(self, params, part):
        if len(params):
            return []

        return suggest(get_template_names(), part)