RSSI information with Scapy

落花浮王杯 提交于 2021-01-29 14:16:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!