mirror of
https://github.com/Pennyw0rth/NetExec.git
synced 2026-11-07 09:26:01 -10:00
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:
1 parent
22840bfc2a
commit
60b3a5d3d0
1 file changed
+2
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user