Skip to content

Commit b5bc29d

Browse files
feat(args): add additional, more pythonic options for cmd args
1 parent 1214190 commit b5bc29d

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

nxc/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def gen_cli_args():
7878
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)")
7979

8080
credential_group = std_parser.add_argument_group("Authentication", "Options for authenticating")
81-
credential_group.add_argument("-u", metavar="USERNAME", dest="username", nargs="+", default=[], help="username(s) or file(s) containing usernames")
82-
credential_group.add_argument("-p", metavar="PASSWORD", dest="password", nargs="+", default=[], help="password(s) or file(s) containing passwords")
81+
credential_group.add_argument("-u", "--username", metavar="USERNAME", dest="username", nargs="+", default=[], help="username(s) or file(s) containing usernames")
82+
credential_group.add_argument("-p", "--password", metavar="PASSWORD", dest="password", nargs="+", default=[], help="password(s) or file(s) containing passwords")
8383
credential_group.add_argument("-id", metavar="CRED_ID", nargs="+", default=[], type=str, dest="cred_id", help="database credential ID(s) to use for authentication")
8484
credential_group.add_argument("--ignore-pw-decoding", action="store_true", help="Ignore non UTF-8 characters when decoding the password file")
8585
credential_group.add_argument("--no-bruteforce", action="store_true", help="No spray when using file for username and password (user1 => password1, user2 => password2)")
@@ -91,8 +91,8 @@ def gen_cli_args():
9191
kerberos_group = std_parser.add_argument_group("Kerberos", "Options for Kerberos authentication")
9292
kerberos_group.add_argument("-k", "--kerberos", action="store_true", help="Use Kerberos authentication")
9393
kerberos_group.add_argument("--use-kcache", action="store_true", help="Use Kerberos authentication from ccache file (KRB5CCNAME)")
94-
kerberos_group.add_argument("--aesKey", metavar="AESKEY", nargs="+", help="AES key to use for Kerberos Authentication (128 or 256 bits)")
95-
kerberos_group.add_argument("--kdcHost", metavar="KDCHOST", help="FQDN of the domain controller. If omitted it will use the domain part (FQDN) specified in the target parameter")
94+
kerberos_group.add_argument("--aes-key", "--aesKey", metavar="AESKEY", nargs="+", help="AES key to use for Kerberos Authentication (128 or 256 bits)")
95+
kerberos_group.add_argument("--kdc-host", "--kdcHost", metavar="KDCHOST", help="FQDN of the domain controller. If omitted it will use the domain part (FQDN) specified in the target parameter")
9696

9797
server_group = std_parser.add_argument_group("Servers", "Options for nxc servers")
9898
server_group.add_argument("--server", choices={"http", "https"}, default="https", help="use the selected server")

nxc/protocols/smb/proto_args.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def proto_args(parser, parents):
1010
self_delegate_arg = smb_parser.add_argument("--self", dest="no_s4u2proxy", action=get_conditional_action(_StoreTrueAction), make_required=[], help="Only do S4U2Self, no S4U2Proxy (use with delegate)")
1111

1212
dgroup = smb_parser.add_mutually_exclusive_group()
13-
dgroup.add_argument("-d", metavar="DOMAIN", dest="domain", type=str, help="domain to authenticate to")
13+
dgroup.add_argument("-d", "--domain", metavar="DOMAIN", dest="domain", type=str, help="domain to authenticate to")
1414
dgroup.add_argument("--local-auth", action="store_true", help="authenticate locally to each target")
1515

1616
smb_parser.add_argument("--port", type=int, choices={445, 139}, default=445, help="SMB port")
@@ -83,7 +83,6 @@ def proto_args(parser, parents):
8383
posh_group.add_argument("--clear-obfscripts", action="store_true", help="Clear all cached obfuscated PowerShell scripts")
8484
posh_group.add_argument("--force-ps32", action="store_true", help="force PowerShell commands to run in a 32-bit process (may not apply to modules)")
8585

86-
8786
return parser
8887

8988
def get_conditional_action(baseAction):

0 commit comments

Comments
 (0)