John Smith
John Smith

Reputation: 641

How to forward the TCP/IP traffic of a process in Windows XP?

alt text http://img440.imageshack.us/img440/6950/problemyd1.png

(The curly lines with dots represent a network route.)

Having a process called "foo.exe", is there a way to forward everything it communicates over TCP/IP to a forwarding proxy located elsewhere? This forwarding should not reflect to other processes.

Another question: if there are multiple network adapters, is it possible to force a process to use one specific adapter.

Since in this example the targethost.com is known, I could just edit "system32\drivers\etc\hosts" to map targethost.com's IP to localhost, where on port 8765 would be the first forwarder waiting for an incoming connection and pass everything forward to proxy.foo.com. I was wondering if there's a more elegant way of doing this.

This is not for malware, I'm doing some network testing with my complex home network. Thank you for warning us.

Some free software for this would be perfect, alternatively a code idea (native or .net). Thank you very much.

Upvotes: 2

Views: 3085

Answers (3)

wordmonger
wordmonger

Reputation: 53

SocksCap will probably do the job (if you're OK with establishing a SOCKS proxy at proxy.foo.com).

Upvotes: 1

Alexander
Alexander

Reputation: 9370

You could hook into the TCP stack, for example, by using the Windows Filtering Platform or its predecessors, or you could substitute the network libraries/calls of that particular process.

Upvotes: -1

Bill K
Bill K

Reputation: 62789

It's not too hard if you make your own computer a firewall, then your app connects to a port on your own computer, and that port is forwarded to both the original destination and logged or forwarded on to your spying computer.

Alternatively you can make your other computer the firwall and have it log/forward the info.

Finally you could use a sniffer.

Upvotes: 1

Related Questions