From c71e52dbf8bb48e01f6f0e18bfb576b4caec620c Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Sat, 4 Jan 2025 14:41:44 -0500 Subject: [PATCH] Pass the target ip to the tools, so that they don't need to resolve the domain --- nxc/connection.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nxc/connection.py b/nxc/connection.py index da1072df..c7955ed2 100755 --- a/nxc/connection.py +++ b/nxc/connection.py @@ -570,6 +570,7 @@ class connection: } self.logger.info("Loading certificate and key from file") + # Load the certificate and key from file if self.args.pfx_cert or self.args.pfx_base64: pfx = self.args.pfx_cert if self.args.pfx_cert else self.args.pfx_base64 ini = myPKINIT.from_pfx(pfx, self.args.pfx_pass, dhparams, bool(self.args.pfx_base64)) @@ -582,10 +583,11 @@ class connection: username = self.args.username[0] log_ccache = os.path.expanduser(f"~/.nxc/logs/{self.hostname}_{self.host}_{datetime.now().strftime('%Y-%m-%d_%H%M%S')}-{username}.ccache".replace(":", "-")) + # Request a TGT with the cert data req = ini.build_asreq(self.domain, username) self.logger.info("Requesting TGT") - sock = KerberosClientSocket(KerberosTarget(self.domain)) + sock = KerberosClientSocket(KerberosTarget(self.host)) try: res = sock.sendrecv(req) except Exception as e: @@ -603,7 +605,7 @@ class connection: creds = ccache.getCredential(principal) if creds is not None: tgt = creds.toTGT() - dumper = GETPAC(username, self.domain, self.domain, key, tgt) + dumper = GETPAC(username, self.domain, self.host, key, tgt) nthash = dumper.dump() if not self.kerberos: self.hash_login(self.domain, username, nthash)