问题
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:
People already tried to work with 802.11 via sockets.
You may try to modify this code for Ethernet communication. Note the socket creation:
socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW))
-AF_PACKET
instead ofAF_INET
allows Level 2 operations.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.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