Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a service which listens on host1:5000. My intention is to redirect my client to localhost:5000.

What I desire is a service running on localhost:5000 that redirects all traffic to host1:5000 while saving the traffic in pcap format. This way I can later review the traffic in say Wireshark.

Is there an existing tool that does this?

Thanks, Thakur

share|improve this question
What operating system are you running? Usually there would be no need to proxy the connection locally to capture the traffic. Is there a reason why you want to do it this way? – Paul May 8 '12 at 5:34
I'm on Linux. I don't have root access. I assumed not having root access prevents me from simply listening on the interface. – Thakur May 8 '12 at 14:10
Yeah that is right, libpcap won't work without elevated permissions. So you do not have root on any device that can connect to host1:5000? – Paul May 8 '12 at 14:40
Nope. It's a corporate IT controlled environment. – Thakur May 9 '12 at 18:51
Do you really need pcap format data? You are talking about redirecting the traffic to localhost, so all of the IP headers will be between The only thing you'd be missing if you captured the raw data is the TCP headers, which also won't have much value as localhost:5000 would be a proxy and so the tcp interaction would be local. So only thing that would reflect the real connection would be the raw data. This you could capture to a file and look at with a hex editor with the same detail as wireshark (unless wireshark was familiar with the protocol used under tcp?) – Paul May 9 '12 at 22:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.