File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -669,6 +669,7 @@ def from_cli_arguments(
669669 if not valid_ip (target ):
670670 hostname = target
671671 target = str (Net (target ))
672+
672673 # Check UPN
673674 try :
674675 _ , realm = _parse_upn (UPN )
@@ -678,12 +679,23 @@ def from_cli_arguments(
678679 except ValueError :
679680 # not a UPN: NTLM only
680681 kerberos = False
682+
681683 # Do we need to ask the password?
682- if HashNt is None and password is None and ST is None :
684+ if all (
685+ x is None
686+ for x in [
687+ ST ,
688+ password ,
689+ HashNt ,
690+ HashAes256Sha96 ,
691+ HashAes128Sha96 ,
692+ ]
693+ ):
683694 # yes.
684695 from prompt_toolkit import prompt
685696
686697 password = prompt ("Password: " , is_password = True )
698+
687699 ssps = []
688700 # Kerberos
689701 if kerberos and hostname :
@@ -731,11 +743,13 @@ def from_cli_arguments(
731743 "Kerberos required but domain not specified in the UPN, "
732744 "or target isn't a hostname !"
733745 )
746+
734747 # NTLM
735748 if not kerberos_required :
736749 if HashNt is None and password is not None :
737750 HashNt = MD4le (password )
738751 ssps .append (NTLMSSP (UPN = UPN , HASHNT = HashNt ))
752+
739753 # Build the SSP
740754 return cls (ssps )
741755
You can’t perform that action at this time.
0 commit comments