Repository navigation
Closed
Labels
bugSomething isn't working
Description
Describe the bug
When connecting to ssh-mitm from MobaXTerm client version 21.5, the connection is dropped.
To Reproduce
Steps to reproduce the behavior:
- Go to https://mobaxterm.mobatek.net/download-home-edition.html
- Download and run MobaXterm Portable v21.5
- Create new session to ssh-mitm and try to connect
- Connection is dropped
Expected behavior
SSH client successfully connects to SSH server
ssh-mitm debug output
ssh-mitm-x86_64.AppImage -d server --listen-port XXX --remote-host XXX
──────────────────────────────────────────────────────────────────────────────────────── SSH-MITM - ssh audits made simple ─────────────────────────────────────────────────────────────────────────────────────────
Version: 1.0.0
Documentation: https://docs.ssh-mitm.at
Issues: https://github.com/ssh-mitm/ssh-mitm/issues
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[03/21/22 15:26:42] INFO generated temporary RSAKey key with 2048 bit length and fingerprints: __init__.py:141
MD5:a8:69:09:66:7f:c4:eb:ea:ba:5c:ad:43:69:42:82:3f
SHA256:pZGSmr8/zIQF0T9iOjQoT/Pt9lJd2DtpS0iAiqmVy/U
INFO listen interfaces 0.0.0.0 and :: on port XXX __init__.py:229
[03/21/22 15:26:49] DEBUG incoming connection from ('::ffff:XXX', XXX, 0, 0) to ('::ffff:XXX', XXX, 0, 0) __init__.py:239
INFO ℹ session b7ad0231-d53d-4038-92ce-092043b42a20 created session.py:68
INFO ℹ connected client version: SSH-2.0-MoTTY_Release_0.76 key_negotiation.py:48
DEBUG cookie: 09e3b442f2c200331a53a4920f634839 key_negotiation.py:51
DEBUG kex_algorithms: ['diffie-hellman-group-exchange-sha256', 'diffie-hellman-group-exchange-sha1', 'diffie-hellman-group14-sha256', 'diffie-hellman-group14-sha1', key_negotiation.py:52
'diffie-hellman-group1-sha1', 'rsa2048-sha256', 'rsa1024-sha1', 'curve448-sha512', 'curve25519-sha256', '[email protected]', 'ecdh-sha2-nistp256',
'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521', 'ext-info-c']
DEBUG server_host_key_algorithms: ['ssh-ed448', 'ssh-ed25519', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', 'rsa-sha2-512', 'rsa-sha2-256', key_negotiation.py:53
'ssh-rsa', 'ssh-dss']
DEBUG encryption_algorithms_client_to_server: ['aes256-ctr', 'aes256-cbc', '[email protected]', 'aes192-ctr', 'aes192-cbc', 'aes128-ctr', 'aes128-cbc', key_negotiation.py:54
'[email protected]', '3des-ctr', '3des-cbc', 'blowfish-ctr', 'blowfish-cbc', 'arcfour256', 'arcfour128']
DEBUG encryption_algorithms_server_to_client: ['aes256-ctr', 'aes256-cbc', '[email protected]', 'aes192-ctr', 'aes192-cbc', 'aes128-ctr', 'aes128-cbc', key_negotiation.py:55
'[email protected]', '3des-ctr', '3des-cbc', 'blowfish-ctr', 'blowfish-cbc', 'arcfour256', 'arcfour128']
DEBUG mac_algorithms_client_to_server: ['hmac-sha2-256', 'hmac-sha1', 'hmac-sha1-96', 'hmac-md5', '[email protected]', '[email protected]', key_negotiation.py:56
'[email protected]', '[email protected]']
DEBUG mac_algorithms_server_to_client: ['hmac-sha2-256', 'hmac-sha1', 'hmac-sha1-96', 'hmac-md5', '[email protected]', '[email protected]', key_negotiation.py:57
'[email protected]', '[email protected]']
DEBUG compression_algorithms_client_to_server: ['zlib', '[email protected]', 'none'] key_negotiation.py:58
DEBUG compression_algorithms_server_to_client: ['zlib', '[email protected]', 'none'] key_negotiation.py:59
DEBUG languages_client_to_server: [''] key_negotiation.py:60
DEBUG languages_server_to_client: [''] key_negotiation.py:61
DEBUG first_kex_packet_follows: False key_negotiation.py:62
Desktop (please complete the following information):
- OS: Windows 10
- MobaXterm Portable v21.5
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
manfred-kaiser commentedon Mar 21, 2022
Thanks for the bug report.
It seems that MobaXterm uses a SSH client implementation, which is not supported by paramiko.
I will open an issue ticket in paramiko to discuss this problem.
You can test it with:
ssh-mitm --debug --paramiko-log-level debug --disable-workarounds serverParamiko exception:
manfred-kaiser commentedon Mar 24, 2022
I found the reason, why MobaXterm is unable to connect to SSH-MITM.
Background:
With OpenSSH 8.8 sha1 for rsa signatures was deprecated. A lot of ssh libraries has to update to support more secure hash algorithms.
Paramiko 2.9 has implemented support for the new algorithms, but there are still some problems with older clients and servers, which only support sha1.
Possible fix
If you need to intercept clients, which has limited support for the new algorithms you should use Paramiko <2.9.
I recommend using the Python Package from pypi.org: https://pypi.org/project/ssh-mitm/
This should work with MobaXterm, but you can get problems connecting to OpenSSH 8.8 or later, if you are using the default server configuration.
manfred-kaiser commentedon Apr 1, 2022
This issue is related to paramiko/paramiko#1984 and paramiko/paramiko#2012
SSH-MITM is compatible with the latest version of paramiko and 'paramiko<2-9'.
If the client is not compatible (like MobaXterm) with the latest version of paramiko, paramiko<2-9 should be used as decribed in #95 (comment)
manfred-kaiser commentedon Jul 12, 2022
An analysis of the connection has shown that MobaXterm uses the SSH components of "SecureBlackbox" for the integrated SFTP client.
This can be seen from the version string sent from the client to the server:
SSH-2.0-SecureBlackbox.9.For shell connections (SSH) a PuTTY fork named
MoTTYis apparently used.SSH-2.0-MoTTY_Release_0.77Only the SFTP connection via the SecureBlackbox SSH component is affected by the described problems.
manfred-kaiser commentedon Jul 12, 2022
I have created a pull request for paramiko, which should fix the described bug: paramiko/paramiko#2083
@nikty Thanks for the bug report 👍
fix #95 - added workarround for MonaXterms SecureBlackbox SSH impleme…
manfred-kaiser commentedon Jul 13, 2022
@nikty the latest development branch has a workarround, which adds compatibility for MobaXterm