问题描述
当我尝试使用 Scapy 从我周围的无线网络获取 Rssi 信息时,出现了一些错误.另外,我使用的是 ALFA-036NH,我的监控模式是打开的,操作系统是 Kali Linux.我使用了以下代码:
from scapy.all import *从日期时间导入日期时间导入操作系统输入信号导入系统def PacketHandler(pkt) :如果 pkt.haslayer(Dot11) :如果 pkt.type == 0 和 pkt.subtype == 8 :如果 pkt.haslayer(Dot11Beacon) 或 pkt.haslayer(Dot11ProbeResp):尝试:额外 = pkt.notdecodedrssi = -(256 - ord(额外[-4:-3]))除了:rssi = -100打印WiFi 信号强度:",RSSI嗅探(iface =wlan0mon",prn = PacketHandler)
但是,所有网络都给出 -100 dbm.感谢您的关注.
请使用最新的
您不需要您提供的功能.
PS:你在哪里找到这样的代码?你自己做的吗?谢谢
When I try to get Rssi information from my around wireless network with Scapy , I'm getting some error. Also , I am using ALFA-036NH , my monitor mode is open and OS is Kali Linux. I used below codes :
from scapy.all import *
from datetime import datetime
import os
import signal
import sys
def PacketHandler(pkt) :
if pkt.haslayer(Dot11) :
if pkt.type == 0 and pkt.subtype == 8 :
if pkt.haslayer(Dot11Beacon) or pkt.haslayer(Dot11ProbeResp):
try:
extra = pkt.notdecoded
rssi = -(256 - ord(extra[-4:-3]))
except:
rssi = -100
print "WiFi signal strength:", rssi
sniff(iface="wlan0mon", prn = PacketHandler)
However, all of networks giving -100 dbm. Thanks for your interest.
Please retry using the latest scapy github version (or 2.4.1+). It has improved support for RSSI, which is now available (if present), via the dBm_AntSignal
field.
pkt.dBm_AntSignal
You don’t need the function you provided.
PS: where did you find such code ? Did you do it yourself? Thanks
这篇关于Scapy 的 RSSI 信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!