Skip to main content
Specialist Playbook: Hardware, IoT & Mobile Tasks
Lesson 5 of 8

Specialist Playbook: Hardware, IoT & Mobile Tasks

Decode captured hardware bus signals with sigrok, unpack embedded IoT firmware images with Binwalk, and decompile Android APKs with jadx to uncover hardcoded secrets and exposed components.

Advanced 26 min CTF

Learning objectives

  • Classify hardware, IoT, and mobile CTF artefacts by file format and select the matching analysis tool
  • Decode captured UART, SPI, and I2C serial traces using sigrok protocol decoders
  • Inspect firmware images with Binwalk to locate and extract embedded filesystems safely
  • Decompile Android APKs with jadx to audit AndroidManifest.xml and client-side secrets
  • Apply embedded and mobile security controls to remove debug consoles and hardcoded credentials

Recommended first: CTF Formats, Toolkits, Ethics & Structured Note-TakingSpecialist Playbook: Linux, Pwn & Reverse Engineering

#Why this matters

Modern software rarely runs only on standard x86 servers. Smart locks, industrial sensors, and mobile banking apps put executable code, configuration files, and cryptographic keys onto physical devices that an attacker can inspect offline. In CTFs, the hardware, iot, and mobil categories train the exact workflow product-security teams use when auditing embedded devices and mobile clients before release.

Because these targets span physical signalling, embedded Linux filesystems, and mobile runtimes, guessing blindly wastes time. A disciplined playbook maps each artefact directly to the right parser, decompiler, or emulator.

#Classifying the artefact: signals, images, and packages

During initial triage, check the file extension and run file to determine which domain layer you are inspecting:

Category Common CTF artefacts Primary tools Core question to answer
hardware .sr, .vcd, .csv logic traces sigrok, PulseView Which bus protocol is captured and what bytes were sent?
iot .bin, .img, .ubi flash dumps Binwalk, strings, QEMU Where does the root filesystem start and what runs at boot?
mobil .apk, .aab, .ipa app bundles jadx, adb, Ghidra Which components are exposed and how are secrets handled?
  1. 3Mobile client (APK)AndroidManifest.xml, DEX bytecode, native .so
  2. 2IoT firmware (.bin)Bootloader, Linux kernel, SquashFS rootfs
  3. 1Hardware bus (.sr)UART, SPI, I2C voltage transitions over time

In multi-stage challenges, these layers often connect: a UART boot log captured on hardware reveals a firmware download path, the iot firmware contains a local API server, and the mobil app holds the client token format needed to query it.

#Hardware: decoding captured bus traffic

In software-only CTFs, hardware tasks usually supply a logic-analyser capture file (.sr for sigrok or .vcd for Value Change Dump) rather than physical chips. Three serial protocols appear repeatedly:

  • UART: Uses separate TX and RX lines with no clock wire. You must determine the baud rate (common rates include 9600, 38400, 57600, and 115200 bits per second) by measuring the shortest single-bit pulse width T in seconds (baud = 1 / T).
  • SPI: Synchronous four-wire bus (SCLK, MOSI, MISO, CS chip select). Because SCLK carries the clock explicitly, you do not need to guess a baud rate; focus on clock polarity/phase (CPOL, CPHA) and active-low CS.
  • I2C: Synchronous two-wire bus (SDA data, SCL clock) where multiple peripherals share the wires using 7-bit device addresses and ACK/NACK bits.

Instead of reading waveforms manually bit by bit, pass the capture to sigrok-cli (or its GUI, PulseView) with the matching protocol decoder:

Decoding a captured UART trace with sigrok-cli
$ sigrok-cli -i uart_boot.sr -P uart:baudrate=115200:rx=D0
uart-1: Start bit
uart-1: U-Boot 2022.04-lab (Nov 10 2026)
uart-1: Hit any key to stop autoboot:  0
uart-1: env_token=LAB-UART-9142

If decoded text looks like garbled symbols, the baud rate or bit order is wrong. Adjust the rate to match the shortest pulse width observed in the raw trace rather than trying numbers at random.

#IoT: unpacking firmware and hunting secrets

An IoT firmware .bin file is usually a raw flash image packing several regions back to back: bootloader, compressed kernel, and a root filesystem such as SquashFS, JFFS2, or ext4. Binwalk scans the binary for magic-byte signatures and entropy shifts (high entropy indicates compression or encryption).

Scanning and extracting an IoT firmware image
$ binwalk router_lab.bin

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
131072        0x20000         uImage header, header size: 64 bytes, image size: 1835008 bytes
2097152       0x200000        Squashfs filesystem, little endian, version 4.0, size: 4210688 bytes

$ binwalk -e router_lab.bin
$ ls _router_lab.bin.extracted/squashfs-root/
bin  etc  lib  sbin  usr  www

Once extracted, treat the filesystem like a Linux static audit (connecting directly to the linux skills from the previous lesson):

  1. Inspect /etc/init.d/, /etc/rc.local, or systemd units to see which custom daemons start at boot.
  2. Search /etc/, /www/, and custom binaries under /usr/bin/ for hardcoded credentials, API keys, or custom encryption helpers.
  3. Run file on custom binaries inside squashfs-root/usr/bin/ before opening them in Ghidra or running them under qemu-user-static, because IoT binaries typically target ARM or MIPS rather than x86-64.

If binwalk reports flat high entropy across the entire file with zero valid filesystem headers, the vendor likely encrypted or obfuscated the update image; check earlier bootloader stages or companion updater binaries for the decryption routine.

#Mobile: decompiling Android APKs and checking manifests

An Android .apk is a ZIP archive. Decompile it with jadx (jadx-gui for interactive browsing, or jadx -d out app.apk for searchable source directories). Start with AndroidManifest.xml, not random Java classes:

  • Check android:debuggable="true" and android:allowBackup="true", which expand local inspection options in a lab.
  • Find every activity, service, receiver, and provider with android:exported="true" or an <intent-filter>. Any exported component is a potential entry point you can trigger from another app or via adb (adb shell am start ...).
  • Look at res/values/strings.xml, BuildConfig.java, and network-client classes for hardcoded API tokens, symmetric keys, or custom URI schemes.

Consider a decompiled Android check recovered by jadx:

java
public class DebugGateActivity extends AppCompatActivity {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String code = getIntent().getStringExtra("unlock_code");
        if (code != null && code.equals(getString(R.string.lab_pin))) {
            showDiagnosticFlag();
        }
    }
}

If DebugGateActivity is marked android:exported="true" in AndroidManifest.xml, an attacker does not even need to click through the login screen: reading R.string.lab_pin from res/values/strings.xml and launching the activity directly with an intent extra triggers showDiagnosticFlag(). Always check lib/ as well; when Java code calls System.loadLibrary("native-lib"), the real flag check lives inside an ARM64 .so file that you inspect in Ghidra.

#Defending and common mistakes

Securing embedded and mobile products requires addressing trust boundaries at manufacture and build time, aligned with OWASP Mobile Top 10 and embedded hardening practices:

  • Hardware and IoT: Disable interactive UART/JTAG debug consoles (or blow hardware debug fuses) before shipping production boards, verify firmware images with asymmetric digital signatures (Ed25519 or ECDSA), and generate unique per-device credentials rather than baking shared secrets into SquashFS.
  • Mobile: Never store API keys, admin PINs, or encryption secrets inside strings.xml, BuildConfig, or native .so files; enforce authentication on the backend server, set android:exported="false" on internal components, and validate every Intent extra or deep-link parameter.

Common mistakes to avoid when solving these tasks:

  • Running binwalk -e as root: Untrusted firmware archives can contain malicious symlinks pointing to /etc/passwd; always extract as an unprivileged user inside a dedicated working directory.
  • Guessing UART baud rates without measuring pulses: Measure one bit duration first (1 / bit_time) instead of cycling through random settings.
  • Stopping at Java decompilation: If jadx shows thin wrapper methods with native declarations, inspect lib/arm64-v8a/*.so in Ghidra.

#Summary

  • Match each specialist category to its primary workflow: sigrok for hardware bus captures, Binwalk + Linux/RE auditing for iot firmware, and jadx + adb for mobil packages.
  • Measure bit timing before decoding UART traces, and verify clock/chip-select lines on SPI and I2C captures.
  • Extract firmware images as a non-root user, inspect startup scripts and configs, and note the target CPU architecture before running or disassembling binaries.
  • Audit AndroidManifest.xml for exported components and debug flags early, and check native .so libraries alongside decompiled Java code.

Knowledge check

Sign in to take the test, complete lessons and save your progress. Log in

Practice: test your knowledge