Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 42 lines (37 sloc) 1.88 KB
date draft toc comments categories tags title wip snippet
2018-04-27 23:03:22 -0400
false
false
false
Research
Go-Fuzz
Fuzzing
Go-Fuzz Quickstart
false
Steps to get fuzzing with Go-Fuzz quickly.

Quickstart

  1. Get Go-fuzz by go get github.com/dvyukov/go-fuzz.
  2. Build and install go-fuzz and go-fuzz-build.
    • cd src\github.com\dvyukov\go-fuzz\go-fuzz
    • go install
    • cd ..\go-fuzz-build
    • go install
  3. Get the target package and store it in GOPATH. I usually keep it under src\github.com\author\project.
  4. Create a new file in the target package named Fuzz.go.
  5. Create a function named Fuzz inside Fuzz.go with this signature func Fuzz(data []byte) int.
  6. Fuzz should return 1 if input is good and 0 otherwise.
  7. Create fuzzing directory, e.g. go-fuzz-project-name.
  8. go-fuzz-build github.com/author/project (note forward slashes even on Windows). Copy the resulting file (project-fuzz.zip) to the fuzzing directory.
  9. Make a directory called corpus and store samples there.
  10. go-fuzz -bin=project-fuzz.zip -workdir=. to begin fuzzing.

Links