admin管理员组文章数量:1123697
Trying to extract the vendor information (Apple, Samsung, etc) from Probe Request coming from mobile, So far no luck. Not sure where the corrections to be made to get this info.
Adding my code:
import codecs
from scapy.all import *
from netaddr import *
def handler(p):
if not (p.haslayer(Dot11ProbeResp) or p.haslayer(Dot11ProbeReq) or p.haslayer(Dot11Beacon)):
return
rssi = p[RadioTap].dBm_AntSignal
dst_mac = p[Dot11].addr1
src_mac = p[Dot11].addr2
ap_mac = p[Dot11].addr2
global macf
maco = EUI(src_mac)
try:
macf = maco.oui.registration()
except NotRegisteredError:
macf = "Not available"
info = f"rssi={rssi:2}dBm, dst={dst_mac}, src={src_mac}, ap={ap_mac}, manf= {macf}"
if p.haslayer(Dot11ProbeReq):
stats = p[Dot11ProbeReq]work_stats()
ssid = str(stats['ssid'])
channel = None
if "channel" in stats:
channel = stats['channel']
print(f"[ProbReq ] {info}")
print(f"ssid = {ssid}, channel ={channel}") #rate= {rates}
sniff(iface="wlan1", prn=handler, store=0)
本文标签: pythonExtracting vendor info from Probe Request using ScapyStack Overflow
版权声明:本文标题:python - Extracting vendor info from Probe Request using Scapy - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736587202a1945027.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论