(^) Be aware of potential ethical and legal implications of your actions
(^) Use isolated networks for your assignments and research
How do embedded systems work?
The special-purpose computer software that controls an embedded system is often referred to as fi rmware and it is stored in non-volatile memory
How do embedded systems work?
The special-purpose computer software that controls an embedded system is often referred to as fi rmware and it is stored in non-volatile memory
Many vendors use flash memory in their devices to store their firmware, which enables them to later: - Improve the system’s functionality - (^) Fix security vulnerabilities
What does a fi rmware image look like?
(^) Possible methods for obtaining the firmware image of a device:
(^) Downloading it from the vendor’s website
Capturing it during the device’s firmware update process
(^) Extracting it from the hardware
What does a fi rmware image look like?
(^) Possible methods for obtaining the firmware image of a device:
(^) Downloading it from the vendor’s website
Capturing it during the device’s firmware update process
(^) Extracting it from the hardware
(^) For illustration purposes, we will use a firmware image from the OpenWrt project: - https://downloads.openwrt.org/releases/18.06.0/targets/ar71xx/generic/ - (^) https://git.openwrt.org/openwrt/openwrt.git/
$ strings
(^) We can inspect sequences of printable characters in the firmware image with the strings command
$ hexdump
(^) We can examine the bytes of the firmware image with the hexdump command
$ hexdump
(^) 0x48445230 (HDR0) corresponds to the magic number of the TRX header:
(^) If the -v option is not provided, hexdump replaces repeating lines with a single asterisk (*)
$ hexdump
(^) 0x68737173 (hsqs) corresponds to the magic number of the little-endian SquashFS filesystem: - https://sourceforge.net/ p/squashfs/code/ci/ master/tree/ squashfs-tools/ squashfs_fs.h
$ binwalk
(^) We can use binwalk to scan for known signatures
(^) Custom signatures can easily be incorporated
(^) Wide variety of analysis options available
https://github.com/ ReFirmLabs/binwalk
$ binwalk
Regions that contain compressed or encrypted data tend to have high values of entropy
(^) Useful for the inspection of regions that contain data in an unknown format