expanding the reach of fuzzing
play

Expanding the Reach of Fuzzing Caroline Lemieux September 8 th , - PowerPoint PPT Presentation

Expanding the Reach of Fuzzing Caroline Lemieux September 8 th , 2020 Fuzzcon Europe Coverage-Guided Fuzzing Greybox, Mutational seeds Input Input Input Input Initial Input pick mutate Input execute Input Input Input n save


  1. Expanding the Reach of Fuzzing Caroline Lemieux September 8 th , 2020 Fuzzcon Europe

  2. Coverage-Guided Fuzzing Greybox, Mutational seeds Input Input Input Input Initial Input pick mutate Input execute Input Input Input n ’ save Execution Execution Feedback Execution Input 2 ’ Interesting Feedback? Feedback Execution Feedback Input n ’ Feedback n 1 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  3. Coverage-Guided Fuzzing Can we modify CGF tools for: Greybox, Mutational seeds Different Bugs Input Input Input Input Initial Input pick mutate Input execute Input Input Input n ’ Deeper Exploration save Execution Execution Feedback Execution Input 2 ’ Interesting Feedback? Feedback Execution Feedback Input n ’ Feedback n 2 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  4. Different Bugs Deeper Exploration 3 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  5. Pe PerfFuzz https://github.com/carolemieux/perffuzz Fu FuzzF zzFactor ory https://github.com/rohanpadhye/FuzzFactory Deeper Exploration 4 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  6. Nobody Expects Performance Problems 5 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  7. Alleviating Performance Problems DEV DE Pathological Input Profiling Tool 6 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  8. Alleviating Performance Problems DEV DE Pathological Input Profiling Tool 7 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  9. PerfFuzz Goal Automatically generate pathological inputs DEV DE Pathological Input Profiling Tool 8 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  10. Can We Use Coverage-Guided Fuzzing? seeds Input Input Input Input Initial Input pick mutate Input execute Input Input Input n ’ save Execution Execution Feedback Execution Input 2 ’ Interesting Feedback? Feedback Execution Feedback Input n ’ Feedback n Input executes for longer? Execution time of input 9 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  11. Can We Use Coverage-Guided Fuzzing? seeds Input Input ✗ Input Input Initial Input pick mutate Input execute Input Input Input n ’ Too coarsed-grained! save Execution Execution Feedback Execution Input 2 ’ Interesting Feedback? Feedback Execution Feedback Input n ’ Feedback n Input executes for longer? Execution time of input 10 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  12. Can We Use Coverage-Guided Fuzzing? seeds Input Input Input Input Initial Input pick mutate Input execute Input Input Input n ’ save Execution Execution Feedback Execution Input 2 ’ Interesting Feedback? Feedback Execution Feedback Input n ’ Feedback n 11 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  13. PerfFuzz seeds Input Input Input Input Initial Input pick mutate Input execute Input Input Input n ’ save Ed Edge # # Hits Ed Edge # # Hits Ed Edge # Hits # Edge Ed # Hits # Input 2 ’ Interesting Feedback? Input n ’ ... ... ... ... ... ... ... ... 12 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  14. PerfFuzz seeds Input Input Input Input Initial Input pick mutate Input execute Input Input Input n ’ save Ed Edge # # Hits Ed Edge # # Hits Maximizes # hits Edge Ed # Hits # for some edge? Edge Ed # Hits # Input 2 ’ Input n ’ ... ... ... ... ... ... ... ... 13 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  15. PerfFuzz pick input seeds maximizing # hits for Input Input Input Input Initial some edge Input mutate Input execute Input Input Input n ’ save Edge Ed # # Hits Edge Ed # Hits # Maximizes # hits Edge Ed # # Hits for some edge? Ed Edge # # Hits Input 2 ’ Input n ’ ... ... ... ... ... ... ... ... 14 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  16. PerfFuzz: Algorithmic Complexity • Maximum path length for varying input sizes Insertion Sort PCRE URL regex Word Frequency 500 3erI)uzz 3erI)uzz 3erI)uzz 0axLPuP 3ath Length 0axLPuP 3ath Length 0axLPuP 3ath Length 300k 6low)uzz 6low)uzz 6low)uzz 3000 400 300 200k 2000 200 1000 100k 100 0 10 20 30 40 50 60 10 20 30 40 50 60 10 20 30 40 50 60 0ax InSut Length (bytes) 0ax InSut Length (bytes) 0ax InSut Length (bytes) 15 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  17. PerfFuzz: Algorithmic Complexity • Maximum path length for varying input sizes All hash collisions Insertion Sort PCRE URL regex Word Frequency 500 3erI)uzz 3erI)uzz 3erI)uzz 0axLPuP 3ath Length 0axLPuP 3ath Length 0axLPuP 3ath Length 300k 6low)uzz 6low)uzz 6low)uzz ? 3000 400 300 200k 2000 200 1000 Many short words 100k 100 0 10 20 30 40 50 60 10 20 30 40 50 60 10 20 30 40 50 60 0ax InSut Length (bytes) 0ax InSut Length (bytes) 0ax InSut Length (bytes) 16 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  18. PerfFuzz pick input seeds maximizing https://github.com/carolemieux/perffuzz # hits for Input Input Input Input Initial some edge Input mutate Input execute Input Input Input n ’ Built on top of AFL • Comes with afl-showmax tool to • identify bad inputs save Edge Ed # Hits # Ed Edge # # Hits Maximizes # hits Requires building with afl-clang- • Ed Edge # Hits # for some edge? Edge Ed # # Hits Input 2 ’ Input n ’ fast ... ... ... ... ... ... ... ... 17 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  19. PerfFuzz pick input seeds maximizing # hits for Input Input Input Input Initial some edge Input mutate Input execute Input Input Input n ’ save Edge Ed # # Hits Edge Ed # Hits # Maximizes # hits Edge Ed # # Hits for some edge? Ed Edge # # Hits Input 2 ’ Input n ’ ... ... ... ... ... ... ... ... 18 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  20. Observation: Algorithm is More General pick input seeds maximizing # hits for Input Input Input Input Initial some edge Input mutate Input execute Input Input Input n ’ save Edge Ed # # Hits Edge Ed # Hits # Maximizes # hits Edge Ed # # Hits for some edge? Ed Edge # # Hits Input 2 ’ Input n ’ ... ... ... ... ... ... ... ... 19 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  21. Observation: Algorithm is More General pick input seeds maximizing value for va Input Input Input Input Initial some ke key Input mutate Input execute Input Input Input n ’ save Ke Key Value Va Ke Key Va Value Maximizes va value Ke Key Va Value for some ke key ? Key Ke Va Value Input 2 ’ Input n ’ ... ... ... ... ... ... ... ... 20 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  22. What Other Problems Can We Solve? Ke Key Va Value ... ... ... ... ... ... ... ... 21 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  23. What Other Problems Can We Solve? e.g. finding memory-allocation maximizing inputs Ke Key Va Value ... ... Memory Allocation Location: Cumulative amount of memory ... ... allocated Line 247: x = malloc(…); ... ... ... ... 22 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  24. What Other Problems Can We Solve? e.g. going through “hard” comparisons Ke Key Va Value ... ... “Hard” Comparison Location: ... ... Number of bits matched if ( x == 0xBAD0CAFE) ... ... ... ... 23 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  25. Observation: Algorithm is More General pick input seeds maximizing value for va Input Input Input Input Initial some ke key Input mutate Input execute Input Input Input n ’ save Ke Key Value Va Ke Key Va Value Maximizes va value Ke Key Va Value for some ke key ? Key Ke Va Value Input 2 ’ Input n ’ ... ... ... ... ... ... ... ... 24 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  26. FuzzFactory pick input seeds maximizing value for va Input Input Input Input Initial some ke key Input mutate Input execute Input Input Input n ’ save Ke Key Value Va Ke Key Va Value Maximizes va value Ke Key Va Value for some ke key ? Key Ke Va Value Input 2 ’ Input n ’ ... ... ... ... ... ... ... ... 25 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

  27. FuzzFactory, Step 1: Generalize Algorithm pick input with newest seeds aggregate va value for Input Input Input Input Initial some ke key Input mutate Input execute Input Input Input n ’ save Key Ke Value Va Ke Key Va Value New aggregate va value Ke Key Va Value for some ke key Key Ke Va Value Input 2 ’ Input n ’ ... ... ... ... ... ... ... ... 26 9/10/20 Caroline Lemieux -- Expanding the Reach of Fuzzing @ FuzzCon Europe

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