我试图从一个替罪羊嗅探功能中解码无线管理帧中的信号值(SSI)。我寻找并尝试了几个答案,但没有成功。到目前为止我的情况是这样的。试图破译六角线。
代码:
from scapy.all import *
def packet_handler(pkt):
if pkt.haslayer(Dot11) and pkt.type == 0:
sig = pkt[RadioTap].notdecoded.decode("hex")
print sig
sniff(iface="wlan0mon", prn=packet_handler)数据包示例:
###[ RadioTap dummy ]###
version = 0
pad = 0
len = 36
present = TSFT+Flags+Rate+Channel+dBm_AntSignal+b14+b29+Ext
notdecoded= ' \x08\x00\x00\x00\x00\x00\x00\xf4\x82\xc2\xc6\x01\x00\x00\x00\x10\x02\x99\t\xa0\x00\xb1\x00\x00\x00\xb1\x00'我正在捕捉“未解码”字段的值,并试图通过直蟒对其进行解码。
错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/scapy/sendrecv.py", line 600, in sniff
r = prn(p)
File "<stdin>", line 4, in packet_handler
File "/usr/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode
output = binascii.a2b_hex(input)
TypeError: Non-hexadecimal digit found发布于 2018-06-12 12:28:09
更新到最新版本的替罪羊;这些在更新中被正确解码(我使用的是2.4.0 dev263)。
更新替罪羊:
git clone https://github.com/secdev/scapy
cd scapy
./run_scapy或
git clone https://github.com/secdev/scapy
cd scapy
python setup.py installhttps://stackoverflow.com/questions/31544712
复制相似问题