之前的有几篇是在蓝牙开启并且开发放检测才能搜索的到
现在我们打开蓝牙,设置为不能被检测到重新搜索蓝牙
先大致说一下思路
蓝牙的mac地址和开启蓝牙的主机的mac地址很类似
对于iphone而言,蓝牙的mac地址是主机网卡的mac地址加1
对于华为手机而言,比如我的手机的无线网卡mac地址为0c:8f:ff:e0:cc:31
而我的手机上蓝牙的mac地址为0c:8f:ff:e0:c1:e1
所以你先获取无线网卡的mac地址
然后给无线网卡的mac地址加上一特定的数就得到蓝牙的mac地址
根据特定的蓝牙mac地址我们就可以发出一个设备名称的查询请求
这时蓝牙自动会回复我们的
然后就得到了该mac地址蓝牙的设备名称
/////////////////////////////////////////////////////
获取无线网卡的mac地址
在这里只根据mac地址的前6位查找
在此之前你需要将网卡设置为混杂模式
airmon-ng start wlan0
#!/usr/bin/python
# -*- coding: utf-8 -*-
from scapy.all import *
def wifiPrint(pkt):
iPhone_OUI = '0C:8F:FF'
if pkt.haslayer(Dot11):
wifiMAC = pkt.getlayer(Dot11).addr2
if iPhone_OUI == wifiMAC[:8]:
print '[*] Detected iPhone MAC: ' + wifiMAC
conf.iface = 'wlan0mon'
sniff(prn=wifiPrint)
开始推算出蓝牙
因为不同的手机其网卡mac地址和蓝牙mac关系不一样
所以在此你自己算一下
用主机的网卡的mac地址减去蓝牙的mac地址
然后填在下面这段程序的AAAAA处
def retBtAddr(addr):
btAddr=str(hex(int(addr.replace(':', ''), 16) + AAAAA))[2:]
btAddr=btAddr[0:2]+":"+btAddr[2:4]+":"+btAddr[4:6]+":"+\
btAddr[6:8]+":"+btAddr[8:10]+":"+btAddr[10:12]
return btAddr
//////////////////////////////////////////////////////////////
完整代码如下
不要全复制,找我上面的改
#!/usr/bin/python
# -*- coding: utf-8 -*-
from scapy.all import *
from bluetooth import *
def retBtAddr(addr):
btAddr=str(hex(int(addr.replace(':', ''), 16) + 1))[2:]
btAddr=btAddr[0:2]+":"+btAddr[2:4]+":"+btAddr[4:6]+":"+\
btAddr[6:8]+":"+btAddr[8:10]+":"+btAddr[10:12]
return btAddr
def checkBluetooth(btAddr):
btName = lookup_name(btAddr)
if btName:
print '[+] Detected Bluetooth Device: ' + btName
else:
print '[-] Failed to Detect Bluetooth Device.'
def wifiPrint(pkt):
iPhone_OUI = '0C:8F:FF'
if pkt.haslayer(Dot11):
wifiMAC = pkt.getlayer(Dot11).addr2
if iPhone_OUI == wifiMAC[:8]:
print '[*] Detected iPhone MAC: ' + wifiMAC
btAddr = retBtAddr(wifiMAC)
print '[+] Testing Bluetooth MAC: ' + btAddr
checkBluetooth(btAddr)
conf.iface = 'mon0'
sniff(prn=wifiPrint)
////////////////////////////////////////////
最后如何查看手机的蓝牙的mac地址和无线网卡的mac地址
设置---关于手机---状态消息
里面就有你的手机IP地址
无线网卡的mac地址
蓝牙mac地址
Python搜索隐藏的蓝牙
最新推荐文章于 2024-03-18 08:55:48 发布