问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/51917850/rssi-information-with-scapy