coolchyni / beyond-debug

Other
20 stars 5 forks source link

ssh2 dependency does not seem to support older KEX algorithms #20

Open ThePMO opened 5 months ago

ThePMO commented 5 months ago

I have to work with a very old Solaris server as a target and I am stuck on the remote debugging setup.

This is the error message that is reported in the OUTPUT -> Extension Host: 2024-05-06 12:38:47.209 [error] Error: Handshake failed: no matching key exchange algorithm at makeError (c:\Users\PA4698.vscode\extensions\coolchyni.beyond-debug-0.9.15\out\extension.js:11263:19) at doFatalError (c:\Users\.vscode\extensions\coolchyni.beyond-debug-0.9.15\out\extension.js:11300:17) at handleKexInit (c:\Users\.vscode\extensions\coolchyni.beyond-debug-0.9.15\out\extension.js:16608:16) at Protocol.onKEXPayload (c:\Users\.vscode\extensions\coolchyni.beyond-debug-0.9.15\out\extension.js:17899:18) at NullDecipher.decrypt (c:\Users\.vscode\extensions\coolchyni.beyond-debug-0.9.15\out\extension.js:12433:30) at Protocol.parsePacket [as _parse] (c:\Users\.vscode\extensions\coolchyni.beyond-debug-0.9.15\out\extension.js:19528:29) at Protocol.parse (c:\Users\.vscode\extensions\coolchyni.beyond-debug-0.9.15\out\extension.js:18322:20) at Socket. (c:\Users\.vscode\extensions\coolchyni.beyond-debug-0.9.15\out\extension.js:23923:25) at Socket.emit (node:events:514:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at Socket.push (node:internal/streams/readable:234:10) at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

Other than that there is no output on the DEBUG CONSOLE or OUTPUT -> BeyondDebug, only a toast "Disconnected from "

I am able to connect to other servers that have a more recent sshd, so I'm pretty sure the problem comes from the KEX algorithms

The Solaris server proposes the following:

debug2: peer server KEXINIT proposal debug2: KEX algorithms: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: host key algorithms: ssh-rsa,ssh-dss debug2: ciphers ctos: aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc debug2: ciphers stoc: aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc debug2: MACs ctos: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96 debug2: MACs stoc: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96

From what I can read about other extensions, I assume under the hood there is a dependency on ssh2, so I looked what it supports there:

kex - mixed - Key exchange algorithms.

Default list (in order from most to least preferable):

  • curve25519-sha256 (node v14.0.0+)
  • curve25519-sha256@libssh.org (node v14.0.0+)
  • ecdh-sha2-nistp256
  • ecdh-sha2-nistp384
  • ecdh-sha2-nistp521
  • diffie-hellman-group-exchange-sha256
  • diffie-hellman-group14-sha256
  • diffie-hellman-group15-sha512
  • diffie-hellman-group16-sha512
  • diffie-hellman-group17-sha512
  • diffie-hellman-group18-sha512

Other supported names:

  • diffie-hellman-group-exchange-sha1
  • diffie-hellman-group14-sha1
  • diffie-hellman-group1-sha1

I see that what the server proposes is listed under "Other supported names". I have not figured out a way to test ssh2 directly, but my assumption is that these other supported names need to be enabled somehow when the Native Debug extension opens the ssh connection?