honggfuzz-rs

Fuzz your Rust code with Honggfuzz !

asciicast

About Honggfuzz

Honggfuzz is a security oriented fuzzer with powerful analysis options. Supports evolutionary, feedback-driven fuzzing based on code coverage (software- and hardware-based) * project homepage http://honggfuzz.com/ * project repository https://github.com/google/honggfuzz * this upstream project is maintained by Google, but ... * this is NOT an official Google product

Description (from upstream project)

How to use this crate

Install honggfuzz command to build with instrumentation and fuzz sh cargo install honggfuzz # will install honggfuzz and honggfuzz-build subcommands in cargo Add to your dependencies toml [dependencies] honggfuzz = "0.2" Add code snippet to fuzz ```rust

![no_main]

[macro_use] extern crate honggfuzz;

fuzz_target!(|data: &[u8]| { if data.len() != 10 {return} if data[0] != 'q' as u8 {return} if data[1] != 'w' as u8 {return} if data[2] != 'e' as u8 {return} if data[3] != 'r' as u8 {return} if data[4] != 't' as u8 {return} if data[5] != 'y' as u8 {return} if data[6] != 'u' as u8 {return} if data[7] != 'i' as u8 {return} if data[8] != 'o' as u8 {return} if data[9] != 'p' as u8 {return} panic!("BOOM") }); Build with instrumentation sh

a wrapper on "cargo build" with fuzzing instrumentation enabled. produces binaries in "fuzzing_target" directory

cargo honggfuzz-build ```

Fuzz ```sh mkdir in

a wrapper on honggfuzz executable with settings adapted to work with Rust code

cargo honggfuzz -f in -P -- fuzzingtarget/x8664-unknown-linux-gnu/debug/fuzzme ```

Relevant documentation about honggfuzz usage

About Rust fuzzing

There is other project providing Rust fuzzing support at https://github.com/rust-fuzz.

You'll find support for AFL and LLVM's LibFuzzer and there is also a trophy case ;-) .

This crate was inspired by those projects!