使用C检测接口是否处于混杂模式 [英] Detect if interface is in promiscuous mode with C
问题描述
我正在使用其他工具来检查linux服务器的安全性……没有什么重要的东西,与chkrootkit的工具非常相似.我想做的工具之一,就像chkrootkit的ifpromisc.c一样,它可以检测服务器接口之一是否处于混杂模式.
I am doing a different tools to check security of linux servers... nothing important and very similar to the tools of chkrootkit. One of the tools I want to do, is like the ifpromisc.c from chkrootkit, that is detect if one of the server interfaces is in promiscuous mode.
我在stackoverflow上找到了答案:如何检查网络设备状态在C中?
I found an answer on stackoverflow: howto check a network devices status in C?
但是在检查了此解决方案之后,我注意到仅适用于旧内核,因为在使用PACKET_MR_PROMISC时,新的libpcap不会设置IFF_PROMISC标志.我一直在寻找其他没有运气的解决方案.有什么主意吗?
But after check this solution, I noticed is only for old kernels, because new libpcap doesn't set IFF_PROMISC flag when uses PACKET_MR_PROMISC. I have been looking for other solutions without luck. Any idea?
谢谢!
推荐答案
此帖子可能会有所帮助: https://lists.archive.carbon60.com/linux/kernel/178148我无法找到其他任何方式来达到 dev_set_promiscuity
.老实说,这真的很奇怪.
This post might help:
https://lists.archive.carbon60.com/linux/kernel/178148
I haven't been able to find any other way of reaching dev_set_promiscuity
.
To be honest this is really weird.
无论如何,我链接的帖子很清楚.
Anyways, the post I linked is pretty clear.
这篇关于使用C检测接口是否处于混杂模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!