通过受控静态循环分析将协议格式提取为状态机
Extracting Protocol Format as State Machine via Controlled Static Loop Analysis
AI总结:
本文提出一种受控静态循环分析方法,将协议解析循环提取为状态机,从而高精度、高覆盖率地逆向协议消息格式,并显著提升协议模糊测试的覆盖率与零日漏洞发现能力。
摘要:
协议消息格式的逆向工程对许多安全应用至关重要。主流技术使用动态分析,并继承了其低覆盖率问题——推断出的消息格式仅反映其输入的特征。为了实现高覆盖率,我们选择使用静态分析从协议解析器的实现中推断消息格式。在这项工作中,我们关注一类极具挑战性的协议,其格式通过约束增强的正则表达式描述,并使用有限状态机进行解析。此类状态机通常被实现为复杂的解析循环,使用传统静态分析本质上难以分析。我们的新技术通过将每次循环迭代视为一个状态,并将循环迭代之间的依赖关系视为状态转移,来提取状态机。为了实现高精度(即路径敏感)但避免路径爆炸,分析被控制为基于精心设计的规则尽可能多地合并路径。评估结果表明,我们可以在五分钟内推断出状态机,从而推断出消息格式,精确率和召回率均超过90%,远优于现有最先进技术。我们还将状态机应用于增强协议模糊测试器,在覆盖率方面提升了20%至230%,并且与基线相比检测到多十个零日漏洞。
英文摘要:
Reverse engineering of protocol message formats is critical for many security applications. Mainstream techniques use dynamic analysis and inherit its low-coverage problem -- the inferred message formats only reflect the features of their inputs. To achieve high coverage, we choose to use static analysis to infer message formats from the implementation of protocol parsers. In this work, we focus on a class of extremely challenging protocols whose formats are described via constraint-enhanced regular expressions and parsed using finite-state machines. Such state machines are often implemented as complicated parsing loops, which are inherently difficult to analyze via conventional static analysis. Our new technique extracts a state machine by regarding each loop iteration as a state and the dependency between loop iterations as state transitions. To achieve high, i.e., path-sensitive, precision but avoid path explosion, the analysis is controlled to merge as many paths as possible based on carefully-designed rules. The evaluation results show that we can infer a state machine and, thus, the message formats, in five minutes with over 90% precision and recall, far better than state of the art. We also applied the state machines to enhance protocol fuzzers, which are improved by 20% to 230% in terms of coverage and detect ten more zero-days compared to baselines.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。