Using netcat to build a simple TCP proxy in Linux en

By Soultaker on maandag 11 juni 2012 22:18 - Comments (5)
Category: -, Views: 143.237

Recently I wanted to analyze the network communication between a local application and a remote server. The usual way to accomplish this is to use a system-wide packet analyzer like Wireshark or tcpdump. These tools require the system to be set up to allow packet filtering with special privileges granted to the local user that wants to inspect the network traffic passing through the system.

A less intrusive approach that doesn't require system-wide configuration is the use of a TCP proxy: a program that accepts a local connection, connects to a remote host, and forwards traffic between the two sockets, while also printing out the forwarded data for inspection by the user. Indeed, Google lists many such tools, but Linux users don't need to resort to installing third-party applications when the same functionality can be recreated using already-installed tools!

Read more »