Computer NetworksNETWORKS

Spoofing Router & Target at the same Time & Fixing Problems | python ethical hacking | Spoofing Code

Spoofing Router & Target at the same Time & Fixing Problems | python Ethical Ethical Hacking | Spoofing Code

Spoofing Router and Target at the same Time and Fixing Problems | in this lecture we will turn this code into a function and create a new function that will spoof the router as well. So now what we’re going to do is we will just cut this code here and turn it into a function like that. Let’s actually here. So now what we’re going to do is we’ll define a function. So we will. So as you remember, this code is for spoofing the target here. And after that, we’re just going to add copy this here. So now we have a spoof target method function and now we will also add spoof router so and we will create a similar function to this as well. But here we will actually change some values, right? And if. So here, this was a spoof, uh, Target. And this is going to be spoof router, here. And after that, we will also, for now, we will copy this and we will. Here. So that’s it. And here. This is in remembered in the previous year. Fake router IP. So here we are. Pretend. To be that IP here and pretend. And here we will also add fake. Fake target. Or instead, we will write the fake device. And here we will pretend. Pretend to be that device. Or the Typekit here. So and after that, for example, remember our column machine’s IP address here? Ifconfig This is the IP address of our local machine. And remember, our Windows machine IP address ends with 128. So now we will change this to 128 here. And here we will paste the Router’s IP address instead of a Target machine’s IP address. So now this is the. Brothers. IP address. As you remember, our router IP address was this here. It will change to here. And also we will also need the router. Mac address. You can find it with FERPA. It was ending with two here. So this is the Mac address of our router here. That’s it. Now we’re going to paste it here. So we will also change the routers routers, Mac address. Here. It will change to here. And this is also the way this will be stay the same and this is the attacker’s machine, which in this case is Kali Linux and this is the fake device pretending to be that IP. So as the name suggests of our function, this with that code we are spoofing the router. So we are pretending that we are some device, right? So in this function we change the value pdst, DST, and P is RC and here the complete program will look like this. Actually, let me delete that lines. And also here. From here. Here, here. That’s it. So here and after that we will also add if and main here. If name main here, if name here and main. So this will this code will work whenever our program starts. Main here and after that. If name main here. If name here and main. So this will this code will work whenever our program starts. Main here and after that. Here. As you can see, we got an error here because we need to add this. And after that, we will first spoof the victim in this case, spoof the target. And after that, we will spoof the router spoof. Of the router. That’s it. And keep in mind that we will only spoof these devices once for now too. So, uh, to create a permanent spoofing, we can do, uh, this codes like. Loops and continuously send these packets after a certain delay. So this way the ARP tables will not get a chance to reset and you will be able to permanently spoof these devices. So as long as your spoof program is running. So in order to do that, we will do the while true true here and we will just add here. So, in reality, actually, you also don’t need to wait or add some delay in it, but we will not add here for now. It will furnish us with the raw target. And after that, we’re going to spoof the victim. Uh, so the. Target here. So now let’s run this. This might be asking for some permission, as you can see, operation not permitted. So we’re going to open our desk. And now let’s go to PyCharm Project. Go to our project name. And here, that’s it. It’s clear now we’re going to run with sudo with superuser privileges. And we will do main.py and call here. Oops. Uh, python three, of course. Python. That’s it. And as you can see, we are keep we keep sending packages here and here. Let’s actually check the Internet now. So we will close the Internet because you will need to here. And as you can see, when our Internet is not working here. Right. Let’s actually go to my ip.com. So our internet will not work for now. So we will now interrupt this and enter the Internet immediately. We’ll come back here. Yeah. And as you can see, our Internet just came back and let’s run it again. Yes, You can see it’s running now. But that’s it. So here. Now we will also try. To. Spoof his devices once. But we can also try to put an exit condition in our loop. So now what we’re going to do is we will use try and. Patch of to close this and now here. What are we going to do is we will use dry here. While true. Evil spoof, the target spoof,

source

mac 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.