如何获取连接的接入点的MAC地址? [英] How to get MAC address of connected Access point?

查看:120
本文介绍了如何获取连接的接入点的MAC地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Scapy 嗅探接入点(AP)信标数据包,并且还获取了所有AP信标数据包以及AP附近的MAC地址,但是我需要连接的AP的确切 MAC地址然后如何仅嗅探已连接的AP信标帧如何使用scapy 任何其他构想来过滤已连接的AP信标帧.

I am using Scapy to sniff access point(AP) beacon packets and also getting all AP beacon packets and it's MAC address nearby AP but I need exact MAC address of connected AP then How to sniff only connected AP beacon frame or How to filter connected AP beacon frame using scapy or any alternate idea.

*我正在python 2.7中完成

*I am doing it in python 2.7

推荐答案

我选择替代方法,即在python程序中使用命令

I choose alternate method i.e using command in python program

代码段

def Check_connected_ap():
    cmd =["nmcli -f BSSID,ACTIVE dev wifi list | awk '$2 ~ /yes/ {print $1}'"]
    address = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
    (out, err) = address.communicate()
    print out

这篇关于如何获取连接的接入点的MAC地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆