通过无效性引导的知识推理的自动固件仿真(扩展版)
Automatic Firmware Emulation through Invalidity-guided Knowledge Inference (Extended Version)
摘要:
由于硬件和固件之间的紧密耦合,微控制器的仿真固件具有挑战性。这极大地阻碍了动态分析工具在固件分析中的应用。这项最先进的工作通过观察未知外设的访问模式来自动对其进行建模,然后在访问未知外设寄存器时利用逻辑分析来计算相应的响应。然而,我们根据经验发现,这种方法和相应的算法通常不足以模拟固件。在这项工作中,我们提出了一种新的方法,称为uEmu模拟固件与未知的外设。与现有的工作,试图建立一个通用的模型,为每个外设,我们的方法学习如何正确地模拟固件执行在各个外设接入点。它将图像作为输入,并通过将未知的外围寄存器表示为符号来符号化地执行它。在符号执行期间,它推断规则以响应未知的外围设备访问。这些规则存储在知识库中,在动态固件分析期间参考该知识库。uEmu在一组外围设备驱动程序的单元测试中取得了95%的通过率,无需任何人工协助。我们还使用真实世界的固件样本对uEmu进行了评估,发现了新的bug。
英文摘要:
Emulating firmware for microcontrollers is challenging due to the tight coupling between the hardware and firmware. This has greatly impeded the application of dynamic analysis tools to firmware analysis. The state-of-the-art work automatically models unknown peripherals by observing their access patterns, and then leverages heuristics to calculate the appropriate responses when unknown peripheral registers are accessed. However, we empirically found that this approach and the corresponding heuristics are frequently insufficient to emulate firmware. In this work, we propose a new approach called uEmu to emulate firmware with unknown peripherals. Unlike existing work that attempts to build a general model for each peripheral, our approach learns how to correctly emulate firmware execution at individual peripheral access points. It takes the image as input and symbolically executes it by representing unknown peripheral registers as symbols. During symbolic execution, it infers the rules to respond to unknown peripheral accesses. These rules are stored in a knowledge base, which is referred to during the dynamic firmware analysis. uEmu achieved a passing rate of 95% in a set of unit tests for peripheral drivers without any manual assistance. We also evaluated uEmu with real-world firmware samples and new bugs were discovered.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。