Skip to content

Commit c8993ab

Browse files
committed
ssh: allow passing disabled_algorithms keyword argument from ssh to paramiko
1 parent 636b3b2 commit c8993ab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pwnlib/tubes/ssh.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ class ssh(Timeout, Logger):
574574
def __init__(self, user=None, host=None, port=22, password=None, key=None,
575575
keyfile=None, proxy_command=None, proxy_sock=None, level=None,
576576
cache=True, ssh_agent=False, ignore_config=False, raw=False,
577-
auth_none=False, *a, **kw):
577+
auth_none=False, disabled_algorithms=None, *a, **kw):
578578
"""Creates a new ssh connection.
579579
580580
Arguments:
@@ -593,6 +593,7 @@ def __init__(self, user=None, host=None, port=22, password=None, key=None,
593593
ignore_config(bool): If :const:`True`, disable usage of ~/.ssh/config and ~/.ssh/authorized_keys
594594
raw(bool): If :const:`True`, assume a non-standard shell and don't probe the environment
595595
auth_none(bool): If :const:`True`, try to authenticate with no authentication methods
596+
disabled_algorithms(dict): Mapping of algorithm type and list of algorithms identifier to disable. Passed directly to paramiko.
596597
597598
NOTE: The proxy_command and proxy_sock arguments is only available if a
598599
fairly new version of paramiko is used.
@@ -682,7 +683,7 @@ def __init__(self, user=None, host=None, port=22, password=None, key=None,
682683
proxy_sock = None
683684

684685
try:
685-
self.client.connect(host, port, user, password, key, keyfiles, self.timeout, allow_agent=ssh_agent, compress=True, sock=proxy_sock, look_for_keys=not ignore_config)
686+
self.client.connect(host, port, user, password, key, keyfiles, self.timeout, allow_agent=ssh_agent, compress=True, sock=proxy_sock, look_for_keys=not ignore_config, disabled_algorithms=disabled_algorithms)
686687
except paramiko.BadHostKeyException as e:
687688
self.error("Remote host %(host)s is using a different key than stated in known_hosts\n"
688689
" To remove the existing entry from your known_hosts and trust the new key, run the following commands:\n"

0 commit comments

Comments
 (0)