使用Python发送CTS帧 [英] Send CTS frames in Python

查看:129
本文介绍了使用Python发送CTS帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用scapy等模块在python3中发送CTS帧.如果没有,我将如何使用套接字模块?

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?

谢谢.

推荐答案

我不能说很容易,但是对于python socket模块而言,CTS帧和802.11通常似乎太深了. 这是OSI级别2,而socket在OSI级别3以下具有有限的功能.

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.

一些可能的起点是:

  1. 您可以尝试修改此代码以进行以太网通信.请注意套接字的创建:socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW))-AF_PACKET而不是AF_INET允许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.

    尝试使用socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL))). ETH_P_ALL表示套接字将接收 all 2级数据包.所有这些都是因为实际上我在Linux内核中找不到任何802.11特定的源.

    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.

    获取无线NIC的开源驱动程序,并查看它们的操作方式.与尝试在套接字中嵌入通用机制相比,直接与硬件进行通信似乎更有成果.

    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.

    相关的电子邮件线程:使用以下方法获取802.11标头的正确方法原始套接字?

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

    这篇关于使用Python发送CTS帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆