class ModuleAPIView(ListAPIView): """List available Modules""" queryset = [{ "name": key, "description": value["description"] } for key, value in __modules__.items()] serializer_class = PassSerializer
def run(self, *args): try: args = self.parser.parse_args(args) except SystemExit: return self.log('info', "Commands") rows = [] for command_name, command_item in Commands().commands.items(): rows.append([command_name, command_item['description']]) rows.append(["exit, quit", "Exit Viper"]) rows = sorted(rows, key=lambda entry: entry[0]) self.log('table', dict(header=['Command', 'Description'], rows=rows)) self.log('info', "Modules") rows = [] for module_name, module_item in __modules__.items(): rows.append([module_name, module_item['description']]) rows = sorted(rows, key=lambda entry: entry[0]) self.log('table', dict(header=['Command', 'Description'], rows=rows))
def run(self, *args): try: args = self.parser.parse_args(args) except SystemExit: return self.log("info", "Commands") rows = [] commands = load_commands() for command_name, command_item in commands.items(): rows.append([command_name, command_item["description"]]) rows.append(["exit, quit", "Exit Viper"]) rows = sorted(rows, key=lambda entry: entry[0]) self.log("table", dict(header=["Command", "Description"], rows=rows)) if len(__modules__) == 0: self.log("info", "No modules installed.") else: self.log("info", "Modules") rows = [] for module_name, module_item in __modules__.items(): rows.append([module_name, module_item["description"], ", ".join(c for c in module_item["categories"])]) rows = sorted(rows, key=lambda entry: entry[0]) self.log("table", dict(header=["Command", "Description", "Categories"], rows=rows))
def run(self, *args): try: args = self.parser.parse_args(args) except SystemExit: return self.log('info', "Commands") rows = [] commands = load_commands() for command_name, command_item in commands.items(): rows.append([command_name, command_item['description']]) rows.append(["exit, quit", "Exit Viper"]) rows = sorted(rows, key=lambda entry: entry[0]) self.log('table', dict(header=['Command', 'Description'], rows=rows)) self.log('info', "Modules") rows = [] for module_name, module_item in __modules__.items(): rows.append([module_name, module_item['description']]) rows = sorted(rows, key=lambda entry: entry[0]) self.log('table', dict(header=['Command', 'Description'], rows=rows))
def cmd_help(self, *args): print(bold("Commands:")) rows = [] for command_name, command_item in self.commands.items(): rows.append([command_name, command_item['description']]) print(table(['Command', 'Description'], rows)) print("") print(bold("Modules:")) rows = [] for module_name, module_item in __modules__.items(): rows.append([module_name, module_item['description']]) print(table(['Command', 'Description'], rows))
def cmd_help(self, *args): self.log('info', "Commands") rows = [] for command_name, command_item in self.commands.items(): rows.append([command_name, command_item['description']]) rows.append(["exit, quit", "Exit Viper"]) rows = sorted(rows, key=lambda entry: entry[0]) self.log('table', dict(header=['Command', 'Description'], rows=rows)) self.log('info', "Modules") rows = [] for module_name, module_item in __modules__.items(): rows.append([module_name, module_item['description']]) rows = sorted(rows, key=lambda entry: entry[0]) self.log('table', dict(header=['Command', 'Description'], rows=rows))
def cmd_help(self, *args): print(bold("Commands:")) rows = [] for command_name, command_item in self.commands.items(): rows.append([command_name, command_item["description"]]) rows = sorted(rows, key=lambda entry: entry[0]) print(table(["Command", "Description"], rows)) print("") print(bold("Modules:")) rows = [] for module_name, module_item in __modules__.items(): rows.append([module_name, module_item["description"]]) rows = sorted(rows, key=lambda entry: entry[0]) print(table(["Command", "Description"], rows))
def cmd_help(self, *args): print(bold("Commands:")) rows = [] for command_name, command_item in self.commands.items(): rows.append([command_name, command_item['description']]) rows = sorted(rows, key=lambda entry: entry[0]) print(table(['Command', 'Description'], rows)) print("") print(bold("Modules:")) rows = [] for module_name, module_item in __modules__.items(): rows.append([module_name, module_item['description']]) rows = sorted(rows, key=lambda entry: entry[0]) print(table(['Command', 'Description'], rows))
def cmd_help(self, *args): self.log("info", "Commands") rows = [] for command_name, command_item in self.commands.items(): rows.append([command_name, command_item["description"]]) rows.append(["exit, quit", "Exit Viper"]) rows = sorted(rows, key=lambda entry: entry[0]) self.log("table", dict(header=["Command", "Description"], rows=rows)) self.log("info", "Modules") rows = [] for module_name, module_item in __modules__.items(): rows.append([module_name, module_item["description"]]) rows = sorted(rows, key=lambda entry: entry[0]) self.log("table", dict(header=["Command", "Description"], rows=rows))
def cmd_help(self, *args): print(bold("Commands:")) rows = [] for command_name, command_item in self.commands.items(): rows.append([command_name, command_item['description']]) rows.append(["exit, quit", "Exit Viper"]) rows = sorted(rows, key=lambda entry: entry[0]) print(table(['Command', 'Description'], rows)) print("") print(bold("Modules:")) rows = [] for module_name, module_item in __modules__.items(): rows.append([module_name, module_item['description']]) rows = sorted(rows, key=lambda entry: entry[0]) print(table(['Command', 'Description'], rows))