Towards Automatic Software Lineage Inference

Towards Automatic Software Lineage Inference

Towards Automatic Software Lineage Inference Abstract—Software continuously evolves to reflect changing and Linux kernel [10] in order to verify Lehman’s laws of requirements, feature updates, and bug fixes. Most existing software evolutions and to understand software evolution research focuses on analyzing software release histories to process. understand the software evolution process and to describe evolutionary relationships among programs. However, there The security community has studied malicious software has been little research on inferring software lineage from (malware) evolution based upon the observation that the (binary) programs. majority of incoming malware are tweaked variants of well- In this paper, we take a systematic approach towards soft- known malware [4, 12, 13]. With over 1.1 million malware ware lineage inference. We explore three fundamental questions appearing in one day [2], researchers have studied such evo- not addressed by existing work. First, how do we measure the quality of a lineage inference algorithm? Second, given existing lutionary relationships to identify new variants of previously- approaches to binary similarity analysis, how good are they for analyzed malware [8], to understand the diversity of exploits lineage both currently and in an idealized setting? Third, what used by notorious worms [20], and to generate phylogeny are the challenging problems in software lineage inference? models to describe derivation relationships among programs Towards these goals we build LIMetric—a system for automatic as a dendrogram [14, 15]. software lineage inference of binary programs. We evaluated LIMetric on two types of lineage—straight line lineage and The task of software lineage inference is to infer a tem- directed acyclic graph (DAG) lineage. We have also extended poral ordering and ancestor/descendant relationships among our technique to handle multiple straight line lineages. Our programs. Software lineage can be defined as follows: experiments used large scale real-world programs, with a total of 1,777 releases spanning over a combined 110 years of Definition I.1. A lineage graph G = (N; A) is a directed development history. In order to quantify lineage quality, we acyclic graph (DAG) comprising a set of nodes N and a set propose four metrics: (i) number of inversions and (ii) edit of arcs A. A node n 2 N represents a program, and an arc distance to monotonicity for straight line lineage, and (iii) a = (x; y) 2 A denotes that program y is a derivative of number of lowest common ancestor (LCA) mismatches and (iv) average pairwise distance to true LCA for DAG lineage. program x. We say that x is a predecessor of y and y is a LIMetric effectively extracted software derivation relationships successor of x. among binary programs with high accuracy. Through close root case analysis, we also formulate several challenging problems We define some terminology. A is a node that has no in software lineage inference that need to be addressed to attain incoming arc and a leaf is a node that has no outgoing arc. even higher accuracy. Since a DAG can have multiple roots, we introduce a new Keywords-software evolution, software lineage, systematic node called the super root and add a new arc from it to every evaluation root. A DAG that has been augmented in this way is called a super DAG. Note that a root in a super DAG has exactly one I. INTRODUCTION incoming arc from the super root. An ancestor of a node n is Software evolves to adapt to changing needs, bug fixes, a node that can reach n. Note that n is an ancestor of itself. and feature requests [18]. The lineage of software through its A common ancestor of x and y is the intersection of the evolution provides a potentially rich source of information two sets of ancestors. In a DAG, a lowest common ancestor for a number of security questions. For example, given a (LCA) of two nodes x and y is a common ancestor of x collection of malware variants, which malware came first? and y that is not an ancestor to another common ancestor Given a collection of binaries in forensics, are any of of x and y [6]. Notice that there can be multiple LCAs. We them derived from the others? These kinds of questions are denote the set of LCAs of x and y as SLCA(x; y). important enough that the US Defense Advanced Research In this paper, we ask three basic research questions: Projects Agency (DARPA) is spending $43 million to study • What are good metrics? Existing research focused on them [1]. Unfortunately, existing work has primarily focused building phylogeny of malware [14, 15], but has lacked on analyzing known lineage, not inferring lineage. For exam- quality metrics to scientifically measure the quality of ple, Belady and Lehman studied software evolution of IBM their output. OS/360 [5], and Lehman and Ramil formulated eight laws Good metrics are necessary to assess how good our describing software evolution process [18]: 1) continuing approach is with respect to the ground truth. Good change, 2) increasing complexity, 3) self regulation, 4) metrics also allow us to quantify the quality of our conservation of organisational stability, 5) conservation of output, and to compare different approaches. familiarity, 6) continuing growth, 7) declining quality, and • How well are we doing now? We would like to 8) feedback system. With a wealth of release information understand what are the limits of existing techniques such as release dates and program versions, researchers have even in ideal cases, meaning we have 1) control over analyzed histories of open source projects [28], Firefox [21], variables affecting the compilation of programs such Contiguous Revisions Released Versions Released Binaries DAG-like Revisions Software Lineage Inference Datasets 3 Datasets 1 Straight Line Lineage DAG Lineage Features 9 Root Revision 2 Features 1 Root Revision 2 Timestamp 3 Section Size n-grams Inferred Root Hybrid Inferred Root No Timestamp File Size Real Root Real Root Pseudo Timestamp Cyclomatic Complexity Real Timestamp Disassembly Instructions Mnemonics with operands types Quality Metrics 2 Quality Metrics 2 Normalized Mnemonics Sorted Normalized Mnemonics Number of Inversions Number of LCA Mismatches Hybrid Edit Distance to Monotonicity Average Distance to True LCA Figure 1: Design space in software lineage inference as compiler versions and optimization options so that addition, we extend our approach for straight line lineage to binary code compiled from similar source code would k-straight line lineage. be similar, 2) reliable feature extraction techniques • Four metrics to measure quality. We propose two to abstract binary programs accurately and precisely, metrics for straight line lineage: number of inversions which is not always guaranteed due to the difficulty of and edit distance to monotonicity. Given an inferred disassembling, and 3) the ground truth with which we graph G and the ground truth G∗, the number of can compare our results to measure accuracy and to inversions measures how often we get the question spot error cases. “which one of program pi and program pj comes first” Although previous approaches have focused on mal- wrong. The edit distance to monotonicity asks “how ware, we argue that it is necessary to first system- many nodes do we need to remove in G such that the atically validate a lineage inference technique with remaining nodes are in sorted order and thus respect “goodware”, e.g., open source projects. Since malware G∗”. is often surreptitiously developed by adversaries, it is We also propose two metrics for DAG lineage: number hard or even impossible to obtain the ground truth. of LCA mismatches and average pairwise distance to Furthermore, we cannot hope to understand evolution true LCA. An LCA mismatch is a generalized version of on adversarial programs unless we first understand an inversion because the LCA of two nodes in a straight limits of our approach without an adversary. To the best line is the earlier node. In case we have a wrong LCA, of our knowledge, no systematic experiment addressing we also measure the average pairwise distance between all the variables has been done before. the true LCA(s) and the derived LCA(s) in G∗. This • What are the challenging problems? We need to detailed measurement is desirable because it often helps identify challenging problems in order to improve soft- us to decide which of methods is better even when their ware lineage inference techniques. We should evaluate LCA scores are the same. with an eye towards uncovering fundamental limits or • Large scale systematic evaluation. We systematically problems. Previous work has not addressed this. evaluated LIMetric with goodware that we have ground In this paper, we propose techniques and metrics for the truth. For straight line lineage, we collected three kinds systematic investigation on software lineage as described of datasets: 1) contiguous revisions from a version in Figure1. We explore two types of lineage: straight control system with highly varying time gap between line lineage and directed acyclic graph (DAG) lineage. In adjacent commits (<10 minutes to over a month)— 371 revisions from 3 programs representing 4 years from the difficulty of getting precise disassembly outputs of combined history, 2) released versions distributed to from binary programs [17, 19]. In order to exclude the end users, meaning that experimental features that con- errors introduced at the feature extraction step and focus on tiguous revisions may have are excluded—271 releases evaluating the performance of a software lineage inference from 5 programs representing 55 years of combined algorithm, we also leverage assembly obtained using gcc history, and 3) actual released binary programs from -S (not source code itself) to obtain basic blocks more deb or rpm package files where we do not have accurately.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    16 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us