From 155e3ad5e932a4d1b7dcbaf9d3a31545aa305c44 Mon Sep 17 00:00:00 2001 From: Marshall Hallenbeck Date: Fri, 14 Jun 2024 12:05:11 -0400 Subject: [PATCH] fix: add nargs for password arg to prompt if only -p is passed in Fixes #30 which was added for #27 --- smbclientng/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smbclientng/__main__.py b/smbclientng/__main__.py index 2453e31..eedf250 100644 --- a/smbclientng/__main__.py +++ b/smbclientng/__main__.py @@ -37,7 +37,7 @@ def parseArgs(): secret = parser.add_argument_group() cred = secret.add_mutually_exclusive_group() cred.add_argument("--no-pass", action="store_true", help="Don't ask for password (useful for -k).") - cred.add_argument("-p", "--password", dest="auth_password", metavar="PASSWORD", action="store", help="Password to authenticate with.") + cred.add_argument("-p", "--password", dest="auth_password", metavar="PASSWORD", action="store", nargs="?", help="Password to authenticate with.") cred.add_argument("-H", "--hashes", dest="auth_hashes", action="store", metavar="[LMHASH:]NTHASH", help="NT/LM hashes, format is LMhash:NThash.") cred.add_argument("--aes-key", dest="auth_key", action="store", metavar="hex key", help="AES key to use for Kerberos Authentication (128 or 256 bits).") secret.add_argument("-k", "--kerberos", dest="use_kerberos", action="store_true", help="Use Kerberos authentication. Grabs credentials from .ccache file (KRB5CCNAME) based on target parameters. If valid credentials cannot be found, it will use the ones specified in the command line.") @@ -117,4 +117,4 @@ def main(): print("[debug] Exiting the console.") if __name__ == "__main__": - main() \ No newline at end of file + main()