Towards Automatic Generation of Vulnerability- Based Signatures

Similar documents
Theory and Techniques for Automatic Generation of Vulnerability-Based Signatures

Towards Practical Automatic Generation of Multipath Vulnerability Signatures

Polygraph: Automatically Generating Signatures for Polymorphic Worms

Homework 3 CS161 Computer Security, Fall 2008 Assigned 10/07/08 Due 10/13/08

Tracking Pointers with Path and Context Sensitivity for Bug Detection in C Programs. {livshits,

Symbolic Execution for Bug Detection and Automated Exploit Generation

Module: Future of Secure Programming

Creating Vulnerability Signatures Using Weakest Preconditions

Bouncer: Securing Software by Blocking Bad Input

Lecture 4 September Required reading materials for this class

EURECOM 6/2/2012 SYSTEM SECURITY Σ

Buffer overflow is still one of the most common vulnerabilities being discovered and exploited in commodity software.

System Administration and Network Security

CS 330 Lecture 18. Symbol table. C scope rules. Declarations. Chapter 5 Louden Outline

Shuntaint: Emulation-based Security Testing for Formal Verification

CSE 565 Computer Security Fall 2018

Outline STRANGER. Background

Announcements. assign0 due tonight. Labs start this week. No late submissions. Very helpful for assign1

Program verification. Generalities about software Verification Model Checking. September 20, 2016

Malicious Code Analysis II

Hacking in C. Pointers. Radboud University, Nijmegen, The Netherlands. Spring 2019

Module: Future of Secure Programming

Secure Software Development: Theory and Practice

Is stack overflow still a problem?

Static Analysis Basics II

Memory Corruption 101 From Primitives to Exploit

CMPSC 497 Other Memory Vulnerabilities

Static Analysis methods and tools An industrial study. Pär Emanuelsson Ericsson AB and LiU Prof Ulf Nilsson LiU

CS 61C: Great Ideas in Computer Architecture C Pointers. Instructors: Vladimir Stojanovic & Nicholas Weaver

COS 320. Compiling Techniques

Assignment 4: Semantics

Finding Vulnerabilities in Web Applications

EURECOM 6/2/2012 SYSTEM SECURITY Σ

Module: Program Vulnerabilities. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

C and C++ Secure Coding 4-day course. Syllabus

CSE 565 Computer Security Fall 2018

Module: Program Vulnerabilities. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

Advanced Systems Security: Control-Flow Integrity

Bouncer: Securing Software by Blocking Bad Input

Secure Programming. An introduction to Splint. Informatics and Mathematical Modelling Technical University of Denmark E

Sendmail crackaddr - Static Analysis strikes back

Finding User/Kernel Pointer Bugs with Type Inference p.1

COMP 524 Spring 2018 Midterm Thursday, March 1

Secure Programming I. Steven M. Bellovin September 28,

Detecting Self-Mutating Malware Using Control-Flow Graph Matching

Information Flow Analysis and Type Systems for Secure C Language (VITC Project) Jun FURUSE. The University of Tokyo

The Low-Level Bounded Model Checker LLBMC

Buffer overflow prevention, and other attacks

K-Miner Uncovering Memory Corruption in Linux

Inception: System-Wide Security Testing of Real- World Embedded Systems Software Nassim Corteggiani (Maxim Integrated / EURECOM) Giovanni Camurati

CIS 551 / TCOM 401 Computer and Network Security. Spring 2007 Lecture 2

Confinement (Running Untrusted Programs)

Automated Signature Generation: Overview and the NoAH Approach. Bernhard Tellenbach

Using Static Code Analysis to Find Bugs Before They Become Failures

Module: Program Vulnerabilities. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

Advanced Systems Security: Ordinary Operating Systems

Java Security HotJava to Netscape and Beyond

Programming Languages and Compilers Qualifying Examination. Answer 4 of 6 questions.

Static Code Analysis - CERT C Secure Code Checking

Pierce Ch. 3, 8, 11, 15. Type Systems

Preventing Use-after-free with Dangling Pointers Nullification

Topics in Systems and Program Security

Application of Propositional Logic II - How to Test/Verify my C program? Moonzoo Kim

MWR InfoSecurity Security Advisory. IBM WebSphere MQ - rrilookupget Remote Denial of Service Vulnerability. 4th March 2010

Outline. Classic races: files in /tmp. Race conditions. TOCTTOU example. TOCTTOU gaps. Vulnerabilities in OS interaction

Specification and verification of a simple machine

Memory Corruption Vulnerabilities, Part II

Buffer Overflow. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

CS-527 Software Security

Protection and Mitigation of Software Bug Exploitation

typedef void (*type_fp)(void); int a(char *s) { type_fp hf = (type_fp)(&happy_function); char buf[16]; strncpy(buf, s, 18); (*hf)(); return 0; }

Static Analysis: Overview, Syntactic Analysis and Abstract Interpretation TDDC90: Software Security

Analysis of Software Vulnerability

Buffer Overflow. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Undefined Behaviour in C

A program execution is memory safe so long as memory access errors never occur:

Limits of Learning-based Signature Generation with Adversaries

Advanced Systems Security: Ordinary Operating Systems

CSE 509: Computer Security

1.1 For Fun and Profit. 1.2 Common Techniques. My Preferred Techniques

Scaling CQUAL to millions of lines of code and millions of users p.1

Software and Web Security 1. Root Cause Analysis. Abstractions Assumptions Trust. sws1 1

Low level security. Andrew Ruef

Structuring an Abstract Interpreter through Value and State Abstractions: EVA, an Evolved Value Analysis for Frama C

Baggy bounds with LLVM

Stack Overflow COMP620

Heap, Variables, References, and Garbage. CS152. Chris Pollett. Oct. 13, 2008.

ShieldGen: Automatic Data Patch Generation for Unknown Vulnerabilities with Informed Probing

Computer Security Course. Midterm Review

12 th January MWR InfoSecurity Security Advisory. WebSphere MQ xcsgetmem Heap Overflow Vulnerability. Contents

Simple Overflow. #include <stdio.h> int main(void){ unsigned int num = 0xffffffff;

Language Security. Lecture 40

Polymorphic Blending Attacks. Slides by Jelena Mirkovic

Today Program Analysis for finding bugs, especially security bugs problem specification motivation approaches remaining issues

CS161 Midterm 1 Review

Buffer overflow background

CS527 Software Security

Computer Security. Robust and secure programming in C. Marius Minea. 12 October 2017

SentinelOne Technical Brief

Towards automated detection of buffer overrun vulnerabilities: a first step. NDSS 2000 Feb 3, 2000

Transcription:

Towards Automatic Generation of Vulnerability- Based Signatures David Brumley, James Newsome, Dawn Song, Hao Wang, and Somesh Jha (presented by Boniface Hicks) Systems and Internet Infrastructure Security Laboratory (SIIS) 1

Beware the LION New year 2001 10,000 systems affected invades Linux systems through a network exploit infiltrates BIND DNS through TCP or UDP protocol allows infiltration through a legit request, but then can execute arbitrary commands through additional string of characters. incident report March 30 by CERT Systems and Internet Infrastructure Security Laboratory (SIIS) 2

3 Vulnerability vulnerability - type of bug that can be used by an attacker to alter the intended operation of software in a malicious way exploit - an actual input that triggers a devastating consequence (these can be polymorphic)

4 Overview Goal: automatic signature generation Challenges: polymorphism vulnerability-based (not exploit-based) Approach: vulnerability signature: whether executing an input potentially results in an unsafe program state vulnerability condition: representation (how to express a vulnerability as a signature) coverage (measured by false positive rate)

5 Contributions requires single sample exploit to identify vulnerability formal definition of vulnerability signature expose trade-off between matching time and accuracy notion of coverage introduced manual control of introducing imprecision new static analysis techniques and novel application prototype implementation handles COTS binaries

6 Vulnerability signature vulnerability signature - representation for set of inputs that define a specified vulnerability condition trade-offs: representation: matching accuracy vs. efficiency signature creation: creation time vs. coverage {P,T,x,c} = binary program (P), instruction trace (T), exploit string (x), vulnerability condition (c).

7 Example P given in box x = g/aaaa T= {1,2,3,4,6,7,8,9,8, 10,11,10,11,10,11, 10,11,10,11} c = heap overflow (on 5th iteration of line 11) 1 char geturl (char inp[10]) { 2 char *url = malloc(4); 3 int c = 0; 4 if (inp[c]!= g && inp[c]!= G ) 5 return NULL; 6 inp[c] = G ; 7 c++; 8 while (inp[c] == ) 9 c++; 10 while (inp[c]!= ) { 11 url = inp[c]; c++; url++; 12 } 13 printf( %s, url); 14 return url; 15}

8 Vulnerability sig notation (P,c) = (< i 1,...,i k >,c) T(P,x) is the execution trace of running P with input x. T c means T satisfies vulnerability condition c LP,c consists of the set of all inputs x to a program P such that Formally: T (P,x) c L P,c = {x Σ T (P,x) c} An exploit for a vulnerability (P,c) is an input x L P,c

9 Vulnerability sig definition A vulnerability signature is a matching function MATCH which for an input x returns either EXPLOIT or BENIGN for a program P without running the program. A perfect vulnerability signature satisfies: MATCH(x) = { EXPLOIT when x L P,c BENIGN when x L P,c completeness: x : x L P,c MATCH(x) = EXPLOIT soundness: x : x L P,c MATCH(x) = BENIGN

10 Vulnerability Condition c : Γ D M K I {BENIGN, EXPLOIT} Γ is a memory D is the set of variables defined M is the program s map from memory to values K is the continuation stack I is the next instruction to execute

11 Example Formal operational semantics definition of the vulnerability in the example: Γ,D,M,K *exp D,M,K exp Γ[n SafePtr(m,s)],D,M : [n v n ],K n { BENIGN if m n < m + s EXPLOIT 1. In order to dereference a pointer *exp, exp must first be evaluated. 2. Once exp is resolved to address n, get a safe pointer to n, (with base address m, size s) and check whether it s in the specified range.

12 Sig representation classes Turing machine signatures precise (no false positive or negatives) may not terminate (in presence of loops, e.g.) symbolic constraint signatures approximates looping, aliasing guaranteed to terminate regular expression signatures approximates elementary constructs (counting) very efficient

13 Turing Machine sig Can provide a precise, even exact, characterization of the vulnerability condition in a particular program. A TM that exactly emulates the program has no error rate.

14 Example symbolic constraint says that for 10-char input, the first char is g or G, up to four of the next chars may be symbolic constraint sig for example spaces and at least 5 chars are non-spaces regexp: [g G][ ]*[ˆ ]{5,} says g or G followed by 0 or more spaces and at least 5 non-spaces

15 Accuracy vs. Efficiency TM - inlining vulnerability condition takes poly time Symb. Constraint - poly-time transformations on TM Regexp - solve constraint (exp time; PSPACEcomplete) or data-flow on TM (poly time)

16 MEP and PEP coverage MEP is a straight-line program -- e.g. the path that the exploit took to reach the vulnerability PEP includes different paths to the vulnerability a complete PEP coverage signature accepts all inputs in LP,c complete coverage through a chop of the program includes all paths from the input read (vinit) to the vulnerability point (vfinal).

17 Procedure Get MEP for exploit (e.g. T in example) Compute chop for MEP to get complete coverage Compute initial signature S refine S by adding alternative MEPs from chop Example: initial MEP is T PEP is lines {1-5, 7-12}

18 Algorithm 1. Pre-process 1. Disassemble binary 2. Convert to an intermediate representation (IR) 2. Chop P wrt trace T, develop complete PEP 3. Compute the signature 1. Compute TM signature 2. Develop symbolic constraint signature 3. Compute regular expression

19 Evaluation 9000 lines C++ code CBMC model checker to build/solve symbolic constraints, generate regexp s disassembler based on Kruegel; IR new ATPhttpd various vulnerabilities; sprintf-style string too long 10 distinct subpaths to regexp in 0.1216sec BIND stack overflow vulnerability; TSIG vulnerability 10 distinct graphs in symbolic constraint 30 micro-secs for chop 88% of functions were reachable between entry and vulnerability

20