Skip to content

Commit 0befdd0

Browse files
authored
Merge pull request Pennyw0rth#703 from Pennyw0rth/neff-fix-logger-port
Fix logging port and also update the port when switching to LDAPS
2 parents c15faf1 + 5cd7a6c commit 0befdd0

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

nxc/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def call_modules(self):
275275
extra={
276276
"module_name": module.name.upper(),
277277
"host": self.host,
278-
"port": self.args.port,
278+
"port": self.port,
279279
"hostname": self.hostname,
280280
},
281281
)

nxc/protocols/ldap.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ def kerberos_login(self, domain, username, password="", ntlm_hash="", aesKey="",
375375
# Connect to LDAPS
376376
self.logger.extra["protocol"] = "LDAPS"
377377
self.logger.extra["port"] = "636"
378+
self.port = 636
378379
ldaps_url = f"ldaps://{self.target}"
379380
self.logger.info(f"Connecting to {ldaps_url} - {self.baseDN} - {self.host} [2]")
380381
self.ldap_connection = ldap_impacket.LDAPConnection(url=ldaps_url, baseDN=self.baseDN, dstIp=self.host, signing=False)
@@ -463,6 +464,7 @@ def plaintext_login(self, domain, username, password):
463464
# Connect to LDAPS
464465
self.logger.extra["protocol"] = "LDAPS"
465466
self.logger.extra["port"] = "636"
467+
self.port = 636
466468
ldaps_url = f"ldaps://{self.target}"
467469
self.logger.info(f"Connecting to {ldaps_url} - {self.baseDN} - {self.host} [4]")
468470
self.ldap_connection = ldap_impacket.LDAPConnection(url=ldaps_url, baseDN=self.baseDN, dstIp=self.host, signing=False)
@@ -553,6 +555,7 @@ def hash_login(self, domain, username, ntlm_hash):
553555
# We need to try SSL
554556
self.logger.extra["protocol"] = "LDAPS"
555557
self.logger.extra["port"] = "636"
558+
self.port = 636
556559
ldaps_url = f"ldaps://{self.target}"
557560
self.logger.info(f"Connecting to {ldaps_url} - {self.baseDN} - {self.host}")
558561
self.ldap_connection = ldap_impacket.LDAPConnection(url=ldaps_url, baseDN=self.baseDN, dstIp=self.host, signing=False)

0 commit comments

Comments
 (0)