esac
esac

Reputation: 24695

How to listen at the network layer?

Programs like AdMuncher seem to intercept packets at the network layer before it ever reaches whatever protocol it is using. I want to do something similar, basically analyze each packet as it comes into the system and filter/rewrite, etc.. I know I can essentially write a proxy (or setup a proxy) to do similar, but I would like to intercept it before it even reaches that point.

Not looking for any specific language, but if it is possible with C# that would be nice.

Upvotes: 2

Views: 1259

Answers (1)

Christopher Armstrong
Christopher Armstrong

Reputation: 7953

I assume you'll be building on the Windows platform? If so, you'll probably want to look into winpcap: http://www.winpcap.org/

On Unix/Linux, you'll want to make use of libpcap: http://www.tcpdump.org/

In either of these, you'll need to develop in C/C++ or use a native interface to call the libraries from your language of choice.

EDIT: Found a .NET wrapper for WinPcap that you'll likely want to make use of: http://pcapdotnet.codeplex.com/

Upvotes: 4

Related Questions