Research findings on firmware rehosting techniques have revealed issues such as low simulation execution efficiency and a single execution path. To alleviate these problems, an automated multi-state embedded device firmware rehosting method is proposed. The startup completion position is automatically located based on static features, a distance-first path selection algorithm is designed, and rapid self-testing of the simulated device during startup is achieved. Additionally, a hybrid execution algorithm based on exception avoidance is devised to generate a dynamic execution model with multi-path execution capabilities, thereby enabling the diversification of execution paths. Through experimental testing involving 19 firmware samples across two types of platforms and three types of architectures, the method successfully generates a static boot model and a dynamic hybrid execution model for all embedded device firmware, facilitating efficient multi-state simulation operations of the device firmware.
嵌入式设备通电开机后会首先执行启动自检过程,启动自检过程根据功能领域不同可划分为设备硬件初始化和用户自定义的启动自检操作两部分。其中硬件初始化过程由设备的启动文件定义,该文件通常由硬件厂商或是集成开发环境(Integrated Development Environment,IDE)提供,在设备重启时启动文件会引导设备依次完成屏蔽所有中断、复制.data段内容到RAM、初始化.bss段、初始化栈内存空间和栈寄存器、调用main函数等操作。硬件初始化过程调用main函数后,控制权转移到用户代码,用户进行一些自定义的初始化过程,设置设备外设状态,检查外设可用性等操作。
The 2023 IOT Security Landscape Report[EB/OL]. (2023-12-11)[2024-10-11].
[2]
BELLARDF. QEMU, a fast and portable dynamic translator[C]∥Proceedings of the USENIX annual technical conference. Berkeley, USA: USENIX Association, 2005:41-46.
[3]
CHEND D, EGELEM, WOO M, et al. Towards automated dynamic analysis for linux-based embedded firmware[C]∥Proceedings of the 2016 Network and Distributed System Security Symposium. San Diego, USA: Internet Society, 2016. DOI:10.14722/ndss.2016.23415 .
GUSTAFSONE, MUENCHM, SPENSKYC, et al. Toward the analysis of embedded firmware through automated re-hosting[C]∥Proceedings of the RAID 2019. Chaoyang District. Berkeley, USA: USENIX, 2019:135-150.
[10]
FENGB, MERAA, LUL. P2IM: scalable and hardware-independent firmware testing via automatic peripheral interface modeling[C]∥Proceedings of the 29th USENIX Security Symposium. Berkeley, USA: USENIX, 2020:1237-1254.
[11]
CAOC, GUANL, MINGJ, et al. Device-agnostic firmware execution is possible: a concolic execution approach for peripheral emulation[C]∥Proceedings of the Annual Computer Security Applications Conference. New York, USA: ACM, 2020:746-759.
[12]
JOHNSONE, BLANDM, ZHUY F, et al. Jetset: targeted firmware rehosting for embedded systems[C]∥Proceedings of the 30th USENIX Security Symposium. Berkeley, USA: USENIX, 2021:321-338.
MAK K, PHANG KYIT, FOSTERJ S, et al. Directed symbolic execution[C]∥Proceedings of the 18th International Coference on Static Analysis. Berlin, Germany: Springer, 2011:95-111.
[15]
ZADDACHJ, BRUNOL, FRANCILLONA, et al. Avatar: a framework to support dynamic security analysis of embedded systems’ firmwares[C]∥Proceedings of the 2014 Network and Distributed System Security Symposium. San Diego,USA: Internet Society, 2014:1-16.
[16]
SHOSHITAISHVILIY, WANGR Y, SALLSC, et al. SOK:(state of) the art of war: offensive techniques in binary analysis[C]∥Proceedings of the 2016 IEEE Symposium on Security and Privacy. Piscataway, USA: IEEE, 2016:138-157.
[17]
MUENCHM, NISID, FRANCILLONA, et al. Avatar2: a multi-target orchestration platform[C]∥Proceedings of the 2018 Workshop on Binary Analysis Research. San Diego, USA: Internet Society, 2018:1-11.