python win32 and COM? for internet monitoring

Graham Fawcett graham.fawcett at gmail.com
Tue Nov 22 12:47:06 EST 2005


Matthew Thorley wrote:
> Greetings, I have a question I hope some one with more back ground can
> give me a little help with.
>
> I want to write a simple internet monitoring script for windows that
> watches out bound http traffic and keeps a list of all the site visited.
>
> I am thinking that I might be able to use pywin32 and COM to listen on
> open ports (e.g. 80) and watch for http headers. But I'm not sure if
> there is a better way to do it.

You might want to look into PCAP (a.k.a libpcap), which is the
network-sniffing libary used by Ethereal, among other programs.  Much
more portable than COM, and there are Python wrappers for it, IIRC.

You could also implement an HTTP proxy server in Python; Google should
turn up numerous existing implementations.

Graham




More information about the Python-list mailing list