hierynomus / hierynomus/sshj

Bad packet length after SSH_MSG_KEXINIT

Open
#670 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.7k
Forks
620
Avg merge
3d 23h
Merged PRs (30d)
11

Description

Hi all,

I'm getting the following when upgrading sshj from 0.18 to 0.31.

a) 0.31 - bad packet length:
```
2021-03-09 19:49:21,322 [pool-InterpreterHandler_TELNET-thread-4] INFO telnetproxy.SshClientConfig - Getting algorithm for seeding
2021-03-09 19:49:21,322 [pool-InterpreterHandler_TELNET-thread-4] INFO telnetproxy.SshClientConfig - Generating seed
2021-03-09 19:49:21,323 [pool-InterpreterHandler_TELNET-thread-4] INFO telnetproxy.SshClientConfig - Seed generated
2021-03-09 19:49:21,344 [pool-InterpreterHandler_TELNET-thread-4] DEBUG sshj.DefaultConfig - Available cipher factories: [aes128-cbc, aes128-ctr, aes192-cbc, aes192-ctr, aes256-cbc, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com, blowfish
-cbc, blowfish-ctr, cast128-cbc, cast128-ctr, idea-cbc, idea-ctr, serpent128-cbc, serpent128-ctr, serpent192-cbc, serpent192-ctr, serpent256-cbc, serpent256-ctr, 3des-cbc, 3des-ctr, twofish128-cbc, twofish128-ctr, twofish192-cbc, twofish192-ctr, twofi
sh256-cbc, twofish256-ctr, twofish-cbc, arcfour, arcfour128, arcfour256]
2021-03-09 19:49:21,355 [pool-InterpreterHandler_TELNET-thread-4] INFO transport.TransportImpl - Client identity string: SSH-2.0-SSHJ_0.31.0
2021-03-09 19:49:21,377 [pool-InterpreterHandler_TELNET-thread-4] INFO transport.TransportImpl - Server identity string: SSH-2.0-RomSShell_4.31
2021-03-09 19:49:21,378 [pool-InterpreterHandler_TELNET-thread-4] DEBUG transport.KeyExchanger - Sending SSH_MSG_KEXINIT
2021-03-09 19:49:21,381 [reader] TRACE transport.Decoder - Received packet #0: 14 f0 61 57 c8 c2 86 ce 6e e9 67 e7 f0 36 95 3a e7 00 00 00 1a 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 2d 73 68 61 31 00 00 00 07 73 73 68 2d 64 73
73 00 00 00 08 33 64 65 73 2d 63 62 63 00 00 00 08 33 64 65 73 2d 63 62 63 00 00 00 09 68 6d 61 63 2d 73 68 61 31 00 00 00 09 68 6d 61 63 2d 73 68 61 31 00 00 00 04 6e 6f 6e 65 00 00 00 04 6e 6f 6e 65 00 00 00 00 00 00 00 00 00 00 00 00 00
2021-03-09 19:49:21,383 [reader] TRACE transport.TransportImpl - Received packet KEXINIT
2021-03-09 19:49:21,383 [reader] DEBUG transport.KeyExchanger - Received SSH_MSG_KEXINIT
2021-03-09 19:49:21,384 [pool-InterpreterHandler_TELNET-thread-4] TRACE transport.Encoder - Encoding packet #0: 14 cc 91 04 3d 4c 04 5d 0d 40 45 29 b1 04 67 28 5b 00 00 02 a7 63 75 72 76 65 32 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 35
35 31 39 2d 73 68 61 32 35 36 40 6c 69 62 73 73 68 2e 6f 72 67 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d 73 68 61 32 35 36 2c 65 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 31 2c 65 63 64 68 2d 73
68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 36 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d 73 68 61 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 7
2 6f 75 70 31 2d 73 68 61 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d
67 72 6f 75 70 31 35 2d 73 68 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 37 2d 73 68 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65
6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 40 73 73 68 2e 63 6f 6d 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 35 2d 73 6
8 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 35 2d 73 68 61 32 35 36 40 73 73 68 2e 63 6f 6d 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 35 2d 73 68 61 33 38 34 40 73 73 68 2e 63 6f 6d 2c 64 69
66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 61 33 38 34 40 73 73 68 2e 63 6f 6d 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f
75 70 31 36 2d 73 68 61 35 31 32 40 73 73 68 2e 63 6f 6d 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 31 32 40 73 73 68 2e 63 6f 6d 2c 65 78 74 2d 69 6e 66 6f 2d 63 00 00 00 ab 73 73 68 2d 65 64 32 35 35 31 39 2
c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 31 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 36 2c 72 73 61 2d 73 68 61 32 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32
35 36 2c 73 73 68 2d 72 73 61 2d 63 65 72 74 2d 76 30 31 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 73 73 68 2d 64 73 73 2d 63 65 72 74 2d 76 30 31 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 73 73 00 00 01 a3 61 65 73 31
32 38 2d 63 62 63 2c 61 65 73 31 32 38 2d 63 74 72 2c 61 65 73 31 39 32 2d 63 62 63 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 32 35 36 2d 63 62 63 2c 61 65 73 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6
d 2c 61 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 62 6c 6f 77 66 69 73 68 2d 63 62 63 2c 62 6c 6f 77 66 69 73 68 2d 63 74 72 2c 63 61 73 74 31 32 38 2d 63 62 63 2c 63 61 73 74 31 32 38 2d 63 74 72 2c 69 64 65 61 2d 63 62 63 2c
69 64 65 61 2d 63 74 72 2c 73 65 72 70 65 6e 74 31 32 38 2d 63 62 63 2c 73 65 72 70 65 6e 74 31 32 38 2d 63 74 72 2c 73 65 72 70 65 6e 74 31 39 32 2d 63 62 63 2c 73 65 72 70 65 6e 74 31 39 32 2d 63 74 72 2c 73 65 72 70 65 6e 74 32 35 36 2d 63 62 63 2c
73 65 72 70 65 6e 74 32 35 36 2d 63 74 72 2c 33 64 65 73 2d 63 62 63 2c 33 64 65 73 2d 63 74 72 2c 74 77 6f 66 69 73 68 31 32 38 2d 63 62 63 2c 74 77 6f 66 69 73 68 31 32 38 2d 63 74 72 2c 74 77 6f 66 69 73 68 31 39 32 2d 63 62 63 2c 74 77 6f 66 69 7
3 68 31 39 32 2d 63 74 72 2c 74 77 6f 66 69 73 68 32 35 36 2d 63 62 63 2c 74 77 6f 66 69 73 68 32 35 36 2d 63 74 72 2c 74 77 6f 66 69 73 68 2d 63 62 63 2c 61 72 63 66 6f 75 72 2c 61 72 63 66 6f 75 72 31 32 38 2c 61 72 63 66 6f 75 72 32 35 36 00 00 01
a3 61 65 73 31 32 38 2d 63 62 63 2c 61 65 73 31 32 38 2d 63 74 72 2c 61 65 73 31 39 32 2d 63 62 63 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 32 35 36 2d 63 62 63 2c 61 65 73 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 63 6d 40 6f 70 65 6e 73 73
68 2e 63 6f 6d 2c 61 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 62 6c 6f 77 66 69 73 68 2d 63 62 63 2c 62 6c 6f 77 66 69 73 68 2d 63 74 72 2c 63 61 73 74 31 32 38 2d 63 62 63 2c 63 61 73 74 31 32 38 2d 63 74 72 2c 69 64 65 61 2
d 63 62 63 2c 69 64 65 61 2d 63 74 72 2c 73 65 72 70 65 6e 74 31 32 38 2d 63 62 63 2c 73 65 72 70 65 6e 74 31 32 38 2d 63 74 72 2c 73 65 72 70 65 6e 74 31 39 32 2d 63 62 63 2c 73 65 72 70 65 6e 74 31 39 32 2d 63 74 72 2c 73 65 72 70 65 6e 74 32 35 36
2d 63 62 63 2c 73 65 72 70 65 6e 74 32 35 36 2d 63 74 72 2c 33 64 65 73 2d 63 62 63 2c 33 64 65 73 2d 63 74 72 2c 74 77 6f 66 69 73 68 31 32 38 2d 63 62 63 2c 74 77 6f 66 69 73 68 31 32 38 2d 63 74 72 2c 74 77 6f 66 69 73 68 31 39 32 2d 63 62 63 2c 74
77 6f 66 69 73 68 31 39 32 2d 63 74 72 2c 74 77 6f 66 69 73 68 32 35 36 2d 63 62 63 2c 74 77 6f 66 69 73 68 32 35 36 2d 63 74 72 2c 74 77 6f 66 69 73 68 2d 63 62 63 2c 61 72 63 66 6f 75 72 2c 61 72 63 66 6f 75 72 31 32 38 2c 61 72 63 66 6f 75 72 32 3
5 36 00 00 01 46 68 6d 61 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63
2d 6d 64 35 2c 68 6d 61 63 2d 6d 64 35 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 6d 64 35 2d 39 36 2c 68 6d 61 63 2d 6d 64 35 2d 39 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c
68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 72 69 70 65 6
d 64 31 36 30 2c 68 6d 61 63 2d 72 69 70 65 6d 64 31 36 30 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 72 69 70 65 6d 64 31 36 30 2d 39 36 2c 68 6d 61 63 2d 72 69 70 65 6d 64 31 36 30 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 00 00 01
46 68 6d 61 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 6d 64 35 2c
68 6d 61 63 2d 6d 64 35 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 6d 64 35 2d 39 36 2c 68 6d 61 63 2d 6d 64 35 2d 39 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 2
d 73 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 72 69 70 65 6d 64 31 36 30
2c 68 6d 61 63 2d 72 69 70 65 6d 64 31 36 30 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 72 69 70 65 6d 64 31 36 30 2d 39 36 2c 68 6d 61 63 2d 72 69 70 65 6d 64 31 36 30 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 00 00 00 04 6e 6f 6e 65
00 00 00 04 6e 6f 6e 65 00 00 00 00 00 00 00 00 00 00 00 00 00
2021-03-09 19:49:21,385 [reader] DEBUG transport.KeyExchanger - Negotiated algorithms: [ kex=diffie-hellman-group1-sha1; sig=ssh-dss; c2sCipher=3des-cbc; s2cCipher=3des-cbc; c2sMAC=hmac-sha1; s2cMAC=hmac-sha1; c2sComp=none; s2cComp=none; rsaSHA2Support=false ]
2021-03-09 19:49:21,397 [reader] TRACE transport.Encoder - Encoding packet #1: 1e 00 00 00 80 3f 56 6c 38 36 60 d2 99 eb 0d b5 42 d8 60 f2 e4 ec a2 85 c8 23 a8 71 f5 27 4f b7 55 11 93 cc 6a 12 2b 86 b7 d1 f3 85 e8 55 ed 53 0e 40 7d 73 cf 49 e1 9f 97
f0 b9 37 98 2f e8 04 84 7e a4 f9 25 96 7e 0d 5b e3 e8 a5 fb d4 2f 1a de f7 c7 00 18 9d bd f9 62 d1 d5 41 c6 4b bc 08 3a 54 38 39 b3 0c c4 51 df 9d 93 da 76 f1 0d b9 90 ba 83 b3 0a af 08 1f ea e4 be 37 1e 6f 4e 22 d3 86 d3 6c d4
2021-03-09 19:49:21,398 [reader] TRACE transport.Decoder - Received packet #1: 01 00 00 00 02 00 00 00 11 42 61 64 20 70 61 63 6b 65 74 20 6c 65 6e 67 74 68 00 00 00 00
2021-03-09 19:49:21,398 [reader] TRACE transport.TransportImpl - Received packet DISCONNECT
2021-03-09 19:49:21,398 [reader] INFO transport.TransportImpl - Received SSH_MSG_DISCONNECT (reason=PROTOCOL_ERROR, msg=Bad packet length)
2021-03-09 19:49:21,398 [reader] ERROR transport.TransportImpl - Dying because - Bad packet length
net.schmizz.sshj.transport.TransportException: [PROTOCOL_ERROR] Bad packet length
at net.schmizz.sshj.transport.TransportImpl.gotDisconnect(TransportImpl.java:565)
at net.schmizz.sshj.transport.TransportImpl.handle(TransportImpl.java:521)
at net.schmizz.sshj.transport.Decoder.decode(Decoder.java:113)
at net.schmizz.sshj.transport.Decoder.received(Decoder.java:203)
at net.schmizz.sshj.transport.Reader.run(Reader.java:60)
2021-03-09 19:49:21,399 [reader] INFO transport.TransportImpl - Disconnected - PROTOCOL_ERROR
2021-03-09 19:49:21,399 [reader] DEBUG transport.KeyExchanger - Got notified of net.schmizz.sshj.transport.TransportException: [PROTOCOL_ERROR] Bad packet length
2021-03-09 19:49:21,399 [reader] DEBUG transport.TransportImpl$NullService - Notified of net.schmizz.sshj.transport.TransportException: [PROTOCOL_ERROR] Bad packet length
```

b) In 0.18 everything works fine:
```
2021-03-09 20:39:34,636 [pool-InterpreterHandler_TELNET-thread-1] INFO telnetproxy.SshClientConfig - Getting algorithm for seeding
2021-03-09 20:39:34,636 [pool-InterpreterHandler_TELNET-thread-1] INFO telnetproxy.SshClientConfig - Generating seed
2021-03-09 20:39:34,636 [pool-InterpreterHandler_TELNET-thread-1] INFO telnetproxy.SshClientConfig - Seed generated
2021-03-09 20:39:34,684 [pool-InterpreterHandler_TELNET-thread-1] DEBUG sshj.DefaultConfig - Available cipher factories: [net.schmizz.sshj.transport.cipher.AES128CTR$Factory@b5191e2, net.schmizz.sshj.transport.cipher.AES192CTR$Factory@1edffbed, net.schmizz.sshj.transport.cipher.AES256CTR$Factory@70f66466, net.schmizz.sshj.transport.cipher.AES128CBC$Factory@5744cb7, net.schmizz.sshj.transport.cipher.AES192CBC$Factory@2ad037a, net.schmizz.sshj.transport.cipher.AES256CBC$Factory@634c8051, net.schmizz.sshj.transport.cipher.TripleDESCBC$Factory@205a0d0a, net.schmizz.sshj.transport.cipher.BlowfishCBC$Factory@76cfc42, blowfish-ctr, cast128-cbc, cast128-ctr, idea-cbc, idea-ctr, serpent128-cbc, serpent128-ctr, serpent192-cbc, serpent192-ctr, serpent256-cbc, serpent256-ctr, 3des-ctr, twofish128-cbc, twofish128-ctr, twofish192-cbc, twofish192-ctr, twofish256-cbc, twofish256-ctr, twofish-cbc, arcfour, arcfour128, arcfour256]
2021-03-09 20:39:34,700 [pool-InterpreterHandler_TELNET-thread-1] INFO telnetproxy.SshCommandProcessor - Connecting to 'Address = 10.238.94.252:22'
2021-03-09 20:42:45,734 [pool-InterpreterHandler_TELNET-thread-1] INFO transport.TransportImpl - Client identity string: SSH-2.0-SSHJ_0_17_2
2021-03-09 20:42:45,763 [pool-InterpreterHandler_TELNET-thread-1] INFO transport.TransportImpl - Server identity string: SSH-2.0-RomSShell_4.31
2021-03-09 20:42:45,764 [pool-InterpreterHandler_TELNET-thread-1] DEBUG transport.KeyExchanger - Sending SSH_MSG_KEXINIT
2021-03-09 20:42:45,765 [reader] TRACE transport.Decoder - Received packet #0: 14 34 9a 33 9d 99 09 94 05 3c 61 db 49 a1 0e c5 32 00 00 00 1a 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 2d 73 68 61 31 00 00 00 07 73 73 68 2d 64 73
73 00 00 00 08 33 64 65 73 2d 63 62 63 00 00 00 08 33 64 65 73 2d 63 62 63 00 00 00 09 68 6d 61 63 2d 73 68 61 31 00 00 00 09 68 6d 61 63 2d 73 68 61 31 00 00 00 04 6e 6f 6e 65 00 00 00 04 6e 6f 6e 65 00 00 00 00 00 00 00 00 00 00 00 00 00
2021-03-09 20:42:45,768 [reader] TRACE transport.TransportImpl - Received packet KEXINIT
2021-03-09 20:42:45,768 [reader] DEBUG transport.KeyExchanger - Received SSH_MSG_KEXINIT
2021-03-09 20:42:45,770 [pool-InterpreterHandler_TELNET-thread-1] TRACE transport.Encoder - Encoding packet #-1: 14 13 fc e5 3e c8 e4 db a8 f9 63 e3 f6 c0 fc 55 cb 00 00 00 d4 63 75 72 76 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 62 73 73 68 2e
6f 72 67 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d 73 68 61 32 35 36 2c 65 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 31 2c 65 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 63 64 68 2
d 73 68 61 32 2d 6e 69 73 74 70 32 35 36 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d 73 68 61 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 64 69 66 66 69 65
2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 2d 73 68 61 31 00 00 00 2f 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 36 2c 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 73 73 2c 73 73 68 2d 65 64 32 35 35 31 39 00 00 01 75 61 65 73 31 32 38 2d 63 74
72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 63 62 63 2c 61 65 73 31 39 32 2d 63 62 63 2c 61 65 73 32 35 36 2d 63 62 63 2c 33 64 65 73 2d 63 62 63 2c 62 6c 6f 77 66 69 73 68 2d 63 62 63 2c 62 6c 6f 77 6
6 69 73 68 2d 63 74 72 2c 63 61 73 74 31 32 38 2d 63 62 63 2c 63 61 73 74 31 32 38 2d 63 74 72 2c 69 64 65 61 2d 63 62 63 2c 69 64 65 61 2d 63 74 72 2c 73 65 72 70 65 6e 74 31 32 38 2d 63 62 63 2c 73 65 72 70 65 6e 74 31 32 38 2d 63 74 72 2c 73 65 72
70 65 6e 74 31 39 32 2d 63 62 63 2c 73 65 72 70 65 6e 74 31 39 32 2d 63 74 72 2c 73 65 72 70 65 6e 74 32 35 36 2d 63 62 63 2c 73 65 72 70 65 6e 74 32 35 36 2d 63 74 72 2c 33 64 65 73 2d 63 74 72 2c 74 77 6f 66 69 73 68 31 32 38 2d 63 62 63 2c 74 77 6f
66 69 73 68 31 32 38 2d 63 74 72 2c 74 77 6f 66 69 73 68 31 39 32 2d 63 62 63 2c 74 77 6f 66 69 73 68 31 39 32 2d 63 74 72 2c 74 77 6f 66 69 73 68 32 35 36 2d 63 62 63 2c 74 77 6f 66 69 73 68 32 35 36 2d 63 74 72 2c 74 77 6f 66 69 73 68 2d 63 62 63 2
c 61 72 63 66 6f 75 72 2c 61 72 63 66 6f 75 72 31 32 38 2c 61 72 63 66 6f 75 72 32 35 36 00 00 01 75 61 65 73 31 32 38 2d 63 74 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 63 62 63 2c 61 65 73 31 39 32 2d 63 62 63 2c 61 65 73 32 35 36 2d 63 62 63 2c 33 64 65 73 2d 63 62 63 2c 62 6c 6f 77 66 69 73 68 2d 63 62 63 2c 62 6c 6f 77 66 69 73 68 2d 63 74 72 2c 63 61 73 74 31 32 38 2d 63 62 63 2c 63 61 73 74 31 32 38 2d 63 74 72 2c 69 64 65 61 2d 63 62 63 2c 69 64 65 61 2d 63 74 72 2c 73 65 72 70 65 6e 74 31 32 38 2d 63 62 63 2c 73 65 72 70 65 6e 74 31 32 38 2d 63 74 72 2c 73 65 72 70 65 6e 74 31 39 32 2d 63 62 63 2c 73 65 72 70 65 6e 74 31 39 32 2d 63 74 72 2c 73 65 72 70 65 6e 74 32 35 36 2d 63 62 63 2c 73 65 72 70 65 6e 74 32 35 36 2d 63 74 72 2c 33 64 65 73 2d 63 74 72 2c 74 77 6f 66 69 73 68 31 32 38 2d 63 62 63 2c 74 77 6f 66 69 73 68 31 32 38 2d 63 74 72 2c 74 77 6f 66 69 73 68 31 39 32 2d 63 62 63 2c 74 77 6f 66 69 73 68 31 39 32 2d 63 74 72 2c 74 77 6f 66 69 73 68 32 35 36 2d 63 62 63 2c 74 77 6f 66 69 73 68 32 35 36 2d 63 74 72 2c 74 77 6f 66 69 73 68 2d 63 62 63 2c 61 72 63 66 6f 75 72 2c 61 72 63 66 6f 75 72 31 32 38 2c 61 72 63 66 6f 75 72 32 35 36 00 00 00 47 68 6d 61 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 2c 68 6d 61 63 2d 6d 64 35 2c 68 6d 61 63 2d 6d 64 35 2d 39 36 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 00 00 00 47 68 6d 61 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 2c 68 6d 61 63 2d 6d 64 35 2c 68 6d 61 63 2d 6d 64 35 2d 39 36 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 00 00 00 04 6e 6f 6e 65 00 00 00 04 6e 6f 6e 65 00 00 00 00 00 00 00 00 00 00 00 00 00
2021-03-09 20:42:45,771 [reader] DEBUG transport.KeyExchanger - Negotiated algorithms: [ kex=diffie-hellman-group1-sha1; sig=ssh-dss; c2sCipher=3des-cbc; s2cCipher=3des-cbc; c2sMAC=hmac-sha1; s2cMAC=hmac-sha1; c2sComp=none; s2cComp=none ]
2021-03-09 20:42:45,789 [reader] DEBUG kex.DHG1 - Sending SSH_MSG_KEXDH_INIT
2021-03-09 20:42:45,789 [reader] TRACE transport.Encoder - Encoding packet #0: 1e 00 00 00 81 00 c0 55 08 d0 b5 d3 76 22 ca 56 51 f6 82 9b 2d 25 d0 76 eb 25 df b8 f5 9d 8c bb df 5a 4a 34 a5 e7 69 4e b2 10 60 fa 24 c9 a3 39 63 c1 dd 46 c4 38 47 a8 4e d2 c1 b1 16 3b 9f 17 4f 23 3e 84 c4 eb 3a fd 69 67 a8 69 0d a9 23 09 2c 70 43 b7 d7 2f 46 6b 14 e8 72 ad 25 1d bc e8 b4 f6 be 2e d7 1f 94 46 fa 71 53 48 32 41 e7 58 60 50 c3 e7 53 48 22 2d cd f8 56 1b df f5 34 d0 ef 98 d1 51 4f 3b
2021-03-09 20:42:46,310 [reader] TRACE transport.Decoder - Received packet #1: 1f 00 00 01 b0 00 00 00 07 73 73 68 2d 64 73 73 00 00 00 81 00 a6 5f ea ab 51 1c 61 e3 3d f3 8f dd da f0 3b 59 b6 f2 5e 1f a4 de 57 e5 cf 00 ae 47 8a 85 5d da 4f 36 38 d3 8b b0 0a c4 af 7d 84 14 c3 fb 36 e0 4f bd f3 d3 16 67 12 d4 3b 42 1b fa 75 7e 85 69 4a d2 7c 48 f3 96 d0 3c 8b ce 8d a5 8d b5 b8 20 39 f3 5d cf 85 72 35 c2 f1 c7 3b 22 26 a3 61 42 91 90 dc b5 b6 cd 0e df b0 ff 69 33 90 0b 02 ce cc 0c e6 92 74 d8 da e7 c6 94 80 43 18 d6 d6 b9 00 00 00 15 00 b5 af d2 f9 32 46 b1 ef cd 1f 3a 7c 24 0c 1e 9e 21 a3 63 0b 00 00 00 7f 7b bd 2c 5d c9 17 a5 e0 8b 9c 2f 80 a4 9f b6 3f cd 5c 05 78 ba 70 1e 25 4f e3 53 0d ed d3 b6 68 0a 6e 5a fb 32 80 b5 3f 15 40 28 ba ff f7 3d 1b a0 fd b0 00 4b 9e b0 db f2 4b 29 5b f2 a3 56 91 3c d1 c0 be 03 c5 10 3a 1d a8 b7 3e 76 70 b5 6d 71 6e d5 54 7a f6 7b 50 61 31 1e ea 24 5e 2e 5c 33 78 43 cb c1 35 b9 b9 c1 87 75 d5 d5 6c fd a3 1b 74 7e 24 49 86 1a df 3b 3f 72 71 89 c0 a3 00 00 00 80 6b 19 8c d1 a2 fa f6 7f 9a 32 aa 9d f1 f3 9c 5c be 0d 90 1f 5c fa 48 3e bf 62 0c a6 40 53 0f cf 27 06 a9 ce 75 90 1e 86 e1 65 cf 06 66 9f 38 b7 16 6b e5 dd 5d e1 f5 2b a8 a0 3e 15 c9 b4 5c b5 95 cd 7a 80 30 7c 7a ac 45 7a f0 c2 9e 5b eb 37 c8 f5 7e df 5a 20 44 d4 91 da 13 18 bd 54 73 d1 42 76 09 07 79 a3 d4 bd b1 cf 2e 33 eb 77 46 03 7c a4 ce a2 90 91 32 ce 10 b2 7f ab 8f a2 97 af 00 00 00 81 00 f4 49 cb c9 51 4c 86 c8 e6 39 2c f1 98 9f 4a 7e c4 24 c9 28 98 dc e2 1d 9e cd 79 a6 ea 5e 96 57 2d c7 73 a2 41 41 d5 00 64 42 a0 e5 08 97 ec e5 c3 e6 6c aa 6c 55 67 ad f2 a9 b6 c0 d1 8d e4 26 09 3c fc e3 81 a8 a0 15 4e db 38 2e ff cb b2 7a 4f 87 84 22 1d e1 7b d5 7d a5 35 a2 fe e0 b4 5e 4e e3 7c 1d 83 ee 7b 6c 17 de 3c f6 eb f4 d4 84 cf fa 1f 25 68 24 36 fb f8 b4 68 bb 18 0f fb 6c 00 00 00 37 00 00 00 07 73 73 68 2d 64 73 73 00 00 00 28 0e 31 90 5b 0c 6e 52 4b 2a 1f ea 50 a8 c2 c3 eb 25 ba 33 23 81 86 f9 70 de fe 9b 5a d9 46 a2 03 87 e8 42 b0 90 b3 02 3f
2021-03-09 20:42:46,311 [reader] TRACE transport.TransportImpl - Received packet KEXDH_31
2021-03-09 20:42:46,311 [reader] DEBUG transport.KeyExchanger - Received kex followup data
2021-03-09 20:42:46,311 [reader] DEBUG kex.DHG1 - Received SSH_MSG_KEXDH_REPLY
2021-03-09 20:42:46,337 [reader] DEBUG transport.KeyExchanger - Trying to verify host key with net.schmizz.sshj.transport.verification.PromiscuousVerifier@228aab19
2021-03-09 20:42:46,337 [reader] DEBUG transport.KeyExchanger - Sending SSH_MSG_NEWKEYS
2021-03-09 20:42:46,337 [reader] TRACE transport.Encoder - Encoding packet #1: 15
2021-03-09 20:42:46,353 [reader] TRACE transport.Decoder - Received packet #2: 15
2021-03-09 20:42:46,353 [reader] TRACE transport.TransportImpl - Received packet NEWKEYS
2021-03-09 20:42:46,353 [reader] DEBUG transport.KeyExchanger - Received SSH_MSG_NEWKEYS
2021-03-09 20:42:46,359 [pool-InterpreterHandler_TELNET-thread-1] DEBUG sshj.SSHClient - Key exchange took 0.595 seconds
```

Additional info: the SSH server is a bit odd and needs the flag '-c 3des-cbc' from the command line:
```
$ ssh -v xxxxxx@10.238.94.252
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to 10.238.94.252 [10.238.94.252] port 22.
debug1: Connection established.
...
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version RomSShell_4.31
debug1: no match: RomSShell_4.31
debug1: Authenticating to 10.238.94.252:22 as 'xxxxxx'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group1-sha1
debug1: kex: host key algorithm: ssh-dss
Unable to negotiate with 10.238.94.252 port 22: no matching cipher found. Their offer: 3des-cbc
```

I can run any test you need, but the server is an embedded one so I can't modify it.

Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.