Code to capture and send ip packets
-
Hello I am looking for c++ code to capture all the ip packets. I want to capture the original packet not taking a copy from this packet. In other words I don’t want windows to capture this packet. My program should be the only entity that will read this packet.
-
Hello I am looking for c++ code to capture all the ip packets. I want to capture the original packet not taking a copy from this packet. In other words I don’t want windows to capture this packet. My program should be the only entity that will read this packet.
-
In that case you will need to write a network driver and install it in the kernel. And it is unlikely that anyone here will offer to help you as code such as you describe is exactly the sort of thing that hackers and scammers would use.
Thank you for your reply. As a mater of fact this would s an academic project next o am trying to do to write a small firewall. What if rephrase the question to lookf or to capture frames from NIC?
-
Thank you for your reply. As a mater of fact this would s an academic project next o am trying to do to write a small firewall. What if rephrase the question to lookf or to capture frames from NIC?
Well either way this is a research issue. You should google for likely candidates of sample code to help to do what you want. There are already applications available that can capture the internet packets (e.g. Wireshark · Go Deep[^] ), and maybe that would be a good place to start.
-
Thank you for your reply. As a mater of fact this would s an academic project next o am trying to do to write a small firewall. What if rephrase the question to lookf or to capture frames from NIC?
Member 16391238 wrote:
What if rephrase the question to lookf or to capture frames from NIC?
And then what? How do you view them? How do you collect them? You are going to need more than just that.
Member 16391238 wrote:
an academic project
This is going to be a complex project. FIRST, you would need to learn how to write a driver, and driver. And figure out how to do it for the target OS. Either Windows or Linux. Then you would need to find a NIC that you can actually find internal documentation for. So you can access it. Following is the layers you would be looking to replace. And it took me a bit to even find that diagram. The Internet Protocol Stack[^] I suspect you would need to create a IP layer. I think you can do that these days with C++. However you are going to need to really understand how linking works and API interfaces. And probably a bit of hardware knowledge also. It will likely also require special compilation macros to insure that your API is constructed correctly. Internally you might be able to use OO but for the API methods they will not be class methods. It is possible that one of the small hobby computers (like 'Basic Stamp') might be workable mainly because it might be easier to find hardware details. But with that you are then also going to learn how to use that and to create binaries for it.