简体   繁体   English

在Linux上使用ioctl进行被动wifi扫描

[英]Passive wifi scan with ioctl on linux

I can perform normal scan using ioctl SIOCSIWSCAN and SIOCGIWSCAN and get list of AP, but when I set card into monitor mode i get errno = Operation not supported. 我可以使用ioctl SIOCSIWSCAN和SIOCGIWSCAN执行正常扫描,并获取AP列表,但是当我将卡设置为监视模式时,我得到errno =不支持操作。

Is there a different ioctl call for passive scans?? 是否有其他ioctl要求进行被动扫描?

I know the wifi card is not the issue, because I get results with airodump-ng and I checked two different cards. 我知道wifi卡不是问题,因为我用airodump-ng获得了结果,并且检查了两个不同的卡。

First, on the command line type: 首先,在命令行上输入:

iw phy <phy> info 

and see if new_interface is listed under supported commands. 并查看new_interface是否在受支持的命令下列出。 You can get the phy for your cards by: 您可以通过以下方式获取卡的物理位置:

iw dev 开发者

Second, I have found that it's easier to set a card in monitor mode if I delete all interfaces on the phy first. 其次,我发现如果先删除phy上的所有接口,将卡设置为监控模式会更容易。 Some cards don't play well if there are interfaces active. 如果接口处于活动状态,则某些卡不能很好地发挥作用。

Use ioctl to bring cards up or down and to get the card's hw addr. 使用ioctl可使卡向上或向下移动,并获取卡的硬件地址。 Otherwise you should be using netlink - You're looking for NL80211_CMD_NEW_INTERFACE in nl80211.h 否则,您应该使用netlink-您正在nl80211.h中寻找NL80211_CMD_NEW_INTERFACE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM