Takes domain value from ccache file Default principal

This commit is contained in:
termanix
2025-04-08 14:02:51 -04:00
parent 27f58aee79
commit b32f95bcbc
+4 -1
View File
@@ -19,6 +19,7 @@ from nxc.protocols.ldap.laps import laps_search
from nxc.helpers.pfx import pfx_auth
from impacket.dcerpc.v5 import transport
from impacket.krb5.ccache import CCache
sem = BoundedSemaphore(1)
global_failed_logins = 0
@@ -542,11 +543,13 @@ class connection:
data.extend(parsed_data)
if self.args.use_kcache:
ccache = CCache.parseFile()
self.logger.debug("Trying to authenticate using Kerberos cache")
with sem:
username = self.args.username[0] if len(self.args.username) else ""
password = self.args.password[0] if len(self.args.password) else ""
self.kerberos_login(self.domain, username, password, "", "", self.kdcHost, True)
domain = ccache[0]
self.kerberos_login(domain, username, password, "", "", self.kdcHost, True)
self.logger.info("Successfully authenticated using Kerberos cache")
return True