Skip to main content
Challenges OTA manifest and signature verification
IoT Medium IoT OTA security: verifying the HMAC-SHA256 manifest signature and the SHA-256 integrity of the firmware Solves: 5

OTA manifest and signature verification

Author: CyberSamSU
Points
45

An OTA (Over-the-Air) update package of an IoT gateway was intercepted: ota_bundle.zip. Inside the archive there are device.cfg, two manifests (manifest.json and manifest.old.json) and three firmware images (images/fw_a.bin, images/fw_b.bin, images/fw_c.bin).

Before applying an update, the device performs a two-stage check:

1. Manifest authenticity (HMAC-SHA256): the hmac field of the manifest is verified using the key ota_psk (an ASCII string) in device.cfg. The canonical text over which the HMAC is computed is built from the following lines (separated by \n, file names in alphabetical order):
<version>\nimages/fw_a.bin:<size>:<sha256>\nimages/fw_b.bin:<size>:<sha256>\nimages/fw_c.bin:<size>:<sha256>

2. Image integrity (SHA-256): only the images/fw_*.bin file that truly matches the sha256 hash inside the manifest whose HMAC signature turned out to be correct is genuine (the other two images are corrupted or are decoy images belonging to an old manifest).

Each fw_*.bin image starts with a 24-byte SAMOTA1\0 header: struct.unpack('<8sIIII', data[:24]) → (magic, code_offset, code_size, cfg_offset, cfg_size). Decrypt BAYROQ{...} by XOR-ing the cfg section (data[cfg_offset : cfg_offset + cfg_size]) of the genuine image periodically with the first 16 bytes of the ota_psk string. (Flag format: BAYROQ{OTA_MANIFEST_<16 kichik hex>}).

Attached files
ota_bundle.zip Log in to download
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −4 pts Log in
Hint 2 −9 pts Log in
Hint 3 −13 pts Log in
To submit a flag, log in.

First solvers

1. Mirjaxon Qaxxarov 24.11.2026
2. Odam 25.11.2026
3. leshiy 27.11.2026
4. Shcherbakov Nikita 27.11.2026
5. Asmaa Mottery 27.11.2026