Skip to content

Commit c71e52d

Browse files
committed
Pass the target ip to the tools, so that they don't need to resolve the domain
1 parent 716ae2a commit c71e52d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

nxc/connection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ def login(self):
570570
}
571571
self.logger.info("Loading certificate and key from file")
572572

573+
# Load the certificate and key from file
573574
if self.args.pfx_cert or self.args.pfx_base64:
574575
pfx = self.args.pfx_cert if self.args.pfx_cert else self.args.pfx_base64
575576
ini = myPKINIT.from_pfx(pfx, self.args.pfx_pass, dhparams, bool(self.args.pfx_base64))
@@ -582,10 +583,11 @@ def login(self):
582583
username = self.args.username[0]
583584
log_ccache = os.path.expanduser(f"~/.nxc/logs/{self.hostname}_{self.host}_{datetime.now().strftime('%Y-%m-%d_%H%M%S')}-{username}.ccache".replace(":", "-"))
584585

586+
# Request a TGT with the cert data
585587
req = ini.build_asreq(self.domain, username)
586588
self.logger.info("Requesting TGT")
587589

588-
sock = KerberosClientSocket(KerberosTarget(self.domain))
590+
sock = KerberosClientSocket(KerberosTarget(self.host))
589591
try:
590592
res = sock.sendrecv(req)
591593
except Exception as e:
@@ -603,7 +605,7 @@ def login(self):
603605
creds = ccache.getCredential(principal)
604606
if creds is not None:
605607
tgt = creds.toTGT()
606-
dumper = GETPAC(username, self.domain, self.domain, key, tgt)
608+
dumper = GETPAC(username, self.domain, self.host, key, tgt)
607609
nthash = dumper.dump()
608610
if not self.kerberos:
609611
self.hash_login(self.domain, username, nthash)

0 commit comments

Comments
 (0)