How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali Linux

Hello Guys! You’re warm welcome in this advance hacking blog. Now today I came here to share about “How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali Linux”  Now today’s we will learn about man in the middle attack or we can say in short MITM attack. Here I m going to use a very popular tool called Ettercap to perform a MITM attack, and our operating system will be obvious Kali Linux.

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali Linux

I think you are not a newbie in Ethical hacking field because Man in the middle attack is not for newbie, you’re the great learner that’s why you’ are reading this post.

Now friends here I’ll not tell you that what is Kali Linux, and how to use it. And how to give the command and execute them because this is not the part of my blog post, I hope you’ll understand.

Note: This post is only for educational purposes.I didn’t harm anyone, I used my own device during explaining of this method so please don’t use this method any kind of illegal or malicious activities because hacking is a crime if you do this then it’s can land you in jail. I’m not support any kind of illegal or malicious hacking.

Here I am not going to waste your time so just follow the steps and know how you can use Ettercap tool in Kali Linux os for performing MITM attack very easily.

Requirement:


  • You have installed two operating systems (kali linux+windows or any other) in your computer because you’ll need to consider Kali Linux machine as the attacker machine, and windows machine as the victim.

Attacker Machine >>> Kali Linux
Victim Machine >>> Windows 10 (In my case you can use any os for checking how MITM attack work)

  • Ettercap tool
  • Basic knowledge of how to execute the command in Kali Linux terminal
  • High-speed internet connection
READ MORE:
 


How To Perform MITM Attack Using Ettercap 

Now, here are some steps that you can easily perform MITM attacks. So, Step by step follow me-

STEP1;  First of all, open your Kali Linux machine, and you need to search ettercap tool by going to the search bar, here you’ll see 2 ettercap one is the command line and another is GUI. So before using this ettercap tool we’ll need to configure it so follow below some point for configuring it‎👇

a. Open terminal window of Kali Linux machine

b. Give this command nano /etc/ettercap/etter.conf , after executing this command you’ll see a file called ettercap.conf open in nano text editor.

 Note: There is one space between nano and /etc/ettercap/etter.conf

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali LInux

c. Now, a ettercap.conf file will open, simply scroll down, and try to find [privs] section. first, change the value of ec_uid and ec_gid so, change the default value. the value is 0

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali LInux

d. Now, the second change in ettercap.conf file. simply scroll down and try to find Linux section, now in Linux section you will see there are 2 iptables below this sentence if you use iptables. Simply remove the # sign from both of iptables which is in the starting point. And after that save this file by going to file then save option.

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali LInux

STEP2; After configuring ettercap tool you need to open Kali Linux terminal again, and now you need to start the Apache server. I think you know about the Apache server if you don’t know then try to know about it here I am not discussing upon it, simply for hosting any file from your system to globally, you’ll need to use a server. Apache server comes inbuilt in Kali Linux. So simply for starting Apache server  execute below command ‎‎👇

service apache2 start

 Note: There is one space between service and apache2 and also one space between apache2 and start in the above-given command.



STEP3; Now, testing this MITM attack, I make a small website, and save that site in the Apache server. If you don’t know how to host any file from your computer to any other computer anywhere in the world. 

STEP4;  Now, friend you’ll need a static ip , you can check your IP by executing this command in terminal of kali machine ifconfig And you’ll get your ip , suppose your IP is 192.168.19.129 (Remember it)

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali LInux

STEP5; After that again go to the terminal window, and enter below command‎👇

nano /etc/ettercap/etter.dns

 After entering this command a file will open called etter.dns

 Note: There is one space between nano and /etc/ettercap/etter.dns

STEP6; Now, scroll down the file etter.dns, and try to find out This line redirect it to www.linux.org, Now here you need to set your target. So suppose you are going to hack facebook.com using MITM attack simply make an entry of facebook.com and associate your IP address with Facebook. After that, now save the etter.dns file.

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali LInux

STEP7; Now,  the time comes to do a DNS spoofing attack on the victim’s machine (windows machine in my case).Now again open the terminal of Kali Linux, and execute this command‎👇

ettercap -G

 STEP8; After that, ettercap tool will open, Simply click on the sniff option given the upper side of the ettercap tool, and then click on unified sniffing.

STEP9; After that, a popup will come asking for selecting your network interface, In my case, my network interface is Ethernet (eth0). Select your own network interface and click okay.

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali LInux

STEP10; Now, you need to stop unified sniffing by going to the start option, and then click on stop sniffing option.

STEP11; After stopping the sniffing you’ll need to select your targeted system which is connected with your LAN connection. so, simply click on the Target option listed upper side of the ettercap tool and then click on hosts and then scan for hosts. Now you’ll see the list of connected systems with your’s system.

STEP12; Now again go to the hosts list, here you will need to select the gateway IP (just select only) and click on add to target 2.Basically gateway IP listed in the above of all IP and it looks like 255.0.1.4.

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali LInux

STEP13; And again select your victim machine IP (just select only) and click on the add to target 1.

STEP14; So in this way you successfully add gateway IP in target 2 location and victim machin’s ip in target 1 location.

STEP15; Now click on the MITM option which is listed on the upper side of ettercap tool and then click on ARP Poisoning. Now a popup comes where you need to select the sniff remote connection and then click on okay.

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali LInux

STEP16;  Now, go to the plugin option which is situated on the upper side of the ettercap tool then click on manage plugins and then activate the dns spoofing plugin by tapping on it double.

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali LInux

STEP17; Now, the full set up has completed. Now our attacker machine is ready for doing MITM attack on the targeted machine. Simply click on the start button and then start sniffing.

 How To Perform A Man-In-The-Middle(MITM) Attack Using Ettercap in Kali LInux

Now if your victim will try to open the site facebook.com then instead of it your hosted site will open because of your IP address which you mention in the ettercap.dns file after www.facebook.com.

LAST WORD: So friend this is the overall post, if you like this post please share it with your friends. Or in case if you want to ask me something then drop your mail by going to the contact us section of this site,I’ll try to resolve your issue as soon as possible.

Leave a Comment

error: Content is protected !!