使用SDR嗅探北欧芯片无线键鼠数据包

0x01 系统安装

下载Ubuntu 16.04

0x02 搭建SDR开发环境

安装pip和pybombs

apt-get update
apt-get install git
apt-get install python-pip
pip install --upgrade pip
pip install git+https://github.com/gnuradio/pybombs.git

获取GnuRadio的安装库

pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git  
pybombs recipes add gr-etcetera git+https://github.com/gnuradio/gr-etcetera.git

安装SDR常用软件

pybombs install osmo-sdr rtl-sdr gnuradio hackrf airspy gr-iqbal libosmo-dsp gr-osmosdr gqrx

使用pybombs安装bladeRF会报错,这里选择源码编译:

git clone https://github.com/Nuand/bladeRF
cd bladeRF/host
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig

0x03 编译gr-nordic

gr-nordic:GNU Radio module and Wireshark dissector for the Nordic Semiconductor nRF24L Enhanced Shockburst protocol.

git clone https://github.com/BastilleResearch/gr-nordic/
cd gr-nordic/
mkdir build
cd build/
cmake ../
make
sudo make install
sudo ldconfig

0x04 安装WireShark

apt-get install wireshark

Ubuntu系统中,访问网络端口需要root权限,而wireshark的只是/usr/share/dumpcap的一个UI,/usr/share/dumpcap需要root权限,所以没法non-root用户无法读取网卡列表。解决办法使用sudo wireshark启动抓包,但使用root权限启动wireshark就不能使用lua脚本: 解决方案:

sudo -s  
groupadd wireshark  
usermod -a -G wireshark $你的用户名  
chgrp wireshark /usr/bin/dumpcap  
chmod 750 /usr/bin/dumpcap 

setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
getcap /usr/bin/dumpcap

当输出为:

/usr/bin/dumpcap = cap_net_admin,cap_net_raw+eip
1.png

即为设置生效。注销登录状态或者重启系统启用配置。

0x05 数据包捕获

1.png

gr-nordic项目中include里边包含了nordic的tx、rx、API头文件,lib文件夹则是该项目依赖的一些库文件,example文件包含了Microsoft鼠标以及扫描、嗅探使用Nordic北欧芯片键鼠的利用脚本,wireshark文件夹中则是对扫描、嗅探到的数据包进行分析所需的lua脚本。

gr-nordic$ wireshark -X lua_script:wireshark/nordic_dissector.lua -i lo -k -f udp

gr-nordic$cd examplegr-nordic/example$./nordic_sniffer_scanner.py

14748794773330

0x06 演示视频

0x07 Thanks & refer

gr-nordic: GNU Radio module and Wireshark dissector for the Nordic Semiconductor nRF24L Enhanced Shockburst protocol.

孤独小白:GNU Radio教程(一)

Sniffing with Wireshark as a Non-Root User

Bastille 巴士底狱安全研究员:Marc Newlin 、 Balint Seeber

*文章原创作者:雪碧0xroot@vulbox,转载请注明来自FreeBuf黑客与极客(FreeBuf.COM)

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据