fix(modules): only display modules for the protocol requested

main
Marshall Hallenbeck 2023-04-19 14:02:36 -04:00
parent 10ac9d22d2
commit d1a22e8c98
2 changed files with 6 additions and 2 deletions

View File

@ -170,7 +170,8 @@ def main():
if args.list_modules:
for name, props in sorted(modules.items()):
cme_logger.display(f"{name:<25} {props['description']}")
if args.protocol in props["supported_protocols"]:
cme_logger.display(f"{name:<25} {props['description']}")
sys.exit(0)
elif args.module and args.show_module_options:
for module in args.module:

View File

@ -105,7 +105,10 @@ class ModuleLoader:
{
"path": module_path,
"description": module_spec.description,
"options": module_spec.options.__doc__
"options": module_spec.options.__doc__,
"supported_protocols": module_spec.supported_protocols,
"opsec_safe": module_spec.opsec_safe,
"multiple_hosts": module_spec.multiple_hosts,
}
}
if self.module_is_sane(module_spec, module_path):