I have a server which will act as a proxy, using squid. My goal is to have something replace outgoing data. I tried ettercap, no luck whatsoever. The idea is, whatever-will-replace-data needs to run alongside with squid on the same box. Any ideas of a good ettercap replacement ? Or how would I go about using ettercap with squid on the same box ?
If you're using squid that implies you're talking about HTTP. But you're trying to modify the contents at the stram level - if you try to do this at the packet level, that means that you need to build your own TCP stack to decompose/resompose the HTTP stream, then implement your own HTTP stack on top of that before you can get acces to the data!
Wouldn't it be a lot simpler to use the TCP and HTTP stacks already available in squid and the OS? Here's a simple example of how to modify content using squid.