0

I basically want to capture all the packets in a selected port and transfer them through HTTP. What is the best way of doing that? Should I use a packet capture program like SharpPcap for that?

EDIT: I want to alow for 2 computers that are behing secured networks to conect to each other. For that I need to write a client program and a server program. So client1 will send the packets to the server through HTTP and the server will send it to client2 through HTTP.

geniaz1
  • 1,143
  • 1
  • 11
  • 16

2 Answers2

1

Your question is a bit vague, what do you mean by transfer them through HTTP? Transfer them to where and then do what?

Take for example Tor. Tor will set up a SOCKS and HTTP proxy locally for you to use. As long as the client supports one of those protocols you can connect to the proxy. The local proxy will then route the requests over the Tor network to an exit node which will then connect out to the wider world.

In your case you'd want something similar. A SOCKS or HTTP proxy locally which then sends out HTTP requests to some exit point which will then perform the relevant requests for real.

At no point do you need to do packet capture because that just starts to over-complicate things and work on a whole other level.

Lloyd
  • 29,197
  • 4
  • 84
  • 98
  • The fundamentals are still the same, CodeProject has many varying examples, take this for example - http://www.codeproject.com/Articles/71871/Internet-Magic-Proxy-Server-Windows-Application – Lloyd Feb 25 '13 at 12:08
  • But in the client how do you capture the packets? Just using a TcpListener? You don't need anything else? – geniaz1 Feb 25 '13 at 12:34
  • You don't need to capture the packets. If your client (web browser or whatever) supports SOCKS you can configure it to route through that. It's a whole other ball game to do packet level tunneling and I think beyond your skill set presently. Get SOCKS/HTTP proxying working first. – Lloyd Feb 25 '13 at 12:36
  • And if it doesn't support SOCKS? That means I need to do packet capture? – geniaz1 Feb 25 '13 at 12:48
  • If it doesn't support proxying natively then yes, but you're asking for trouble with that. – Lloyd Feb 25 '13 at 12:50
  • Why? Is it too complicated? And how about this code? http://www.nocrew.org/software/httptunnel.html – geniaz1 Feb 25 '13 at 13:55
1

I just googled for "http tunneling example" and found the follwing links. Maybe they will help you.

Link 1

Link 2

Community
  • 1
  • 1
Tomtom
  • 9,087
  • 7
  • 52
  • 95