Intercepting all outbound traffic on OSX [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this questionI 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 lib开发者_如何学Pythonrary?
Any direction would be appreciated.
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
I would check out libpcap (part of tcpdump): http://www.tcpdump.org/
精彩评论