File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,12 @@ def getMachineKerberosSalt(self):
7777 """
7878 if self .__smbConnection .getServerName () == '' :
7979 host , _ = self .getMachineNameAndDomain ()
80- domain = self .__smbConnection .getRemoteName ().split (f"{ host } ." )[1 ]
80+ remoteName = self .__smbConnection .getRemoteName ()
81+ # Check if remoteName is FQDN, otherwise it will likely be the hostname only and we can't build the salt
82+ if remoteName .lower ().startswith (f"{ host .lower ()} ." ):
83+ domain = "." .join (remoteName .split ("." )[1 :])
84+ else :
85+ return b''
8186 else :
8287 host = self .__smbConnection .getServerName ()
8388 domain = self .__smbConnection .getServerDNSDomainName ()
Original file line number Diff line number Diff line change @@ -762,7 +762,12 @@ def getMachineKerberosSalt(self):
762762 """
763763 if self .__smbConnection .getServerName () == '' :
764764 host , _ = self .getMachineNameAndDomain ()
765- domain = self .__smbConnection .getRemoteName ().split (f"{ host } ." )[1 ]
765+ remoteName = self .__smbConnection .getRemoteName ()
766+ # Check if remoteName is FQDN, otherwise it will likely be the hostname only
767+ if remoteName .lower ().startswith (f"{ host .lower ()} ." ):
768+ domain = "." .join (remoteName .split ("." )[1 :])
769+ else :
770+ return b''
766771 else :
767772 host = self .__smbConnection .getServerName ()
768773 domain = self .__smbConnection .getServerDNSDomainName ()
You can’t perform that action at this time.
0 commit comments