Explain the MITM attack. How to prevent it?

A Grey Hat Hacker possesses both the traits of a Black Hat and a White Hat Hacker. The system is being abused without malice, but because they lack the necessary authority to surf the system, it might become a threat at any point. The hacker eavesdrops on the communication between two parties in a Man-in-the-Middle attack. The person then poses as someone else and makes the data transmission appear normal to the other parties. The goal is to manipulate data, steal personal information, or get login credentials in order to sabotage communication.

There are a few things you can do to avoid a MITM attack:

  1. Public key pair based authentication
  2. Virtual private network
  3. Strong router login credentials
  4. Implement well built Intrusion Detection systems (IDS) like firewalls.
  5. Strong WEP/WPA encryption on access points