Exemple #1
0
 def execute(self, tokens):
     if len(tokens) > 0:
         command, params = tokens[0], tokens[1:]
         #print "command: " + command + "; " + str(self.get_commands())
         if command in self.get_commands():
             return menu.execute(self, tokens)
         else:
             self._enablePlugins(','.join(tokens).split(','))
     else:
         return self
Exemple #2
0
 def execute(self, tokens):
     if len(tokens) > 0:
         command, params = tokens[0], tokens[1:]
         #print "command: " + command + "; " + str(self.get_commands())
         if command in self.get_commands():
             return menu.execute(self, tokens)
         else:
             self._enablePlugins(','.join(tokens).split(','))
     else:
         return self
Exemple #3
0
 def execute(self, tokens):
     """
     This is a trick to make this console back-compatible.
     For example, command 'audit' means 'show all audit plugins',
     while command 'audit xss' means 'enable xss plugin'.
     At the same time, to show only enabled audit plugin, the command
     'list audit enabled' has to be used.
     That's an inconsistency, which needs a resolution.
     """
     if len(tokens) == 1 and tokens[0] in self._children:
         return self._cmd_list(tokens)
     return menu.execute(self, tokens)
Exemple #4
0
 def execute(self, tokens):
     """
     This is a trick to make this console back-compatible.
     For example, command 'audit' means 'show all audit plugins',
     while command 'audit xss' means 'enable xss plugin'.
     At the same time, to show only enabled audit plugin, the command
     'list audit enabled' has to be used.
     That's an inconsistency, which needs a resolution.
     """
     if len(tokens) == 1 and tokens[0] in self._children:
         return self._cmd_list(tokens)
     return menu.execute(self, tokens)