简介
Radiotap为802.11帧发射和接收的事实标准,802.11依赖Radiotap完成通信过程,Linux系统在驱动和API内建支持Radiotap,802.11帧发射之前,网卡驱动在802.11头前面Radiotap头,反之当网卡接收到无线帧时,驱动通知MAC层,此帧头包含Radiotap头。Radiotap为802.11帧传递额外信息,在不破坏原始头结构条件下,增加传递信息,厂家可自定义,因此头长度不固定。
抓包分析
先将无线网卡设置为monitor模式,使用Wireshark进行抓包。

Radiotap抓包信息
Radiotap Header v0, Length 18 #声明Radiotap Header 版本和长度
Header revision: 0 #默认为0 1字节
Header pad: 0 #占位符,默认为0 1字节
Header length: 18 #Header长度 802.11协议头在Radiotap之后,所以可以推测出802.11包头的起始位置 2字节
Present flags #数据位掩码 4字节
Present flags word: 0x0000482e
.... .... .... .... .... .... .... ...0 = TSFT: Absent #接收到数据包的时间戳单位毫秒,若有,下面会有MAC timestamp字段
.... .... .... .... .... .... .... ..1. = Flags: Present #标记
.... .... .... .... .... .... .... .1.. = Rate: Present #速度
.... .... .... .... .... .... .... 1... = Channel: Present #信道
.... .... .... .... .... .... ...0 .... = FHSS: Absent #跳频技术
.... .... .... .... .... .... ..1. .... = dBm Antenna Signal: Present #天线信号
.... .... .... .... .... .... .0.. .... = dBm Antenna Noise: Absent #天线噪声
.... .... .... .... .... .... 0... .... = Lock Quality: Absent
.... .... .... .... .... ...0 .... .... = TX Attenuation: Absent
.... .... .... .... .... ..0. .... .... = dB TX Attenuation: Absent
.... .... .... .... .... .0.. .... .... = dBm TX Power: Absent
.... .... .... .... .... 1... .... .... = Antenna: Present #天线
.... .... .... .... ...0 .... .... .... = dB Antenna Signal: Absent
.... .... .... .... ..0. .... .... .... = dB Antenna Noise: Absent
.... .... .... .... .1.. .... .... .... = RX flags: Present #接收标识
.... .... .... .0.. .... .... .... .... = Channel+: Absent
.... .... .... 0... .... .... .... .... = MCS information: Absent
.... .... ...0 .... .... .... .... .... = A-MPDU Status: Absent
.... .... ..0. .... .... .... .... .... = VHT information: Absent
.... .... .0.. .... .... .... .... .... = frame timestamp: Absent
.... .... 0... .... .... .... .... .... = HE information: Absent
.... ...0 .... .... .... .... .... .... = HE-MU information: Absent
...0 000. .... .... .... .... .... .... = Reserved: 0x0
..0. .... .... .... .... .... .... .... = Radiotap NS next: False
.0.. .... .... .... .... .... .... .... = Vendor NS next: False
0... .... .... .... .... .... .... .... = Ext: Absent #扩展,若Ext为1时,则后面至少跟着1个32位的Present flags
Flags: 0x00 #标记 1字节
.... ...0 = CFP: False
.... ..0. = Preamble: Long
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...0 .... = FCS at end: False
..0. .... = Data Pad: False
.0.. .... = Bad FCS: False
0... .... = Short GI: False
Data Rate: 1.0 Mb/s #速度 1字节
Channel frequency: 2412 [BG 1] #信道 2字节
Channel flags: 0x00a0, Complementary Code Keying (CCK), 2 GHz spectrum # 信道标识 2字节
Antenna signal: -63dBm #天线信号 1字节
Antenna: 1 #天线 1字节
RX flags: 0x0000 # 接收标识 2字节
名称 | 解释 | 长度 (字节) |
---|---|---|
Header revision | 修订,默认为0 | 1 |
Header pad | 占位,默认为0 | 1 |
Header length | 声明长度 | 2 |
Present flags | 数据为掩码 | 4 |
Flags | 标记 | 1 |
Data Rate | 速度 | 1 |
Channel frequency | 信道 | 2 |
Channel flags | 信道标识 | 2 |
Antenna signal | 天线信号强度 | 1 |
Antenna | 是否使用天线 | 1 |
RX flags | 接收标识 | 2 |
总计18字节,正好等于Radiotap Header v0, Length 18
声明的18字节。
1字节 = 8位。
备注:由于各厂商无线网卡的Radiotap包头定义不同,以下抓包的信息会有差别。
一些补充
Present flags 声明的信息,若存在,则将会在之后的数据中进行体现,例如:
......
Present flags
Present flags word: 0x0000482e
.... .... .... .... .... .... .... ...0 = TSFT: Absent
.... .... .... .... .... .... .... ..1. = Flags: Present
.... .... .... .... .... .... .... .1.. = Rate: Present
......
Flags: 0x00 #标记 1字节
.... ...0 = CFP: False
.... ..0. = Preamble: Long
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...0 .... = FCS at end: False
..0. .... = Data Pad: False
.0.. .... = Bad FCS: False
0... .... = Short GI: False
Data Rate: 1.0 Mb/s
......
Header revision:
Antenna signal信号:0 - 50dBm - 信号很好,50 - 75dBm - 信号一般
其余信息科见Radiotap抓包数据注释。
网友评论