Man-in-the-middle-attack: Understanding in simple words

,


Introduction
In cryptography and PC security, a man-in-the-middle attack (MITM) is an attack where the attacker furtively transfers and perhaps changes the correspondence between two parties who trust they are straightforwardly communicating with each other. A man in the middle (MITM) attack is a general term for when a culprit positions himself in a discussion between a client and an application; either to listen stealthily or to imitate one of the parties, making it show up as though an ordinary trade of information is in progress (Meyer & Wetzel, 2004;Kish, 2006;Hypponen & Haataja, 2007;Ouafi et al. 2008). The objective of an attack is to take individual information, for example, login certifications, account points of interest and charge card numbers. Targets are normally the clients of financial applications, SaaS businesses, web-based business locales and other sites where logging in is required. Information obtained during an attack could be utilized for many, purposes, including fraud, unapproved support exchanges or an unlawful watchword change. Furthermore, it can be utilized to gain a decent footing inside an anchored edge during the infiltration phase of an Advanced Persistent Threat (APT) strike. Fig. 1 portrays a schematic of 'men-in-the-middle-attack' belief system. A man-in-the-middle attack allows a malicious actor to intercept, send and receive data meant for someone else, or not meant to be sent at all, without either outside party knowing until it is too late. Man-in-the-middle attacks can be abbreviated in many ways, including MITM, MitM, MiM or MIM (Ouafi et al., 2008;Joshi et al., 2009;Khader & Lai, 2016 ;Tung et al., 2016;Wallace & Miller, 2017;.

Fig. 1. Men-in-the-middle attack ideology schematic
One case of man-in-the-middle attacks is dynamic eavesdropping, in which the attacker makes independent associations with the victims and transfers messages between them to influence them to trust they are talking straightforwardly to each other over a private association when in certainty the whole discussion is controlled by the attacker. The attacker must have the capacity to intercept every single significant message passing between the two casualties and inject new ones. This is direct in many conditions; for instance, an attacker within gathering scope of an unencrypted wireless access point (Wi-Fi) could insert himself as a man-in-the-middle (Callegati et al., 2009;Desmedt, 2011). As an attack that goes for circumventing common authentication, or scarcity in that department, a man-in-the-middle attack can succeed just when the attacker can mimic every endpoint agreeable to them not surprisingly from the genuine closures. Comprehensively speaking, a MITM attack is what might as well be called a mailman opening your bank proclamation, writing down your record points of interest and after that resealing the envelope and delivering it to your entryway. Most cryptographic conventions include some type of endpoint authentication particularly to persist MITM attacks. For instance, TLS can authenticate one or the two parties using a commonly confided in endorsement expert (Sounthiraraj et al., 2014;Khader & Lai, 2015;Rahim, 2017).

Literature review
MITM is named for a ball game where two people play catch while a third person in the middle attempts to intercept the ball. MITM is also known as a fire brigade attack, a term derived from the emergency process of passing water buckets to put out a fire. In the year 2004, U. Meyer and S. Wetzel presented a report on Universal Mobile Telecommunication System's (UITM) security protocol where they discussed about 'men-in-the-middle-attack' on mobile communication (Meyer & Wetzel, 2004). In 2006, Kish published his research in a master listed journal where he showed an encryption method of MITM using Kirchhoff-loop-Johnson (-like)-noise cipher (Kish, 2006). Hypponen and Haataja (2007), made a research on secure Bluetooth communication and showed their developed system was capable of preventing MITM attack (Hypponen & Haataja, 2007). Sun et al., 2018 andSaif et al., 2018; made similar type of researches on updated version of Bluetooth networks security and discussed about new techniques to prevent MITM in two party's communication (Sun et al., 2018;Saif et al., 2018). Ouafi et al. (2008), Callegati et al. (2009), Joshi et al., (2009), Desmedt, (2011 and Sounthiraraj et al., (2014) conducted researches about HTTP security and those researches found MITM as a very serious threat and those also discussed about the prevention techniques (Ouafi et al., 2008;Callegati et al., 2009;Joshi et al., 2009;Desmedt, 2011;Sounthiraraj et al., 2014). Khader et al. (2015) and Tung et al. (2016) published their researches which mostly talks about different prevention methods of MITM (Khader & Lai, 2015;Tung et al., 2016). Wallace and Miller (2017) patented their research about endpoint based MITM where they tested multiple prevention methods for MITM (Wallace & Miller, 2017). ; did a survey on MITM and its effects on the economy. Li et al. (2017), Rahim (2017) and Howell et al. (2018) made identical researches on prevention of MITM mainly for internet communication and those papers discusses several unique and effective measures on prevention of MITM from on-net communication Rahim, 2017;Howell et al., 2018). Fei et al. (2017), Usman et al. (2018), Valluri (2018) and Kuo et al. (2018) published their review reports on MITM which mostly discusses about WLAN security for 2-way communication.

Progression of 'man-in-the-middle-attack'
Effective MITM execution has two distinct stages: interception and decryption; which involves being within physical closeness to the intended target, and another that exclusive involves malware, known as a man-in-the-browser (MITB) attack. With a conventional MITM attack, the attacker needs access to an unsecured, or ineffectively anchored Wi-Fi switch Rahim, 2017;Fei et al., 2018;Howell et al., 2018;Sun et al., 2018). These sorts of associations are by and large found out in the open territories with free Wi-Fi hotspots, and even in a few people's homes. An attacker will check the switch using code looking for particular shortcomings, for example, default or poor secret key utilize, or security gaps because of the poor arrangement of the switch. Once the attacker has discovered the powerlessness, they will then insert their instruments in the middle of the clients' PC and the sites the client visits. A fresher variation of this attack has been gaining fame with cybercriminals because of its simplicity of execution. With a man-in-the-browser attack, every one of an attacker needs are an approach to inject malware into the PC, which will then install itself into the browser without the clients' learning and will then record the information that is being sent between the victim and particular focused on sites, for example, financial institutions, that are coded into the malware. Once the malware has gathered the particular information it was modified to gather, it then transmits that information back to the attacker.

Interceoption
The initial step intercepts client activity through the attacker's system before it achieves its intended destination. The most well-known (and easiest) method for doing this is an inactive attack in which an attacker makes free/open wifi hotspots; accessible to general society. Commonly named in a way that relates to their area, they aren't watchword secured. Once a casualty interfaces with such a hotspot, the attacker gains full permeability to any online information trade. Attackers wishing to adopt a more dynamic strategy to interception may dispatch one of the following attacks: • IP spoofing involves an attacker disguising himself as an application by altering parcel headers in an ip address. Accordingly, clients attempting to get to a url associated with the application are sent to the attacker's site ('man in the middle (mitm) attack' (incapsula co.), 2016) • ARP spoofing is the way toward linking an attacker's mac address with the ip address of a legitimate user on a local area network using fake arp messages. Subsequently, information sent by the client to the host ip deliver is instead transmitted to the attacker (Meyer & Wetzel, 2004;Kish, 2006;Hypponen & Haataja, 2007;Ouafi et al., 2008;Callegati et al., 2009;Joshi et al., 2009;Desmedt, 2011) • DNS spoofing, otherwise called DNS store poisoning, involves infiltrating a DNS server and altering a site's address record. Accordingly, clients attempting to get to the site are sent by the adjusted dns record to the attacker's site (Ouafi et al., 2008;Joshi et al., 2009;Khader et al., 2015;Howell et al., 2018;Sun et al., 2018;Usman et al., 2018;Valluri, 2018;Kuo et al., 2018;Saif et al., 2018; 'man in the middle (mitm) attack' (incapsula co.)).

Decryption
After an interception, any two-way SSL movement should be unscrambled without alerting the client or application. Various strategies exist to accomplish this: • HTTPS spoofing sends an imposter endorsement to the victim's browser once the initial association demand for a safe site is made ('Man-in-the-middle attack' (Wikipedia)). It holds an advanced thumbprint related with the bargained application, which the browser confirms according to an existing rundown of confided in destinations. The attacker is then ready to get to any information entered by the casualty before it's passed to the application.
• SSL BEAST (browser abuse against SSL/TLS) focuses on a TLS variant 1.0 helplessness in SSL.
Here, the casualty's PC is infected with pernicious JavaScript that intercepts scrambled treats sent by a web application. Then the application's figure square chaining (CBC) is endangered in order to decode its treats and authentication tokens ('man-in-the-middle-attack-mitm' (Techpedia); "man-in-the-middleattack" (Rapid Web Ser.); 'What is a Man In The Middle attack?' (Symantec Corp.), Norton Security Blog,; 'What is UMTS?' (Tech Target Web), Blog Post) • SSL hijacking happens when an attacker passes produced authentication keys to both the client and application during a TCP handshake. This sets up what seems, by all accounts, to be a safe association when, actually, the man in the middle controls the whole session (K. Ouafi et al., 2008;Y. Desmedt, 2011; 'Man-in-the-middle attack' (Wikipedia); 'Flaw in Windows DNS client exposed millions of users to hacking' (SC Mag. UK), News Article) • SSL stripping minimizes an HTTPS association with HTTP by intercepting the TLS authentication sent from the application to the client. The attacker sends a decoded form of the application's site to the client while maintaining the anchored session with the application. In the meantime, the client's whole session is noticeable to the attacker Li et al., 2017;Rahim, 2017;Fei et al., 2018;Howell et al., 2018;Sun et al., 2018;Usman et al., 2018;Valluri, 2018).

MITM: What and how?
'Man-in-the-middle-attack' also known/abbreviated as MIM, MiM, MitM or MITMA is a type of cryptographic attack over a communication channel by a malicious third party where he/she takes over a confidential/personal communication channel between two or legitimate communicative points or parties. In this cyber attack, the attacker can control (read, modify, intercept, change or replace) the communication traffic between victims. But by using MITM protocol the unauthenticated attacker leaves no clues/traces of his interception of this cybercrime, in short words the attacker remains invisible to the victims.
It needs a communication channel to make a MITM attack. The most used communication channels of MITM attack are namely GSM, UMTS, Long-Term Evolution (LTE), Bluetooth, Near Field Communication (NFC), Radio Frequency and Wi-Fi. The first recorded MITM attack was planned in the time of WW-II for intercepting German Military's radio communication and was done by the Royal British Intelligence (also known as MI-6) (Kozaczuk, 1984). In normal sense, there are three most possible compromises, namely Confidentiality, Integrity, and Availability; which is aimed at my MITM attack. Most of the MITM attacks now days are done in social media, because of the extensive use of human communication are done using social media (Facebook, Twitter, Yahoo Messenger and etc. (Hudaib, 2014) Decoding a MITM attack is a long process, basically this is done using three ways, namely 1) Based on impersonation methods of cyber decoding, 2) Based on Telecommunication addressing techniques and lastly 3) Based on GPS locating method of attacker and victims both .

Present status of MITM attacks
Nowadays, most of the MITM attacks are performed using communication layers. Open System Intercommunication (OSI) and GSM networks are the most affected communication channels by MITM attacks. Table-1 shows types of MITM attacks on different OSI and Cellular service networks ('Man-inthe-middle attack' (Wikipedia); 'man-middle-attack' (CA Tech); 'man-in-the-middle-attack-mitm' (Techpedia); "man-in-the-middle-attack" (Rapid Web Ser.); 'What is a Man In The Middle attack?' (Symantec Corp.), Norton Security Blog); 'What is UMTS?' (Tech Target Web), Blog Post; 'Flaw in Windows DNS client exposed millions of users to hacking' (SC Mag. UK), News Article; Fatima, 2011;Kozaczuk, 1984;Hudaib, 2014;.  Table 1, we list MITM attacks across OSI layers and cellular networks. Each layer enforces different approaches to provide security. Nevertheless, neither of them is free from MITM attacks. Ornaghi et al. 2003, at a European conference, was the first to present a security system-based tracking location of the attacker and victim. He classified MITM attacks in three distinct categories: a) LAN (Local Area Network) tracking, b) LAN to Remote Network tracking and c) Remote Network track. The authors also take into consideration that STP mangling is a closed type of MITM as the attacker can only manage to decode the unmanaged traffic between two clients.

Spoofing: Most common MITM
Spoofing an impersonation technique which is originated from 'spying'. In the middle century, European spies used to hear secret conversation by impersonating him/her to the communicative party. The same method is applied in modern cryptographic spoofing, as the attacker intercepts a confidential/personal communication between two hosts and controls over transferring data, while the hosts are not being aware of the unauthenticated attacker. Some research papers ('Flaw in Windows DNS client exposed millions of users to hacking' (SC Mag. UK), News Article; 'What is UMTS?' (Tech Target Saif et al., 2018;Kuo et al., 2018;Valluri, 2018;Usman et al., 2018;Senie & Ferguson, 1998;Humphreys et al., 2008;Scott, 2001;Schuckers, 2002) describe spoofing as the first step of executing MITM, not being the total of a MITM attack; while some other deliciated research papers claim spoofing as a whole MITM process. In this paper, we will consider it as a spoofing based MITM or spoofing attack. When a party wants to communicate with other parties over a cryptographic network then if their network is same with an unknown MAC address then the server broadcasts an address resolution protocol (also abbreviated as ARP) request to all hosts under the same network connection. The client with the announced Internet Protocol is only expected to make a reply including his/her MAC (Media Access Control) address. However, when ARP cache is managed in a dynamic mode, cache entries can be easily fabricated by forged ARP messages, since proper authentication mechanism is missing . In the meantime, the communicating medium saves the IP to MAC entry in its local cache, so the next time communication can be speeded up, by avoiding the broadcasts.
3)When 'A' wants to send a message to 'B', it will go to 'X''s MAC address EE:EE:EE:EE:EE:X3, instead of 'B''s BB:BB:BB:BB:BB:X2. 4) When 'B' wants to send a message to 'A', it will also go to 'X'.
Schematic regarding the example stated above is given in Fig. 2.

Fig. 2. Spoofing method between two clients
There are many well-researched works of literature where spoofing defending system is discussed. Among them T. Demuth et al., 2005, D. Pansa et al., 2008, Z. Trabelsi et al., 2007and R. Philip et al., 2007 are mostly considerable (D. Pansa and T. Chomsiri, 2008;T. Demuth and A. Leitner, 2005; Z. Trabelsi and W. El-Hajj, 2007;R. Philip et al., 2007). They introduced various well-researched techniques to prevent spoofing and make secure communication over LAN. But those Literature doesn't concern about wireless methods of communications. Table 2 below shows a typical comparison between spoofing prevention techniques:

MITM on GSM: A threat to phone communication security
In the early 90's, the European Telecommunications Standards Institute introduced GSM as a second generation (2G) telecommunication standard. Today, according to the mobility report (SAMSUNG ELECTRONICS SUSTAINABILITY REPORT), GSM covers more than 90% of the world population. There are two basic types of services offered through GSM: telephony and data bearer. The GSM architecture consists of Mobile Stations (MSs) and Base Terminal Stations (BTS), which communicate with each other through radio links. Each BTS connects to the Base Station Controller (BSC). BSC links to the Mobile Switching Center (MSC), which is responsible for routing signals to and from fixed networks (Z. . Home Location Register (HLR) and the Visitor Location Register (VLR) are the two major databases for each mobile service provider in the GSM architecture. Fig. 3 shows a schematic of GSM architecture. Each of GSM subscribers has the secret key, which is stored in the Subscriber Identity Module (SIM) card of the MS. The Authentication Center (AUC) has a secret key, which is shared with the subscriber and AUC. AUC generates a set of security parameters for execution of encryption and authentication. Fig. 3. GSM Architecture (Kurose, 2005) The main idea behind the attack is to impersonate same mobile network code as the legitimate GSM network to false BTS (or IMSI Cather (Hardin, 2018)) and convince the victim that this station is the valid one. Let us consider the next example: network consists of the Legitimate MS, Legitimate BTS, False BTS, and False MS. Attacker's network is a combination of the False BTS and False MS. While in standby mode the MS connects to the best received BTS. Therefore, False BTS should be more powerful than the original one, or closer to the target. If the victim is already connected, then the attacker requires to drawn any present real stations. The algorithm of the FBS-based MITM attack on GSM is the following: 1) Attacker sets-up connection between False BTS and Legitimate MS.
2) False MS impersonates the victim's MS to the real network by resending the identity information, which was received from the step 1.
3) Victim's MS sends its authentication information and cipher-suites to the False BTS.
4) Attacker forwards message from step 3 to the Legitimate BTS, with changed authentication abilities of the MS to do not support encryption (A5/0 algorithm ), or to weak encryption algorithm (e.g., A5/2).   Finally, the authentication is finished. All following messages between the victim and real network are going through attacker's entities, with encryption specified by an attacker, or no encryption at all. This manipulation is possible since GSM does not provide the data integrity (Chen et al., 2007), as a result, the attacker can catch, modify, and resend messages. At the designing phase of the GSM protocol, FBS seemed impractical due to costly required equipment, but currently, this kind of attack is completely applicable since costs decreased (Feher et al., 2018). Paik et. al. (2010); besides describing GSM security concerns, pointed out that nowadays attackers are better equipped. Among the reasons we can identify opensource projects (e.g., Open BTS (Burgess & Samra, 2008)) and low-cost hardware (e.g., Ettus Research (A. N. I. C. Ettus Research. Ettus research -the leader in software-defined radio (SDR))). In particular, an attacker can build its own false BTS for less than $1000. An algorithm of FBD based MITM attack on GSM network is given below in Fig. 5. Table 3 discusses various FBS based MITM attacks prevention approaches and different attacks with regarding references.

Statistical analysis of MITM attack
For statistical analysis of the MiM attacks, we refer to the usual finite lattice of security levels, ( , ⊑ , ⨅ , ⨆ ,⊺ , ) and based on it define : → as a mapping from names to their security levels. Now, we can define the name integrity property as follows.

Property [Name integrity]
We say that a name, , has the integrity property with respect to a environment if ∀ ∈ : ⊑ The predicate integrity , indicates that upholds the above property with respect to . A MITM attack is defined as an attack in which the intruder is capable of breaching the integrity of names of two processes.

Property [Man-in-the-Middle Attack]
A context, (a process with a hole) succeeds in launching a MiM attack on two processes, and , if the result of the abstract interpretation, | | | || proves that∃ ∈ , ∈ : , ⋁ , .

Preventing MITM
Blocking MITM attacks requires a few down to earth ventures with respect to clients, and additionally a combination of encryption and check techniques for applications. For clients, this implies: • Avoiding WiFi associations that aren't password encrypted.
• Paying consideration regarding browser warnings reporting a site as being unsecured.
• Immediately logging out of a protected application when it's not in utilize.
For site administrators, secure correspondence conventions, including TLS and HTTPS, help relieve spoofing attacks by vigorously encrypting and authenticating transmitted information (Fatima, 2011). Doing so keeps the interception of site activity and hinders the decoding of delicate information, for example, authentication tokens. It is viewed as best practice for applications to utilize SSL/TLS to anchor each page of their site and not only the pages that expect clients to sign in. Doing so helps diminishes the possibility of an attacker stealing session treats from a client browsing on an unsecured segment of a site while signed in.

Conclusion
The MITMs interrupt interchanges between two frameworks, and this phenomenon takes place when the attacker is responsible for a switch along typical point of movement. The attacker in all cases is situated on a similar communicated domain as the victim stands. Indeed, in a HTTP exchange, a TCP protocol exists among the customer and the server. The attacker divides the TCP protocol into two connectionsone between the victim and the attacker and the other between the attacker and the server. On intercepting the TCP protocol, the attacker goes about as an intermediary reading, altering and inserting information in intercepted correspondence. In an unsecured connection (e.g. HTTP protocol), the communication of two users can be hacked by an intruder without any difficulties. In a HTTPS connection, a single TCP protocol is attained by building two independent SSL connections. A MITM attack exploits the shortcoming in arrange correspondence convention, convincing the casualty to course movement through the attacker instead of ordinary switch and is by and large alluded to as ARP spoofing. This unethical phenomenon can affect a country's economy and may be a reason of instability between nations by stealing/modifying classified/secret defense sector data/information. So, this unethical phenomenon has to be prevented, and the necessary measures should be taken for ending. Although the paper did not focus on extensive analysis for future research directions of MITM, but a good understanding about MITM and the technologies for preventing MITM like Li-Fi were discussed briefly.