Send CTS frames in Python

混江龙づ霸主 提交于 2019-12-13 00:08:55

问题


I was wondering if it was possible to send CTS frames in python3 with modules such as scapy. If not, how would I do it with the sockets module?

Thanks in advance.


回答1:


I can't say for scapy, but CTS frames and 802.11 in general seems to be too deep for the python socket module. This is OSI Level 2, while socket have limited capabilities below OSI Level 3.

Some possible starting points are:

  1. People already tried to work with 802.11 via sockets.

  2. You may try to modify this code for Ethernet communication. Note the socket creation: socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW)) - AF_PACKET instead of AF_INET allows Level 2 operations.

  3. Try to use socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL))). ETH_P_ALL means the socket will be receiving all Level 2 packets. All because actually I haven't find any 802.11-specific sources in the Linux kernel.

  4. Get an open source driver for your Wireless NIC and see how they do it. It may appear that communicating directly with the hardware will be more fruitful than trying to find a general mechanism embedded in sockets.

A related email thread: Correct way to obtain the 802.11 headers with a raw socket?



来源:https://stackoverflow.com/questions/40208463/send-cts-frames-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!