Cellular Baseband Emulation & Fuzzing with FirmWire
Overview & Audit Objective
FirmWire allows researchers to run uncompressed vendor baseband firmware binaries (Samsung Shannon and MediaTek) in an instrumented QEMU emulator. This playbook guides operators through extracting modem firmware images, booting the virtualized baseband RTOS, attaching GDB debuggers, and fuzzing GSM/LTE/5G protocol handlers with AFL++.
Execution Steps
- 1Prepare Baseband Firmware Image:
Extract modem image (e.g.
modem.bin) from device OTA or vendor TAR archive:Terminal — Extract Imagemkdir -p /tmp/firmware && cd /tmp/firmware tar -xf firmware.tar.md5 modem.bin 2>/dev/null || true - 2Launch FirmWire Baseband Emulator:
Boot the virtualized modem OS with interactive logging and GDB server enabled on port 1234:
Terminal — Boot Shannon Basebandcd /opt/telcosec/firmwire python3 -m firmwire.firmwire --gdb /tmp/firmware/modem.bin - 3Inject Cellular Signalling Frames:
Transmit crafted RRC or NAS protocol packets directly into the baseband virtual transceiver:
Terminal — Inject RRC Framepython3 firmwire/scripts/inject_frame.py --pcap test_rrc.pcap - 4Attach Debugger & Triage Crashes:
Inspect CPU registers and stack traces when memory corruptions or panics occur:
Terminal — GDB Multiarchgdb-multiarch -ex "target remote localhost:1234"
Evidence & Artifact Archiving
Export baseband crash dumps, execution traces, and reproduction PCAPs:
Terminal — Bundle Evidence
telcosec bundle-evidence firmwire-crash-triage