Skip to content

Commit fcec117

Browse files
authored
Fix access of undefined ssh._tried_sftp in raw mode (#2396)
* Fix access of undefined `ssh._tried_sftp` in `raw` mode The attribute was never set when setting `ssh(raw=True)` which caused the code to run `ssh.__getattr__` which raised an AttributeError due to `_tried_sftp` starting with an `_` on Python 3.12. * Document all `ssh` attributes
1 parent fe560c9 commit fcec117

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pwnlib/tubes/ssh.py

+16
Original file line numberDiff line numberDiff line change
@@ -544,16 +544,32 @@ class ssh(Timeout, Logger):
544544
#: Remote port (``int``)
545545
port = None
546546

547+
#: Remote username (``str``)
548+
user = None
549+
550+
#: Remote password (``str``)
551+
password = None
552+
553+
#: Remote private key (``str``)
554+
key = None
555+
556+
#: Remote private key file (``str``)
557+
keyfile = None
558+
547559
#: Enable caching of SSH downloads (``bool``)
548560
cache = True
549561

562+
#: Enable raw mode and don't probe the environment (``bool``)
563+
raw = False
564+
550565
#: Paramiko SSHClient which backs this object
551566
client = None
552567

553568
#: PID of the remote ``sshd`` process servicing this connection.
554569
pid = None
555570

556571
_cwd = '.'
572+
_tried_sftp = False
557573

558574
def __init__(self, user=None, host=None, port=22, password=None, key=None,
559575
keyfile=None, proxy_command=None, proxy_sock=None, level=None,

0 commit comments

Comments
 (0)