Skip to main content
QUICK REVIEW

[论文解读] DICE: Automatic Emulation of DMA Input Channels for Dynamic Firmware Analysis

Alejandro Mera, Bo Feng|arXiv (Cornell University)|Jul 3, 2020
Advanced Malware Detection Techniques参考文献 21被引用 6
一句话总结

DICE 是一种与硬件无关、与分析器无关的框架,可在动态分析期间自动识别并模拟嵌入式固件中的 DMA 输入通道,从而在无需源代码或硬件的情况下实现完整代码覆盖率和漏洞检测。它实现了 89% 的 DMA 通道真实阳性检测率,并在真实固件中将代码路径覆盖率最高提升 79 倍,发现了 5 个此前未知的新漏洞。

ABSTRACT

Microcontroller-based embedded devices are at the core of Internet-of-Things and Cyber-Physical Systems. The security of these devices is of paramount importance. Among the approaches to securing embedded devices, dynamic firmware analysis gained great attention lately, thanks to its offline nature and low false-positive rates. However, regardless of the analysis and emulation techniques used, existing dynamic firmware analyzers share a major limitation, namely the inability to handle firmware using DMA. It severely limits the types of devices supported and firmware code coverage. We present DICE, a drop-in solution for firmware analyzers to emulate DMA input channels and generate or manipulate DMA inputs. DICE is designed to be hardware-independent, and compatible with common MCU firmware and embedded architectures. DICE identifies DMA input channels as the firmware writes the source and destination DMA transfer pointers into the DMA controller. Then DICE manipulates the input transferred through DMA on behalf of the firmware analyzer. We integrated DICE to the firmware analyzer P2IM (Cortex-M architecture) and a PIC32 emulator (MIPS M4K/M-Class architecture). We evaluated it on 83 benchmarks and sample firmware, representing 9 different DMA controllers from 5 different vendors. DICE detected 33 out of 37 DMA input channels, with 0 false positives. It correctly supplied DMA inputs to 21 out of 22 DMA buffers, which previous firmware analyzers cannot achieve due to the lack of DMA emulation. DICE's overhead is fairly low, it adds 3.4% on average to P2IM execution time. We also fuzz-tested 7 real-world firmware using DICE and compared the results with the original P2IM. DICE uncovered tremendously more execution paths (as much as 79X) and found 5 unique previously-unknown bugs that are unreachable without DMA emulation. All our source code and dataset are publicly available.

研究动机与目标

  • 为解决现有动态固件分析工具在处理基于 DMA 的输入通道时存在的关键局限性。
  • 在无需固件源代码或硬件依赖的情况下,实现对支持 DMA 的 MCU 固件的完整代码覆盖率和漏洞检测。
  • 设计一种通用的、与硬件无关的解决方案,兼容多种嵌入式架构和 DMA 控制器。
  • 作为即插即用模块,与现有固件分析器无缝集成,实现自动 DMA 输入模拟。
  • 在模拟过程中动态检测并提供有效的 DMA 输入,确保固件执行正确进行。

提出的方法

  • DICE 通过监控固件对 DMA 控制器寄存器的写入操作来识别 DMA 输入通道,特别是源和目标传输指针。
  • 它通过分析这些寄存器写入操作,动态推断出用于 DMA 传输的内存缓冲区位置和大小。
  • 该框架代表固件分析器模拟 DMA 输入数据,向内存缓冲区提供有效数据,如同由真实外设写入一般。
  • DICE 不修改固件,也无需源代码,因此可与任何固件分析器和嵌入式架构兼容。
  • 它与现有模拟器(如 P 2 IM 和 MIPS PIC32 模拟器)集成,提供透明的 DMA 输入支持。
  • 系统使用运行时插桩技术,在固件执行过程中检测 DMA 配置和数据传输事件。

实验结果

研究问题

  • RQ1能否设计一种通用的、与硬件无关的框架,在无需源代码的情况下自动检测并模拟嵌入式固件中的 DMA 输入通道?
  • RQ2此类框架在固件执行过程中,对动态配置的 DMA 缓冲区的识别准确度如何?
  • RQ3将 DMA 模拟集成到现有固件分析流水线中,其性能开销如何?
  • RQ4DMA 模拟在多大程度上提升了真实固件中的代码路径覆盖率和漏洞检测能力?
  • RQ5该框架能否发现以往分析器因缺乏 DMA 模拟而无法触及的、存在于依赖 DMA 的固件中的未知漏洞?

主要发现

  • 在 83 个基准测试和样本固件中,DICE 检测到 37 个 DMA 输入通道中的 33 个,实现 0% 的误报率和 89% 的真正阳性率。
  • 它成功向固件实际使用的 22 个 DMA 缓冲区中的 21 个提供了正确的 DMA 输入,使此前无法执行的代码路径得以运行。
  • 将 DICE 集成到 P 2 IM 后,平均运行时开销仅为 3.4%。
  • 在真实固件模糊测试中,与原始 P 2 IM(无 DMA 支持)相比,DICE 将代码路径覆盖率最高提升了 79 倍。
  • DICE 在真实固件中发现了 5 个独特且此前未知的漏洞,这些漏洞因缺乏 DMA 模拟而无法被先前的分析器发现。
  • 所有源代码和数据集均已公开,支持可复现性及固件分析领域的进一步研究。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。