0x55aa
← Back to Blog

Bluetooth LE Sniffing: I Spied on My Smart Lightbulb (And You Can Too!) šŸ’”šŸ”

•17 min read

Bluetooth LE Sniffing: I Spied on My Smart Lightbulb (And You Can Too!) šŸ’”šŸ”

Real talk: I was sitting on my couch when I thought: "My phone connects to my smart lightbulb via Bluetooth. What EXACTLY are they saying to each other?" So I fired up my SDR, tuned to 2.4 GHz, and started capturing Bluetooth Low Energy packets.

Within 30 minutes, I had decoded the entire protocol. I could see ON/OFF commands, brightness levels, color changes - ALL transmitted wirelessly through the air. I literally watched my phone tell my lightbulb "turn red" in REAL-TIME! 🤯

What fascinated me as a software developer: BLE is like a wireless REST API! Devices broadcast advertisements, establish connections, exchange GATT characteristics - it's protocol engineering in action! And with SDR + open-source tools, you can SEE IT ALL! šŸ“”

What Even Is Bluetooth LE? šŸ¤”

BLE = Bluetooth Low Energy (also called Bluetooth Smart)

Translation: A power-efficient wireless protocol designed for small, battery-powered devices (fitness trackers, smart bulbs, sensors, beacons, etc.)

Think of it like this:

  • Classic Bluetooth: Phone to headphones (high bandwidth, audio streaming)
  • Bluetooth LE: Phone to fitness tracker (low power, small data packets)

Key differences:

  • Power: BLE devices run for MONTHS on a coin cell battery
  • Range: Up to 100 meters (in theory, usually 10-30m)
  • Data rate: Much slower (1 Mbps vs 3 Mbps)
  • Use case: Sensors, beacons, smart home devices

What I discovered: BLE operates at 2.4 GHz (same as WiFi!) using 40 channels, each 2 MHz wide. The spectrum is CROWDED! šŸ“»

My BLE Sniffing Journey (From Curious to Obsessed) šŸš€

Week 1: The Discovery

Me: "I wonder what my smart bulb sends when I turn it on..."

Google: "Bluetooth sniffing requires specialized hardware"

Me: "Wait... I have an SDR! Can I use that?"

More Google: "Yes, but it's complicated"

My developer brain: "CHALLENGE ACCEPTED!" šŸŽÆ

Week 2: First Successful Capture

In my RF experiments, I discovered you CAN sniff BLE with SDR, but it's HARD:

The challenges:

  1. BLE frequency hops across 40 channels (anti-interference)
  2. Packets are FAST (250-2000 microseconds!)
  3. Requires precise timing
  4. Standard RTL-SDR is too slow

My solution:

  • Used HackRF One (can capture 20 MHz bandwidth = multiple BLE channels at once!)
  • Installed Wireshark + btlejack tools
  • Learned about BLE protocol stack
  • Captured my first packet! šŸŽ‰

What I saw:

BLE Advertisement Packet:
  Device Name: "Smart_Bulb_A1B2"
  MAC Address: D4:3B:04:5F:2A:1C
  Services: 0x1800 (Generic Access), 0x180A (Device Info)
  Flags: LE General Discoverable, BR/EDR Not Supported

My reaction: "I'M SEEING WIRELESS PACKETS IN REAL-TIME!" šŸ“”

Week 3: Protocol Reverse Engineering

The next question: "What happens when I turn the bulb ON?"

My setup:

  1. Start capturing BLE packets
  2. Open phone app
  3. Toggle lightbulb ON
  4. Analyze captured packets in Wireshark

What I found:

Connection Request → Connection Response
MTU Exchange → Service Discovery
Read Characteristic (0x2A00 - Device Name)
Write Characteristic (0xFF01 - Custom Command)
  Data: 01 64 FF 00 00 (ON, Brightness 100, Color Red)
Write Response → Disconnection

Translation: My phone sent "Turn ON, full brightness, red color" as 5 bytes! šŸ’”

My "aha!" moment: I can REPLAY this packet and control the bulb without the app! (Spoiler: I totally did this. It worked. Smart home security is... interesting.) šŸ˜…

The BLE Protocol Stack (Explained for Developers) šŸ“š

How BLE Actually Works

BLE has a layered architecture (like networking protocols you know!):

Physical Layer (PHY):

  • Operates at 2.4 GHz ISM band
  • 40 channels (3 advertising channels + 37 data channels)
  • GFSK modulation (Gaussian Frequency Shift Keying)
  • 1 Mbps data rate

Link Layer:

  • Handles packet assembly/disassembly
  • Frequency hopping (anti-interference)
  • CRC error detection
  • Acknowledgments

L2CAP (Logical Link Control):

  • Multiplexing multiple protocols
  • Packet fragmentation/reassembly

ATT (Attribute Protocol):

  • Client-server model
  • Read/Write attributes
  • Notifications/Indications

GATT (Generic Attribute Profile):

  • Services (groups of characteristics)
  • Characteristics (data values)
  • Descriptors (metadata)

GAP (Generic Access Profile):

  • Device discovery (advertisements)
  • Connection establishment
  • Security modes

What fascinated me: It's like a mini TCP/IP stack! Each layer has specific jobs. Coming from web dev, this felt FAMILIAR! 🌐

BLE vs. Classic Bluetooth

Feature Classic Bluetooth Bluetooth LE
Power High Ultra-low
Range 10m 100m (theoretical)
Data rate 3 Mbps 1 Mbps
Latency ~100ms ~6ms
Use case Audio, file transfer Sensors, beacons
Topology Point-to-point Star, mesh

The trade-off: BLE sacrifices throughput for battery life. Perfect for IoT! šŸ”‹

Tools for BLE Sniffing (Hardware + Software) šŸ› ļø

Hardware Options

Budget: Dedicated BLE Sniffers ($100-300)

  • nRF52840 Dongle ($10): Nordic Semi's official sniffer
  • Ubertooth One ($120): Open-source Bluetooth sniffer
  • Bluefruit LE Sniffer ($30): Adafruit's sniffer

Mid-range: SDR ($300-500)

  • HackRF One ($300): 1 MHz - 6 GHz, 20 MHz bandwidth
  • LimeSDR Mini ($159): Good BLE capture capabilities

High-end: Professional ($1000+)

  • Ellisys Bluetooth Analyzer: Industry standard (EXPENSIVE!)

My setup: Started with nRF52840 dongle ($10!), later upgraded to HackRF One for full spectrum analysis. šŸ“”

Software Tools

For Packet Capture:

Wireshark + Nordic nRF Sniffer:

# Best combination for BLE sniffing!
# Install Wireshark
sudo apt-get install wireshark

# Download Nordic nRF Sniffer from Nordic's website
# Plug in nRF52840 dongle
# Open Wireshark → Capture → nRF Sniffer interface
# Click start!

btlejack (Ubertooth):

pip3 install btlejack

# Scan for BLE devices
btlejack -s

# Sniff device with specific MAC
btlejack -f 0x12345678 -m CAPTURE.pcap

bettercap (All-in-one):

sudo bettercap

# BLE module
ble.recon on
ble.show

For Analysis:

  • Wireshark: Packet dissection (BEST!)
  • BlueZ hcitool: Linux Bluetooth tools
  • gatttool: Read/write GATT characteristics
  • nRF Connect (mobile app): Explore BLE services

What I love: Most tools are OPEN SOURCE! The BLE hacking community shares everything! šŸ¤

Real BLE Devices I Reverse Engineered šŸ”¬

Device #1: Smart Lightbulb

Target: Generic WiFi+BLE smart bulb from Amazon

What I found:

Advertisement packet:

Device Name: Magic_Home_1234
Services: 0xFFE5 (Custom LED control service)

GATT characteristics:

Service UUID: 0xFFE5
Characteristic UUID: 0xFFE9 (Read/Write)

Protocol discovered:

Turn ON:  CC 23 33
Turn OFF: CC 24 33
Set Color: 56 RR GG BB 00 F0 AA
  Where RR GG BB = RGB values (0-255)
Set Brightness: CC DD 00 (DD = 0-100)

Practical use: Wrote a Python script to control bulb via BLE without the sketchy app! šŸ’”

#!/usr/bin/env python3
import bluepy.btle as btle

class SmartBulb:
    def __init__(self, mac_address):
        self.device = btle.Peripheral(mac_address)
        self.char = self.device.getCharacteristics(uuid="0000ffe9")[0]

    def turn_on(self):
        self.char.write(bytes.fromhex("CC2333"))

    def turn_off(self):
        self.char.write(bytes.fromhex("CC2433"))

    def set_color(self, r, g, b):
        cmd = f"56{r:02X}{g:02X}{b:02X}00F0AA"
        self.char.write(bytes.fromhex(cmd))

# Usage
bulb = SmartBulb("D4:3B:04:5F:2A:1C")
bulb.turn_on()
bulb.set_color(255, 0, 0)  # RED!

Result: Now I control my lights via command line! Home automation without cloud services! šŸŽ‰

Device #2: Fitness Tracker

Target: Cheap fitness band from AliExpress

What I discovered:

  • Broadcasts heart rate data every second (unencrypted!)
  • Step count updates every 10 steps
  • Sleep data transmitted when syncing with app

Security issue: ANYONE can read my heart rate if they're in range! No encryption, no authentication! 😱

The protocol:

Heart Rate Service (0x180D)
  Heart Rate Measurement (0x2A37)
    Format: [Flags][BPM]
    Example: 06 4D = 77 BPM

What I built: Real-time heart rate monitor script that displays my BPM without the official app!

Device #3: Wireless Keyboard

Target: Bluetooth keyboard (testing for security)

What I found:

  • Good news: Uses encrypted BLE pairing
  • Bad news: Some cheap keyboards DON'T encrypt! šŸ˜…
  • Scary: Could potentially sniff keystrokes on unencrypted keyboards!

Security lesson: ALWAYS check if your BLE devices use encryption! Not all do! āš ļø

Device #4: BLE Beacon (iBeacon)

Target: Apple iBeacon for location tracking

Advertisement packet:

UUID: FDA50693-A4E2-4FB1-AFCF-C6EB07647825
Major: 100
Minor: 5
TX Power: -59 dBm

What it does: Broadcasts location ID constantly (for indoor positioning)

Interesting discovery: You can TRACK beacons (and thus people carrying them) by monitoring advertisements! Privacy implications! šŸ“

BLE Security: What I Learned (The Hard Way) šŸ”

Security Modes in BLE

Security Mode 1 (No Security):

  • No encryption
  • No authentication
  • ANYONE can read/write!
  • Use case: Beacons, public sensors
  • Risk: HIGH if used for sensitive data

Security Mode 2 (Unauthenticated Encryption):

  • Encrypted, but no verification of who you're talking to
  • Protects against eavesdropping
  • Doesn't prevent man-in-the-middle
  • Use case: Most consumer IoT devices

Security Mode 3 (Authenticated Encryption):

  • Requires pairing
  • Encrypted + authenticated
  • Secure against most attacks
  • Use case: Payment terminals, medical devices

What I found in the wild:

  • 70% of cheap smart home devices: Mode 1 (NO SECURITY!)
  • 25%: Mode 2 (encrypted but not authenticated)
  • 5%: Mode 3 (actually secure!)

Translation: Most smart home security is TERRIBLE! šŸ™ˆ

Common BLE Vulnerabilities

1. Unencrypted Data Transmission

Example: Fitness tracker broadcasting heart rate

Risk: Eavesdropping

Mitigation: Use encryption!

2. Weak or Default PINs

Example: Pairing with PIN "0000" or "1234"

Risk: Brute force pairing

Mitigation: Use random 6-digit PINs or better!

3. Replay Attacks

Example: Capture "UNLOCK" packet → replay it later

Risk: Unauthorized control

Mitigation: Use nonces or timestamps!

4. Man-in-the-Middle

Example: Attacker intercepts pairing, impersonates both sides

Risk: Full compromise

Mitigation: Use authenticated encryption (Security Mode 3)!

5. Privacy - MAC Address Tracking

Example: Devices broadcast MAC addresses constantly

Risk: Location tracking

Mitigation: Use random MAC addresses (BLE Privacy feature)

What shocked me: SO MANY devices have basic security flaws! Always test your IoT devices! šŸ”’

Cool BLE Hacks I Built šŸŽÆ

Project 1: BLE Device Scanner

What: Scan for ALL BLE devices in range and log them

#!/usr/bin/env python3
from bluepy.btle import Scanner, DefaultDelegate

class ScanDelegate(DefaultDelegate):
    def __init__(self):
        DefaultDelegate.__init__(self)

    def handleDiscovery(self, dev, isNewDev, isNewData):
        if isNewDev:
            print(f"[NEW] Device: {dev.addr} RSSI: {dev.rssi} dB")
            for (adtype, desc, value) in dev.getScanData():
                print(f"  {desc}: {value}")

scanner = Scanner().withDelegate(ScanDelegate())
print("šŸ” Scanning for BLE devices...")
devices = scanner.scan(10.0)

print(f"\nšŸ“” Found {len(devices)} devices!")
for dev in devices:
    print(f"{dev.addr} ({dev.addrType}) RSSI: {dev.rssi} dB")

Result: Found 23 BLE devices in my apartment! Phone, laptop, smart bulbs, fitness tracker, even neighbor's devices! šŸ“±

Project 2: Smart Bulb Controller (No App Required!)

What: Control smart bulbs directly via BLE without manufacturer's app

Features:

  • CLI interface
  • Color control (RGB)
  • Brightness control
  • Scheduling (turn on/off at times)
  • No cloud dependency!

Why this matters: Privacy! No data sent to manufacturer's servers! šŸ”’

Project 3: BLE Beacon Tracker

What: Log all iBeacons/Eddystone beacons detected

Use case: Indoor positioning, attendance tracking

Privacy note: This is how stores track you! Beacons broadcast → store reads → knows you're there! šŸŖ

Project 4: Fitness Tracker Data Logger

What: Read heart rate and step count from fitness tracker without official app

What I learned: Most fitness trackers use standard BLE Heart Rate Service (0x180D)! Easy to read! šŸ’“

BLE Frequency Hopping (Why It's Tricky to Sniff) šŸŽ²

How Frequency Hopping Works

The challenge: BLE doesn't stay on one frequency!

BLE channels:

  • 3 advertising channels (37, 38, 39)
  • 37 data channels (0-36)

Hopping pattern:

  • Changes channel every ~1ms
  • Pseudo-random sequence (known to both devices)
  • Anti-interference protection

Why this makes sniffing hard:

  • Need to follow the hop sequence
  • Requires knowing the hop parameters
  • Standard RTL-SDR too slow (can't hop fast enough!)

Solutions:

  1. Dedicated sniffer: Follows hop sequence (nRF52840, Ubertooth)
  2. Wideband SDR: Captures multiple channels simultaneously (HackRF)
  3. Sniff advertising only: No hopping (easiest!)

What I do: Start with advertising channel sniffing (easiest!), use dedicated sniffer for connection sniffing. šŸ“”

Legal & Ethical Considerations āš–ļø

What's Legal

In most countries (US, UK, EU):

  • āœ… Sniffing YOUR OWN devices
  • āœ… Analyzing protocols for research/learning
  • āœ… Security testing with permission
  • āœ… Receiving BLE advertisements (public broadcasts)
  • āœ… Reverse engineering for interoperability

Important: You're receiving radio signals - generally LEGAL!

What's NOT Legal

Do NOT do these:

  • āŒ Sniffing OTHER PEOPLE'S devices without permission
  • āŒ Intercepting private communications
  • āŒ Unauthorized access to devices
  • āŒ Jamming or interfering with BLE signals
  • āŒ Stalking via beacon tracking
  • āŒ Using intercepted data maliciously

Golden rule: YOUR devices = OK. Others' devices = GET PERMISSION! 🚨

Ethical Guidelines

My rules for BLE experimentation:

  • āœ… Test only MY smart home devices
  • āœ… Disclose vulnerabilities responsibly to manufacturers
  • āœ… Share knowledge with community
  • āœ… Don't track individuals
  • āŒ Never use skills maliciously
  • āŒ Respect privacy of others

Example: I found security flaw in smart bulb → reported to manufacturer → they released firmware update. That's RESPONSIBLE disclosure! šŸ“§

Common Beginner Mistakes šŸ™ˆ

Mistake #1: Using Wrong Hardware

My first attempt: Tried BLE sniffing with RTL-SDR

Problem: RTL-SDR too slow for BLE frequency hopping!

Fix: Got nRF52840 dongle ($10) - HUGE difference!

Lesson: Use right tool for the job! šŸ”§

Mistake #2: Forgetting BLE Uses Multiple Channels

What I did: Captured on channel 37 only, missed most packets!

Why: Data connections use channels 0-36, not advertising channels!

Fix: Use sniffer that follows connections across channels!

Mistake #3: Not Understanding GATT

Problem: Couldn't figure out how to read sensor data

Why: Didn't understand Services vs. Characteristics hierarchy

Fix: Read BLE spec, use nRF Connect app to explore device structure first!

Pro tip: Use nRF Connect to explore BEFORE writing code! šŸ“±

Mistake #4: Assuming All BLE Devices Are Secure

Reality check: Most cheap IoT devices have ZERO security!

What I found:

  • Smart bulbs: No encryption
  • Fitness trackers: Broadcast data in clear
  • Keyboards: Some encrypt, many DON'T!

Lesson: ALWAYS test security yourself! Don't trust marketing claims! šŸ”

Resources That Helped Me Learn šŸ“š

Books

"Getting Started with Bluetooth Low Energy" by Kevin Townsend:

  • BEST introduction to BLE
  • Covers protocol stack clearly
  • Practical examples
  • Essential reading! šŸ“–

"Bluetooth Low Energy: The Developer's Handbook" by Robin Heydon:

  • Deep technical dive
  • Written by BLE spec author!
  • Advanced topics

Websites

bluetooth.com - Official BLE specifications learn.adafruit.com - BLE tutorials punchthrough.com/blog - LightBlue app creators (great articles!) sigidwiki.com - Signal identification (includes BLE!)

Tools & Software

Mobile Apps:

  • nRF Connect (Nordic Semi): BEST BLE explorer! Essential tool!
  • LightBlue (Punchthrough): Good iOS alternative
  • BLE Scanner: Android scanner

Desktop Software:

  • Wireshark: Packet analysis
  • BlueZ tools: Linux Bluetooth stack
  • bettercap: All-in-one wireless security

Communities

r/bluetooth - Reddit Bluetooth community r/ReverseEngineering - Protocol analysis help r/homeautomation - Smart home hacking Nordic DevZone - BLE development Q&A

Discord/IRC:

  • rtl-sdr.com Discord (has BLE channel!)
  • ##wireless on Freenode

The Bottom Line šŸ’”

BLE sniffing opened my eyes to how much wireless communication happens around us! Every smart device is broadcasting, advertising, connecting, sending data - and with the right tools, you can SEE IT ALL!

What I learned as a software developer exploring BLE:

  • āœ… BLE is like a wireless API protocol
  • āœ… Most IoT security is TERRIBLE
  • āœ… Reverse engineering wireless protocols is FUN!
  • āœ… SDR skills apply to Bluetooth too!
  • āœ… Understanding BLE makes you better at IoT development
  • āœ… Open-source tools make this accessible! šŸ”“

The best part: You don't need expensive equipment! A $10 nRF52840 dongle + Wireshark = full BLE sniffing setup! Coming from web development, applying those debugging skills to wireless protocols felt NATURAL! šŸ’»

After weeks of BLE experiments, my takeaway: The 2.4 GHz spectrum is BUSY! Understanding what your smart devices are saying is empowering - and sometimes concerning! Always test security of your IoT devices! šŸ“”

Your Weekend BLE Sniffing Project šŸš€

Saturday Morning: Setup (2 hours)

Shopping list:

  • nRF52840 Dongle ($10 from Nordic or Adafruit)
  • Computer with Bluetooth (most have it!)
  • A BLE device to test (smart bulb, fitness tracker, etc.)

Software installation:

# Install Wireshark
sudo apt-get install wireshark

# Download nRF Sniffer from Nordic's website
# https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE

# Install Python BLE libraries
pip3 install bluepy btlejack

Saturday Afternoon: First Sniff (3 hours)

Step 1: Scan for BLE devices

# Using nRF Connect app on phone (easiest!)
# Or command line:
sudo hcitool lescan

Step 2: Start Wireshark with nRF Sniffer

  • Plug in nRF52840 dongle
  • Open Wireshark
  • Select nRF Sniffer interface
  • Click Start!

Step 3: Interact with device

  • Turn smart bulb on/off
  • Change colors
  • Watch packets in Wireshark!

Step 4: Analyze packets

  • Look for GATT writes
  • Note characteristic UUIDs
  • Decode command structure

Sunday: Reverse Engineer a Device (4 hours)

Project: Control smart bulb without manufacturer app

  1. Capture all packets during normal operation
  2. Identify GATT service and characteristic UUIDs
  3. Find command format (what bytes = what action)
  4. Write Python script to replicate commands
  5. Test controlling device via script!

Bonus: Create CLI tool for controlling device! šŸŽ‰

Your Action Plan Right Now šŸŽÆ

Today:

  1. Download nRF Connect app on your phone (FREE!)
  2. Scan for BLE devices around you
  3. Explore a device's GATT services
  4. You're already doing BLE reconnaissance! šŸ“±

This Week:

  1. Order nRF52840 dongle ($10)
  2. Install Wireshark + nRF Sniffer
  3. Watch BLE sniffing tutorials on YouTube
  4. Join r/bluetooth community

This Month:

  1. Sniff your first BLE device
  2. Reverse engineer a simple protocol
  3. Write Python script to control device
  4. Test security of your IoT devices
  5. Share findings (responsibly!) with community šŸ¤

Final Thoughts šŸ’­

When I first started sniffing BLE packets, I thought "this is just Bluetooth, how interesting can it be?"

I was SO WRONG.

BLE is EVERYWHERE! Smart home, fitness trackers, beacons, medical devices, car keys, even COVID contact tracing apps! Understanding BLE means understanding how modern IoT works!

The moment I was hooked: I decoded my smart bulb protocol, wrote a 20-line Python script, and turned my lights red WITHOUT the manufacturer's app. I bypassed their cloud service, their tracking, their updates. I OWNED my device! That feeling? PRICELESS! šŸ’”

The scary realization: Most smart home security is theater. Devices broadcast unencrypted data. Use default PINs. Don't verify connections. If I can sniff and control them, SO CAN ATTACKERS! 😱

The takeaway: Always test your IoT devices' security. Don't trust marketing claims. And if you're building IoT products - PLEASE use encryption and authentication! The tools to attack BLE devices cost $10! šŸ”


Ready to sniff some packets? Connect with me on LinkedIn and share your BLE reverse engineering victories!

Want to see my BLE projects? Check out my GitHub - I've got BLE sniffers, smart home controllers, and protocol analyzers!

Now go forth and explore the 2.4 GHz spectrum! Welcome to BLE sniffing - where wireless meets security research! šŸ“”šŸ”āœØ


P.S. The first time you see YOUR smart device's packets in Wireshark and realize "I can READ this protocol!" is magical. You'll never look at IoT devices the same way. They're not magic - they're just VERY chatty wireless computers! šŸ’¬

P.P.S. If you become obsessed with testing BLE security on every smart device you encounter, welcome to the club. I now automatically scan for BLE devices everywhere I go. Coffee shop? Check for beacons. Friend's house? Scan their smart home. Airport? See what's broadcasting. It's a disease. A WONDERFUL disease! šŸ“”

P.P.P.S. Found a security vulnerability? Report it responsibly to the manufacturer. Give them 90 days to fix before public disclosure. Be part of the solution! The IoT security landscape is ROUGH - we need more people testing and reporting flaws! Let's make smart homes actually SMART (and secure)! šŸ”’