Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intercepting all outbound traffic on OSX [closed]

Tags:

macos

cocoa

I want to intercept all outbound traffic on my Mac the same way Little Snitch does (just, in my code :)).

I can't seem to find any info on how to do this. Are there any libraries I could use for Cocoa for this? Perhaps some Unix library?

Any direction would be appreciated.

like image 824
Che Kofif Avatar asked Jan 10 '11 23:01

Che Kofif


1 Answers

You could also use a kernel extension to implement a network socket filter. Developing a kext is more difficult but your program would not depend on the libpcap library. Apple has a code sample at http://developer.apple.com/library/mac/#samplecode/tcplognke/Introduction/Intro.html#//apple_ref/doc/uid/DTS10003669

like image 61
Pinatubo Avatar answered Sep 19 '22 16:09

Pinatubo