Git Product home page Git Product logo

radiobit's Introduction

Radiobit, a BBC Micro:Bit RF firmware

Introduction

Radiobit is composed of a dedicated Micropython-based firmware and a set of tools allowing security researchers to:

  • sniff, receive and send data over Nordic's Enhanced ShockBurst protocol (ESB)
  • sniff, receive and send data over Nordic' ShockBurst protocol (SB)
  • sniff, receive and send data over Bluetooth Smart Link Layer
  • sniff raw 2.4GHz GFSK demodulated data

Using Radiobit tools and examples

Radiobit provides the following tools:

  • ubit-sniffer: a ESB/SB/BLE/raw sniffer able to collect data and display them.
  • cheerson-cx10: the firmware corresponding to the hack described in my DefCon25 presentation, used to hijack a Cheerson CX-10 quadcopter in flight.
  • wireless-keylogger: Microsoft wireless keyboard sniffer firmware, as shown at DefCon25

See the corresponding README.md files for each tool of the tools directory.

Radiobit also provides many examples of what can be achieved with its firmware:

  • A BLE advertiser and its associated sniffer
  • A BLE connection request packet sniffer
  • An ESB basic sniffer running on the Micro:Bit

A precompiled version of the Radiobit firmware is provided in the precompiled directory, as a convenience.

If you want to try Radiobit's custom radio Python module, read the specific documentation.

How to program the Micro:Bit with some Python code

Use uflash to program your Micro:Bit:

  1. Plug your Micro:Bit to your computer with a USB cable, it will be recognised as a mass storage device
  2. Mount it
  3. Use uflash to merge the firmware with your main Python3 program and flash the device
$ uflash -r precompiled/radiobit.hex yourprogramhere.py

Uflash will program your Micro:Bit and reset it once it's done !

Recompiling the firmware

If you want to modify the Radiobit firmware, you must follow the procedure below. This procedure has been tested on Debian, but should work on Ubuntu as well.

How to setup the environment

First, install all the required packages (Debian):

$ sudo apt-get install cmake ninja-build gcc-arm-none-eabi srecord libssl-dev

Create a virtual environment with virtualenv for Python 3.x:

$ virtualenv venv

This will create a Python3.x virtual environment in a dedicated folder named venv. You then need to activate this environment in order to install all the required tools with pip3.

$ source venv/bin/activate

Use pip to install yotta in our newly created virtual environment:

(venv)$ pip install yotta

Finally, use yotta to setup the build environment:

(venv)$ cd micropython
(venv)$ yt target bbc-microbit-classic-gcc-nosd
(venv)$ yt up

How to build the firmware

You can now uild the modified micropython firmware. Make sure you are in the micropython directory:

(venv)$ yt build

This may produce a lot of warnings (who said python developers produce clean code ?) but at last a valid binary (in Ihex format).

Your compiled firmware should be located in the build/bbc-microbit-classic-gcc-nosd/source directory, named microbit-micropython.hex.

How to flash a Micro:Bit with this new firmware

Micropython should not be used alone (as a REPL), but combined with a Python script merged into the firmware. This is a usual way to program a Micro:Bit using CLI rather than online services.

First, you need to install uflash in your virtual environment:

(venv)$ pip install uflash

You then can use uflash to flash your Micro:Bit using the following command:

(venv)$ uflash -r build/bbc-microbit-classic-gcc-nosd/source/microbit-micropython.hex ../examples/helloworld/helloworld.py

Obviously, you must have your Micro:Bit connected to your host machine when launching the previous command, or uflash will complain.

radiobit's People

Contributors

virtualabs avatar hackgnar avatar rcayre avatar

Watchers

James Cloos 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.