Diffie-hellman ssh keyxchange

I decided to make a primitive SSH client in C #; you can remember me from posts like primitive ssh connection (low level) hehe.

In any case, everything is fine until I initiate the DH key exchange. I compared traffic when I establish an ssh connection (from an openssh client to an openssh server) to traffic when my client connects to the same openssh server.

OpenSSH client -> OpenSSH server (S for server, C for client): S: SSH-2.0-OpenSSH_5.1p1 Debian-6ubuntu2 \ r (saying hi) C: SSH-2.0-OpenSSH_5.2 \ r (introducing itself) C: Key Exchange Init (0x14 = 20) S: Key Exchange Init C: GEX request Diffie-Hellman (0x22 = 34) (with DH GEX min, number of bits and max) S: Diffie-Hellman Key Exchange Reply (with P, G and etc.) C: Diffie-Hellman GEX Init S: Diffie-Hellman GEX Reply

My client -> OpenSSH server: S: SSH-2.0-OpenSSH_5.1p1 Debian-6ubuntu2 \ r (saying hi) C: SSH-2.0-Some_Name \ r (introducing itself) C: Key Exchange Init (0x14 = 20) S: Key Exchange Init C: GEX Diffie-Hellman request (0x22 = 34) (with DH GEX min, number of bits and max)

and then a dummy TCP packet as a response (perhaps the connection to the server was interrupted after / after the GEX request.

I still need to use AES128 (which, I think, chose encryption, but I'm not sure how to check it ...), and I still send an uncompressed format, hoping to get P, G, etc., to execute DH calculations.

So where I am stuck: RFC 4419 p. 3 http://www.ietf.org/rfc/rfc4419.txt I am sending SSH_MSG_KEY_DH_GEX_REQUEST, but the server is not responding with SSH_MSG_KEX_DH_GEX_GROUP.

Can someone give me some advice on what I don’t understand here? Doesn’t the server understand my GEX request (because of which it expects encryption or?)?

Any help is much appreciated, thanks :)

+3
source share
2 answers

, , ().

0

, , openssh , , openssh. , wirehark openssh .

, , , " openssh" ... , , , .

0

Source: https://habr.com/ru/post/1747011/


All Articles