0x00 本机环境
1 |
Mac osx 10.15.5 |
0x01 环境搭建
1. 安装lib库
1 |
apt-get install python-software-properties |
2. 安装libbtbb
1 |
wget https://github.com/greatscottgadgets/libbtbb/archive/2015-09-R2.tar.gz -O libbtbb-2015-09-R2.tar.gz |
3. 安装ubertooth
1 |
sudo apt-get install ubertooth |
报错安装:
1 sudo apt-get install pkg-config
4. 安装wireshark
1 |
sudo apt-get install wireshark |
5. 安装kismet
1 |
sudo apt-get install ckermit |
在~中创建.kermrc,然后输入如下配置信息:
1 |
set line /dev/ttyUSB0 |
1 |
wget https://kismetwireless.net/code/kismet-2020-09-R1.tar.xz |
报错安装:
1
2
3
4
5 sudo apt-get install ncurses-dev
sudo apt-get install libpcap-dev
sudo apt-get install libz-dev
sudo apt-get install libmicrohttpd-dev
sudo apt-get install libsqlite3-dev
找到kismet的配置文件kismet.conf ,把”pcapbtbb”加入到kismet.conf的logtypes= 里边
6. 安装BLE解密工具crackle
1 |
git clone https://github.com/mikeryan/crackle.git |
0x02 嗅探扫描
1. Spectool
1 |
sudo apt install spectools |
扫描附近信号在频谱上显示
RAW中文的解释是“原材料”或“未经过处理的东西”,这里猜测是显示设备捕获到的未经处理的信号数据:
将Ubertooth One作为一台“硬件服务器”,并监听TCP:30569端口,局域网内任何可以跟主机建立通信的PC可通过Ubertoothe主机IP+30569共享设备。连接方式:在另外一台主机终端上执行:spectool_gtk
—>选择Open Network Device —>输入ip、端口
2. Hcitool
hcitool –help
1 |
hcitool - HCI Tool ver 5.48 |
hcitool scan :扫描附近蓝牙设备
hcitool lescan :扫描附近低功耗蓝牙设备
3. Gatttool
gatttool -h
1 |
Usage: |
gatttool -b EC:F3:42:B2:DF:24 -I
4. Ubertooth-scan -s
sudo apt install ubertooth
5. Ubertooth-ble
ubertooth-btle - passive Bluetooth Low Energy monitoring
Usage:
-h this help
Major modes:
-f follow connections
-p promiscuous: sniff active connections
-a[address] get/set access address (example: -a8e89bed6)
-s<address> faux slave mode, using MAC addr (example: -s22:44:66:88:aa:cc)
-t<address> set connection following target (example: -t22:44:66:88:aa:cc)
Interference (use with -f or -p):
-i interfere with one connection and return to idle
-I interfere continuously
Data source:
-U<0-7> set ubertooth device to use
Misc:
-r<filename> capture packets to PCAPNG file
-q<filename> capture packets to PCAP file (DLT_BLUETOOTH_LE_LL_WITH_PHDR)
-c<filename> capture packets to PCAP file (DLT_PPI)
-A<index> advertising channel index (default 37)
-v[01] verify CRC mode, get status or enable/disable
-x<n> allow n access address offenses (default 32)
If an input file is not specified, an Ubertooth device is used for live capture.
In get/set mode no capture occurs.
ubertooth-btle -f -c test.pcap抓包&保存到本地
使用这条命令我们可以把设备捕获到的数据包保存到本地,完成后可导入wireshark进行数据包、协议分析。
wireshark导入嗅探到的蓝牙数据包需要处理一下才能正常查看,不然无法正常分析数据:
Edit → Preferences → Protocols → DLT_USER → Edit → New
在payload protocol中输入btle
使用规则过滤数据包:参考Capturing BLE in Wireshark
1 |
btle.data_header.length > 0 || btle.advertising_header.pdu_type == 0x05 |
6. crackle
如果捕获到足够的数据包尤其是btsmp,抓到包之后我们最关心的问题是我们有没有抓到的足够的包来破解tk。所以在wireshark中你可以在filter处加上btsmp,确保抓到了我们需要的6个包。,那接下来便可以用crackle来破解tk和ltk:
做到这个点尝试了身边的一些设备的连接没抓到大量包没有至少6个btsmp之后实践中碰到补足图片
1 |
crackle -i <file.pcap> |
1 |
从上图中我们可以看到我们不但破解了tk,还利用利用tk和其它一些数据成功的还原出了ltk。 |
解密数据包,并把解密后的包另存:
1 |
crackle -i <file.pcap> -o <output.pcap> |
可以看到成功破解了7个包
0x03 解决方案
1 |
[email protected]:~/Desktop# crackle -i heart.pcap |
0x04 参考:
https://blog.csdn.net/charmve/article/details/107170250
路人甲@乌云drops:Bluetooth Low Energy 嗅探
疯狗@乌云drops:物联网安全拔“牙”实战——低功耗蓝牙(BLE)初探
https://github.com/greatscottgadgets/ubertooth/wiki/Build-Guide
https://github.com/greatscottgadgets/ubertooth/wiki/Capturing-BLE-in-Wireshark
FROM :ol4three.com | Author:ol4three
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论