File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -305,8 +305,9 @@ def enum_host_info(self):
305305 except Exception as e :
306306 self .logger .debug (f"Error adding host { self .host } into db: { e !s} " )
307307
308- # DCOM connection with kerberos needed
309- self .remoteName = self .host if not self .kerberos else f"{ self .hostname } .{ self .targetDomain } "
308+ # When the target is already an FQDN, use it directly so the SPN matches
309+ # the host's AD registration (e.g. host.evil.com, not host.corp.evil.com).
310+ self .remoteName = self .host if (not self .kerberos or "." in self .host ) else f"{ self .hostname } .{ self .targetDomain } "
310311
311312 # using kdcHost is buggy on impacket when using trust relation between ad so we kdcHost must stay to none if targetdomain is not equal to domain
312313 if not self .kdcHost and self .domain and self .domain == self .targetDomain :
You can’t perform that action at this time.
0 commit comments