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
This commit is contained in:
Mrx committed 2026-09-18 13:45:47 +05:30
1 parent 22840bfc2a
commit 60b3a5d3d0
1 file changed
+2
+2
View File
@@ -134,6 +134,8 @@ class ssh(connection):
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()