driller augmenting fuzzing through symbolic execution
play

Driller: Augmenting Fuzzing through Symbolic Execution Nick Stephens - PowerPoint PPT Presentation

Driller: Augmenting Fuzzing through Symbolic Execution Nick Stephens , John Grosen, Christopher Salls, Andrew Dutcher, Ruoyu Wang, Jacopo Corbetta, Yan Shoshitaishvili, Christopher Kruegel, Giovanni Vigna Motivation - Large number of memory


  1. Driller: Augmenting Fuzzing through Symbolic Execution Nick Stephens , John Grosen, Christopher Salls, Andrew Dutcher, Ruoyu Wang, Jacopo Corbetta, Yan Shoshitaishvili, Christopher Kruegel, Giovanni Vigna

  2. Motivation - Large number of memory corruption bugs - Problems with testcase generation techniques - Fuzzing - Symbolic Execution

  3. Fuzzing

  4. x = int(input()) if x > 10: if x < 100: Let's fuzz it! print "You win!" else: print "You lose!" 1 ⇒ "You lose!" else: print "You lose!" 593 ⇒ "You lose!" 183 ⇒ "You lose!" 4 ⇒ "You lose!" 498 ⇒ "You lose!" 48 ⇒ "You win!" 4

  5. Catching Bugs - Monitors program for crashes

  6. x = int(input()) Let's fuzz it! if x > 10: if x^2 == 152399025: print "You win!" else: 1 ⇒ "You lose!" print "You lose!" else: 593 ⇒ "You lose!" print "You lose!" 183 ⇒ "You lose!" 4 ⇒ "You lose!" 498 ⇒ "You lose!" 42 ⇒ "You lose!" 3 ⇒ "You lose!" ……… . 57 ⇒ "You lose!" 6

  7. Symbolic Execution

  8. ??? x = input() if x >= 10: if x % 1337 == 0: print "You win!" x < 10 x >= 10 else: print "You lose!" else: x >= 10 x >= 10 print "You lose!" x % 1337 != 0 x % 1337 == 0

  9. ??? x = input() if x >= 10: if x % 1337 == 0: print "You win!" x < 10 x >= 10 else: print "You lose!" else: x >= 10 x >= 10 print "You lose!" x % 1337 != 0 x % 1337 == 0 1337

  10. Catching Bugs - Checks each state for safety violations - symbolic program counter - writes/reads from symbolic address

  11. x = input() def recurse(x, depth): if depth == 2000 return 0 else { r = 0; if x[depth] == “B” : r = 1 return r + recurse(x[depth], depth) ??? if recurse(x, 0) == 1: print “You win!” x[d] != “B” x[d] == “B”

  12. Different Approaches Fuzzing Symbolic Execution - Good at finding solutions - Good at finding solutions for general conditions for specific conditions - Spends too much time - Bad at finding solutions for iterating over general specific conditions conditions

  13. Fuzzing vs. Symbolic Execution x = int(input()) x = input() if x >= 10: if x^2 == 152399025: def recurse(x, depth): print "You win!" if depth == 2000 else: return 0 print "You lose!" else { else: r = 0; print "You lose!" if x[depth] == “B” : r = 1 return r + recurse(x [depth], depth) if recurse(x, 0) == 1: print “You win!” Fuzzing Wins Symbolic Execution Wins

  14. Symbolic Execution Fuzzing good at find solutions for good at finding solutions specific input for general input

  15. American Fuzzy Lop + angr AFL angr - state-of-the-art - binary analysis platform instrumented fuzzer - implements symbolic - path uniqueness tracking execution engine - genetic mutations - influenced by Mayhem - open source - works on binary code - available on github

  16. Combining the Two (High-level) Test Cases Control Flow Graph

  17. Combining the Two Test Cases “Cheap” fuzzing coverage “X” “Y” Control Flow Graph

  18. Combining the Two Reachable? Test Cases “Cheap” fuzzing coverage “X” ! “Y” Tracing via Symbolic Execution Control Flow Graph

  19. Combining the Two Synthesized! Test Cases “Cheap” fuzzing coverage “X” “Y” Tracing via Symbolic Execution “MAGIC” New test cases generated Control Flow Graph

  20. Towards completer code coverage! Combining the Two Test Cases “Cheap” fuzzing coverage “X” “Y” Tracing via Symbolic Execution “MAGIC” New test cases generated “MAGICY” Control Flow Graph

  21. AFL’s Path Selection - Tracks state-transitions on each program run - Basic Block A -> Basic Block B - Path uniqueness = Set of state-trans uniqueness - Input generation is still primitive mutations

  22. Improving Path Selection with angr Test Cases AFL strcmp(input, "MAGIC") input[0] == 'X' ... ... ...

  23. Improving Path Selection with angr Test Cases AFL “X” strcmp(input, "MAGIC") input[0] == 'X' ... ... ...

  24. Improving Path Selection with angr Test Cases AFL “X” strcmp(input, "MAGIC") “Y” input[0] == 'X' ... ... ...

  25. Improving Path Selection with angr Test Cases AFL “X” strcmp(input, "MAGIC") “Y” input[0] == 'X' ... “Z” ... ...

  26. Improving Path Selection with angr Test Cases AFL “X” strcmp(input, "MAGIC") “Y” input[0] == 'X' ... ... ...

  27. Improving Path Selection with angr Test Cases angr “X” strcmp(input, "MAGIC") ? “Y” input[0] == 'X' ... ... ...

  28. Improving Path Selection with angr Test Cases angr “X” strcmp(input, "MAGIC") “Y” input[0] == 'X' ... “MAGIC” New state transition, ... ... synthesize!

  29. Improving Path Selection with angr angr ... ... ... ... ... ... ... Continue following “X”’s original path until completion, deviating when possible.

  30. State Space Reduction - Symbolic Execution’s state-space is reduced to AFL’s - Reduces path explosion

  31. Symbolic Execution (angr) - 16 total Fuzzing (AFL) - 68 total 16 S & F Shared - 13 total 68 71 / 128 binaries Binary Crashes per Technique

  32. Symbolic Execution (angr) - 16 77 Fuzzing (AFL) - 68 16 S & F Shared - 13 total Driller - 77 55 68 77 / 128 binaries Binary Crashes per Technique

  33. Distribution of Transitions Found as Iterations of Symbolic Execution and Fuzzing symbolic execution fuzzing

  34. Limitations int main(void) { char data[100]; char *computed_hash; char hash[16]; read (0, data, sizeof data); computed_hash = hash (data); read (0, hash, sizeof hash); if ( memcmp (hash, computed_hash, 16) != 0) { // `data` processed here // code susceptible to fuzzing } } Fuzzing beyond the hash is still problematic!

  35. Conclusion - Driller is greater than the sum of its parts - Offers a >10% increase in crashes over pure AFL - Driller curbs path explosion

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend