Skip to content

Commit

Permalink
fix user passwords loading
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jul 11, 2024
1 parent c095050 commit ded223b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions dploot/action/masterkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def entry(options: argparse.Namespace) -> None:
a.run()

def parse_masterkeys_options(options: argparse.Namespace, target: Target) -> Tuple[bytes,Dict[str,str],Dict[str,str]]:
pvkbytes = passwords = nthashes = None
pvkbytes = None
passwords = {}
nthashes = {}
if hasattr(options,'pvk') and options.pvk is not None:
try:
pvkbytes = open(options.pvk, 'rb').read()
Expand All @@ -98,16 +100,12 @@ def parse_masterkeys_options(options: argparse.Namespace, target: Target) -> Tup
except Exception as e:
logging.error(str(e))
sys.exit(1)
if target.username:
if target.password != '':
passwords[target.username] = target.password

if target.password != '':
if passwords is None:
passwords = dict()
passwords[target.username] = target.password

if target.nthash != '':
if nthashes is None:
nthashes = dict()
nthashes[target.username] = target.nthash.lower()
if target.nthash != '':
nthashes[target.username] = target.nthash.lower()

if nthashes is not None:
nthashes = {k.lower():v.lower() for k, v in nthashes.items()}
Expand Down

0 comments on commit ded223b

Please sign in to comment.