diff --git a/hatsploit/__main__.py b/hatsploit/__main__.py index 970dbf5a5..d536f574e 100755 --- a/hatsploit/__main__.py +++ b/hatsploit/__main__.py @@ -46,6 +46,7 @@ from hatsploit.lib.jobs import Jobs from hatsploit.lib.runtime import Runtime from hatsploit.lib.payloads import Payloads +from hatsploit.lib.encoders import Encoders from hatsploit.lib.show import Show @@ -326,6 +327,7 @@ def __init__(self) -> None: self.hatasm = HatAsm() self.payloads = Payloads() + self.encoders = Encoders() self.show = Show() @@ -462,9 +464,11 @@ def cli(self) -> None: query += '/' + args.arch if args.payloads: - self.show.show_search_payloads(query) + self.show.show_search_payloads( + self.payloads.get_payloads(), query) elif args.encoders: - self.show.show_search_encoders(query) + self.show.show_search_encoders( + self.encoders.get_encoders(), query) elif args.formats: if not args.platform: diff --git a/hatsploit/commands/advanced.py b/hatsploit/commands/advanced.py index b98d08426..20f3740a9 100755 --- a/hatsploit/commands/advanced.py +++ b/hatsploit/commands/advanced.py @@ -30,4 +30,4 @@ def rpc(self, *args): return self.modules.get_current_advanced() def run(self, argc, argv): - self.show.show_advanced() + self.show.show_advanced(self.modules.get_current_module()) diff --git a/hatsploit/commands/encoder_db.py b/hatsploit/commands/encoder_db.py index ceb7c3d4f..ef8e533c8 100755 --- a/hatsploit/commands/encoder_db.py +++ b/hatsploit/commands/encoder_db.py @@ -60,10 +60,14 @@ def run(self, argc, argv): choice = argv[1] if choice == '-l': - self.show.show_encoder_databases() + self.show.show_encoder_databases( + self.db.get_encoder_databases()) + elif choice == '-d': self.db.disconnect_encoder_database(argv[2]) + elif choice == '-b': self.builder.build_encoder_database(argv[2], argv[3]) + elif choice == '-c': self.db.connect_encoder_database(argv[2], argv[3]) diff --git a/hatsploit/commands/encoders.py b/hatsploit/commands/encoders.py index 10c5832b9..07cbe751b 100755 --- a/hatsploit/commands/encoders.py +++ b/hatsploit/commands/encoders.py @@ -30,4 +30,4 @@ def rpc(self, *args): return self.encoders.get_encoders() def run(self, argc, argv): - self.show.show_encoders() + self.show.show_encoders(self.encoders.get_encoders()) diff --git a/hatsploit/commands/jobs.py b/hatsploit/commands/jobs.py index a7713cbec..318eb06ab 100755 --- a/hatsploit/commands/jobs.py +++ b/hatsploit/commands/jobs.py @@ -34,7 +34,7 @@ def run(self, argc, argv): choice = argv[1] if choice == '-l': - self.show.show_jobs() + self.show.show_jobs(self.jobs.get_jobs()) elif choice == '-k': self.jobs.delete_job(argv[2]) diff --git a/hatsploit/commands/loot.py b/hatsploit/commands/loot.py index 1aa05e266..44be146b5 100755 --- a/hatsploit/commands/loot.py +++ b/hatsploit/commands/loot.py @@ -34,7 +34,7 @@ def run(self, argc, argv): choice = argv[1] if choice == '-l': - self.show.show_loot() + self.show.show_loot(self.loot.list_loot()) elif choice == '-r': self.loot.remove_loot(argv[2]) diff --git a/hatsploit/commands/module_db.py b/hatsploit/commands/module_db.py index a00742e8b..846e9dcd3 100755 --- a/hatsploit/commands/module_db.py +++ b/hatsploit/commands/module_db.py @@ -57,10 +57,14 @@ def run(self, argc, argv): choice = argv[1] if choice == '-l': - self.show.show_module_databases() + self.show.show_module_databases( + self.db.get_module_databases()) + elif choice == '-d': self.db.disconnect_module_database(argv[2]) + elif choice == '-b': self.builder.build_module_database(argv[2], argv[3]) + elif choice == '-c': self.db.connect_module_database(argv[2], argv[3]) diff --git a/hatsploit/commands/modules.py b/hatsploit/commands/modules.py index 255c81bfa..9ceb696db 100755 --- a/hatsploit/commands/modules.py +++ b/hatsploit/commands/modules.py @@ -48,9 +48,9 @@ def run(self, argc, argv): if argc > 1: if argv[1] in categories: - self.show.show_modules(argv[1]) + self.show.show_modules(self.modules.get_modules(), argv[1]) else: self.print_error("Invalid module category!") self.print_information(f"Available categories: {str(categories)}") else: - self.show.show_modules() + self.show.show_modules(self.modules.get_modules()) diff --git a/hatsploit/commands/options.py b/hatsploit/commands/options.py index 70b3fa9a9..ed1de6687 100755 --- a/hatsploit/commands/options.py +++ b/hatsploit/commands/options.py @@ -30,4 +30,4 @@ def rpc(self, *args): return self.modules.get_current_options() def run(self, argc, argv): - self.show.show_options() + self.show.show_options(self.modules.get_current_module()) diff --git a/hatsploit/commands/payload_db.py b/hatsploit/commands/payload_db.py index ca1fb066c..34e77589b 100755 --- a/hatsploit/commands/payload_db.py +++ b/hatsploit/commands/payload_db.py @@ -60,10 +60,14 @@ def run(self, argc, argv): choice = argv[1] if choice == '-l': - self.show.show_payload_databases() + self.show.show_payload_databases( + self.db.get_payload_databases()) + elif choice == '-d': self.db.disconnect_payload_database(argv[2]) + elif choice == '-b': self.builder.build_payload_database(argv[2], argv[3]) + elif choice == '-c': self.db.connect_payload_database(argv[2], argv[3]) diff --git a/hatsploit/commands/payloads.py b/hatsploit/commands/payloads.py index 9c31666e0..e6194351b 100755 --- a/hatsploit/commands/payloads.py +++ b/hatsploit/commands/payloads.py @@ -30,4 +30,4 @@ def rpc(self, *args): return self.payloads.get_payloads() def run(self, argc, argv): - self.show.show_payloads() + self.show.show_payloads(self.payloads.get_payloads()) diff --git a/hatsploit/commands/plugin_db.py b/hatsploit/commands/plugin_db.py index 54819201d..976847af2 100755 --- a/hatsploit/commands/plugin_db.py +++ b/hatsploit/commands/plugin_db.py @@ -57,10 +57,14 @@ def run(self, argc, argv): choice = argv[1] if choice == '-l': - self.show.show_plugin_databases() + self.show.show_plugin_databases( + self.db.get_plugin_databases()) + elif choice == '-d': self.db.disconnect_plugin_database(argv[2]) + elif choice == '-b': self.builder.build_plugin_database(argv[2], argv[3]) + elif choice == '-c': self.db.connect_plugin_database(argv[2], argv[3]) diff --git a/hatsploit/commands/plugins.py b/hatsploit/commands/plugins.py index d395cbc7e..ef2b843b0 100755 --- a/hatsploit/commands/plugins.py +++ b/hatsploit/commands/plugins.py @@ -13,7 +13,7 @@ def __init__(self): super().__init__() self.show = Show() - self.plguins = Plugins() + self.plugins = Plugins() self.details.update({ 'Category': "plugins", @@ -30,4 +30,4 @@ def rpc(self, *args): return self.plugins.get_plugins() def run(self, argc, argv): - self.show.show_plugins() + self.show.show_plugins(self.plugins.get_plugins()) diff --git a/hatsploit/commands/search.py b/hatsploit/commands/search.py index f076254e4..0b9906cac 100755 --- a/hatsploit/commands/search.py +++ b/hatsploit/commands/search.py @@ -6,12 +6,21 @@ from hatsploit.lib.command import Command from hatsploit.lib.show import Show +from hatsploit.lib.modules import Modules +from hatsploit.lib.payloads import Payloads +from hatsploit.lib.encoders import Encoders +from hatsploit.lib.plugins import Plugins + class HatSploitCommand(Command): def __init__(self): super().__init__() self.show = Show() + self.modules = Modules() + self.payloads = Payloads() + self.encoders = Encoders() + self.plugins = Plugins() self.details.update({ 'Category': "core", @@ -20,26 +29,34 @@ def __init__(self): 'Ivan Nikolskiy (enty8080) - command developer', ], 'Description': "Search payloads, modules and plugins.", - 'Usage': "search