从动态控制流推断输入语法
Inferring Input Grammars from Dynamic Control Flow
摘要:
程序的特征在于其输入模型,并且形式化输入模型可以用于不同的领域,包括脆弱性分析、逆向工程、模糊和软件测试、克隆检测和重构。不幸的是,典型程序的输入模型通常不可用或过时。虽然存在可以挖掘程序输入的语法结构的算法,但它们要么产生笨拙和难以理解的语法,要么需要针对特定解析模式的语法分析。在本文中,我们提出了一个通用的算法,需要一个程序和一个小的样本输入,并自动推断出一个可读的上下文无关文法捕捉输入语言的程序。我们推断的句法输入结构,只有通过观察在不同位置的输入解析器的输入字符的访问。这适用于所有基于程序堆栈的递归下降输入解析器,包括PEG和解析器组合子,并且可以完全不使用程序特定的语法。我们的Mimid原型为各种评估主题生成了准确可读的语法,包括expr、URLparse和microJSON。
英文摘要:
A program is characterized by its input model, and a formal input model can be of use in diverse areas including vulnerability analysis, reverse engineering, fuzzing and software testing, clone detection and refactoring. Unfortunately, input models for typical programs are often unavailable or out of date. While there exist algorithms that can mine the syntactical structure of program inputs, they either produce unwieldy and incomprehensible grammars, or require heuristics that target specific parsing patterns. In this paper, we present a general algorithm that takes a program and a small set of sample inputs and automatically infers a readable context-free grammar capturing the input language of the program. We infer the syntactic input structure only by observing access of input characters at different locations of the input parser. This works on all program stack based recursive descent input parsers, including PEG and parser combinators, and can do entirely without program specific heuristics. Our Mimid prototype produced accurate and readable grammars for a variety of evaluation subjects, including expr, URLparse, and microJSON.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。