Skip to content

Commit

Permalink
Merge pull request #510 from Pennyw0rth/fix_kerberos_trust
Browse files Browse the repository at this point in the history
fix trust relation for smb
  • Loading branch information
mpgn authored Dec 19, 2024
2 parents 100a878 + ea7e092 commit d05aeb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nxc/protocols/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,10 @@ def enum_host_info(self):
self.logger.debug(f"Error logging off system: {e}")

# DCOM connection with kerberos needed
self.remoteName = self.host if not self.kerberos else f"{self.hostname}.{self.domain}"
self.remoteName = self.host if not self.kerberos else f"{self.hostname}.{self.targetDomain}"

if not self.kdcHost and self.domain:
# 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
if not self.kdcHost and self.domain and self.domain == self.targetDomain:
result = self.resolver(self.domain)
self.kdcHost = result["host"] if result else None
self.logger.info(f"Resolved domain: {self.domain} with dns, kdcHost: {self.kdcHost}")
Expand Down

0 comments on commit d05aeb5

Please sign in to comment.