Exemplo n.º 1
0
    def run(self):
        information = self.details['Args'][0]

        if self.modules.check_current_module():
            current_module = self.modules.get_current_module_object()

            options = False
            if hasattr(current_module, "options"):
                options = True
        else:
            options = False

        modules = self.storage.get("modules")
        plugins = self.storage.get("plugins")

        informations = list()
        if modules:
            for database in sorted(modules.keys()):
                for category in sorted(modules[database].keys()):
                    informations.append(category)

        if plugins:
            if information == "plugins":
                self.show_plugins()
                return
        if options:
            if information == "options":
                self.show_options()
                return
        if information in informations:
            self.show_modules(information)
        else:
            self.print_usage(informations, plugins, options)
Exemplo n.º 2
0
 def show_modules(self, information):
     modules = self.storage.get("modules")
     modules_data = list()
     number = 0
     headers = ("Number", "Name", "Database", "Risk", "Description")
     for database in modules.keys():
         modules = modules[database][information]
         for platform in sorted(modules.keys()):
             for module in sorted(modules[platform].keys()):
                 full_name = self.modules.get_full_name(
                     information, platform, module)
                 modules_data.append(
                     (number, full_name, database,
                      modules[platform][module]['Risk'],
                      modules[platform][module]['Description']))
                 number += 1
     self.io.output("")
     self.formatter.format_table(information.title() + " Modules", headers,
                                 *modules_data)
     self.io.output("")
Exemplo n.º 3
0
 def run(self):
     information = self.details['Args'][0]
     modules = self.storage.get("modules")
     usage = "Informations: "
     for category in sorted(modules.keys()):
         usage += category + ", "
     usage += "plugins"
     if information in modules.keys():
         modules_data = list()
         headers = ("Name", "Description")
         modules = modules[information]
         for platform in sorted(modules.keys()):
             for module in sorted(modules[platform].keys()):
                 full_name = self.modules.get_full_name(
                     information, platform, module)
                 modules_data.append(
                     (full_name, modules[platform][module]['Description']))
         self.io.output("")
         self.formatter.format_table("Modules", headers, *modules_data)
         self.io.output("")
     else:
         if information == "plugins":
             if self.storage.get("plugins"):
                 plugins_data = list()
                 headers = ("Name", "Description")
                 plugins = self.storage.get("plugins")
                 for plugin in sorted(plugins.keys()):
                     plugins_data.append(
                         (plugin, plugins[plugin]['Description']))
                 self.io.output("")
                 self.formatter.format_table("Plugins", headers,
                                             *plugins_data)
                 self.io.output("")
             else:
                 self.badges.output_warning("No plugins available!")
         else:
             self.badges.output_information(usage)
Exemplo n.º 4
0
    def launch_shell(self):
        using_history = self.local_storage.get("history")
        if using_history:
            self.enable_history_file()
        readline.parse_and_bind("tab: complete")

        version = self.config.core_config['details']['version']
        codename = self.config.core_config['details']['codename']
        if self.config.core_config['console']['clear']:
            self.badges.output_empty(self.colors.CLEAR, end='')

        if self.config.core_config['console']['banner']:
            self.banner.print_random_banner()

        if self.config.core_config['console']['header']:
            plugins = self.local_storage.get("plugins")
            modules = self.local_storage.get("modules")

            plugins_total = 0
            modules_total = 0

            if plugins:
                for database in plugins.keys():
                    plugins_total += len(plugins[database])
            if modules:
                for database in modules.keys():
                    for module_category in modules[database].keys():
                        for module_platform in modules[database][
                                module_category].keys():
                            modules_total += len(
                                modules[database][module_category]
                                [module_platform])

            header = ""
            header += f"{self.colors.END}\n"
            if codename and not codename.isspace():
                header += f"    --=( {self.colors.YELLOW}HatSploit Framework {codename} {version}{self.colors.END}\n"
            else:
                header += f"    --=( {self.colors.YELLOW}HatSploit Framework {version}{self.colors.END}\n"
            header += f"--==--=( Developed by EntySec ({self.colors.LINE}https://entysec.netlify.app/{self.colors.END})\n"
            header += f"    --=( {modules_total} modules loaded | {plugins_total} plugins available\n"
            header += f"{self.colors.END}"
            self.badges.output_empty(header)

        if self.config.core_config['console']['tip']:
            self.tip.print_random_tip()
            self.badges.output_empty("")
Exemplo n.º 5
0
    def run(self):
        module = self.details['Args'][0]
        modules = self.storage.get("modules")

        category = self.modules.get_category(module)
        platform = self.modules.get_platform(module)

        if category in modules.keys():
            if platform in modules[category].keys():
                module = self.modules.get_name(module)
                if module in modules[category][platform].keys():
                    self.add_module(category, platform, module)
                else:
                    self.badges.output_error("Invalid module!")
            else:
                self.badges.output_error("Invalid module!")
        else:
            self.badges.output_error("Invalid module!")
Exemplo n.º 6
0
    def launch_shell(self):
        version = self.config.core_config['details']['version']
        codename = self.config.core_config['details']['codename']
        if self.config.core_config['console']['clear']:
            self.execute.execute_system("clear")

        if self.config.core_config['console']['banner']:
            self.banner.print_random_banner()

        if self.config.core_config['console']['header']:
            plugins = self.storage.get("plugins")
            modules = self.storage.get("modules")

            plugins_total = 0
            modules_total = 0

            if plugins:
                for database in plugins.keys():
                    plugins_total += len(plugins[database])
            if modules:
                for database in modules.keys():
                    for module_category in modules[database].keys():
                        for module_platform in modules[database][
                                module_category].keys():
                            modules_total += len(
                                modules[database][module_category]
                                [module_platform])

            header = ""
            header += f"{self.badges.END}\n"
            if codename and not codename.isspace():
                header += f"    --=( {self.badges.YELLOW}ZetaSploit Framework {codename} {version}{self.badges.END}\n"
            else:
                header += f"    --=( {self.badges.YELLOW}ZetaSploit Framework {version}{self.badges.END}\n"
            header += f"--==--=( Developed by EntySec ({self.badges.LINE}https://entysec.netlify.app/{self.badges.END})\n"
            header += f"    --=( {modules_total} modules loaded | {plugins_total} plugins available\n"
            header += f"{self.badges.END}"
            self.io.output(header)

        if self.config.core_config['console']['tip']:
            self.tip.print_random_tip()
            self.io.output("")
Exemplo n.º 7
0
 def perform_test(self):
     fail = False
     self.db.add_modules(
         self.config.path_config['base_paths']['db_path'] +
         self.config.db_config['base_dbs']['modules_database'])
     modules = self.storage.get("modules")
     for category in modules.keys():
         for platform in modules[category].keys():
             for module in modules[category][platform].keys():
                 try:
                     _ = self.importer.import_module(
                         modules[category][platform][module]['Path'])
                     self.badges.output_success(
                         self.modules.get_full_name(category, platform,
                                                    module) + ': OK')
                 except Exception:
                     self.badges.output_error(
                         self.modules.get_full_name(category, platform,
                                                    module) + ': FAIL')
                     fail = True
     return fail
Exemplo n.º 8
0
 def perform_test(self):
     fail = False
     all_modules = self.local_storage.get("modules")
     if all_modules:
         for database in all_modules.keys():
             self.badges.output_process("Testing modules from " + database +
                                        " database...")
             modules = all_modules[database]
             for category in modules.keys():
                 for platform in modules[category].keys():
                     for module in modules[category][platform].keys():
                         try:
                             _ = self.importer.import_module(
                                 modules[category][platform][module]
                                 ['Path'])
                             self.badges.output_success(
                                 self.modules.get_full_name(
                                     category, platform, module) + ': OK')
                         except Exception:
                             self.badges.output_error(
                                 self.modules.get_full_name(
                                     category, platform, module) + ': FAIL')
                             fail = True
     return fail