开发者

Intercepting all outbound traffic on OSX [closed]

开发者 https://www.devze.com 2023-02-04 13:44 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

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 question

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 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/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号