0 Knowledge Fuzzing Vincenzo Iozzo vincenzo.iozzo@zynamics.com - - PowerPoint PPT Presentation

0 knowledge fuzzing
SMART_READER_LITE
LIVE PREVIEW

0 Knowledge Fuzzing Vincenzo Iozzo vincenzo.iozzo@zynamics.com - - PowerPoint PPT Presentation

0 Knowledge Fuzzing Vincenzo Iozzo vincenzo.iozzo@zynamics.com Disclaimer Disclaimer In this talk you wont see all those formulas, formal definition, code snippets and bullets and bullets. From past experiences the speaker learned that


slide-1
SLIDE 1

0‐Knowledge Fuzzing

Vincenzo Iozzo vincenzo.iozzo@zynamics.com

slide-2
SLIDE 2

Disclaimer Disclaimer

In this talk you won’t see all those formulas, formal definition, code snippets and bullets and bullets. From past experiences the speaker learned that all the aforementioned elements are no useful in making people understand your idea. You instead will see a lot of funny pictures which the speaker hopes will y p p p convey better the understanding of the ideas explained in the talk

You don’t want slides like this, do you?

slide-3
SLIDE 3

Motivations Motivations

slide-4
SLIDE 4

Questions! Questions!

slide-5
SLIDE 5

Fuzzing Fuzzing

slide-6
SLIDE 6

How it used to be How it used to be

slide-7
SLIDE 7

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

slide-8
SLIDE 8

Dumb fuzzing Dumb fuzzing

slide-9
SLIDE 9

Smart Fuzzing Smart Fuzzing

slide-10
SLIDE 10

Evolutionary Based Fuzzing Evolutionary Based Fuzzing

slide-11
SLIDE 11

The idea The idea

slide-12
SLIDE 12

The surface The surface

slide-13
SLIDE 13

We need a filter We need a filter

slide-14
SLIDE 14

Cyclomatic complexity y p y

slide-15
SLIDE 15

This one This one

slide-16
SLIDE 16

Not this one Not this one

slide-17
SLIDE 17

Original formula Original formula

M = E – N + 2P M E N + 2P

Number of edges Number of nodes Connected components

slide-18
SLIDE 18

Why? Cyclomatic number Why? Cyclomatic number

M = E – N + P

slide-19
SLIDE 19

Simplify Simplify

slide-20
SLIDE 20

Formula Formula

M = E – N + 2

slide-21
SLIDE 21

Problem Problem

slide-22
SLIDE 22

Loop detection Loop detection

slide-23
SLIDE 23

Dominator tree Dominator tree

slide-24
SLIDE 24

Dominators Dominators

slide-25
SLIDE 25

Function Function

slide-26
SLIDE 26

Dominator tree Dominator tree

slide-27
SLIDE 27

Dominators Dominators

slide-28
SLIDE 28

Implicit loops Implicit loops

slide-29
SLIDE 29

REIL REIL

slide-30
SLIDE 30

Is that enough? Is that enough?

slide-31
SLIDE 31

Not enough Not enough

Of course not more heuristics needed Of course not, more heuristics needed

void *safe_strcpy(void *old_dest, void *src, int size){ void *dst = realloc(old dest size +1); void dst realloc(old_dest, size +1); strncpy(dst, src, size); return dst; }

slide-32
SLIDE 32

Add your own Add your own

For static analysis we use

slide-33
SLIDE 33

DEMO DEMO

slide-34
SLIDE 34

Questions! Questions!

slide-35
SLIDE 35

Data Tainting Data Tainting

slide-36
SLIDE 36

Dytan Dytan

slide-37
SLIDE 37

PIN PIN

slide-38
SLIDE 38

Taint sources Taint sources

slide-39
SLIDE 39

Markings granularity Markings granularity

slide-40
SLIDE 40

Propagation Propagation add eax, ebx, edx , ,

slide-41
SLIDE 41

Output Output

R i t Registers Memory locations Memory locations

slide-42
SLIDE 42

DEMO DEMO

slide-43
SLIDE 43

Questions! Questions!

slide-44
SLIDE 44

In‐memory fuzzing In memory fuzzing

slide-45
SLIDE 45

Why? Why?

slide-46
SLIDE 46

Problems Problems

slide-47
SLIDE 47

Expertise and patience Expertise and patience

slide-48
SLIDE 48

Memory instability

slide-49
SLIDE 49

False positives False positives

slide-50
SLIDE 50

False negatives False negatives

slide-51
SLIDE 51

Mutation loop insertion Mutation loop insertion

slide-52
SLIDE 52

Snapshot mutation restoration Snapshot mutation restoration

slide-53
SLIDE 53

What do we do? What do we do?

  • Hook image

Hook image

  • Hook functions

k i i

  • Hook instructions
  • Hook
slide-54
SLIDE 54

First approach First approach

slide-55
SLIDE 55

For instance… For instance…

30f064‐30f067 30f064 30f067 ABCD

0x8a Y 0x00

ABCD

0x8a Y 0x00 K

slide-56
SLIDE 56

Second approach Second approach

slide-57
SLIDE 57

Example Example

30f064‐30f067 30f084‐30f097 30f064 30f067 30f084 30f097 ABCD

0x89 K D F 0x96 0x00 J K U Y W 0xA7 0xB8 0x00 0x10 A T N 0x00 0xD3

slide-58
SLIDE 58

Code coverage Code coverage

slide-59
SLIDE 59

How?? How??

Good sample Evil sample Good sample Evil sample Score Score

Compare

slide-60
SLIDE 60

Score Score BBexecuted/BBtotal

Basic Blocks t d Total Basic executed Blocks

slide-61
SLIDE 61

Halting Halting

C C t Cgood = Cevil + t

Code coverage Code coverage User‐supplied good sample evil sample threshold

slide-62
SLIDE 62

What do we use? What do we use? Code coverage Faults monitor

slide-63
SLIDE 63

DEMO DEMO

slide-64
SLIDE 64

Future – A reasoner Future A reasoner

slide-65
SLIDE 65

Thanks Thanks

slide-66
SLIDE 66

Questions! Questions!

slide-67
SLIDE 67

More Info More Info

viozzo wordpress com viozzo.wordpress.com @_snagg vincenzo.iozzo@zynamics.com