diff --git a/nxc/cli.py b/nxc/cli.py index 40c4a8fd4..d94e493bb 100755 --- a/nxc/cli.py +++ b/nxc/cli.py @@ -27,6 +27,7 @@ def gen_cli_args(): generic_parser = argparse.ArgumentParser(add_help=False, formatter_class=DisplayDefaultsNotNone) generic_group = generic_parser.add_argument_group("Generic", "Generic options for nxc across protocols") + generic_group.add_argument("--version", action="store_true", help="Display nxc version") generic_group.add_argument("-t", "--threads", type=int, dest="threads", default=256, help="set how many concurrent threads to use") generic_group.add_argument("--timeout", default=None, type=int, help="max timeout in seconds of each thread") generic_group.add_argument("--jitter", metavar="INTERVAL", type=str, help="sets a random delay between each authentication") @@ -69,8 +70,6 @@ def gen_cli_args(): parents=[generic_parser, output_parser, dns_parser] ) - parser.add_argument("--version", action="store_true", help="Display nxc version") - # we do module arg parsing here so we can reference the module_list attribute below module_parser = argparse.ArgumentParser(add_help=False, formatter_class=DisplayDefaultsNotNone) mgroup = module_parser.add_argument_group("Modules", "Options for nxc modules") @@ -82,7 +81,7 @@ def gen_cli_args(): subparsers = parser.add_subparsers(title="Available Protocols", dest="protocol") std_parser = argparse.ArgumentParser(add_help=False, parents=[generic_parser, output_parser, dns_parser], formatter_class=DisplayDefaultsNotNone) - std_parser.add_argument("target", nargs="+" if not (module_parser.parse_known_args()[0].list_modules or module_parser.parse_known_args()[0].show_module_options) else "*", type=str, help="the target IP(s), range(s), CIDR(s), hostname(s), FQDN(s), file(s) containing a list of targets, NMap XML or .Nessus file(s)") + std_parser.add_argument("target", nargs="+" if not (module_parser.parse_known_args()[0].list_modules or module_parser.parse_known_args()[0].show_module_options or generic_parser.parse_known_args()[0].version) else "*", type=str, help="the target IP(s), range(s), CIDR(s), hostname(s), FQDN(s), file(s) containing a list of targets, NMap XML or .Nessus file(s)") credential_group = std_parser.add_argument_group("Authentication", "Options for authenticating") credential_group.add_argument("-u", "--username", metavar="USERNAME", dest="username", nargs="+", default=[], help="username(s) or file(s) containing usernames") credential_group.add_argument("-p", "--password", metavar="PASSWORD", dest="password", nargs="+", default=[], help="password(s) or file(s) containing passwords")