0

I have a question about Man in the Middle attack.

What should I do during the Man in the middle attack?

In case I am already connected with a friend of mine on the net, but I suspect that there is a third party among us who is reading or modifying mine and my friend's messages. What do I have to do?

First, I thought that I need to close the initial connection and create a new one with authentication.

I had also thought of establishing a TLS connection with my friend, so even if the channel remains unsafe, the CAs would guarantee network security. I just thought ... The man in the middle can intercept the CA's responses and get him authenticated in my place.

What do I do if I have this suspicion of attack?

theantomc
  • 133
  • 5
  • 1
    How did you suspect that? Also, the CA's don't respond to anything. You fundamentally misunderstand how TLS works. –  Jan 28 '20 at 10:38
  • Suspect because the channel is not secure and there may be a third party on the other side @MechMK1 – theantomc Jan 28 '20 at 10:42
  • Contact your friend through some out of band method (such as phone, SMS, fax, postal mail, sneakernet, etc.) and ask your friend what his public key is. Then, next time you connect to your friend, make sure that same public key is in the certificate that you receive fro your friend. – mti2935 Jan 28 '20 at 10:46
  • @theantomc I highly recommend you to read [How does SSL/TLS work?](https://security.stackexchange.com/questions/20803/how-does-ssl-tls-work). It explains the underlying concepts and what you need to communicate securely. –  Jan 28 '20 at 10:56
  • @mti2935 How do you make sure that such insecure communication is not intercepted by a third party? –  Jan 28 '20 at 11:00
  • then is it recommended to close the connection and open a new authenticated one? If I apply TLS on the one I have, could it work or is it still insecure? – theantomc Jan 28 '20 at 11:19
  • MechMK1, That's why I stipulated that this verification step should be done 'out of band'. – mti2935 Jan 28 '20 at 12:19
  • @mti2935 This out-of-band communication can also be intercepted and modified. –  Jan 28 '20 at 12:24
  • @theantomc The problem is that you need to verify through some means that who you are communicating with is really your friend. But yes, close any insecure communication channels and communicate solely over encrypted channels, which you also authenticate –  Jan 28 '20 at 12:25
  • 1
    This question is missing some very important details. To reiterate what @MechMK1 said, I think you are misunderstanding some fundamentals. An important question though: how are you "connected" with your friend? Are you emailing each other? Using a texting app? Posting on a website? Strategies for defeating a MitM vary wildly depending on the method of communication. Most likely your thought of using TLS won't even make sense for your current method of communication – Conor Mancone Jan 28 '20 at 13:53
  • MechMK1, Please see my answer below in response to your comment. – mti2935 Jan 29 '20 at 11:31

1 Answers1

1

This answer is inspired by my conversation with MechMK1 in the comments. The problem that MechMK1 points out in the comments basically boils down to authenticity, which is often seen as the achilles heel of public key cryptography. How can you be sure the public key purporting to belong to the person that you are attempting to connect with really belongs to that person, and not an MITM?

One way to verify the authenticity of the other party's public key is to use use an out-of-band channel, such as SMS, fax, phone, postal mail, etc.

But, as MechMK1 points out, it's possible that the attacker may be able to intercept connections in these other bands as well. Not many attackers have the ability to this, but it's not out of the realm of possibility for a three-letter agency or a nation state. In this case, sneakernet (exchanging public keys in person) may be the most secure way to verify the authenticity of the other party's public key, if possible.

But, if sneakernet is not an option, due to proximity, time constraints, logistics, etc., then another option is to use a trusted third party, who's public key we know, to verify the authenticity of the other party's public key. This is what SSL/TLS does, using certificate authorities (CA's). PGP does this using a web-of-trust model.

But we know that neither of these are perfect solutions. Perhaps the most notorious example of this was the incident involving the CA DigiNotar in 2013.

Moreover, if the CA or trusted third party is not able to verify the authenticity of the other party's public key in person, then the CA or trusted third party must connect to the other party through some network. If the attacker has as much reach as we are assuming for the sake of this question, then the attacker can simply MITM that connection as well.

To summarize, there is no perfect solution to this problem.

mti2935
  • 21,098
  • 2
  • 47
  • 66