Skip to content

Commit

Permalink
Merge pull request #30 from p0dalirius/add-password-prompt
Browse files Browse the repository at this point in the history
[enhancement] Prompt for password if one isn't included
  • Loading branch information
p0dalirius authored Jun 13, 2024
2 parents 39161f7 + 0cde2b1 commit ad6ef29
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions smbclientng/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,17 @@ def parseArgs():
parser.print_help()
sys.exit(1)

args = parser.parse_args()
options = parser.parse_args()

return args
if options.auth_username is not None and (options.auth_password is None and options.no_pass == False and options.auth_hashes is None):
print("[+] No password or hashes provided and --no-pass is '%s'" % options.no_pass)
from getpass import getpass
if options.auth_domain is not None:
options.auth_password = getpass(" | Provide a password for '%s\\%s':" % (options.auth_domain, options.auth_username))
else:
options.auth_password = getpass(" | Provide a password for '%s':" % options.auth_username)

return options


def main():
Expand Down

0 comments on commit ad6ef29

Please sign in to comment.