This document introduces ARM-X, an ARM firmware emulation framework being developed by Saumil Shah. The goals of ARM-X include creating an IoT virtual machine to enable runtime analysis, reverse engineering, fuzzing, and exploit development of IoT devices. It discusses challenges with emulating IoT device firmware using QEMU and matching the kernel and drivers to the actual device. Extraction of firmware from IoT devices directly from flash memory or via hidden UART interfaces and serial consoles is also covered. A preview release of ARM-X is announced for October 23, 2019.
NETSQUARE (c) SAUMILSHAHHITB Cyberweek 2019 UAE
Introducing
ARM-X
Saumil Shah
@therealsaumil
16 October 2019
2.
NETSQUARE (c) SAUMILSHAHHITB Cyberweek 2019 UAE
# WHO AM I
Saumil Shah
CEO, Net Square
@therealsaumil
educating, entertaining
and exasperating
audiences since 1999
3.
NETSQUARE (c) SAUMILSHAHHITB Cyberweek 2019 UAE
Introducing ARM-X
• An ARM Firmware Emulation Framework.
• Ultimate Goal - create an IoT VM!
• A Virtual IoT device makes for easy
– runtime analysis
– reverse engineering
– fuzzing
– exploit development
• Great insight into embedded hardware by
trying to emulate it.
NETSQUARE (c) SAUMILSHAHHITB Cyberweek 2019 UAE
CPU and
Hardware
Kernel
Drivers
File System
nvram
User Processes
API
UI
libnvram
JTAG
UART
SPI
...it is a special computer...
8.
NETSQUARE (c) SAUMILSHAHHITB Cyberweek 2019 UAE
compressed FS
CPU
Kernel
Boot Loader
mounted
FS
nvram
init
scripts
Services
Apps
libnvram
The IoT Boot Up Process
conf
conf
conf
conf
firmware
Loads Kernel.
Uncompresses FS to ramdisk,
invokes init process.
ramdiskuserland
Reads config from nvram.
Builds system config files on
the fly.
Starts up system services.
Invokes Applications and
Application services.
READY
POWER ON
9.
NETSQUARE (c) SAUMILSHAHHITB Cyberweek 2019 UAE
QEMU
CPU and
Limited
Hardware
Kernel
Drivers
uncompressed
Filesystem
emulated
nvram
init scripts
Services
Apps
libnvram
Emulation: Goals and Challenges
x
x
x
x
BUILDROOT
Match the kernel with the
one on the device
chroot environment
Implemented as an INI file,
preloaded before "boot up"
conf
conf
Fix to match QEMU environment
Not all drivers load successfully
10.
NETSQUARE (c) SAUMILSHAHHITB Cyberweek 2019 UAE
QEMU
CPU and
Limited
Hardware
Kernel
The ARM-X Startup Process
NETSQUARE (c) SAUMILSHAHHITB Cyberweek 2019 UAE
QEMU
CPU and
Limited
Hardware
Kernel
Drivers
uncompressed
Filesystem
emulated
nvram
init scripts
Services
Apps
libnvram
Emulation: Goals and Challenges
x
x
x
x
conf
conf
NETSQUARE (c) SAUMILSHAHHITB Cyberweek 2019 UAE
2: Hidden UART interfaces
Vcc (+3.3V) GND
The other
two pins
have to
be TX, RX.
GND
Verify continuity across GND
23.
NETSQUARE (c) SAUMILSHAHHITB Cyberweek 2019 UAE
Serial Console
Device
GND
TX
RX
GND
TX
RX
minicom
Serial Port = /dev/ttyUSB0
115200 baud
8N1
Vcc