IP packet logging at a port

Started by
1 comment, last by hplus0603 17 years, 2 months ago
Hello, I want to make a program that logs the incoming datas through a port with Delphi. Its a kind of sniffing program. Has anybody got an idea how to do it? I accept WinSock ideas, Delphi component ideas or even DirectPlay8 sollutions :) As I said I except the Delphi sollution, but if someone has C++/VisualBASIC etc idea, write down pls :)
Advertisement
At the time being, I don't have any specific code, but I can give you some general advice. Assuming you know the port number you want to get packets 'from', as well as the server address the packets are being sent to or from, I reccomend you simply make a proxy program that relays data between client and server. Schematically, it would look something like this:

- Client starts.
- Client connects to your proxy program (this is tricky, it might require you to dissassemble the client exe file in the worst case scenario).
- Client starts to send data to the server, which is picked up by your program, saved to disk, and then sent to the server.
- Server responds with some data that is sent to your program, which is, again, saved to disk by your program, and then relayed to the client.

etc.

Hope that wasn't too hard to understand! Good luck! :)
_______________________Afr0Games
I would first try to use WireShark to do the capture for me.
If that's not good, then I'd use the WinPcap library to help me capture packets.
Only if that didn't work would I go looking for SOCK_RAW type socket information on MSDN.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement