Top Banner
BinRec: Attack Surface Reduction Through Dynamic Binary Recovery Taddeus Kroes, Anil Altinay, Joseph Nash, Yeoul Na, Stijn Volckaert, Herbert Bos, Michael Franz, Cristiano Giuffrida October 19, 2018
62

BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

May 29, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec: Attack Surface Reduction Through Dynamic Binary Recovery

Taddeus Kroes, Anil Altinay, Joseph Nash,Yeoul Na, Stijn Volckaert, Herbert Bos,

Michael Franz, Cristiano Giuffrida

October 19, 2018

Page 2: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Attack Surface Reduction

x = getenv(“SET_ME”);

if (x)

cold_code();

hot_code();

2

Page 3: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Attack Surface Reduction

x = getenv(“SET_ME”);

if (x)

cold_code();

hot_code();

3

Buggy features

ROP gadgets

Page 4: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Attack Surface Reduction

x = getenv(“SET_ME”);

if (x)

cold_code();

hot_code();

4

Remove unwanted features

Attack surface reduced

to well-tested code

Page 5: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Attack Surface Reduction

5

setme_str: .asciz: “SET_ME”

push setme_str

call getenv

cmp eax, 0

je main

call cold_code

main:

call hot_code

Want to work on COTS binaries

Page 6: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Static approach

Input binary

Transformed binary

6

Transform

Page 7: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Static approach

Input binary

Transformed binary

7

incompletedisassemblyPIC?obfuscated?

Transform

Page 8: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Static approach

Input binary

Transformed binary

8

incompletedisassembly

contains coldcode

PIC?obfuscated?

which code is reached?

Transform

Page 9: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Dynamic approach by BinRec

TransformInput binary

9

Transformed binary

precisedisassembly

only hot code

Execute

Page 10: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Recovery

Dynamic approach by BinRec

Input binary

Recovered binary

10

TransformExecute

Page 11: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Recovery

Dynamic approach by BinRec

Input binary

Recovered binary

11

TransformExecute

can we make this more generic?

Page 12: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec goal: complex binary transformation

Attack Surface Reduction

/Binary

rejuvenation/

Profile-guided optimization

/(De)obfuscation

/ISA retargeting

Input binary

Recovered binary

12

many applications

Execute

Page 13: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec goal: complex binary transformation

Attack Surface Reduction

/Binary

rejuvenation/

Profile-guided optimization

/(De)obfuscation

/ISA retargeting

Input binary

Recovered binary

13

many applications

requires

high-level

code!

Execute

Page 14: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Input binary

Recovered binary

Compiler IR

MachineCode

14

Execute

Transform

Page 15: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift

Input binary

Recovered binary

Compiler IR

MachineCode

15

Execute

Transform

Lower

Page 16: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift

Input binary

Recovered binary

Compiler IR

MachineCode

16

Execute

Transform

Lower

Sometimes we want more code coverage than a single code path

Page 17: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift

Input binary

Recovered binary

Compiler IR

MachineCode

17

Symbolic execution

Transform

Lower

Run with “symbolic” input and follow both sides of a branch

Page 18: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift

Input binary

Recovered binary

Compiler IR

MachineCode

18

Symbolic execution

Transform

Lower

Need to observe each instruction

Want to support

multiple architectures

Page 19: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

19

Symbolic execution

Transform

Lower

Emulate in VM,

translate instructions to IR

Page 20: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

20

Symbolic execution

Transform

Lower

Page 21: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

21

Symbolic execution

Transform

Compile

Just use the compiler

Page 22: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

22

Symbolic execution

Transform

Compile

Page 23: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

23

Symbolic execution

Transform

Compile

What about unlifted code paths?

...if (getenv(“SET_ME”)) { puts(“thanks!”); // not recovered!}...

Page 24: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

24

Symbolic execution

Transform

Compile

What about unlifted code paths?

1. do nothing (breaks conservative behavior)

...getenv(“SET_ME”);...

Page 25: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

25

Symbolic execution

Transform

What about unlifted code paths?

2. yield error

...if (getenv(“SET_ME”)) { abort();}...

Compile

Add errors

Page 26: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

26

Symbolic execution

Transform

What about unlifted code paths?

3. fallback to old code

...if (getenv(“SET_ME”)) { goto old_code_address;}...

Compile

Add errors / fallbacks

Page 27: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

27

Symbolic execution

Transform

References data from input binary

Compile

Add errors / fallbacks

Page 28: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

28

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

Page 29: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

29

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

IR interacts with VM runtime

Page 30: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

// Lifted code

emit_event(BASIC_BLOCK_START)

cpu_state.pc = 0x1000

ebx = &cpu_state.registers[R_EBX]

*ebx = *ebx + 1

cpu_state.icount++

cpu_state.pc = 0x1234

emit_event(BASIC_BLOCK_END)

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

30

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

// machine code

0x1000:

add ebx, 1

jmp 0x1234

IR interacts with VM runtime

Page 31: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

// Lifted code

emit_event(BASIC_BLOCK_START)

cpu_state.pc = 0x1000

ebx = &cpu_state.registers[R_EBX]

*ebx = *ebx + 1

cpu_state.icount++

cpu_state.pc = 0x1234

emit_event(BASIC_BLOCK_END)

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

31

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

events, counters

// machine code

0x1000:

add ebx, 1

jmp 0x1234

Page 32: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

// Lifted code

emit_event(BASIC_BLOCK_START)

cpu_state.pc = 0x1000

ebx = &cpu_state.registers[R_EBX]

*ebx = *ebx + 1

cpu_state.icount++

cpu_state.pc = 0x1234

emit_event(BASIC_BLOCK_END)

BinRec design

Input binary

Recovered binary

Compiler IR

MachineCode

32

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

// machine code

0x1000:

add ebx, 1

jmp 0x1234

registers in CPU state

control flow through virtual program counter

Lift in VMStrip emulation

Page 33: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

33

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

// stripped code

global ebx

lifted_1000:

ebx = ebx + 1

goto lifted_1234

// machine code

0x1000:

add ebx, 1

jmp 0x1234

// Lifted code

emit_event(BASIC_BLOCK_START)

cpu_state.pc = 0x1000

ebx = &cpu_state.registers[R_EBX]

*ebx = *ebx + 1

cpu_state.icount++

cpu_state.pc = 0x1234

emit_event(BASIC_BLOCK_END)

Strip emulation

Page 34: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

BinRec design

Lift in VM

Input binary

Recovered binary

Compiler IR

MachineCode

34

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

Strip emulationPre-process Post-process

Needed to prevent over-optimization during transformations (details in paper)

Page 35: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

This is quite bit of code

35

Page 36: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Implementation

Lift in VM

Input binary

Recovered binary

36

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

Strip emulationPre-process Post-process

Page 37: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Implementation

Input binary

Recovered binary

37

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

Strip emulationPre-process Post-process

S2ELift in VM

Page 38: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Implementation

Input binary

Recovered binary

38

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

Strip emulationPre-process Post-process

S2ELift in VM

LLVM

Page 39: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Implementation

Input binary

Recovered binary

39

Symbolic execution

Transform

Compile

Add errors / fallbacks

Link data sections

Strip emulationPre-process Post-process

S2ELift in VM

LLVM

Bash +Python

Binutils

Page 40: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Case study

40

Page 41: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Lift in VM

Input binary

Recovered binary

41

Symbolic execution

Transform

CompileAdd errors / fallbacks

Link data sections

Strip emulationPre-process Post-process

// ab.cint main(int argc, char **argv) { char a = argv[1][0]; char b = argv[1][1]; if (a == 'a') {

if (b == 'b') { puts("You entered \"ab\"");

} } return 0;}

Page 42: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Lift in VM

Input binary

Recovered binary

42

Symbolic execution

Transform

CompileAdd errors / fallbacks

Link data sections

Strip emulationPre-process Post-process

Page 43: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Input binary

Recovered binary

43

Symbolic execution

Transform

CompileAdd errors / fallbacks

Link data sections

Strip emulationPre-process Post-process

Raw code is heavily instrumented

- event triggers- instruction counter- program counter, registers, flags, etc. stored in CPU state in memory

Lift in VM

Page 44: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Input binary

Recovered binary

44

Symbolic execution

Transform

CompileAdd errors / fallbacks

Link data sections

Strip emulationPre-process Post-process

Lift in VM

cmp eax, 1

jle label

“heavily” instrumented

Page 45: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Input binary

Recovered binary

45

Symbolic execution

Transform

CompileAdd errors / fallbacks

Link data sections

Pre-process Post-process

Lift in VM

Raw

Pruned

Strip emulation

Page 46: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Input binary

Recovered binary

46

Symbolic execution

Transform

CompileAdd errors / fallbacks

Link data sections

Pre-process Post-process

Lift in VM

Pruned

OptimizedRaw

Strip emulation

Page 47: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Input binary

Recovered binary

47

Symbolic execution

Transform

CompileAdd errors / fallbacks

Link data sections

Pre-process Post-process

Lift in VMStrip emulation

Cascading optimizations

Page 48: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Input binary

Recovered binary

48

Symbolic execution

Transform

Add errors / fallbacks

Link data sections

Pre-process Post-process

Lift in VMStrip emulation

Compile

.text

Recovered code

...

Page 49: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Input binary

Recovered binary

49

Symbolic execution

Transform

Add errors / fallbacks

Pre-process Post-process

Lift in VMStrip emulation

Compile

.text

.rodata

.data

Old binary

.got

.plt

...

.text

Recovered code

...

.text

.rodata

.data

Recovered binary

.got

.plt

.text.new

=+

...

Link data sections

entry

entry

Page 50: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Input binary

Recovered binary

50

Symbolic execution

Transform

Add errors / fallbacks

Pre-process Post-process

Lift in VMStrip emulation

Compile

.text

.rodata

.data

Old binary

.got

.plt

...

.text

Recovered code

...

.text

.rodata

.data

Recovered binary

.got

.plt

.text.new

=+

...

Link data sections

Remove for error,

Keep for fallback

entry

entry

Page 51: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Input binary

Recovered binary

51

Symbolic execution

Transform

CompileAdd errors / fallbacks

Link data sections

Pre-process Post-process

Lift in VMStrip emulation

Original C

Recovered LLVM

Page 52: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Input binary

Recovered binary

52

Symbolic execution

Transform

CompileAdd errors / fallbacks

Link data sections

Pre-process Post-process

Lift in VMStrip emulation

Original LLVM

Recovered LLVM

Page 53: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Experiments

53

Page 54: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Experiments

- Correctness

- Attack Surface Reduction: ROP gadgets

- Performance

54

Page 55: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Experiment: correctness

Do our transformations preserve semantics?

- Yield errors for unknown code paths

- Check that recovered binary has same output as input binary

55

Page 56: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Experiment: correctness

Do our transformations preserve semantics?

- Yield errors for unknown code paths

- Check that recovered binary has same output as input binary

24 input binaries from SPEC-CPU2006 (x86)

- 15 succeeded, 9 failed (unexpected fallback / crash)

56

Page 57: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Experiment: ROP gadget reduction

Is the attack surface actually smaller?

- 72% fewer instructions- 48% fewer ROP gadgets

(both numbers are geomean)

57

Page 58: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Experiment: performance

- -O3 input binaries: expect similar performance

- -O0 input binaries: expect speedup

- Disable fallback errors: maybe expect speedup

58~44% overhead

Page 59: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

- -O3 input binaries: expect similar performance

- -O0 input binaries: expect speedup

- Disable fallback errors: maybe expect speedup

Experiment: performance

59~2% overhead

Page 60: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

- -O3 input binaries: expect similar performance

- -O0 input binaries: expect speedup

- Disable fallback errors: maybe expect speedup

Experiment: performance

60~5% performance gain

Page 61: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

Wish list / future work

- Gadget-aware compiler backend

- Improve performance

- Do aggressive profile-guided optimization

- Deobfuscation

61

Page 62: BinRec: Attack Surface Reduction Michael Franz, Cristiano … · 2019-11-28 · (De)obfuscation / ISA retargeting Input binary Recovered binary 12 many applications Execute. BinRec

- BinRec successfully transforms binaries at compiler IR level

- … and halves the ROP attack surface in the process

Also

- Binary lifting is hard

Conclusion

62