Transcript
Page 1: Binary Context-Sensitive Recognizer (BCSR)

Binary Context-Sensitive Recognizer (BCSR)

Hong Pham

December 4, 2007

Page 2: Binary Context-Sensitive Recognizer (BCSR)

Motivation

Virus Signatures Database of hexadecimals Definitive registers

Alter the registers and it is another signature

Page 3: Binary Context-Sensitive Recognizer (BCSR)

Register Manipulation

Different registers give different signatures

Page 4: Binary Context-Sensitive Recognizer (BCSR)

BCSR

Program generator to recognize context-sensitive binary signatures

General representation of signatures, not dependent on registers

The signatures are specified by the user in the source specification

Page 5: Binary Context-Sensitive Recognizer (BCSR)

Source Specification

A signature Binary signature actions

Variable construct [name, size, values] Global / Local

Ambiguous source rules

{definitions}

%%

{rules}

%%

{user subroutines}

Page 6: Binary Context-Sensitive Recognizer (BCSR)

Example

89 c3: mov %eax, %ebx

FF c3: inc %ebx

75 f2: jne 58942345

Page 7: Binary Context-Sensitive Recognizer (BCSR)

Example

89 c3: mov %eax, %ebx

FF c3: inc %ebx

75 f2: jne 58942345

mov %eax, $1

inc $1

jne $2

Page 8: Binary Context-Sensitive Recognizer (BCSR)

Example

89 c3: mov %eax, %ebxFF c3: inc %ebx75 f2: jne 58942345

mov %eax, $1inc $1jne $2

%%1000 1001 1100 0 [a, 3, *]1111 1111 1100 0 [a]0111 0101 [b, 8, *] {}

Page 9: Binary Context-Sensitive Recognizer (BCSR)

BCSR Process

int bcsr_scan( char* addr, int num_bits )

Page 10: Binary Context-Sensitive Recognizer (BCSR)

Strata

Software dynamic translator

Fragment creation Conditional or indirect

control transfer trampoline

Page 11: Binary Context-Sensitive Recognizer (BCSR)

Experiments

Protocol Scanning Strata fragments Spec Int Benchmarks Red Hat Linux X86_64

Statistics Overhead

Page 12: Binary Context-Sensitive Recognizer (BCSR)

Results

???

Page 13: Binary Context-Sensitive Recognizer (BCSR)

Issue 1

Specs are too general !!!

Page 14: Binary Context-Sensitive Recognizer (BCSR)

Issue 1

Specs are too general !!!

Signature

pop %eax

push %ecx

add %eax, %ebx

add %ecx, %eax

push %ecx

Page 15: Binary Context-Sensitive Recognizer (BCSR)

Issue 1

Specs are too general !!!

Signature

pop %eax

push %ecx

add %eax, %ebx

add %ecx, %eax

push %ecx

pop $1

push $2

add $1, %ebx

add $2, $1

push $2

Page 16: Binary Context-Sensitive Recognizer (BCSR)

Issue 1

Specs are too general !!!

Signature

pop %eax

push %ecx

add %eax, %ebx

add %ecx, %eax

push %ecx

pop $1push $2add $1, %ebxadd $2, $1push $2

pop %eaxpush %eaxadd %eax, %ebxadd %eax, %eaxpush %eax

Page 17: Binary Context-Sensitive Recognizer (BCSR)

Issue 1

Specs are too general !!!

Signature

pop %eaxpush %ecxadd %eax, %ebxadd %ecx, %eaxpush %ecx

False positives

pop $1push $2add $1, %ebxadd $2, $1push $2

pop %eaxpush %eaxadd %eax, %ebxadd %eax, %eaxpush %eax

Page 18: Binary Context-Sensitive Recognizer (BCSR)

Issue 2

Multiple fragments

Page 19: Binary Context-Sensitive Recognizer (BCSR)

Issue 2

Multiple fragments

Signatures contains the following: Conditional or indirect control transfers

Page 20: Binary Context-Sensitive Recognizer (BCSR)

Issue 2

Multiple fragments

Signatures contains the following: Conditional or indirect control transfers

False negatives

Page 21: Binary Context-Sensitive Recognizer (BCSR)

Future Work

Address Issue 1 and 2

Extend the language Star, functionality, …

Symbolic code Write in assembly rather than binary

Page 22: Binary Context-Sensitive Recognizer (BCSR)

Questions??


Top Related