Integrating AFL++/libFuzzer into your project
In this section, we will take a look into the two prominent fuzzing tools you can encounter in the wild, namely libFuzzer and AFL++. Let's start by learning about libFuzzer.
Using libFuzzer in your CMake project
libFuzzer is a fuzzing library that is part of the LLVM project. It is a compiler-aided fuzzer that has powerful fuzzing techniques, It is the default go-to fuzzer if your project is already compilable with the LLVM toolchain, since using libFuzzer only requires an additional compiler/linker flag and defining a single function. We will start learning more about these details by digging into an example. Let's get our hands dirty.
To showcase fuzzing in practice, we will follow examples as usual. Let's begin with the example in chapter_11/ex01_libfuzzer_static_lib
first. In this example, we have a hypothetical vulnerable static library target, named message_printer
. This is a simple library that has only one...