STM32 Sniffer for BLE User guide

Revision as of 13:45, 27 June 2023 by Registered User (→‎Multiple interfaces capture)

This article provide help about how to use the STM32 Sniffer for Bluetooth® LE with Wireshark. It is supposed that you've already installed the sniffer, if it is not the case, you can follow this guide.

1. Starting the capture

Plug your sniffer board and open Wireshark.

1.1. Optional configuration

  • In Wireshark, click on the wheel on the left of the STM32 sniffer interface to open the interface configuration menu.
  • The channel index parameter is the channel on which the sniffer will listen when started. It can be changed later on the fly. By default it is channel index 39.
  • This is the channel index, not the frequency index. e.g (primary adverstising channels indexes are 37, 38 and 39).
Optional parameter
Connectivity Sniffer Optional Parameters.png


1.2. Launching the capture

To start the capture:

puce1.png
Click once to select the interface
puce2.png
Click on start capturing

or

puce1.png
Double click on the interface
Optional parameter
Connectivity Sniffer Start Capture.png


1.3. Sniffer started

You should now see the advertising packets on the channel you configured.

puce1.png
By default on startup the target BD address is set to 00:00:00:00:00:00, meaning that no target is set so packets from every devices are displayed.
Optional parameter
Connectivity Sniffer Started.png


2. Following a connection

Once the sniffer is started it reports advertising, scan requests and scan requests of all devices. You can then set the BD address of your target device that you want to follow when a connection to it occur.

puce1.png
Set the target BD address
puce2.png
Apply changes
Setting a target to follow
Connectivity Sniffer Target1.png
Connectivity Sniffer Target2.png


Now you should only see:

  • Advertising and scan responses packets from the target
  • Scan requests to the target
  • Connection packets from and to the target
Target set
Connectivity Sniffer Target3.png


If after setting the target there is no more packets incoming either:

  • There is no device with this BD address advertising on this channel
  • The sniffer has not received the command, set again the target (you will need to make a change to be able to apply changes. Just delete the last number and re-enter it)

Now if a device connect to your target and the sniffer intercept the CONNECT_IND packet you will start to see the communications between the two devices.

Info white.png Information
As the sniffer only listen on one advertising channel it may not intercept the connection request on first try if the request was made on another channel. In this case, reconnect to your target. You can also see the multiple interfaces capture to improve the connection request interception success rate.
Connection intercepted
Connectivity Sniffer Connected1.png


Now you have some additional data:

  • The direction column indicates the direction of the packets
  • The color of the lines is alternating for each connection event

If the connection is terminated or if the sniffer loose it, it will return to the advertising channel you have configured before.

3. Multiple interfaces capture

Because the sniffer can listen to only one channel at a time, capturing from multiple hardware interfaces can be very useful. You can capture the traffic on all advertising channel and pick up the connect request no matter on which channel it happens. You can also follow multiple links.

To capture with multiple sniffers, plug your boards and to start the capture:

puce1.png
Use CTRL or SHIFT and click to select the interfaces you want
puce2.png
Click on start capturing
Start capturing from multiple interfaces
Connectivity Sniffer Start Multiple Captures.png


During the capture you can identify on which sniffer the packets have been captured:

puce1.png
In the Interface column you have the interface number corresponding to the com port number
puce2.png
In the STMicroelectronics BLE sniffer dissection tree you have the Board ID field corresponding to the com port number
Capture example from multiples interfaces

Connectivity Sniffer Multiple Capture Column.png

Connectivity Sniffer Multiple Capture ID.png


Warning white.png Warning
With multiple interfaces, the timestamp and timestamp difference are not relevant as the boards have not their timestamps synchronized

To control each sniffer:

puce1.png
Click on the interface dropdown list and choose the one you want to control
Controlling multiples interfaces

Connectivity Sniffer Multiple Capture Toolbar.png


In case you want each sniffer to be able to intercept a connection, enter for each sniffer the target BD address.

4. Key input

For links that will be encrypted without debug mode or legacy pairing just work, the sniffer needs additional data to decrypt the traffic. On the right side of the toolbar, you have a key type selector and an associated value field. This input gives you the possibility to provide additional data that the sniffer can't know just by listening to the over the air communications. You can give the following data:

  • Legacy passkey: The key entered shall be 128 bits wide. The PassKey shall be zero-padded. For example, if the passkey was 401190 (decimal) -> 0x61F26 (hexa) you shall enter : 000000000000000000000000000061F6.
  • Legacy OOB data: The key entered shall be 128 bits wide. The value shall be entered with the MSO on the leftmost byte.
  • LTK: The key entered shall be 128 bits wide. The value shall be entered with the MSO on the leftmost byte. The key will be used if during a secure connection pairing if none of the devices are in debug mode.

The key shall be entered:

  • The pairing start for legacy PassKey and OOB data
  • Before the LL encryption start for the LTK

If you encounter problems, you can check the Troubleshooting article.

No categories assignedEdit