Coder Social home page Coder Social logo

gypsybud / ice9-bluetooth-sniffer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikeryan/ice9-bluetooth-sniffer

0.0 0.0 0.0 139 KB

Wireshark Bluetooth sniffer for HackRF, BladeRF, and USRP

License: GNU General Public License v2.0

C 95.01% CMake 4.99%

ice9-bluetooth-sniffer's Introduction

ICE9 Bluetooth Sniffer

Bluetooth sniffer for Wireshark and HackRF, BladeRF, and USRP that can listen to between 4 and 40 channels simultaneously.

Dependencies

This tool requires libliquid, libhackrf, libbladerf, and libuhd. On Debian-based systems you can install these using:

sudo apt install libliquid-dev libhackrf-dev libbladerf-dev libuhd-dev

On macOS, Homebrew is the recommended package manager:

brew install liquid-dsp hackrf libbladerf uhd

This code is untested against MacPorts. The deps can be installed with:

port install liquid-dsp hackrf bladeRF uhd

Building and Installing

mkdir build
cd build
cmake ..
make
make install

The install target will copy the binary into $HOME/.config/wireshark/extcap. An uninstall target is also provided as a convenience.

If you want to install the module to a custom directory, set EXTCAP_INSTALL_PATH when running cmake.

Running

This tool is primarily meant to be run from within Wireshark. That said, it is fully operable from the command line. Refer to the usage notes for full details. For a brief overview, to capture 20 channels centered on 2427 MHz and log all BLE traffic to a PCAP file:

./ice9-bluetooth -l -c 2427 -C 20 -w ble.pcap

For performance stats, add -s. For low-level details and info about classic Bluetooth packets, add -v.

To use in Wireshark, plug in your HackRF and launch Wireshark. Scroll to the bottom of the interfaces list in the main window and you should see "ICE9 Bluetooth: hackrf-$serial" listed. Click the wheel icon to the left of it to configure it if you want, but the defaults should get you BLE packets (if your system is fast enough).

Benchmarking

Prior to benchmarking, please edit Makefile to change -O0 to -O2 and remove -fsanitize=address.

There isn't a proper benchmark mode as such, but you can try demodulating a bunch of 0x00 bytes like so:

./ice9-bluetooth -f /dev/zero -s -C 20

The channelizer will most likely be the bottleneck. Start with 20 channels and observe the performance relative to real time. If it is not over 100%, lower the number of channels until it is.

If you do benchmark this code, please share your numbers with me!

Design

+----------------------------+
|  polyphase channelizer     |
|  1 x 20 MHz -> 20 x 2 MHz  |
+-------+------+-------+-----+
        |      |       |
        |      |       |
        |      |       |
  +-----v----+ | +-----v-----+
  | thread 1 | | | thread 2  |
  +----------+ | +-----------+
               |                  output:
               | +-----------+    bursts
      ...      +-> thread 20 |
                 +-----------+

         burst queue
              |
              |
  +-----------v-------------+
  |    burst processor      |
  | FM demod / BT detection |
  +-------------------------+

The complex IQ samples come in from file or HackRF and are fed into a polyphase channelizer. This splits the n MHz input into n channels at 2 MHz wide. These channelized samples are fed to n threads that each process one channel. Each thread runs a "burst catcher", that uses Liquid's AGC to capture bursts on the channel and feeds them via a queue to the burst processor.

The burst processor takes the complex IQ bursts, FM demodulates them, performs carrier frequency offset (CFO) correction, normalizes them to roughly [-1.0, 1.0], bypasses symbol sync (for hysterical reasons), and performs hard bit decisions. These bit buffers are fed into the Bluetooth detectors. First we attempt to detect BR packets using libbtbb's techniques (borrowed from Ubertooth and earlier gr-bluetooth). If that fails, we then try to detect BLE packets.

Bugs

This code is naughty and occasionally needs to be killed with prejudice (kill -9). This happens most often in benchmark mode.

Author

This code was written by Mike Ryan of ICE9 Consulting LLC. For more information visit https://ice9.us/

ice9-bluetooth-sniffer's People

Contributors

mikeryan avatar tlercher avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.