コード例 #1
0
ファイル: session.py プロジェクト: RUTUPARNk/eggshell
    def show_commands(self):
        print(h.WHITEBU + "Local Commands:" + h.ENDC)
        names_local = list(self.server.modules_local.keys())
        names_local.sort()
        for key in names_local:
            h.show_command(self.server.modules_local[key])

        print("\n" + h.WHITEBU + "Device Commands:" + h.ENDC)
        command_modules = self.server.get_modules(self.type)
        names = list(command_modules.keys())
        names.sort()
        for k in names:
            h.show_command(command_modules[k])
コード例 #2
0
    def show_commands(self):
        print(h.WHITEBU + "Local Commands:" + h.ENDC)
        names_local = list(self.server.modules_local.keys())
        names_local.sort()
        for key in names_local:
            h.show_command(self.server.modules_local[key])

        print("\n" + h.WHITEBU + "Device Commands:" + h.ENDC)
        command_modules = self.server.get_modules(self.type)
        names = list(command_modules.keys())
        names.sort()
        for k in names:
            if not hasattr(command_modules[k], 'requiresPro') and not hasattr(command_modules[k], 'category'):
                h.show_command(command_modules[k])
            if hasattr(command_modules[k], 'requiresPro'):
                if command_modules[k].requiresPro == False and not hasattr(command_modules[k], 'category'):
                    h.show_command(command_modules[k])

        print("\n" + h.WHITEBU + "Data Extraction Commands:" + h.ENDC)
        for command in command_modules:
            if hasattr(command_modules[command], 'category'):
                if command_modules[command].category == "data_extraction":
                    try:
                        h.show_command(command_modules[command])
                    except Exception as err:
                        print("err: " + str(err))
                        pass

        print("\n" + h.WHITEBU + "Misc Commands:" + h.ENDC)
        for command in command_modules:
            if hasattr(command_modules[command], 'category'):
                if command_modules[command].category == "misc":
                    try:
                        h.show_command(command_modules[command])
                    except Exception as err:
                        print("err: " + str(err))
                        pass

        print("\n" + h.WHITEBU + "EggShell-Pro Commands:" + h.ENDC)
        for command in command_modules:
            if hasattr(command_modules[command], 'requiresPro'):
                try:
                    h.show_command(command_modules[command])
                except:
                    pass