Computer NetworksNETWORKS

How to build an Address resolution protocol spoof program | Python Ethical Hacking

in this lecture we will learn how to build an address resolution protocol spoof program. So before we move on, let’s take a look at the ARP tables again in both Kali as well as the Windows and you can see windows ARP table in the right top corner of the screen here and I think, yeah, you can see it. And here we will also check the ARP. Here you can see we have the. Here. Zero. ETA, ETA as well. And this is our and some of this is incomplete, but I think this 1 to 8 is wind belongs to windows. So as you can see here, see here we have the correct Mac addresses for the router located at 192168.3.13.2. Carly here is located at 138 and sometimes you might not see own IP addresses in your packets, but sometimes you can see. So it doesn’t make any big difference here, so don’t worry about it. So and our Windows 10 is located at 192.168 point 13.128 here. And we can see the IP address. So we are thus in we are in the same network as Windows 10 here. So we can now close the just we will just close the windows, but we will not turn it on or turn it off here. Let’s it to see fully here. And now what we’re going to do is we will start our project. We can you can also open the PyCharm here and delete all project or you can create a new project from the file, the new project here. And that’s it. So I suggest to use virtual environment, but you can also use this on your own. Python three. Uh, program here. So now what we’re going to do is we’re going to import some of the libraries. Actually, let’s import all of the libraries. And while we are while we are coding our program, the integrated development environment will suggest us what the. The libraries and packages we want to import. So now let’s from scrapy dot all we will import all here, but here we will here. This asterisk actually means that we want to import all the modules present in here. So as we learned in the previous lectures to spoof, we have to create fake responses. So first we will create a response intended for the victim. And to do this we will create an ARP packet and see what fields can be set in it. So we will use the My ARP response here and we will create a new ARP class here. As you can see, we got an error because we we have to import the escape layers l2 arp here. So I think if I would increase the size of the text a little bit, you will to see better here and we will use the custom fault. 18. Perfect. So now what we’re going to do is after that we will print this ARP response. In this case, this will not ask any root privileges so we can run it here. And as you can see here, ARP has 000, says one. So as you can see, it’s 100 and it ends with 138. And do you remember somewhere and as you can see, it’s our. It’s our. Local. It’s our Linux machines, local IP address. So and after that we will also use show. And let’s see what will change here. And as you can see here, we are seeing Ethernet ten megabit IP version two, IP version four, and we are seeing our IP address and Mac address here. So now the output would look like this. And we can also check this on here terminal and Python. Python three main python three main dot pi here. Oops. And as you can see here, we are seeing all of the information that we that the. The ERP provides us address resolution protocol provides us so the fields that we are interested in start from up here or here. So OP stands for operation or type of packet. So this is here who has operation, which means that it it is an ERP request address resolution protocol request. So but we are interested in creating an ERP response instead. So which is w sk here. So now h w SC and we also have h h w dst and p w d st as you can see from DST. Haven’t been set for this packet yet. So now we will make the modifications in this packet in order to spoof the victim. So, actually, let me get my pen here. Okay. So we will change the OP to two. Right. Implying that this is a response here and not a request. And we will also change the PSC. Here you can see here we will change the PSC address field to make it equal to the value of the IP address of the router since our router is located at here. Remember this? Actually, let me open the new tab. New tab and ifconfig and here our router is located at here. Actually, let me write the ARP here and as you can see, our router is located at here and we will set this field to the value. And lastly we will set pdst. So we will set the PTSD to the IP address of the victim’s machine. And here this is the victim’s Mac address here so we can see it freely, Right. And now here in next lecture, you will also write the code for it. In this lecture we actually introduced what we will do to create our project. Actually, this is not a quite simple project that we did in earlier lectures, but this will be like so bigger, so much bigger than the previous projects here. So I’m waiting you in next lecture.

source

ip address

Alice AUSTIN

Alice AUSTIN is studying Cisco Systems Engineering. He has passion with both hardware and software and writes articles and reviews for many IT websites.