Пример #1
0
    def do_list(self, args):
        """
        usage: list [FILTER]

        Displays a list of the available modules, optionally filtered by name.

        Examples:

            mercury> list
            activity.forintent
            activity.info
            ... snip ...
            mercury> list debug
            information.debuggable
            mercury>
        """
        argv = shlex.split(args, comments=True)

        if len(argv) == 1 and (argv[0] == "-h" or argv[0] == "--help"):
            self.do_help("list")
            return

        term = len(argv) > 0 and argv[0] or None

        print console.format_dict(dict(map(lambda m: [m, Module.get(m).name], filter(lambda m: term == None or m.find(term.lower()) >= 0, self.__modules()))))
Пример #2
0
    def do_list(self, args):
        """
        usage: list [FILTER]

        Displays a list of the available modules, optionally filtered by name.

        Examples:

            dz> list
            activity.forintent
            activity.info
            ... snip ...
            dz> list debug
            information.debuggable
            dz>
        
        optional arguments:
        
          --unsupported         include a list of the modules that are not available on your device
        """
        argv = shlex.split(args, comments=True)

        if len(argv) == 1 and (argv[0] == "-h" or argv[0] == "--help"):
            self.do_help("list")
            return

        include_unsupported = False
        if "--unsupported" in argv:
            argv.remove("--unsupported")

            include_unsupported = True

        term = len(argv) > 0 and argv[0] or None

        s_modules = self.modules.all(contains=term,
                                     permissions=self.permissions(),
                                     prefix=self.__base)

        if include_unsupported:
            u_modules = filter(
                lambda m: not m in s_modules,
                self.modules.all(contains=term,
                                 permissions=None,
                                 prefix=self.__base))
        else:
            u_modules = []

        self.stdout.write(
            console.format_dict(
                dict(map(lambda m: [m, self.modules.get(m).name], s_modules)))
            + "\n")

        if len(u_modules) > 0:
            self.stdout.write("\nUnsupported Modules:\n\n")
            self.stdout.write(
                console.format_dict(
                    dict(
                        map(lambda m: [m, self.modules.get(m).name],
                            u_modules))) + "\n")
Пример #3
0
    def do_list(self, args):
        """
        usage: list [FILTER]

        Displays a list of the available modules, optionally filtered by name.

        Examples:

            mercury> list
            activity.forintent
            activity.info
            ... snip ...
            mercury> list debug
            information.debuggable
            mercury>
        """
        argv = shlex.split(args, comments=True)

        if len(argv) == 1 and (argv[0] == "-h" or argv[0] == "--help"):
            self.do_help("list")
            return

        term = len(argv) > 0 and argv[0] or None

        self.stdout.write(
            console.format_dict(
                dict(
                    map(
                        lambda m: [m, Module.get(m).name],
                        filter(
                            lambda m: term == None or m.find(term.lower()) >=
                            0, self.__modules())))) + "\n")
Пример #4
0
    def do_list(self, arguments):
        """list the available payload modules"""

        sys.stdout.write(
            console.format_dict(
                dict([[m, self.builder.module(m).name]
                      for m in self.builder.modules()])) + "\n")
Пример #5
0
    def do_list(self, args):
        """
        usage: list [FILTER]

        Displays a list of the available modules, optionally filtered by name.

        Examples:

            dz> list
            activity.forintent
            activity.info
            ... snip ...
            dz> list debug
            information.debuggable
            dz>
        
        optional arguments:
        
          --unsupported         include a list of the modules that are not available on your device
        """
        argv = shlex.split(args, comments=True)

        if len(argv) == 1 and (argv[0] == "-h" or argv[0] == "--help"):
            self.do_help("list")
            return
        
        include_unsupported = False
        if "--unsupported" in argv:
            argv.remove("--unsupported")
            
            include_unsupported = True
        
        term = len(argv) > 0 and argv[0] or None
        
        s_modules = self.modules.all(contains=term, permissions=self.permissions(), prefix=self.__base)
        
        if include_unsupported:
            u_modules = filter(lambda m: not m in s_modules, self.modules.all(contains=term, permissions=None, prefix=self.__base))
        else:
            u_modules = []

        self.stdout.write(console.format_dict(dict(map(lambda m: [m, self.modules.get(m).name], s_modules))) + "\n")
        
        if len(u_modules) > 0:
            self.stdout.write("\nUnsupported Modules:\n\n")
            self.stdout.write(console.format_dict(dict(map(lambda m: [m, self.modules.get(m).name], u_modules))) + "\n")
Пример #6
0
    def do_list(self, args):
        """
        usage: list [FILTER]

        Displays a list of the available modules, optionally filtered by name.

        Examples:

            mercury> list
            activity.forintent
            activity.info
            ... snip ...
            mercury> list debug
            information.debuggable
            mercury>
        
        optional arguments:
        
          --unsupported         include a list of the modules that are not available on your device
        """
        argv = shlex.split(args, comments=True)

        if len(argv) == 1 and (argv[0] == "-h" or argv[0] == "--help"):
            self.do_help("list")
            return
        
        if "--unsupported" in argv:
            argv.remove("--unsupported")
            
            term = len(argv) > 0 and argv[0] or None
            s_modules = filter(lambda m: term == None or m.find(term.lower()) >= 0, self.__modules())
            u_modules = filter(lambda m: (term == None or m.find(term.lower()) >= 0) and not m in s_modules, self.__modules("any"))
        else:
            term = len(argv) > 0 and argv[0] or None
            s_modules = filter(lambda m: term == None or m.find(term.lower()) >= 0, self.__modules())
            u_modules = []

        self.stdout.write(console.format_dict(dict(map(lambda m: [m, Module.get(m).name], s_modules))) + "\n")
        
        if len(u_modules) > 0:
            self.stdout.write("\nUnsupported Modules:\n\n")
            self.stdout.write(console.format_dict(dict(map(lambda m: [m, Module.get(m).name], u_modules))) + "\n")
Пример #7
0
 def __get_commands_help(self):
     """
     Produce a piece of text, containing the available commands, and their short
     description.
     """
     
     commands = {}
     
     for command in self.__commands():
         commands[command.replace("do_", "")] = getattr(self, command).__doc__.strip()
         
     return console.format_dict(commands, left_margin=2)
Пример #8
0
    def __get_commands_help(self):
        """
        Produce a piece of text, containing the available commands, and their short
        description.
        """

        commands = {}

        for command in self.__commands():
            commands[command.replace("do_",
                                     "")] = getattr(self,
                                                    command).__doc__.strip()

        return console.format_dict(commands, left_margin=2)
Пример #9
0
 def do_list(self, arguments):
     """list the available exploit modules"""
     
     sys.stdout.write(console.format_dict(dict(map(lambda m: [m, self.builder.module(m).name], self.builder.modules()))) + "\n")