FlexEmu:面向灵活MCU外设仿真(扩展版)
FlexEmu: Towards Flexible MCU Peripheral Emulation (Extended Version)
AI总结:
针对MCU固件动态分析缺乏执行环境的问题,提出FlexEmu框架,通过结构基元和统一语义模型建模外设,自动生成仿真器,在90个固件样本上达到98.48%单元测试通过率,并发现10个新漏洞。
摘要:
微控制器单元(MCU)因其低功耗和高性价比而被广泛应用于嵌入式设备中。MCU固件控制这些设备,对嵌入式系统的安全至关重要。然而,由于缺乏可用的执行环境,对MCU固件进行动态安全分析仍然具有挑战性——现有的动态分析无法在物理设备上运行(例如,计算资源不足),而构建仿真器因大量异构硬件(尤其是外设)而成本高昂。\n我们的工作基于这样的洞察:MCU外设可以从两个层面进行建模。在结构层面,外设具有多样化的实现,但我们可以使用一组有限的基元来抽象外设,因为它们的硬件实现基于常见的硬件概念。在语义层面,外设具有多样化的功能。然而,我们可以使用一个统一的语义模型来描述同类外设,因为它们表现出相似的功能。基于此,我们提出了FlexEmu,一个灵活的MCU外设仿真框架。一旦创建了语义模型,FlexEmu会自动提取外设特定的细节来实例化模型,并相应地生成仿真器。我们已成功将FlexEmu应用于对12种MCU外设进行建模。我们在15个不同MCU平台上的90个固件样本上的评估表明,自动生成的仿真器能够忠实地复现硬件行为,并达到98.48%的单元测试通过率,优于现有最先进的方法。为了展示FlexEmu对固件安全的影响,我们使用生成的仿真器对三个流行的RTOS进行模糊测试,并发现了10个先前未知的漏洞。
英文摘要:
Microcontroller units (MCUs) are widely used in embedded devices due to their low power consumption and cost-effectiveness. MCU firmware controls these devices and is vital to the security of embedded systems. However, performing dynamic security analyses for MCU firmware has remained challenging due to the lack of usable execution environments -- existing dynamic analyses cannot run on physical devices (e.g., insufficient computational resources), while building emulators is costly due to the massive amount of heterogeneous hardware, especially peripherals. Our work is based on the insight that MCU peripherals can be modeled in a two-fold manner. At the structural level, peripherals have diverse implementations but we can use a limited set of primitives to abstract peripherals because their hardware implementations are based on common hardware concepts. At the semantic level, peripherals have diverse functionalities. However, we can use a single unified semantic model to describe the same kind of peripherals because they exhibit similar functionalities. Building on this, we propose FlexEmu, a flexible MCU peripheral emulation framework. Once semantic models are created, FlexEmu automatically extracts peripheral-specific details to instantiate models and generate emulators accordingly. We have successfully applied FlexEmu to model 12 kinds of MCU peripherals. Our evaluation on 90 firmware samples across 15 different MCU platforms shows that the automatically generated emulators can faithfully replicate hardware behaviors and achieve a 98.48% unit test passing rate, outperforming state-of-the-art approaches. To demonstrate the implications of FlexEmu on firmware security, we use the generated emulators to fuzz three popular RTOSes and uncover 10 previously unknown bugs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。