STM32 Sniffer for BLE Setup guide

Revision as of 17:08, 16 June 2023 by Registered User (→‎Introduction)

1. Introduction

The STM32 Sniffer for Bluetooth® Low Energy is composed of two main parts.

  • The software part running on the computer : analyzes and displays packets
  • The firmware part running on the STM32WB MCU : intercepts over the air packets
System Architecture
System Architecture

You can download necessary files on STM32 Hotspot.

2. Minimum requirements

The following software and hardware parts are needed.

2.1. Hardware

You will need at least one of these development boards:

2.2. Software

Operating system:

  • Windows 10

Wireshark:

  • Version 4.0.3 or later
  • During setup accept Ncap installation

Python:

  • Version 3.11.2 or later

PySerial:

  • Version 3.5 or later
  • Make sure PySerial is installed on the correct version of Python if you have multiple installations (use pip3 for example to force install on Python3)

3. Programming the board

There is to files to flash:

  • The sniffer application : stm32wb55_ble_sniffer_cm4_app_nucleo.hex or stm32wb55_ble_sniffer_cm4_app_dk.hex
  • The sniffer Bluetooth® LE Wireless Stack : stm32wb55_ble_sniffer_cm0_stack.bin

1. Install STM32CubeProgrammer

2. Update the Wireless stack:

  • Use the stm32wb55_ble_sniffer_cm0_stack.bin file at the start address: 0x080CE000.
  • You can follow this tutorial part 3.2 to learn how to update the Wireless Stack.

3. Flash the application firmware:

  • Use the stm32wb55_ble_sniffer_cm4_app_nucleo.hex or stm32wb55_ble_sniffer_cm4_app_dk.hex file
  • You can follow this tutorial part 3.3 to learn how to flash the application firmware.

4. Installing Wireshark plugins

Launch Wireshark:

puce1.png
Click on the Help menu
puce2.png
Click on About Wireshark to open a new window
puce3.png
Select the Folders tab
puce4.png
Double click ont the Personal Extcap path and Personal Lua Plugins to open the corresponding locations in the file explorer.
Finding the Wireshark plugins directories
Connectivity Sniffer Finding Directories.png

4.1. Installing the plugins

  • Copy the st_ble_sniffer_dissector.lua file into your Wireshark Personal Lua Plugins folder
  • Copy the st_ble_sniffer.py and st_ble_sniffer.bat files into your Wireshark Personal Extcap path folder

Your folders should look like this:

Plugins folders
Connectivity Sniffer Copying Plugins.png
  • Open a command prompt in your Personal Extcap path folder.
  • Run : st_ble_sniffer.bat --extcap-interfaces

You should have an output similar to this:

Verifying extcap plugin can run
Connectivity Sniffer Verifying Extcap.png
  • Make sure a board with the sniffer firmwares is plugged (and no other program use the com port, e.g : serial terminal)
  • In Wireshark, refresh the capture interfaces list:
puce1.png
Click on the Capture menu
puce2.png
Click on Refresh Interfaces
Verifying extcap plugin can run in Wireshark
Connectivity Sniffer Refresh.png

You should now see the STM32WB sniffer interface like this:

Verifying extcap plugin can run in Wireshark
Connectivity Sniffer Verifying Extcap Wireshark.png

4.2. Installing the profile

In Wireshark:

puce1.png
Click on the Help menu
puce2.png
Click on About Wireshark to open a new window
puce3.png
Select the Folders tab
puce4.png
Double click on Personal configuration to open the corresponding location in the file explorer.
Finding the Wireshark profiles directory
Connectivity Sniffer Finding Directories 2.png

Copy ST_BLE_Sniffer_profile folder into your Wireshark Personal configuration/profiles folder

Your folder should look lite this:

Verifying extcap plugin can run in Wireshark
Connectivity Sniffer Copying Profile.png

5. Configuring Wireshark

5.1. Enabling the sniffer profile

In Wireshark :

puce1.png
Click on the Edit menu
puce2.png
Click on Configuration Profiles... to open a new window
puce3.png
Select the ST_BLE_Sniffer_profile
puce4.png
Click on "OK"
Enabling the profile
Connectivity Sniffer Enabling Profile.png

5.2. Enabling the interface toolbar

Open Wireshark :

puce1.png
Click on the View menu
puce2.png
Click on Interface Toolbars
puce3.png
Enable STM32WB interface
Enabling the interface toolbar
Connectivity Sniffer Enabling Toolbar.png

You should now see a toolbar like this:

Interface toolbar
Connectivity Sniffer Toolbar.png

5.3. Testing

Double click on the STM32WB Sniffer interface to launch the capture.

Verifying extcap plugin can run in Wireshark
Connectivity Sniffer Verifying Extcap Wireshark.png

You should now see advertising packets like below meaning that you successfully installed the STM32 Sniffer for Bluetooth® Low Energy 😉

Verifying the installation
Connectivity Sniffer TestOK.png

You can now see the user guide to learn more about how to use the sniffer.

No categories assignedEdit