Skip to content
Sedat Özdemir
Writing

firmware-analysis

Is Your Smart Bulb Handing Over Your House Keys? The Dark Backdoors of IoT

Forget 'admin:admin' hunts on Shodan. Real IoT security threats hide deep within unpatched, messy firmware files and unencrypted protocols. Here's a look at how we analyze these devices during Red Team ops.

Sedat Özdemir
· 4 dk read

Hey everyone, today we’re diving into a topic that’s going to hurt a bit: the world of IoT (Internet of Things). But don't expect a basic 'my smart plug got hacked and the lights flickered' kind of article. I know from my time in the field that when people talk about IoT security, everyone has Shodan open, looking for 'admin:admin' credentials. Look, let’s be real: scanning for open ports on Shodan and getting excited isn't cybersecurity; it's just window shopping. The real disaster is hidden in the warehouse—in those patched-together firmware files that haven't been updated in years and are embedded deep within the device. If you see a CISO relying on Shodan reports and saying 'we're secure' in a prod environment, run away as fast as you can.

Firmware: The 'Root' Password Inside the Trash

The biggest tragedy of IoT devices is their firmware files. Most manufacturers take a Linux kernel, add their own half-baked code, call it a day, and push it to the market. When we encounter a smart camera or an industrial sensor in a Red Team operation, the first thing we do is pull the device's firmware. Usually, we download it as a .bin or .img file directly from the manufacturer’s site.

If we’re lucky (and we’re lucky 90% of the time), the file isn't encrypted. We unleash that legendary tool called binwalk on it, and the rest is history. Check this out: in a lab study we did at example-lab, we decrypted the firmware of a best-selling router with just this command:

# Extracting the file system inside the firmware
binwalk -e firmware_v1.0.bin

The squashfs-root folder that appears after this command is essentially the brain of that device. Do you know what you find when you go inside? You might see the 'root' user's password as 123456 in the /etc/shadow file, or worse, a backdoor script the developer left behind 'just in case.'

For example, something like this:

# That amazing 'debug' code the developer forgot (Mock/Pseudo)
def handle_debug_request(data):
    if data == "GOD_MODE_ON":
        import os
        os.system("/bin/sh -i") # Congrats, you now own the device.

The Misery of Protocols: MQTT and Forgotten Topics

IoT devices usually talk to each other using MQTT (Message Queuing Telemetry Transport). It’s a lightweight protocol, it’s great. But if you open this protocol to the world on port 1883 without using TLS and without encryption, your 'smart' factory suddenly turns into an 'open-to-all' playground.

In a penetration test, we use this simple command to connect to the target network's MQTT broker and listen to all messages:

# Listening to all topics
mosquitto_sub -h 127.0.0.1 -p 1883 -t "#" -v

By using the # wildcard character, you can read the device's entire soul. Data like 'Device_X/status', 'Device_Y/config', or even 'User/Password' flies through the air. An attacker doesn't just watch; they can also push messages.

# Sending a command to reset the device (Defanged example)
mosquitto_pub -h 127.0.0.1 -t "home/security/alarm" -m "DISARM"

While you're sleeping soundly at home...

Related posts