All Projects → Ledger-Donjon → rainbow

Ledger-Donjon / rainbow

Licence: LGPL-3.0 license
Makes Unicorn traces. Generic Side-Channel and Fault Injection simulator

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to rainbow

CopterSim
A high-fidelity simulation model developed in Simulink that compatible with different types of multicopters.
Stars: ✭ 70 (-33.33%)
Mutual labels:  fault-injection
envoy-proxy-demos
Set of Envoy Proxy feature demos (Envoy v2 API supported)
Stars: ✭ 63 (-40%)
Mutual labels:  fault-injection
ebpfault
A BPF-based syscall fault injector
Stars: ✭ 65 (-38.1%)
Mutual labels:  fault-injection
chip
📦 🐳 🚀 - Smart "dummy" mock for cloud native tests
Stars: ✭ 19 (-81.9%)
Mutual labels:  fault-injection
Mastik
GitHub (mirror) repository for the Mastik toolkit, written by Yuval Yarom https://cs.adelaide.edu.au/~yval/Mastik/
Stars: ✭ 27 (-74.29%)
Mutual labels:  side-channel-attacks
cpu-load-side-channel
Side-channel file transfer between independent VMs or processes executed on the same physical host.
Stars: ✭ 45 (-57.14%)
Mutual labels:  side-channel-attacks
rhme-2016
The RHme2 (Riscure Hack me 2) is a low level hardware CTF challenge that comes in the form of an Arduino Nano board. The new edition provides a completely different set of new challenges to test your skills in side channel, fault injection, cryptoanalysis and software exploitation attacks.
Stars: ✭ 42 (-60%)
Mutual labels:  fault-injection
Pumba
Chaos testing, network emulation, and stress testing tool for containers
Stars: ✭ 2,136 (+1934.29%)
Mutual labels:  fault-injection
Litmus
Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q
Stars: ✭ 2,377 (+2163.81%)
Mutual labels:  fault-injection
Istio
Connect, secure, control, and observe services.
Stars: ✭ 28,970 (+27490.48%)
Mutual labels:  fault-injection
Chaosblade
An easy to use and powerful chaos engineering experiment toolkit.(阿里巴巴开源的一款简单易用、功能强大的混沌实验注入工具)
Stars: ✭ 4,343 (+4036.19%)
Mutual labels:  fault-injection
Chaos Mesh
A Chaos Engineering Platform for Kubernetes.
Stars: ✭ 4,265 (+3961.9%)
Mutual labels:  fault-injection
CrashTuner
CrashTuner(SOSP2019)
Stars: ✭ 26 (-75.24%)
Mutual labels:  fault-injection
sicak
SIde-Channel Analysis toolKit: embedded security evaluation tools
Stars: ✭ 17 (-83.81%)
Mutual labels:  side-channel-attacks
hardware-attacks-state-of-the-art
Microarchitectural exploitation and other hardware attacks.
Stars: ✭ 29 (-72.38%)
Mutual labels:  side-channel-attacks
pyecsca
Python Elliptic Curve Side-Channel Analysis toolkit.
Stars: ✭ 23 (-78.1%)
Mutual labels:  side-channel-attacks

Join the chat at https://gitter.im/Ledger-Donjon/rainbow

Rainbow

It makes unicorn traces.

Using Unicorn as a basis, Rainbow aims to provide an easy scripting interface to loosely emulate embedded binaries, trace them to perform side-channels, and (sometime in the near future :) )simulate fault injections.

This is to allow quick and easy testing of physical attack resistance of code snippets, in order to help developers have a first evaluation of the resistance of their code.

An introduction is available here.

Installation

You will need Python 3.6 at least.

  • python3 setup.py install

If Unicorn or Capstone fails to install somehow :

For the side-channel examples, you need to grab the latest Lascar

If you wish to use another version of Python, you can drop an issue and will look into it.

Running the examples

Some examples will use Lascar's side-channel attacks and try to display traces using a custom plotter built on top of Vispy. If you want to run those, you will need Vispy and pyqt5 for the instruction trace + execution trace viewer.

In the ./examples/ folder, you will find:

Example output

See the x64_pimp_my_xor example for a debug trace.

In the comment part of each line (after the semicolon), the memory access that was performed is written in a simplified way : [address] <- value for a load or value -> [address] for a store. Right after, if any register was modified during this instruction, its new value is shown.

At a branch instruction, if the destination is a known function, its name is shown together with the return address and the function's address.

Basic usage

Grab a device or generic emulator like so

from rainbow.devices import rainbow_stm32f215
from rainbow.generics import rainbow_x86

e = rainbow_stm32f215(sca_mode=False)

Loading a binary

e.load('file', typ='.elf')

File type is guessed on the extension when possible (.elf, .hex).

Starting the emulation is done like so:

e.start(start_address, stop_address, count=number_of_instructions)

Just like with unicorn. The underlying Unicorn instance is always available as e.emu.

Side-Channel simulation

Rainbow only produces an execution trace, without applying any processing (such as using the Hamming weight of all values and adding noise) on the values. This is left as some post-processing, so that the user can apply its own leakage model and simulate various conditions from the same traces. Also, not introducing any noise allows testing in a worst-case scenario, which can yield important results.

To perform the analysis, one can use Lascar. You can find some scripts in the examples folder here which already use it.

Application examples

In the case of hardware wallets for example, one could check that :

  • The PIN verification procedure does not allow to use a bad password even with a controlled instruction skip
  • The scalar multiplication procedure does not leak any information on the used scalar
  • a purely software AES is protected against basic DPA attacks without using lab testing equipment (oscilloscope, current/EM probes, ...)

Rainbow and Lascar allow testing implemented countermeasures were correctly coded and the compiler did not interfere. It cannot, however, verify against hardware-related leaks such as some sequence of operations that somehow cancels out random masks on a bus or hidden register.

Bonus applications

Whiteboxed encryption primitives could also be broken using this tool, instead of e.g. Intel Pin or Valgrind to trace execution. Unicorn has several advantages in this regard :

  • Can be used on a different platform than that of the target binary
  • Allows easy manipulation of the state (for example redefining an external call to rand() in python)

Disadvantages :

  • Some reverse engineering necessary !

As a whitebox example (available in examples/OAES, below is the result of the variance of SECCON 2016's OAES encryption function, which has a heavy control flow obfuscation. One can clearly see the 10 rounds of the AES despite this obfuscation :

OAES Variance

Supported archs

Embedded devices :

  • STM32F215

Generic emulators :

  • ARM
  • ARM Cortex M
  • x86
  • x86_64

File formats :

  • ELF
  • Intel Hex file

Planned :

  • PE support
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].