enhancing control flow graph based binary function
play

Enhancing Control Flow Graph Based Binary Function Identification - PowerPoint PPT Presentation

Enhancing Control Flow Graph Based Binary Function Identification Clemens Jonischkeit Chair for IT Security 23. November 2017 C. Jonischkeit 1 / 13 Motivation Technische Universitt Mnchen I just wasted 3 hours of my life. . . . .


  1. Enhancing Control Flow Graph Based Binary Function Identification Clemens Jonischkeit Chair for IT Security 23. November 2017 C. Jonischkeit 1 / 13

  2. Motivation Technische Universität München ”I just wasted 3 hours of my life. . . . . . because I reversed $foo once again” C. Jonischkeit 2 / 13

  3. Motivation Technische Universität München Problem: ▸ Recover function labels Existing Technology: ▸ Pattern Matching (F.L.I.R.T) ▸ BinDiff ▸ Diaphora C. Jonischkeit 3 / 13

  4. Problems of CFGs Technische Universität München 1 , 500 Functions (#) 1 , 000 500 0 1 10 100 Basic Blocks (#) C. Jonischkeit 4 / 13

  5. Problems of CFGs Technische Universität München ⋮ ⋮ 1 mov rax, rdx ⋮ ⋮ 2 ret 1 mov rax, rdx ⋮ ⋮ 2 ret 1 mov rax, rdx 1 mov rax, rdx 2 ret 2 ret C. Jonischkeit 5 / 13

  6. Problems of CFGs Technische Universität München Goal: ▸ Differentiate similar CFGs ▸ Resistence against changes C. Jonischkeit 6 / 13

  7. Problems of CFGs Technische Universität München Problem: ▸ Small Functions: Many functions share the same CFG ▸ Large Functions: Many different CFGs possible per function Idea: ▸ Checking basic block level information ▸ Normalize CFGs C. Jonischkeit 7 / 13

  8. Normalization Technische Universität München instr: 5 Leaf Inlining: ▸ Detect Leafs ▸ Duplicate per parent Combining Nodes: ▸ Detect Nodes with one parent ▸ Filter parents to only have one instr: 3 child ▸ Combine attributes instr: 9 C. Jonischkeit 8 / 13

  9. Normalization Technische Universität München instr: 5 Leaf Inlining: ▸ Detect Leafs ▸ Duplicate per parent Combining Nodes: ▸ Detect Nodes with one parent ▸ Filter parents to only have one instr: 3 child ▸ Combine attributes instr: 9 C. Jonischkeit 8 / 13

  10. Normalization Technische Universität München instr: 5 Leaf Inlining: ▸ Detect Leafs ▸ Duplicate per parent Combining Nodes: ▸ Detect Nodes with one parent ▸ Filter parents to only have one instr: 3 child ▸ Combine attributes instr: 9 C. Jonischkeit 8 / 13

  11. Normalization Technische Universität München instr: 5 Leaf Inlining: ▸ Detect Leafs ▸ Duplicate per parent Combining Nodes: ▸ Detect Nodes with one parent ▸ Filter parents to only have one instr: 3 child ▸ Combine attributes instr: 9 C. Jonischkeit 8 / 13

  12. Normalization Technische Universität München instr: 5 Leaf Inlining: ▸ Detect Leafs ▸ Duplicate per parent Combining Nodes: ▸ Detect Nodes with one parent ▸ Filter parents to only have one instr: 3 child ▸ Combine attributes instr: 9 C. Jonischkeit 8 / 13

  13. Normalization Technische Universität München instr: 5 Leaf Inlining: ▸ Detect Leafs ▸ Duplicate per parent Combining Nodes: ▸ Detect Nodes with one parent ▸ Filter parents to only have one instr: 3 child ▸ Combine attributes instr: 9 C. Jonischkeit 8 / 13

  14. Normalization Technische Universität München instr: 5 Leaf Inlining: ▸ Detect Leafs ▸ Duplicate per parent Combining Nodes: ▸ Detect Nodes with one parent ▸ Filter parents to only have one instr: 3 child ▸ Combine attributes instr: 12 C. Jonischkeit 8 / 13

  15. Graph Comparison Technische Universität München A B C D E C. Jonischkeit 9 / 13

  16. Graph Comparison Technische Universität München A A B C D E C. Jonischkeit 9 / 13

  17. Graph Comparison Technische Universität München A A B C B D E C. Jonischkeit 9 / 13

  18. Graph Comparison Technische Universität München A A B C B D E C. Jonischkeit 9 / 13

  19. Graph Comparison Technische Universität München A A B C B D E C. Jonischkeit 9 / 13

  20. Graph Comparison Technische Universität München A A B C C B D E C. Jonischkeit 9 / 13

  21. Graph Comparison Technische Universität München A A B C C B D E D C. Jonischkeit 9 / 13

  22. Graph Comparison Technische Universität München A A B C C B D E D C. Jonischkeit 9 / 13

  23. Graph Comparison Technische Universität München A A B C C B D E D C. Jonischkeit 9 / 13

  24. Graph Comparison Technische Universität München A A B C C B D E E D C. Jonischkeit 9 / 13

  25. Graph Comparison Technische Universität München A A B C C B D E E D C. Jonischkeit 9 / 13

  26. Results Technische Universität München libc (n.) 0 . 8 28 . 7 15 . 2 libc 0 . 9 33 15 . 4 python (Dia.) 21 . 1 80 . 9 python (n.) 1 . 4 44 . 7 17 . 6 python 1 . 4 45 . 3 16 . 8 0 20 40 60 80 100 Average Matched functions (%) false positive correct (unique) correct C. Jonischkeit 10 / 13

  27. Results Technische Universität München gcc7, gcc6 (n.) gcc7, gcc6 clang, gcc (n.) clang, gcc -O2, -O3 (n.) -O2, -O3 -O1, -O2 (n.) -O1, -O2 0 5 10 15 20 Average Matched functions (%) false positive correct (unique) correct C. Jonischkeit 11 / 13

  28. Results Technische Universität München -O2, -O3 (Dia.) -O2, -O3 (n.) -O2, -O3 -O1, -O2 (Dia.) -O1, -O2 (n.) -O1, -O2 0 10 20 30 40 50 60 70 80 90 Average Matched functions (%) false positive correct (unique) correct C. Jonischkeit 12 / 13

  29. Thanks Technische Universität München jonischk [at] sec.in.tum.de https://github.com/leetonidas/signatures C. Jonischkeit 13 / 13

Recommend


More recommend