Skip to content

Commit

Permalink
Fix AES authentication, and no-pass issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lefayjey authored Nov 28, 2023
1 parent 7216269 commit 6a8c206
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions bloodhound/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,23 +274,19 @@ def main():
if args.username is not None and args.password is not None:
logging.debug('Authentication: username/password')
auth = ADAuthentication(username=args.username, password=args.password, domain=args.domain, auth_method=args.auth_method)
elif args.username is not None and args.password is None and args.hashes is None:
elif args.username is not None and args.password is None and args.hashes is None and args.no_pass is None:
args.password = getpass.getpass()
auth = ADAuthentication(username=args.username, password=args.password, domain=args.domain, auth_method=args.auth_method)
elif args.username is None and (args.password is not None or args.hashes is not None):
logging.error('Authentication: password or hashes provided without username')
sys.exit(1)
elif (args.hashes is not None or args.aesKey is not None) and args.username is not None:
if args.hashes:
logging.debug('Authentication: NT hash')
lm, nt = args.hashes.split(":")
auth = ADAuthentication(lm_hash=lm, nt_hash=nt, username=args.username, domain=args.domain, auth_method=args.auth_method)
if args.aesKey:
logging.debug('Authentication: Kerberos AES')
auth.set_aeskey(args.aesKey)
else:
logging.debug('Authentication: Kerberos AES')
auth = ADAuthentication(username=args.username, domain=args.domain, aeskey=args.aesKey, auth_method=args.auth_method)
elif args.hashes is not None and args.username is not None:
logging.debug('Authentication: NT hash')
lm, nt = args.hashes.split(":")
auth = ADAuthentication(lm_hash=lm, nt_hash=nt, username=args.username, domain=args.domain, auth_method=args.auth_method)
elif args.aesKey is not None and args.username is not None:
logging.debug('Authentication: Kerberos AES')
auth = ADAuthentication(username=args.username, domain=args.domain, aeskey=args.aesKey, auth_method=args.auth_method)
else:
if not args.kerberos:
parser.print_help()
Expand Down

1 comment on commit 6a8c206

@n3rada
Copy link

@n3rada n3rada commented on 6a8c206 Apr 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit leads to issue #168.

Corrected by #175.

Please sign in to comment.