Superset Disassembly: Statically Rewriting x86 Binaries Without Heuristics
Erick Bauman1, Zhiqiang Lin1,2, Kevin Hamlen1
1University of Texas at Dallas 2The Ohio State University
Superset Disassembly: Statically Rewriting x86 Binaries Without - - PowerPoint PPT Presentation
Superset Disassembly: Statically Rewriting x86 Binaries Without Heuristics Erick Bauman 1 , Zhiqiang Lin 1 , 2 , Kevin Hamlen 1 1 University of Texas at Dallas 2 The Ohio State University NDSS 2018 Introduction Background and Overview Design
1University of Texas at Dallas 2The Ohio State University
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
2 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
2 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Systems Year R L D S H S H P H C H D I N P R O P H A C F R U ETCH [RVL+97] 1997 ✗ ✗ ✗ ✗ ✗ ✗ ✗ SASI [ES99] 1999 ✗ ✗ ✗ ✗ ✗ ✗ ✗ PLTO [SDAL01] 2001 ✗ ✗ ✗ ✗ ✗ VULCAN [SEV01] 2001 ✗ ✗ ✗ ✗ DIABLO [PCB+05] 2005 ✗ ✗ ✗ ✗ ✗ CFI [ABEL09] 2005 ✗ ✗ ✗ ✗ ✗ XFI [EAV+06] 2006 ✗ ✗ ✗ ✗ ✗ ✗ PITTSFIELD [MM06] 2006 ✗ ✗ ✗ ✗ ✗ ✗ ✗ BIRD [NLLC06] 2006 ✗ ✗ ✗ ✗ NACL [YSD+09] 2009 ✗ ✗ ✗ ✗ ✗ ✗ ✗ PEBIL [LTCS10] 2010 ✗ ✗ ✗ ✗ ✗ SECONDWRITE [OAK+11] 2011 ✗ ✗ ✗ ✗ ✗ DYNINST [BM11] 2011 ✗ ✗ ✗ ✗ STIR/REINS [WMHL12b, WMHL12a] 2012 ✗ ✗ ✗ ✗ ✗ ✗ CCFIR [ZWC+13] 2013 ✗ ✗ ✗ ✗ ✗ ✗ ✗ BISTRO [DZX13] 2013 ✗ ✗ ✗ ✗ ✗ ✗ ✗ BINCFI [ZS13] 2013 ✗ ✗ ✗ ✗ ✗ PSI [ZQHS14] 2014 ✗ ✗ UROBOROS [WWW16] 2016 ✗ ✗ ✗ ✗ RAMBLR [WSB+17] 2017 ✗ ✗ ✗ 3 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Systems Year R L D S H S H P H C H D I N P R O P H A C F R U ETCH [RVL+97] 1997 ✗ ✗ ✗ ✗ ✗ ✗ ✗ SASI [ES99] 1999 ✗ ✗ ✗ ✗ ✗ ✗ ✗ PLTO [SDAL01] 2001 ✗ ✗ ✗ ✗ ✗ VULCAN [SEV01] 2001 ✗ ✗ ✗ ✗ DIABLO [PCB+05] 2005 ✗ ✗ ✗ ✗ ✗ CFI [ABEL09] 2005 ✗ ✗ ✗ ✗ ✗ XFI [EAV+06] 2006 ✗ ✗ ✗ ✗ ✗ ✗ PITTSFIELD [MM06] 2006 ✗ ✗ ✗ ✗ ✗ ✗ ✗ BIRD [NLLC06] 2006 ✗ ✗ ✗ ✗ NACL [YSD+09] 2009 ✗ ✗ ✗ ✗ ✗ ✗ ✗ PEBIL [LTCS10] 2010 ✗ ✗ ✗ ✗ ✗ SECONDWRITE [OAK+11] 2011 ✗ ✗ ✗ ✗ ✗ DYNINST [BM11] 2011 ✗ ✗ ✗ ✗ STIR/REINS [WMHL12b, WMHL12a] 2012 ✗ ✗ ✗ ✗ ✗ ✗ CCFIR [ZWC+13] 2013 ✗ ✗ ✗ ✗ ✗ ✗ ✗ BISTRO [DZX13] 2013 ✗ ✗ ✗ ✗ ✗ ✗ ✗ BINCFI [ZS13] 2013 ✗ ✗ ✗ ✗ ✗ PSI [ZQHS14] 2014 ✗ ✗ UROBOROS [WWW16] 2016 ✗ ✗ ✗ ✗ RAMBLR [WSB+17] 2017 ✗ ✗ ✗
3 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
4 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
1
2
3
4
5
5 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
6 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
6 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
6 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
7 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
7 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
8 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
8 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
9 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
9 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
10 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
10 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
11 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
11 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
12 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
12 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
13 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
13 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
14 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
14 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
15 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
15 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
16 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
16 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.localmapping
Original Executable, Shared Library New Executable, Shared Library
ELF .rodata .got .got.plt .data .text ELF .rodata .got .got.plt .data .text .newtext
1
17 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.localmapping
Original Executable, Shared Library New Executable, Shared Library
ELF .rodata .got .got.plt .data .text ELF .rodata .got .got.plt .data .text .newtext
1
◮ Disassemble starting from
17 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.localmapping
Original Executable, Shared Library New Executable, Shared Library
ELF .rodata .got .got.plt .data .text ELF .rodata .got .got.plt .data .text .newtext
1
◮ Disassemble starting from
◮ Determine lengths of rewritten
17 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.localmapping
Original Executable, Shared Library New Executable, Shared Library
ELF .rodata .got .got.plt .data .text ELF .rodata .got .got.plt .data .text .newtext
1
◮ Disassemble starting from
◮ Determine lengths of rewritten
◮ Create mapping from original
17 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.localmapping
Original Executable, Shared Library New Executable, Shared Library
ELF .rodata .got .got.plt .data .text ELF .rodata .got .got.plt .data .text .newtext
1
◮ Disassemble starting from
◮ Determine lengths of rewritten
◮ Create mapping from original
2
17 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.localmapping
Original Executable, Shared Library New Executable, Shared Library
ELF .rodata .got .got.plt .data .text ELF .rodata .got .got.plt .data .text .newtext
1
◮ Disassemble starting from
◮ Determine lengths of rewritten
◮ Create mapping from original
2
◮ Translate instructions to
17 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.localmapping
Original Executable, Shared Library New Executable, Shared Library
ELF .rodata .got .got.plt .data .text ELF .rodata .got .got.plt .data .text .newtext
1
◮ Disassemble starting from
◮ Determine lengths of rewritten
◮ Create mapping from original
2
◮ Translate instructions to
◮ Use mapping to determine
17 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
1
18 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
1
2
◮ Invalid instruction encoding ◮ Already disassembled offset ◮ End of byte sequence 18 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
1
2
◮ Invalid instruction encoding ◮ Already disassembled offset ◮ End of byte sequence 3
18 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
1
2
◮ Invalid instruction encoding ◮ Already disassembled offset ◮ End of byte sequence 3
4
18 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
1
2
◮ Invalid instruction encoding ◮ Already disassembled offset ◮ End of byte sequence 3
4
5
18 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Offset 0 19 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Offset 0 Offset 1 19 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Offset 0 Offset 1 Offset 2 19 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Offset 0 Offset 1 Offset 2 Offset 3 19 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Offset 0 Offset 1 Offset 2 Offset 3 Offset 4 19 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Offset 0 Offset 1 Offset 2 Offset 3 Offset 4 Offset 5 19 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Offset 0 Offset 1 Offset 2 Offset 3 Offset 4 Offset 5 Offset 6 19 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Offset 0 Offset 1 Offset 2 Offset 3 Offset 4 Offset 5 Offset 6 ... 19 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.text .data .globalmapping .newtext .localmapping local_lookup global_lookup .text (libc) .data (libc) .newtext (libc) .localmapping (libc) local_lookup
20 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.text .data .globalmapping .newtext .localmapping local_lookup global_lookup .text (libc) .data (libc) .newtext (libc) .localmapping (libc) local_lookup 1
20 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.text .data .globalmapping .newtext .localmapping local_lookup global_lookup .text (libc) .data (libc) .newtext (libc) .localmapping (libc) local_lookup 2 1
20 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.text .data .globalmapping .newtext .localmapping local_lookup global_lookup .text (libc) .data (libc) .newtext (libc) .localmapping (libc) local_lookup 2 1 3
20 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.text .data .globalmapping .newtext .localmapping local_lookup global_lookup .text (libc) .data (libc) .newtext (libc) .localmapping (libc) local_lookup 2 1 3 4
20 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.text .data .globalmapping .newtext .localmapping local_lookup global_lookup .text (libc) .data (libc) .newtext (libc) .localmapping (libc) local_lookup 2 1 3 4 5
20 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.text .data .globalmapping .newtext .localmapping local_lookup global_lookup .text (libc) .data (libc) .newtext (libc) .localmapping (libc) local_lookup 2 1 3 4 5 6
20 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
21 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
21 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
21 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
4 . p e r l b e n c h 4 1 . b z i p 2 4 3 . g c c 4 2 9 . m c f 4 4 5 . g
m k 4 5 6 . h m m e r 4 5 8 . s j e n g 4 6 2 . l i b q u a n t u m 4 6 4 . h 2 6 4 r e f 4 7 1 .
n e t p p 4 7 3 . a s t a r 4 8 3 . x a l a n c b m k 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% 288.3% 129.9% 128.2% Binary + Libraries Binary Only Binary Only w/o Generic PIC 22 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
23 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
23 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
23 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
23 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
4 . p e r l b e n c h 4 1 . b z i p 2 4 3 . g c c 4 2 9 . m c f 4 4 5 . g
m k 4 5 6 . h m m e r 4 5 8 . s j e n g 4 6 2 . l i b q u a n t u m 4 6 4 . h 2 6 4 r e f 4 7 1 .
n e t p p 4 7 3 . a s t a r 4 8 3 . x a l a n c b m k 0x 2x 4x 6x 8x 10x 12x 14x 16x 25.3x 24.4x 23.7x 84.8x 23.7x 23.7x 20.8x 81.2x MULTIVERSE MULTIVERSE w/ Binary Only MULTIVERSE w/ Binary Only w/o Generic PIC Pintool Pintool w/ Binary Only
24 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
25 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
25 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
25 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
25 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
4 . p e r l b e n c h 4 1 . b z i p 2 4 3 . g c c 4 2 9 . m c f 4 4 5 . g
m k 4 5 6 . h m m e r 4 5 8 . s j e n g 4 6 2 . l i b q u a n t u m 4 6 4 . h 2 6 4 r e f 4 7 1 .
n e t p p 4 7 3 . a s t a r 4 8 3 . x a l a n c b m k 0% 20% 40% 60% 80% 100% 120% 140% 160% 180% 200% 220% 240% 260% 280% 300% 2069.01% 1369.05% 1034.26% 891.91% 7190.70% MULTIVERSE MULTIVERSE w/ Shadow Stack Pintool w/ Shadow Stack 26 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
27 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
27 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
27 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.localmapping
Original Executable, Shared Library New Executable, Shared Library
ELF .rodata .got .got.plt .data .text ELF .rodata .got .got.plt .data .text .newtext
28 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
.localmapping
Original Executable, Shared Library New Executable, Shared Library
ELF .rodata .got .got.plt .data .text ELF .rodata .got .got.plt .data .text .newtext
29 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
30 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
31 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
Itanium R programs with dynamic instrumentation, Proc. 37th IEEE/ACM Int.
32 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
33 / 34
Introduction Background and Overview Design and Implementation Evaluation Conclusion References
34 / 34