Miracle in a small back office. Part 3I'd like to welcome those patient enough to get so far, as this tutorial can wear you down ))). We remember how in the last step running the program was not recommended. In this step, we will eliminate this inconvenience. The thing is, the program reviewed in the last step was generating an incorrect match of IPA - MAC (IPAttack) and IPB - MAC (IPAttack) for the machines being attacked with its two threads. So if we just stop these threads and do not correct the false match for the correct one IPA - MAC (IPA) and IPB - MAC (IPB), then the machines attacked will have to wait for updates to their local ARP-tables for a while, or simply wait for their reboot. But we want to be smart and organized about it. To correct the data corrupted by previous threads, we run the same threads again, but the new flows will give to both machines the correct IP - MAC matches. That's what we are going to do within the ResetSpoof () function. We launched two new threads with real data (Picture. 3.1.). We allow 5-10 seconds for the threads to "persuade" the machines attacked to change the data in the local ARP-tables. Then we just stop these threads and free the memory. That's it, the program can be safely closed. Experiment with it, run it and type Ctrl + C. In a few seconds, the process will be complete and everything will become clear. So by this path Remember the second step where we have set ourselves the objective of intercepting traffic from IPA to IPB? How do we achieve that?
This can be done by the means of WinPcap. In its core there is a function pcap_loop() That's the way we are going to do it. From within the packet_handler () function, we call the ForwardPacket () function. We will receive the packet body (pktdata pointer) and analyze it from within this function. We begin catching and handling the IPA-IPB thread. Changing the packet header, send it back to the network. Changing the packet header, send it back to the network. It seems clear? By the way this point in the program can be completed function ForwardPacket () or more complex processing, God forgive me - stand-in, packet data, there will be very comfortable working with him. Let's summarize. We've got a fully working program by this path: Also, in the files folder you will find a simple program to detect this type of attack. This console program will show which machines on the network changed their MAC addresses. Then, if you understand where addresses are being changed, you need to get on that machine and run sniffer to determine the host sending ARP-packets with false MAC-addresses. The one sending them is the "perpetrator." ))
The project was not too difficult. Sources: sources/__sheva740/miracle/03/files
|