Skip to content

Commit

Permalink
Modified how hashes are treated for auth (closes #17)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-useless-one committed Sep 19, 2016
1 parent 85ea99b commit 7fc01cb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pywerview/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ def main():
default=str(), help='Name of the domain we authenticate with')
credentials_parser.add_argument('-u', '--user', required=True,
help='Username used to connect to the Domain Controller')
credentials_parser.add_argument('-p', '--password',
credentials_parser.add_argument('-p', '--password', default=str(),
help='Password associated to the username')
credentials_parser.add_argument('--hashes', action='store', metavar = 'LMHASH:NTHASH',
help='NTLM hashes, format is LMHASH:NTHASH')
help='NTLM hashes, format is [LMHASH:]NTHASH')

# AD parser, used for net* functions running against a domain controller
ad_parser = argparse.ArgumentParser(add_help=False, parents=[credentials_parser])
Expand Down Expand Up @@ -325,7 +325,10 @@ def main():

args = parser.parse_args()
if args.hashes:
args.lmhash, args.nthash = args.hashes.split(':')
try:
args.lmhash, args.nthash = args.hashes.split(':')
except ValueError:
args.lmhash, args.nthash = 'aad3b435b51404eeaad3b435b51404ee', args.hashes
else:
args.lmhash = args.nthash = str()

Expand Down

0 comments on commit 7fc01cb

Please sign in to comment.