From 60b3a5d3d0e8acd2ec3b46cc447d247ab49ced2a Mon Sep 17 00:00:00 2001 From: Mrx Date: Fri, 18 Sep 2026 13:45:47 +0530 Subject: [PATCH] SSH: catch TimeoutError during login with a clean fail message plaintext_login() only caught AuthenticationException and SSHException before falling through to the generic Exception handler, which logs via logger.exception() and dumps a full traceback. A connection timing out mid-login is routine on a target sweep, not something that needs a stack trace, and smb.py already treats TimeoutError this way elsewhere in the codebase. Fixes #358 --- nxc/protocols/ssh.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nxc/protocols/ssh.py b/nxc/protocols/ssh.py index 57d0f7148c..4d80582802 100644 --- a/nxc/protocols/ssh.py +++ b/nxc/protocols/ssh.py @@ -134,6 +134,8 @@ def plaintext_login(self, username, password, private_key=""): self.logger.error(f"Internal Paramiko error for {username}:{process_secret(password)}, {e}") else: self.logger.exception(e) + except TimeoutError: + self.logger.fail(f"{username}:{process_secret(password)} Connection timed out") except Exception as e: self.logger.exception(e) self.conn.close()