0

I would like to ask about code which can provide network communication through another application. I mean something like hook. I will describe it in easy way.

Target application as a client on my computer communicate with server on the internet through tcp connection. And I need to capture packets which it sends or receives and also to be able pass my own packets which I want to send on server but for the server it will seem to be the same application. So I dont need another connection. It seems to be some socket hooking but I never did anything with that.

Joziff
  • 23
  • 6
  • you could use a proxy on localhost. – Florian Feb 19 '14 at 14:50
  • Can you describe me how to do it ? – Joziff Feb 19 '14 at 15:23
  • @Joziff "write http proxy c#" google query shows [this article](http://times.imkrisna.com/2011/08/simple-http-proxy-server-c-source-code/) and you can also google for "write proxy c#" [this](http://stackoverflow.com/questions/226784/how-to-create-a-simple-proxy-in-c) – oleksa Feb 19 '14 at 15:42
  • well it is the same way as many profiler like jmeter works. you are sending requests to another host. to include another application, just send the request to that application (listening on localhost and a specific port), which redirects the request to the target host. the target host sends back his answer to the application which redirects the anwer again back again to the original application. – Florian Feb 19 '14 at 19:26
  • Sounds to me you are trying to develop some sort of man in the middle application on TCP level. I do not think that is possible unless the client creates a connection to your application and you just reroute everything to the server and vice versa. If that is something you can live with I might be able to help. – Kay Tsar Feb 20 '14 at 06:31
  • OK thanks for answers I describe it. There are several application that can do it. You select process (application) and it finds its connection (dont know how) but because TCP connected app is defined by source port it seems to be something with sockets. Maybe through handle or sth like that. I cant redirect app connection through proxy because I cant change IP address for server connection in it. And yes its sth like man in the middle. I would like to capture and maybe destroy packets and send my owen tcp segments which I can pass to that application. – Joziff Feb 20 '14 at 14:31

0 Answers0