[Pythonmac-SIG] Python solution to monitor your internet connection?

Bob Ippolito bob at redivi.com
Tue Jan 20 08:07:51 EST 2004


On Jan 20, 2004, at 7:34 AM, Jack Jansen wrote:

>
> On 18-jan-04, at 18:21, Bob Ippolito wrote:
>
>>
>> On Jan 18, 2004, at 11:25 AM, W.T. Bridgman wrote:
>>
>>> I know of a few commercial/shareware packages that can monitor your 
>>> machine for apps that try to 'phone home' when you're online, but 
>>> does anyone know of any open source (preferably Python) solutions 
>>> for this?
>>>
>>> If not, can anyone point me to somewhere that I might find out what 
>>> I need to write such an app that can monitor my internet connection? 
>>>  I'm specifically interested in monitoring OS X applications.  Do 
>>> the python internet modules have sufficient access to the internet 
>>> API to do this?
>>
>> You pretty much have to write the bulk of such a thing in C, since 
>> you have to intercept calls to C functions from other processes.
>
> I don't think you have to be *that* gross. The ipfirewall device (see 
> man 4 firewall) can probably be used to make all packets be given to 
> your code for inspection. But still I don't think I'd want to do this 
> in Python because of the overhead.

It's extremely important to know the pid the packet came from in this 
sort of application, so that interface won't cut it.  Little Snitch 
uses a kext.

(kextstat output -- little snitch isn't even active at the moment, I 
guess it stays resident)
    86    0 0x2fa51000 0xe000     0xd000     at.obdev.KUC (1.1.1) <10>

(the startup item is probably a replicant of what is in the pref pane..)
/Library/StartupItems/LittleSnitch/Resources/ODKUControl.kext
/Library/PreferencePanes/Little 
Snitch.prefPane/Contents/Resources/ODKUControl.kext


-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040120/390dc38b/smime.bin


More information about the Pythonmac-SIG mailing list