智能锁蓝牙BLE分析

kali使用btproxy

apt-get install bluetooth bluez blueman

git clone https://github.com/conorpp/btproxy 

cd btproxy

sudo python setup.py install

service dbus start

service bluetooth start

hciconfig

hciconfig hci0 up

hcitool scan

 

我的mac地址为94:87:E0:C0:62:29,智能锁的地址为D2:57:CE:36:6C:E5

btproxy 94:87:E0:C0:62:29 D2:57:CE:36:6C:E5

在手机sdcard中查找btsnoop_hci.log

/sdcard/MIUI/debug_log/common/btsnoop_hci.log

蓝牙系统核心架构可分为三层:

User Application(Host) 应用层API

HCI(Host Controller Interface) 中间层

Controller 底层蓝牙芯片

在抓到的btsnoop_hci.log中有几种数据包:

在host与controller传递消息时,每个HCL包的前面会有一个indicator来指定数据包的类型,常见的有

HCI Command Packet:host发给controller,主要是HCI 命令, 注意是命令,不是数据。

HCI Event Packet:controller发给host。对应于command packet。

HCI ACL Data Packet: host发给controller或者相反。主要是L2CAP发送和接收的数据。

HCI Synchronous Data Packet:用来传输语音(SCO)数据的。注意一般都会通过PCM接口来传输SCO数据。

HOST层的三个部分

L2CAP(Logic Link Control and Adaptation Protocol)

ATT(Attribute Protocol)

GATT(Generic Attribute Profile)

参考文章

使用btproxy对蓝牙设备进行安全分析

http://www.freebuf.com/articles/wireless/77389.html

https://github.com/conorpp/btproxy

(但后来发现不支持BLE)

猜你喜欢

转载自www.cnblogs.com/bl8ck/p/9710454.html