zoukankan      html  css  js  c++  java
  • Proj THUDBFuzz Paper Reading: Static Program Analysis as a Fuzzing Aid

    Github

    https://github.com/test-pipeline/Orthrus

    Abstract

    1. Fuzzing有效、成规模
    2. 无法全面测试控制流有很大差异的应用,比如firewalls和网络包分析器
    3. 本文: 静态分析指引已有程序模型
    4. 前提:代码模式反映了输入的数据模式
      本文方法:通过分析程序控制流和数据流来自动构建input dictionary
      效果:
    5. 增加coverage 10%-15%
    6. 暴露安全隐患的速度快乐一个数量级
    7. 发现15个0-day漏洞
      实验对象:
      nDPI(packet inspection library)
      tcpdump(network packet analyzer)

    发现:
    the synergy between program analysis and testing can be exploited for a better outcome.

    1. Intro

    P1. 软件复杂、安全很难、fuzzing可用

    P2. 复杂

    P3. 为何已有的方法不能用于测试复杂的第三方网络软件:

    1. 需要用户提供数据模型或者语法说明,但只有少数的网络协议有正式说明
    2. 尽管有Prospex这种从网络trace中自动重建语法的,也只能面向单个协议
    3. 白盒方式:需要大量更改源码、还需要一定领域知识
    4. 例如:需要标出parsing函数

    P4. 本文:

    1. how the stated challenges can be addressed by augmenting fuzzing with static program analysis.
      方法:
    2. 静态分析获取字典
    3. 字典被fuzzer用于生成message fragments
    4. 为了便于部署,写了clang/llvm 插件

    P5: 工具Orthus

    2. Background

    3. Program Analysis Guided Fuzzing

    Problem Scope

    protocol specification = state machine, message format
    本文只做message format推测
    Since file formats are stateless specificat ions, our work is applicable for conducting security evaluations of file format parsers as well.

    Approach Overview

    message construct:例如字符串
    message conjunction: message constructs的连接
    特点:

    1. 无需语法说明
    2. 无需改动软件
    3. as-is to existing fuzzers

    3.1 Input Dictionary Generation

    Program Slicing

    determining the subset of program statements, or variables that process, or contain program input
    问题是确定程序语句、变量的子集
    已有方法问题:只能做小型程序单个进程的
    本文:backward program slicing
    原则:

    1. data-dependent control flow instruction
    2. data sink API(e.g strcmp), functions that accepts const arg
    3. const assignment
      好处:
    4. 与控制流、数据流相关,不会混入uninteresting
    5. 与parser写法相似

    Analysis Queries

    Syntactic Queries

    query示例
    stringLiteral(hasParent(callExpr(hasName(``strcmp'')))).
    函数查询是组合式的

    Semantic Queries

    分析上下文可以让我们更深入地了解输入消息格式。 例如,我们可能知道哪两个结构彼此结合使用,或者在涉及这些结构的语法产生规则之间是否存在偏序。
    在语义级别,查询message constructs的列表作为输入,并返回conjunctions作为输出。 语义查询是针对在程序的 CFG 上构建的context-sensitive inter-procedural graph 进行的。 每个查询都被编写为一个checker routine,它返回可以在message constructs的调用上下文中验证的conjunctions。

    3.2 Dictionary Based Fuzzing

  • 相关阅读:
    正则匹配整数或小数
    文本超出点点点
    订单页面布局
    数据库连接池 maxActive,maxIdle,maxWait参数
    dll静态调用和动态调用
    Could not open JDBC Connection for transaction; nested exception is com.alibaba.druid.pool.GetConnection
    sql server调优
    AdPlus
    010 Editor
    WinDBG相关
  • 原文地址:https://www.cnblogs.com/xuesu/p/15521709.html
Copyright © 2011-2022 走看看