Ejemplo n.º 1
0
    def do_loader(args):

        """
        Description: Load target APK for analysis wth androguard --

        Requirements: Target APK

        Usage: loader </path/to/apk>
        Usage: loader apk </path/to/apk>

        """

        try:
            from framework.brains.apk.loader import Loader
            # Pass arguments to
            # the loader module
            #
            loader = Loader(args)
            global apk, apks, dex

            if args.split()[0] == "apk":
                apk = loader.run_loader()
                apks = None
            elif args.split()[0] == "dex":
                dex = loader.run_loader()
                apk = None
                apks = None
            else:
                apk, apks = loader.run_loader()
        except ImportError as e:
            print(t.red("[{0}] ".format(datetime.now()) + "Unable to import Loader"))
            Logger.run_logger(e.message)
Ejemplo n.º 2
0
    def do_loader(args):

        """
        Description: Load target APK for analysis wth androguard --

        Requirements: Target APK

        Usage: loader </path/to/apk>
        """

        try:
            from framework.brains.apk.loader import Loader
            loader = Loader(args)
            global apk, apks
            apk, apks = loader.run_loader()
        except ImportError as e:
            print(t.red("[{0}] ".format(datetime.now()) + "Unable to import Loader"))
            Logger.run_logger(e.message)
Ejemplo n.º 3
0
    def do_loader(args):
        """
        Description: Load target APK for analysis wth androguard --

        Requirements: Target APK

        Usage: loader </path/to/apk>
        """

        try:
            from framework.brains.apk.loader import Loader
            loader = Loader(args)
            global apk, apks
            apk, apks = loader.run_loader()
        except ImportError as e:
            print(
                t.red("[{0}] ".format(datetime.now()) +
                      "Unable to import Loader"))
            Logger.run_logger(e.message)
Ejemplo n.º 4
0
    def do_loader(args):
        """
        Description: Load target APK or classes.dex for analysis

        Requirements: APK or Dalvik Executable

        Usage: loader </path/to/apk> - Load APK which includes classes.dex
        Usage: loader apk </path/to/apk> - Load APK which does not include classes.dex
        Usage: loader dex </path/to/classes.dex> - Load classes.dex
        """
        try:
            from framework.brains.apk.loader import Loader
            # Pass arguments to the loader module
            loader = Loader(args)
            # Define global variables
            global apk, apks, dex
            # Begin to check command line arguments for the loader module
            if args:
                # APK only
                if args.split()[0] == enum.APK:
                    apk, apks = loader.run_loader(), None
                # DEX only
                elif args.split()[0] == enum.DEX:
                    dex, apk, apks = loader.run_loader(), None, None
                else:
                    apk, apks = loader.run_loader()
            else:
                print(
                    t.red("[{0}] ".format(datetime.now()) +
                          t.white(enum.ARGUMENTS)))
        except Exception as e:
            if e.message == enum.STRING_INDEX_ERROR or e.message == enum.LIST_INDEX_ERROR:
                print(
                    t.red("[{0}] ".format(datetime.now()) +
                          t.white(enum.ARGUMENTS)))
                print(
                    t.red("[{0}] ".format(datetime.now()) +
                          t.white(enum.LOADER_USAGE)))
        except ImportError as e:
            print(
                t.red("[{0}] ".format(datetime.now()) +
                      enum.IMPORT_ERROR_LOADER))
            Logger.run_logger(e.message)
Ejemplo n.º 5
0
    def do_loader(args):
        """
        Description: Load target APK or classes.dex for analysis

        Requirements: APK or Dalvik Executable

        Usage: loader </path/to/apk> - Load APK which includes classes.dex
        Usage: loader apk </path/to/apk> - Load APK which does not include classes.dex
        Usage: loader dex </path/to/classes.dex> - Load classes.dex
        """
        try:
            from framework.brains.apk.loader import Loader

            # Pass arguments to the loader module
            loader = Loader(args)
            # Define global variables
            global apk, apks, dex
            # Begin to check command line arguments for the loader module
            if args:
                # APK only
                if args.split()[0] == enum.APK:
                    apk, apks = loader.run_loader(), None
                # DEX only
                elif args.split()[0] == enum.DEX:
                    dex, apk, apks = loader.run_loader(), None, None
                else:
                    apk, apks = loader.run_loader()
            else:
                print(t.red("[{0}] ".format(datetime.now()) + t.white(enum.ARGUMENTS)))
        except Exception as e:
            if e.message == enum.STRING_INDEX_ERROR or e.message == enum.LIST_INDEX_ERROR:
                print(t.red("[{0}] ".format(datetime.now()) + t.white(enum.ARGUMENTS)))
                print(t.red("[{0}] ".format(datetime.now()) + t.white(enum.LOADER_USAGE)))
        except ImportError as e:
            print(t.red("[{0}] ".format(datetime.now()) + enum.IMPORT_ERROR_LOADER))
            Logger.run_logger(e.message)