- Get Go-fuzz with
go get github.com/dvyukov/go-fuzz
. - Build and install
go-fuzz
andgo-fuzz-build
.cd src\github.com\dvyukov\go-fuzz\go-fuzz
go install
cd ..\go-fuzz-build
go install
- Get the target package and store it in
GOPATH
. I usually keep it undersrc\github.com\author\project
. - Create a new file in the target package named
Fuzz.go
. - Create a function named
Fuzz
insideFuzz.go
with this signaturefunc Fuzz(data []byte) int
. Fuzz
should return1
if input is good and0
otherwise.- Create fuzzing directory, e.g.
go-fuzz-project-name
. go-fuzz-build github.com/author/project
(note forward slashes even on Windows). Copy the resulting file (project-fuzz.zip
) to the fuzzing directory.- Make a directory called
corpus
and store samples there. go-fuzz -bin=project-fuzz.zip -workdir=.
to begin fuzzing.
- "Fuzzing the new unit testing" by Dmitry Vyukov (Go-Fuzz creator): https://go-talks.appspot.com/github.com/dvyukov/go-fuzz/slides/fuzzing.slide#1
- "go-fuzz github.com/arolek/ase" by Damian Gryski: https://medium.com/@dgryski/go-fuzz-github-com-arolek-ase-3c74d5a3150c
- "Going down the rabbit hole with go-fuzz" by Nemanja Mijailovic: https://mijailovic.net/2017/07/29/go-fuzz/
- DNS parser, meet Go fuzzer by Filippo Valsorda: https://blog.cloudflare.com/dns-parser-meet-go-fuzzer/
- "Automated Testing with Go-Fuzz" GothamGo 2015: https://www.youtube.com/watch?v=kOZbFSM7PuI
- "Fuzzing Markdown parser written in Go" by Krzysztof Kowalczyk: https://blog.kowalczyk.info/article/n/fuzzing-markdown-parser-written-in-go.html