#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? |
- 3Mobile client (APK)AndroidManifest.xml, DEX bytecode, native .so
- 2IoT firmware (.bin)Bootloader, Linux kernel, SquashFS rootfs
- 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
TXandRXlines with no clock wire. You must determine the baud rate (common rates include9600,38400,57600, and115200bits per second) by measuring the shortest single-bit pulse widthTin seconds (baud = 1 / T). - SPI: Synchronous four-wire bus (
SCLK,MOSI,MISO,CSchip select). BecauseSCLKcarries the clock explicitly, you do not need to guess a baud rate; focus on clock polarity/phase (CPOL,CPHA) and active-lowCS. - I2C: Synchronous two-wire bus (
SDAdata,SCLclock) where multiple peripherals share the wires using 7-bit device addresses andACK/NACKbits.
Instead of reading waveforms manually bit by bit, pass the capture to sigrok-cli (or its GUI, PulseView) with the matching protocol decoder:
$ 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-9142If 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).
$ 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 wwwOnce extracted, treat the filesystem like a Linux static audit (connecting directly to the linux skills from the previous lesson):
- Inspect
/etc/init.d/,/etc/rc.local, orsystemdunits to see which custom daemons start at boot. - Search
/etc/,/www/, and custom binaries under/usr/bin/for hardcoded credentials, API keys, or custom encryption helpers. - Run
fileon custom binaries insidesquashfs-root/usr/bin/before opening them in Ghidra or running them underqemu-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"andandroid:allowBackup="true", which expand local inspection options in a lab. - Find every
activity,service,receiver, andproviderwithandroid: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:
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 (
Ed25519orECDSA), 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.sofiles; enforce authentication on the backend server, setandroid:exported="false"on internal components, and validate everyIntentextra or deep-link parameter.
Common mistakes to avoid when solving these tasks:
- Running
binwalk -easroot: 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
jadxshows thin wrapper methods withnativedeclarations, inspectlib/arm64-v8a/*.soin Ghidra.
#Summary
- Match each specialist category to its primary workflow:
sigrokforhardwarebus captures,Binwalk+ Linux/RE auditing foriotfirmware, andjadx+adbformobilpackages. - 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.xmlfor exported components and debug flags early, and check native.solibraries alongside decompiled Java code.