-1

If a client receives a server's certificate typically during handshake, why can't a man in the middle attack proxy client just use the same certificate that will be sent from an authentic server?

Certificates are meant to be public, if I'm not mistaken?

like twitter https://dev.twitter.com/overview/api/ssl

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
ipalibowhyte
  • 1,553
  • 2
  • 22
  • 34
  • 1
    MIM can't simply use the same cert because they don't have the associated private key. Thus, decrypting the data is still impossible. The cert itself is essentially just a public key. That's why MIM forge a certificate and send that instead. – CollinD Oct 04 '15 at 07:51

1 Answers1

1

Simply because the server doesn't only send the certificate; it also proves that its the "owner" of the certificate; speaking simplified here:

The server encrypts something that you can decrypt using the certificate, but only the owner of the certificate could encrypt that way.

Assuming you know the public/private key crypto pattern, the certificate contains a public key that can decrypt data that was encrypted with the server's private key. The server will never ever hand out the private key.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • Okay, I get that. but say I communicate directly with the authentic server and I get the certificate sent and I 'somehow' save it. why can't I now use that same certificate obtained to carry out a man in the middle attack even when ssl pinning is enabled? – ipalibowhyte Oct 04 '15 at 08:08
  • because you can't attach something that only the owner of the matching private key could encrypt, *as I explained* ;) – Marcus Müller Oct 04 '15 at 08:09
  • Ahhh i seeeee! I'm sure you mean the public key encrypts and the private key decrypts ;) – ipalibowhyte Oct 04 '15 at 08:44
  • @Pizzy213codes: No, I don't. The basic idea is: The server's private key encrypts a hash of the certificate and sends it with the certificate. The certificate contains the public key with which you can decrypt the hash. With the hash you can check the certificate. The certificate itself is tamper-proof, because it has been signed by the certificate authority. – Marcus Müller Oct 04 '15 at 08:47
  • Okay, that makes a lot of sense now, thanks!!! but also why is MIM so much of a big deal, I know it exposes sensitive details if successful but wouldn't you first need the client to trust the root certificate of the proxy client like charles or fiddler first? – ipalibowhyte Oct 04 '15 at 08:51