1. Hijacking is a type of network security attack in which the attacker takes control of a communication .
2. In hijacking ( also known as a man in the middle attack ) , the perpetrato takes control of an established connection while it is in progress .
3. The attacker intercepts messages in a public key exchange and then retransmits them , substituting their own public key for the requested one , so that the two original parties still appear to be communicating with each other directly .
4. The attacker uses a program that appears to be the server to the client and appears to be the client to the server .
5. This attack may be used simply to gain access to the messages , or to enable the attacker to modify them before retransmitting them .