Skip to content

Commit 1d55ccf

Browse files
authored
Merge pull request Pennyw0rth#528 from Pennyw0rth/neff-rdp-errors
Show error messages when rdp fails
2 parents 2c421a7 + 7c95169 commit 1d55ccf

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

nxc/protocols/rdp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def kerberos_login(self, domain, username, password="", ntlm_hash="", aesKey="",
269269
if word in str(e):
270270
reason = self.rdp_error_status[word]
271271
self.logger.fail(
272-
(f"{domain}\\{username}{' from ccache' if useCache else f':{process_secret(kerb_pass)}'} {f'({reason})' if reason else str(e)}"),
272+
(f"{domain}\\{username}{' from ccache' if useCache else f':{process_secret(kerb_pass)}'} ({reason if reason else str(e)})"),
273273
color=("magenta" if ((reason or "CredSSP" in str(e)) and reason != "KDC_ERR_C_PRINCIPAL_UNKNOWN") else "red"),
274274
)
275275
elif "Authentication failed!" in str(e):
@@ -284,7 +284,7 @@ def kerberos_login(self, domain, username, password="", ntlm_hash="", aesKey="",
284284
if str(e) == "cannot unpack non-iterable NoneType object":
285285
reason = "User valid but cannot connect"
286286
self.logger.fail(
287-
(f"{domain}\\{username}{' from ccache' if useCache else f':{process_secret(kerb_pass)}'} {f'({reason})' if reason else ''}"),
287+
(f"{domain}\\{username}{' from ccache' if useCache else f':{process_secret(kerb_pass)}'} ({reason if reason else str(e)})"),
288288
color=("magenta" if ((reason or "CredSSP" in str(e)) and reason != "STATUS_LOGON_FAILURE") else "red"),
289289
)
290290
return False
@@ -318,7 +318,7 @@ def plaintext_login(self, domain, username, password):
318318
if str(e) == "cannot unpack non-iterable NoneType object":
319319
reason = "User valid but cannot connect"
320320
self.logger.fail(
321-
(f"{domain}\\{username}:{process_secret(password)} {f'({reason})' if reason else ''}"),
321+
(f"{domain}\\{username}:{process_secret(password)} ({reason if reason else str(e)})"),
322322
color=("magenta" if ((reason or "CredSSP" in str(e)) and reason != "STATUS_LOGON_FAILURE") else "red"),
323323
)
324324
return False
@@ -353,7 +353,7 @@ def hash_login(self, domain, username, ntlm_hash):
353353
reason = "User valid but cannot connect"
354354

355355
self.logger.fail(
356-
(f"{domain}\\{username}:{process_secret(ntlm_hash)} {f'({reason})' if reason else ''}"),
356+
(f"{domain}\\{username}:{process_secret(ntlm_hash)} ({reason if reason else str(e)})"),
357357
color=("magenta" if ((reason or "CredSSP" in str(e)) and reason != "STATUS_LOGON_FAILURE") else "red"),
358358
)
359359
return False

nxc/protocols/smb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ def shares(self):
840840
temp_dir = ntpath.normpath("\\" + gen_random_string())
841841
temp_file = ntpath.normpath("\\" + gen_random_string() + ".txt")
842842
permissions = []
843-
write_check = True if not self.args.no_write_check else False
843+
write_check = bool(not self.args.no_write_check)
844844

845845
try:
846846
self.logger.debug(f"domain: {self.domain}")

0 commit comments

Comments
 (0)