智能鎖藍牙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)
智能鎖藍牙BLE分析