← retour aux outils back to tools

# crackle

Craqueur d'appairage Bluetooth Low Energy (BLE). Exploite le protocole d'appairage BLE legacy pour casser les clés de chiffrement à partir d'échanges d'appairage capturés, déchiffrant le trafic BLE ultérieur. Bluetooth Low Energy (BLE) pairing cracker. Exploits the BLE legacy pairing protocol to crack encryption keys from captured pairing exchanges, decrypting subsequent BLE traffic.

↗ https://github.com/mikeryan/crackle

## Overview

crackle exploits a weakness in Bluetooth Low Energy legacy pairing (BLE < 4.2 Secure Connections). When the TK (Temporary Key) is zero (Just Works pairing) or a small PIN, crackle can brute-force the encryption key from a captured pairing exchange and decrypt all subsequent BLE traffic.

## Installation

    git clone https://github.com/mikeryan/crackle
    cd crackle
    make

## Basic Usage

Crack keys from a BLE capture

    crackle -i ble_capture.pcap

With output file (decrypted packets)

    crackle -i ble_capture.pcap -o decrypted.pcap

Verbose output

    crackle -i ble_capture.pcap -v

## Capturing BLE Traffic

    # Requires a Bluetooth sniffer:
    # - Ubertooth One (recommended)
    # - nRF52840 Dongle with sniffer firmware
    # - BTLE-Sniffer (passive BLE capture)

    # With Ubertooth:
    ubertooth-btle -f -c capture.pcap
    # Then crack the pairing:
    crackle -i capture.pcap -o decrypted.pcap

With HCI interface (Linux):

    sudo btmon -w btmon.log &

→ Pair devices, then analyze btmon.log

## Understanding BLE Pairing Vulnerability

    # Legacy pairing (pre-4.2):
    # Just Works → TK = 0x0000...0000 (all zeros)
    # PIN Code   → TK = PIN as 128-bit integer (max 999999)

    # With TK known/brute-forceable:
    # → crackle can derive the STK (Short-Term Key)
    # → STK encrypts the LTK (Long-Term Key) exchange
    # → LTK decrypts all subsequent sessions

    # Secure Connections (BLE 4.2+): NOT vulnerable to crackle
    # ECDH key exchange prevents this attack

## Output

    crackle -i pairing.pcap

→ Found candidate pairing TK = 0x00000000000000000000000000000000 (Just Works) Successfully derived STK Decrypting LTK… LTK = 0x1234567890ABCDEF1234567890ABCDEF All encrypted sessions can now be decrypted Write decrypted traffic: use -o flag

## Tips

- Only works on BLE legacy pairing — Secure Connections (BLE 4.2+) is not vulnerable
- Just Works pairing (TK=0) cracks instantly; PIN-based pairing has max 999999 possibilities
- The attack requires capturing the initial pairing exchange — can’t retroactively decrypt
- Many IoT devices still use BLE legacy pairing — fitness trackers, medical devices, smart home
- Wireshark can display decrypted BLE traffic if you import the LTK

Help / Man page

    crackle [options]

    -i FILE     Input pcap file (BLE capture with pairing)
    -o FILE     Output pcap (decrypted traffic)
    -v          Verbose output
    -t TK       Specify TK manually (hex, no 0x prefix)

    Requirements:
      - Capture must include BLE LL_CONNECTION_UPDATE and
        SMP pairing messages (Confirm, Random, STK exchange)
      - Just Works or PIN pairing (not Secure Connections)

## Vue d’ensemble

crackle exploite une faiblesse de l’appairage legacy du Bluetooth Low Energy (BLE < 4.2 Secure Connections). Quand la TK (Temporary Key) est nulle (appairage Just Works) ou un petit PIN, crackle peut brute-forcer la clé de chiffrement à partir d’un échange d’appairage capturé et déchiffrer tout le trafic BLE ultérieur.

## Installation

    git clone https://github.com/mikeryan/crackle
    cd crackle
    make

## Utilisation de base

    # Casser les clés depuis une capture BLE
    crackle -i ble_capture.pcap

    # Avec un fichier de sortie (paquets déchiffrés)
    crackle -i ble_capture.pcap -o decrypted.pcap

    # Sortie verbeuse
    crackle -i ble_capture.pcap -v

## Capturer le trafic BLE

    # Nécessite un sniffer Bluetooth :
    # - Ubertooth One (recommandé)
    # - Dongle nRF52840 avec firmware sniffer
    # - BTLE-Sniffer (capture BLE passive)

    # Avec Ubertooth :
    ubertooth-btle -f -c capture.pcap
    # Puis casser l'appairage :
    crackle -i capture.pcap -o decrypted.pcap

    # Avec une interface HCI (Linux) :
    sudo btmon -w btmon.log &
    # → Appairez les appareils, puis analysez btmon.log

## Comprendre la vulnérabilité d’appairage BLE

    # Appairage legacy (avant 4.2) :
    # Just Works → TK = 0x0000...0000 (tout à zéro)
    # Code PIN   → TK = PIN sous forme d'entier 128 bits (max 999999)

    # Avec la TK connue/brute-forçable :
    # → crackle peut dériver la STK (Short-Term Key)
    # → la STK chiffre l'échange de la LTK (Long-Term Key)
    # → la LTK déchiffre toutes les sessions ultérieures

    # Secure Connections (BLE 4.2+) : PAS vulnérable à crackle
    # L'échange de clés ECDH empêche cette attaque

## Sortie

    crackle -i pairing.pcap

→ Candidat trouvé : TK = 0x00000000000000000000000000000000 (Just Works). STK dérivée avec succès. Déchiffrement de la LTK… LTK = 0x1234567890ABCDEF1234567890ABCDEF. Toutes les sessions chiffrées peuvent maintenant être déchiffrées. Pour écrire le trafic déchiffré : utilisez le flag -o.

## Conseils

- Ne fonctionne que sur l’appairage BLE legacy : Secure Connections (BLE 4.2+) n’est pas vulnérable
- L’appairage Just Works (TK=0) se casse instantanément ; l’appairage par PIN a au maximum 999999 possibilités
- L’attaque nécessite de capturer l’échange d’appairage initial : impossible de déchiffrer rétroactivement
- Beaucoup d’appareils IoT utilisent encore l’appairage BLE legacy : trackers de fitness, dispositifs médicaux, domotique
- Wireshark peut afficher le trafic BLE déchiffré si vous importez la LTK

Aide / Page de manuel

    crackle [options]

    -i FILE     Input pcap file (BLE capture with pairing)
    -o FILE     Output pcap (decrypted traffic)
    -v          Verbose output
    -t TK       Specify TK manually (hex, no 0x prefix)

    Requirements:
      - Capture must include BLE LL_CONNECTION_UPDATE and
        SMP pairing messages (Confirm, Random, STK exchange)
      - Just Works or PIN pairing (not Secure Connections)