Skip to main content
QUICK REVIEW

[论文解读] Automatic Heap Layout Manipulation for Exploitation

Sean Heelan, Tom Melham|arXiv (Cornell University)|Apr 23, 2018
Security and Verification in Computing参考文献 11被引用 10
一句话总结

本文提出了首个用于利用堆缓冲区溢出漏洞的堆布局操纵(HLM)自动化方法,采用伪随机黑盒搜索生成输入,以定位脆弱缓冲区相对于目标数据结构的位置。作者提出了Shrike系统,通过组合代码片段自动在PHP解释器中实现HLM,从而在极少人工干预的情况下实现控制流劫持攻击。

ABSTRACT

Heap layout manipulation is integral to exploiting heap-based memory corruption vulnerabilities. In this paper we present the first automatic approach to the problem, based on pseudo-random black-box search. Our approach searches for the inputs required to place the source of a heap-based buffer overflow or underflow next to heap-allocated objects that an exploit developer, or automatic exploit generation system, wishes to read or corrupt. We present a framework for benchmarking heap layout manipulation algorithms, and use it to evaluate our approach on several real-world allocators, showing that pseudo-random black box search can be highly effective. We then present SHRIKE, a novel system that can perform automatic heap layout manipulation on the PHP interpreter and can be used in the construction of control-flow hijacking exploits. Starting from PHP's regression tests, SHRIKE discovers fragments of PHP code that interact with the interpreter's heap in useful ways, such as making allocations and deallocations of particular sizes, or allocating objects containing sensitive data, such as pointers. SHRIKE then uses our search algorithm to piece together these fragments into programs, searching for one that achieves a desired heap layout. SHRIKE allows an exploit developer to focus on the higher level concepts in an exploit, and to defer the resolution of heap layout constraints to SHRIKE. We demonstrate this by using SHRIKE in the construction of a control-flow hijacking exploit for the PHP interpreter.

研究动机与目标

  • 解决在利用基于堆的内存损坏漏洞时堆布局操纵(HLM)缺乏自动化的问题。
  • 克服堆分配器不提供控制内存布局的API这一挑战,需通过应用程序API间接操纵。
  • 实现自动输入生成,以达成成功利用堆边界外访问所需的具体堆布局。
  • 将HLM集成到自动化漏洞利用生成工作流中,使开发人员能够专注于高层次的漏洞利用逻辑,而将布局解析任务交由系统处理。
  • 在真实世界软件(特别是PHP解释器)上验证该方法的可行性和有效性,并使用新型基准测试框架进行评估。

提出的方法

  • 提出一种伪随机黑盒搜索算法,用于探索通过应用程序端分配和释放间接控制堆布局的输入序列。
  • 设计一个基准测试框架,用于在真实世界分配器上评估HLM算法,使用合成和真实世界的堆布局场景。
  • 实现Shrike系统,该系统从回归测试中发现并组合代码片段,生成实现目标堆布局的程序。
  • 将堆布局建模为状态转换问题,其中每个输入序列都会改变堆状态,并搜索能够达到目标配置的序列。
  • 使用符号执行和约束求解来引导搜索,生成能将源缓冲区和目标缓冲区置于期望相对位置的输入。
  • 利用已知的分配器行为(例如,最佳匹配、后进先出的空闲列表)来建模堆布局结果,从而缩小搜索空间。

实验结果

研究问题

  • RQ1伪随机黑盒搜索能否有效解决真实世界分配器的堆布局操纵问题?
  • RQ2自动输入生成在多大程度上能够实现控制流劫持所必需的精确堆布局?
  • RQ3该方法在PHP解释器等真实世界系统中是否有效,尽管其分配器行为复杂且具有非确定性?
  • RQ4Shrike这类系统能否在无需手动布局分析的情况下,自动组合代码片段以实现复杂的堆布局?
  • RQ5将HLM集成到漏洞利用开发工作流中,能否提升自动化漏洞利用生成的可行性与效率?

主要发现

  • 在合成基准测试中,伪随机黑盒搜索取得了高成功率,即使在不了解分配器内部机制的情况下也表现出有效性。
  • Shrike成功生成了在PHP解释器中实现目标堆布局的输入,从而支持构建控制流劫持攻击。
  • 该系统通过自动组合现有代码片段生成输入序列,显著减少了对手动堆布局分析的需求。
  • 在十个不同目标结构和PHP的三个子组件上的评估表明,系统在多种堆布局挑战下均表现出稳健性。
  • 该框架成功识别并利用了分配器交互(例如,按大小分配)以实现精确的布局控制。
  • 该方法可成功集成到自动化漏洞利用生成工作流中,使开发人员能够专注于逻辑设计,而Shrike负责解决布局约束。

更好的研究,从现在开始

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

无需绑定信用卡

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