4

I have a Pcap file that contains some SSH encrypted packets. I have the server public and private key. How do I decrypt these private keys? Is it possible to get the session key using Wireshark or some other software?

1
  • 1
    Decrypting the private keys requires the password for the private keys. Decrypting the session to get the session keys requires decrypting the private key.
    – RoraΖ
    Commented Oct 14, 2015 at 13:41

1 Answer 1

2

I'm not sure what you mean by: "How do I decrypt these private keys?". Well, they are not encrypted. Maybe (and I'm not sure if it is even possible), they could be somehow encrypted by a password, but AFAIK they are not. Admin would have to enter the password on every sshd startup which would be annoying.

SSH protocol uses Diffie-Hellman algorithm to exchange an encryption key. The server private key is used just to sign (not encrypt!) the handshake to prove the server authenticity.

So, even if you manage to obtain the server keys, you won't be able to decrypt a recorded session. You would be just able to fake the server identity.

1
  • It's indeed a good idea to encrypt private keys, so that one needs both the private key and knowledge of the passphrase. As for entering the password repeatdly, nope, ssh-agent deals exactly with that.
    – JeanPierre
    Commented Jan 25, 2023 at 14:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .