CodeSurfer / x86 A Platform for Analyzing x86 Executables

18
Gogul Balakrishnan, Radu Gruian and Thomas Reps Computer Science Dept., Univ. of Wisconsin GrammaTech, Inc. April, 2005 CodeSurfer / x86 A Platform for Analyzing x86 Executables 1

description

CodeSurfer / x86 A Platform for Analyzing x86 Executables. Gogul Balakrishnan , Radu Gruian and Thomas Reps Computer Science Dept., Univ. of Wisconsin GrammaTech , Inc. April, 2005. Contents. Introduction CodeSurfer / x86 Architecture CodeSurfer / x86 Facilities - PowerPoint PPT Presentation

Transcript of CodeSurfer / x86 A Platform for Analyzing x86 Executables

Page 1: CodeSurfer / x86 A Platform for Analyzing x86 Executables

Gogul Balakrishnan, Radu Gruian

and Thomas RepsComputer Science Dept., Univ. of

WisconsinGrammaTech, Inc.

April, 2005

CodeSurfer / x86A Platform for Analyzing x86

Executables

1

Page 2: CodeSurfer / x86 A Platform for Analyzing x86 Executables

ContentsIntroductionCodeSurfer / x86 ArchitectureCodeSurfer / x86 FacilitiesCodeSurfer / x86 LimitationsRecent Work

2

Page 3: CodeSurfer / x86 A Platform for Analyzing x86 Executables

Introduction

3

MotivationEnsuring that 3rd-party applications do not

perform malicious operationsIssues

Symbol-table and debugging information is either absent

No abstract location information (variables)Existing binary analysis tools are not capable

of dealing with these issues

Page 4: CodeSurfer / x86 A Platform for Analyzing x86 Executables

Introduction

4

CodeSurferProgram analysis and inspection toolProgramming API is bundled with the

CodeSurfer programmable package

Page 5: CodeSurfer / x86 A Platform for Analyzing x86 Executables

Introduction

IDAProPowerful and commercial disassemby toolkitProvide APIs for its internal plug-ins

5

Page 6: CodeSurfer / x86 A Platform for Analyzing x86 Executables

Introduction

6

CodeSurfer / x86Prototype system for analyzing x86

executablesCombine Value-Set Analysis(VSA) with

facilities provided by the IDAPro and CodeSurfer toolkits

Recover Intermediate Representations(IR) of programs using VSA

Provide a platform for investigating the properties and behaviors of potentially malicious code

Page 7: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Architecture

7

Overall Architecture

Page 8: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Architecture

8

Value-set Analysis(VSA)Purpose

Over-approximate possible range of values at each program point each memory Location(registers, stack...) might store

DescriptionSeparate address space into a set of disjoint areasMemory Locations are represented as a-locs

Ex) EAX -> ( ㅗ , 4[0, 1]-20, ㅜ ) means that EAX may not contain any meaningful value in Global Environment , may have value 4 * [0, 1] – 20 + ESP in some Local Environment and be able to have any value in some other Local Environment

Page 9: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Architecture

9

IDAProInput

x86 ExecutableProcess

Disassemble x86 binary executableAnalyze static information

OutputAssembly codeControl Flow Graphs(CFGs)Procedure boundariesStatically known memory addresses and offsets

Page 10: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Architecture

10

Connector – ParsingProcess

Parse input data into connector’s data structures for VSA

OutputParsed Data which keeps whole information intact

Page 11: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Architecture

11

Connector – AbstractionProcess

Value-set Analysis – a-locsOutput

Parsed Data with Abstract Information including a-locs with value-sets

Page 12: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Architecture

12

Connector – AugmentationProcess

Augment incomplete(indirect jumps, indirect calls) call graph and CFGs using each program point’s a-locs and value-sets

OutputCode Surfer compatible format data(IRs)

Page 13: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Architecture

13

CodeSurferInput

Code Surfer compatible format DataOutput

Collection of IRs, consisting of Abstract Syntax Tree, CFGs, call graph, System Dependence Graph(SDG)

Page 14: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Architecture

14

Overall Architecture (revisit)

Page 15: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Facilities

15

Standard Compilation Model CheckCheckpoints

Runtime StackSelf-modificationSeparation of Program’s Data

If it cannot be confirmed that the executable conforms to the model, then the IR is possibly incorrect

Page 16: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Facilities

16

CodeSurfer’s GUISDG Browser

CodeSurfer’s APIAccess lower-level information

individual nodes and edges of the program’s SDGCall graphCFGs

Conjunction with GrammaTech’s Path InspectorDetect possibly problematic paths

Page 17: CodeSurfer / x86 A Platform for Analyzing x86 Executables

CodeSurfer / x86 Limitations

17

LimitationsDynamically Determined Information

IDAPro and VSA cannot fully recover dynamically determined information such as heap-allocated data, indirect calls, and indirect jumps

Complex Data StructureRecover only very coarse information about arraysValue-sets are only suitable for congruence,

contiguous data structure

Page 18: CodeSurfer / x86 A Platform for Analyzing x86 Executables

Recent Work

18