This commit is contained in:
n1nj4sec 2016-10-25 10:19:11 +02:00
commit fbe3ab27eb
1 changed files with 15 additions and 6 deletions

View File

@ -341,7 +341,7 @@ class PupyCmd(cmd.Cmd):
for command,doc in cmds_doc: for command,doc in cmds_doc:
if doc is None: if doc is None:
doc="" doc=""
self.stdout.write("- {:<10} {}\n".format(command, color(doc.strip(),'grey'))) self.stdout.write("- {:<15} {}\n".format(command, color(doc.title().strip(),'grey')))
@staticmethod @staticmethod
def format_log(msg): def format_log(msg):
@ -427,12 +427,21 @@ class PupyCmd(cmd.Cmd):
def do_list_modules(self, arg): def do_list_modules(self, arg):
""" List available modules with a brief description (the first description line) """ """ List available modules with a brief description (the first description line) """
system = ''
if self.default_filter:
system = self.pupsrv.get_clients(self.default_filter)[0].desc['platform'].lower()
self.display_success("List modules compatible with the selected host: %s" % system)
else:
self.display_success("List all modules")
for mod in sorted([x for x in self.pupsrv.iter_modules()], key=(lambda x:x.category)): for mod in sorted([x for x in self.pupsrv.iter_modules()], key=(lambda x:x.category)):
doc=mod.__doc__ if mod.is_module:
if not doc: if (self.default_filter and (system in mod.compatible_systems or not mod.compatible_systems)) or (not self.default_filter):
doc="" if mod.__doc__:
doc=doc.strip() doc = mod.__doc__.strip()
self.stdout.write("{:<20} {}\n".format("%s/%s"%(mod.category,mod.get_name()), color(doc.split("\n",1)[0],'grey'))) else:
doc = ''
self.stdout.write("{:<25} {}\n".format("%s/%s"%(mod.category,mod.get_name()), color(doc.title().split("\n",1)[0],'grey')))
def do_sessions(self, arg): def do_sessions(self, arg):
""" list/interact with established sessions """ """ list/interact with established sessions """