0 knowledge fuzzing
play

0-Knowledge Fuzzing Vincenzo Iozzo - PowerPoint PPT Presentation

0-Knowledge Fuzzing Vincenzo Iozzo vincenzo.iozzo@zynamics.com Disclaimer In this talk you wont see all those formulas, formal definiEon, code snippets and


  1. 0-­‑Knowledge ¡Fuzzing ¡ Vincenzo ¡Iozzo ¡ vincenzo.iozzo@zynamics.com ¡

  2. Disclaimer ¡ In ¡this ¡talk ¡you ¡won’t ¡see ¡all ¡those ¡formulas, ¡formal ¡definiEon, ¡code ¡snippets ¡ and ¡bullets. ¡ ¡ From ¡past ¡experiences ¡the ¡speaker ¡learned ¡that ¡all ¡the ¡aforemenEoned ¡ elements ¡are ¡no ¡useful ¡in ¡making ¡people ¡understand ¡your ¡idea. ¡ You ¡instead ¡will ¡see ¡a ¡lot ¡of ¡funny ¡pictures ¡which ¡the ¡speaker ¡hopes ¡will ¡ convey ¡beIer ¡the ¡understanding ¡of ¡the ¡ideas ¡explained ¡in ¡the ¡talk ¡ You ¡don’t ¡want ¡slides ¡like ¡ this, ¡do ¡you? ¡

  3. MoEvaEons ¡

  4. QuesEons! ¡

  5. Fuzzing ¡

  6. How ¡it ¡used ¡to ¡be ¡

  7. How ¡it ¡is ¡today ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ (aka ¡the ¡reason ¡of ¡this ¡talk) ¡

  8. Dumb ¡fuzzing ¡

  9. Smart ¡Fuzzing ¡

  10. EvoluEonary ¡Based ¡Fuzzing ¡

  11. The ¡idea ¡

  12. The ¡surface ¡

  13. We ¡need ¡a ¡filter ¡

  14. CyclomaEc ¡complexity ¡

  15. This ¡one ¡

  16. Not ¡this ¡one ¡

  17. Original ¡formula ¡ ¡ ¡ ¡ ¡M ¡= ¡E ¡– ¡N ¡+ ¡2P ¡ Number ¡of ¡edges ¡ Number ¡of ¡nodes ¡ Connected ¡ components ¡

  18. Why? ¡CyclomaEc ¡number ¡ ¡ ¡ ¡ ¡M ¡= ¡E ¡– ¡N ¡+ ¡P ¡

  19. Simplify ¡

  20. Formula ¡ M ¡= ¡E ¡– ¡N ¡+ ¡2 ¡

  21. Problem ¡

  22. Loop ¡detecEon ¡

  23. Dominator ¡tree ¡

  24. Dominators ¡

  25. FuncEon ¡

  26. Dominator ¡tree ¡

  27. Dominators ¡

  28. Implicit ¡loops ¡

  29. REIL ¡

  30. This ¡one… ¡

  31. …to ¡this ¡one ¡

  32. Is ¡that ¡enough? ¡

  33. Not ¡enough ¡ Of ¡course ¡not, ¡more ¡heurisEcs ¡needed ¡ void *safe_strcpy(void *old_dest, void *src, int size){ void *dst = realloc(old_dest, size +1); strncpy(dst, src, size); return dst; } ¡

  34. Add ¡your ¡own ¡ For ¡staEc ¡analysis ¡we ¡use ¡

  35. DEMO ¡

  36. QuesEons! ¡

  37. Data ¡TainEng ¡

  38. Example ¡ Taint ¡ Taint ¡ Source ¡ mark ¡ movl 0x4[eax], ebx ¡

  39. Dytan ¡

  40. PIN ¡

  41. Taint ¡sources ¡

  42. Markings ¡granularity ¡

  43. PropagaEon ¡ ¡ add eax, ebx, edx ¡

  44. Output ¡ ¡ ¡ ¡ ¡Registers ¡ ¡ ¡ ¡Memory ¡locaEons ¡

  45. DEMO ¡

  46. QuesEons! ¡

  47. In-­‑memory ¡fuzzing ¡

  48. Example ¡ esi ¡= ¡0x30f064 ¡ ¡ Original ¡loc ¡ ¡ Fuzzed ¡loc ¡ ¡ esi ¡= ¡0x30f0A4 ¡ ¡ rep movs

  49. Why? ¡

  50. Problems ¡

  51. ExperEse ¡and ¡paEence ¡

  52. Memory ¡instability ¡

  53. False ¡posiEves ¡

  54. False ¡negaEves ¡

  55. MutaEon ¡loop ¡inserEon ¡

  56. Snapshot ¡mutaEon ¡restoraEon ¡

  57. What ¡do ¡we ¡do? ¡ • Hook ¡image ¡ • Hook ¡funcEons ¡ • Hook ¡instrucEons ¡ • Hook ¡ ¡

  58. First ¡approach ¡

  59. For ¡instance… ¡ 30f064-­‑30f068 ¡ ¡ ¡ ¡ABCD ¡ ¡0x8a ¡Y ¡0x00 ¡ K ¡

  60. Second ¡approach ¡

  61. Example ¡ 30f064-­‑30f068 ¡ 30f084-­‑30f098 ¡ 0x89 ¡K ¡D ¡F ¡0x96 ¡ ¡ ¡ ¡ABCD ¡ 0x00 ¡J ¡K ¡U ¡Y ¡W ¡0xA7 ¡ 0xB8 ¡0x00 ¡0x10 ¡A ¡T ¡N ¡ 0x00 ¡0xD3 ¡ ¡ ¡

  62. Code ¡coverage ¡

  63. Score ¡ BB executed /BB total ¡ Basic ¡Blocks ¡ Total ¡Basic ¡ executed ¡ Blocks ¡ ¡

  64. HalEng ¡ ¡ C evil ¡= ¡C good ¡+ ¡t ¡ Code ¡coverage ¡ Code ¡coverage ¡ User-­‑supplied ¡ evil ¡sample ¡ good ¡sample ¡ threshold ¡

  65. How?? ¡ Good ¡sample ¡ Evil ¡sample ¡ Score ¡ ¡ Score ¡ ¡ Compare ¡

  66. What ¡do ¡we ¡use? ¡ Code ¡coverage ¡ Faults ¡monitor ¡

  67. DEMO ¡

  68. Future ¡– ¡A ¡reasoner ¡

  69. Thanks ¡

  70. QuesEons! ¡

  71. More ¡Info ¡ viozzo.wordpress.com ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡@_snagg ¡ ¡ ¡ ¡vincenzo.iozzo@zynamics.com ¡

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