The Art of Fuzzing, Part 5: FuzzTest, LibAFL and WinAFL
Overview
This is the fifth of five articles on fuzz testing. It returns to compiled code and examines three frameworks that the earlier parts mentioned only briefly. It assumes the vocabulary of Part 1, in particular the five components of a fuzzer and the role of the oracle, and the coverage concepts of Part 2.
- Section 1 explains why these three frameworks matter and what distinguishes them.
- Section 2 covers Google's FuzzTest, which expresses fuzz tests as properties inside ordinary unit tests, with a worked example run in both of its modes.
- Section 3 covers LibAFL, which builds fuzzers from reusable components, and reconstructs the experiment of Part 1 from those components.
- Section 4 covers WinAFL, which fuzzes closed-source Windows binaries through dynamic instrumentation, including target selection, verification and troubleshooting.
- Section 5 compares the three and gives guidance on choosing between them.
- Section 6 closes the series with a reference table of every fuzzing tool it has covered, what each is for and where it is used.
1. Introduction
The engines used so far in this series, libFuzzer and AFL++, are complete fuzzers: the user supplies a target and a harness, and the engine supplies everything else. Three developments since then have changed how fuzzing is practised, and each is represented by one of the frameworks in this article.
The first is the integration of fuzzing into ordinary software testing. libFuzzer's original authors have stopped active development, and LLVM now describes the engine as receiving important fixes only [5]. Google's own successor is FuzzTest, a C++ framework that its README describes as the successor of libFuzzer and similar tools [1]. FuzzTest expresses a fuzz test as a property over typed inputs, in the manner of the property-based tests of Part 1, Section 7, and runs it with a coverage-guided engine. The second development is the modular fuzzer. LibAFL, introduced by Fioraldi and colleagues in 2022, treats a fuzzer as a composition of independent components, so that researchers can replace a scheduler, a mutator or an executor without rewriting the rest [3]. Its use has grown as libFuzzer has moved into maintenance [7]. The third is the fuzzing of closed-source software on Windows, where neither source code nor a convenient harness is available. WinAFL, developed by Google Project Zero, addresses this by instrumenting a running Windows binary and repeatedly re-executing a single function within it [2].
The three frameworks therefore occupy different positions. FuzzTest is for developers testing their own C++ code. LibAFL is for researchers and engineers who need a fuzzer that the standard engines do not provide. WinAFL is for analysts examining Windows software they did not write. The FuzzTest and LibAFL examples below were built and run for this article. The WinAFL material was checked against the project's documentation, for a reason explained in Section 4.
2. FuzzTest
2.1 Fuzz tests as properties
A FuzzTest test consists of a property function, which receives typed arguments and checks that some condition holds for them, and a registration macro, FUZZ_TEST, which declares the property to the framework. The framework generates the arguments. By default each argument may take any value of its type, but the set of values can be restricted with domains, such as an integer range or a string matching a regular expression [1]. A property function returns nothing; it signals failure through GoogleTest assertions or by triggering a sanitizer error.
This design differs from libFuzzer in two respects. First, the harness receives structured, typed values rather than a raw byte buffer, so it does not need to parse bytes into a vector, a string or a struct before calling the code under test. Second, fuzz tests live in the same files and binaries as unit tests and run alongside them. FuzzTest supports two principal modes for this purpose [1]:
- Unit-test mode, the default, builds without coverage instrumentation and runs each fuzz test for a short time with random inputs, together with the ordinary unit tests. It is intended to run on every build.
- Fuzzing mode, enabled at configuration time, builds with coverage instrumentation and sanitizers and runs a single fuzz test continuously, or for a specified duration, under the coverage-guided engine.
An experimental compatibility mode additionally runs FuzzTest properties under libFuzzer as the engine. FuzzTest currently supports C++ only and requires Clang on Linux [1].
2.2 Project set-up
The CMake quickstart in the FuzzTest documentation clones the framework into the project directory and includes it as a subdirectory [1]. Figure 1 shows the resulting build file for the example in this section.
cmake_minimum_required(VERSION 3.19)
project(packet_fuzz)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(fuzztest)
enable_testing()
include(GoogleTest)
fuzztest_setup_fuzzing_flags()
add_executable(packet_test packet_test.cc)
link_fuzztest(packet_test)
gtest_discover_tests(packet_test)
CMakeLists.txt for a FuzzTest project.The function fuzztest_setup_fuzzing_flags() applies the instrumentation and sanitizer flags when the project is configured in fuzzing mode, and link_fuzztest() links the framework and its GoogleTest integration. The examples were built on Ubuntu 24.04 with Clang 18.1.3 and CMake 3.28, using FuzzTest at commit 5d586d5 (26 November 2026):
git clone https://github.com/google/fuzztest.git
# Unit-test mode
CC=clang CXX=clang++ cmake -S . -B build-unit -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build-unit
# Fuzzing mode
CC=clang CXX=clang++ cmake -S . -B build-fuzz -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DFUZZTEST_FUZZING_MODE=on
cmake --build build-fuzz
The first build compiles FuzzTest's dependencies, including Abseil, RE2 and GoogleTest, and therefore takes several minutes. Subsequent builds are incremental.
2.3 The tests
Figure 2 continues the packet format used throughout this series. It defines two properties. The first is a round-trip property in the sense of Part 1, Section 7.1: encoding a payload with a one-byte length prefix and then decoding it must return the original payload. The encoder contains a deliberate defect, since it stores the length in a single byte without checking that the payload is shorter than 256 bytes. The second property applies the parser from Part 1, with its unchecked length field, and asserts nothing explicitly: its oracle is AddressSanitizer.
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <memory>
#include <optional>
#include <vector>
#include "fuzztest/fuzztest.h"
#include "gtest/gtest.h"
// Encodes a payload as one length byte followed by the payload itself.
std::vector<uint8_t> EncodePacket(const std::vector<uint8_t>& payload) {
std::vector<uint8_t> out;
out.push_back(static_cast<uint8_t>(payload.size())); // Deliberate bug: truncates above 255.
out.insert(out.end(), payload.begin(), payload.end());
return out;
}
std::optional<std::vector<uint8_t>> DecodePacket(const std::vector<uint8_t>& in) {
if (in.empty()) return std::nullopt;
size_t declared = in[0];
if (in.size() < 1 + declared) return std::nullopt;
return std::vector<uint8_t>(in.begin() + 1, in.begin() + 1 + declared);
}
// Property 1: decoding an encoded payload returns the original payload.
void DecodeInvertsEncode(const std::vector<uint8_t>& payload) {
std::optional<std::vector<uint8_t>> decoded = DecodePacket(EncodePacket(payload));
ASSERT_TRUE(decoded.has_value());
EXPECT_EQ(*decoded, payload);
}
FUZZ_TEST(PacketTest, DecodeInvertsEncode)
.WithDomains(fuzztest::Arbitrary<std::vector<uint8_t>>().WithMaxSize(400));
// Property 2: the parser from Part 1 never reads outside its input.
static volatile uint8_t observed;
void ParsePacket(const uint8_t* data, size_t size) {
if (size < 1) return;
size_t declared = data[0];
if (declared == 0) return;
observed = data[declared]; // Deliberate bug: no check that declared < size.
}
void ParseNeverReadsOutOfBounds(const std::vector<uint8_t>& input) {
if (input.empty()) return;
auto copy = std::make_unique<uint8_t[]>(input.size());
std::memcpy(copy.get(), input.data(), input.size());
ParsePacket(copy.get(), input.size());
}
FUZZ_TEST(PacketTest, ParseNeverReadsOutOfBounds);
packet_test.cc: two properties of the packet format.The domain Arbitrary<std::vector<uint8_t>>().WithMaxSize(400) restricts the first property to payloads of at most 400 bytes. The second property declares no domain, so FuzzTest uses Arbitrary for its argument. As in Part 1, the second harness copies its input into a heap buffer of exactly the right size, so that any read beyond the end falls outside the allocation.
2.4 Results in unit-test mode
Running the unit-test build executes both fuzz tests for about one second each:
./build-unit/packet_test
=== BUG FOUND!
/lab/packet_test.cc:32: Counterexample found for PacketTest.DecodeInvertsEncode.
The test fails with input:
argument 0: "\2037%s%\277kI\371\302..."
=== Regression test draft
TEST(PacketTest, DecodeInvertsEncodeRegression) {
DecodeInvertsEncode(
fuzztest::ToByteArray(std::string("\2037%s%\277kI\371\302..."))
);
}
...
[ FAILED ] PacketTest.DecodeInvertsEncode (1005 ms)
[ OK ] PacketTest.ParseNeverReadsOutOfBounds (1006 ms)
Two observations follow. First, even without coverage instrumentation, random generation found a payload longer than 255 bytes within one second and reported it together with a draft regression test that reconstructs the failing value in source code. Second, the out-of-bounds read in the second property was not detected. Unit-test mode builds without AddressSanitizer, so the one-byte read beyond the buffer occurs silently. This illustrates a point made in Part 1: a sanitizer is part of the oracle, and an unsanitized build cannot detect a defect that does not crash.
2.5 Results in fuzzing mode
The fuzzing-mode build lists its fuzz tests and runs one at a time. The environment variable FUZZTEST_REPRODUCERS_OUT_DIR instructs FuzzTest to write each failing input to a file:
./build-fuzz/packet_test --list_fuzz_tests
FUZZTEST_REPRODUCERS_OUT_DIR=$PWD/repro \
./build-fuzz/packet_test --fuzz=PacketTest.ParseNeverReadsOutOfBounds
==3008==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x502000000661 ...
READ of size 1 at 0x502000000661 thread T0
#0 ... in ParsePacket(unsigned char const*, unsigned long) /lab/packet_test.cc:42:14
...
=== BUG FOUND!
/lab/packet_test.cc:51: Counterexample found for PacketTest.ParseNeverReadsOutOfBounds.
argument 0: "\221"
=== Reproducer
Reproducer file was dumped at:
/lab/repro/aa0490293f1b1b83
With sanitizer and coverage instrumentation, the fuzzer found the out-of-bounds read in 0.44 seconds. The counterexample is a single byte, \221 (decimal 145), which declares 145 payload bytes in a one-byte input. The saved file replays the failure directly, without further fuzzing:
FUZZTEST_REPLAY=$PWD/repro/aa0490293f1b1b83 \
./build-fuzz/packet_test --gtest_filter=PacketTest.ParseNeverReadsOutOfBounds
Running the round-trip property in fuzzing mode produced the expected failure, in which the decoded payload is empty while the original is not. Since the decoder returns an empty payload only when the stored length byte is zero, and the domain limits payloads to 400 bytes, the counterexample must contain exactly 256 bytes, whose length wraps to zero when stored in one byte. The defect is a narrowing conversion, which produces no crash and no sanitizer report, and is visible only to a property that compares the decoded value with the original.
2.6 Domains and seeds
Domains are FuzzTest's mechanism for encoding knowledge of the input space. Table 1 lists the most useful ones, all in the fuzztest namespace [1].
| Domain | Values produced | Example |
|---|---|---|
Arbitrary<T>() | Any value of type T, including containers and protocol buffers | Arbitrary<std::string>() |
InRange(min, max) | Values in a closed interval | InRange(0, 10) |
Positive<T>(), NonNegative<T>(), NonZero<T>() | Numbers satisfying a sign constraint | Positive<int>() |
ElementOf({...}) | One of a fixed set of values | ElementOf({0xDEADBEEF, 0xFEEDFACE}) |
StringOf(d), AsciiString(), InRegexp(r) | Strings from a character domain or matching a regular expression | InRegexp("[0-9]{4}-[0-9]{2}-[0-9]{2}") |
VectorOf(d) with .WithMinSize, .WithMaxSize | Containers of bounded size | VectorOf(InRange(0, 10)).WithMaxSize(3) |
OneOf(d1, d2), Just(v) | Values from any of several domains, or one constant | OneOf(Just(-1), Positive<int>()) |
StructOf<T>(...), Map(f, d...) | User-defined types built from component domains | StructOf<Packet>(InRange(0, 255), Arbitrary<std::string>()) |
Seeds may be attached either to the test or to a domain. Seeds attached with .WithSeeds() on the FUZZ_TEST macro are executed directly as test inputs, while seeds attached to a domain bias generation towards particular values; for example, Arbitrary<int>().WithSeeds({200, 404, 500}) makes common HTTP status codes more likely [1]. A corpus of existing files can be loaded with fuzztest::ReadFilesFromDirectory().
2.7 Assessment
FuzzTest's principal strength is that it removes the distinction between unit tests and fuzz tests. A property written once runs briefly on every build in unit-test mode and continuously in fuzzing mode, and its typed domains eliminate most of the byte-parsing code that libFuzzer harnesses require. Its limitations are its scope (C++ only, Clang only, Linux only), the substantial build time of its dependencies, and the fact that the cheap unit-test mode omits sanitizers, so memory-safety defects are found only in fuzzing mode. For new C++ code, particularly in projects that already use GoogleTest, it is now the natural default. Existing libFuzzer harnesses can continue to run unchanged, and the compatibility mode allows FuzzTest properties to run under libFuzzer during a migration.
3. LibAFL
3.1 A fuzzer as a composition of components
The anatomy of a fuzzer in Part 1, Section 3 described five components: a generator or mutator, a harness, an oracle, feedback and a reproducer. In libFuzzer and AFL++ these components are fixed parts of a single program. LibAFL, written in Rust, makes each of them a separate, replaceable type, and a fuzzer is assembled by choosing an implementation of each [3]. Table 2 lists the main components and relates them to the vocabulary of Part 1.
| LibAFL component | Role | Part 1 equivalent |
|---|---|---|
| Input | The representation of a test case, usually bytes | Test input |
| Executor | Runs the target on an input: in process, in a forked child, or in an emulator | Harness |
| Observer | Collects information about an execution, such as a coverage map | Feedback (collection) |
| Feedback | Decides whether an input is interesting enough to keep | Feedback (decision) |
| Objective | Decides whether an input is a solution, typically a crash | Oracle |
| Corpus | Stores retained inputs, in memory or on disk | Corpus |
| Scheduler | Chooses which corpus entry to mutate next | Queue selection |
| Mutator and Stage | Produce new inputs; a stage applies mutators in a particular way | Mutator |
| State | Holds the corpus, solutions, random-number generator and metadata | Campaign |
| Event manager and Monitor | Report progress and coordinate multiple fuzzing processes | Status display |
The benefit of this decomposition is that a new idea can be evaluated by replacing a single component. A researcher testing a new scheduling policy writes a scheduler and reuses everything else; an engineer fuzzing an unusual target writes an executor and reuses the mutators and feedback. The cost is that the user must understand, and explicitly assemble, all of the parts.
3.2 Experiment: rebuilding the experiment of Part 1
To make the decomposition concrete, Figure 3 reconstructs the experiment of Part 1, Section 5 from LibAFL components. The target is the same: a crash guarded by the four-byte header FUZZ. Because the target is a Rust closure rather than compiled C code, there is no compiler instrumentation; instead the harness writes to a small array, SIGNALS, at each branch, which serves as a hand-made coverage map. The structure follows LibAFL's own introductory example, baby_fuzzer.
# Cargo.toml
[package]
name = "fuzz_header"
version = "0.1.0"
edition = "2021"
[dependencies]
libafl = "=0.16.1"
libafl_bolts = "=0.16.1"
[profile.release]
panic = "abort"
debug = true
use std::{path::PathBuf, ptr::write};
use libafl::{
corpus::{InMemoryCorpus, OnDiskCorpus},
events::SimpleEventManager,
executors::{ExitKind, InProcessExecutor},
feedbacks::{CrashFeedback, MaxMapFeedback},
fuzzer::{Fuzzer, StdFuzzer},
generators::RandPrintablesGenerator,
inputs::{BytesInput, HasTargetBytes},
monitors::SimpleMonitor,
mutators::{havoc_mutations::havoc_mutations, scheduled::HavocScheduledMutator},
observers::ConstMapObserver,
schedulers::QueueScheduler,
stages::mutational::StdMutationalStage,
state::StdState,
};
use libafl_bolts::{current_nanos, nonnull_raw_mut, nonzero, rands::StdRand, tuples::tuple_list};
// A hand-made coverage map: one entry per branch of the target.
const SIGNALS_LEN: usize = 16;
static mut SIGNALS: [u8; SIGNALS_LEN] = [0; SIGNALS_LEN];
static mut SIGNALS_PTR: *mut u8 = &raw mut SIGNALS as _;
fn signals_set(idx: usize) {
unsafe { write(SIGNALS_PTR.add(idx), 1) };
}
fn main() {
// The target: the four-byte header from Part 1, with each branch reporting coverage.
let mut harness = |input: &BytesInput| {
let target = input.target_bytes();
let buf = ⌖
signals_set(0);
if buf.len() >= 4 && buf[0] == b'F' {
signals_set(1);
if buf[1] == b'U' {
signals_set(2);
if buf[2] == b'Z' {
signals_set(3);
if buf[3] == b'Z' {
panic!("bug behind the header");
}
}
}
}
ExitKind::Ok
};
// Observer: reads the coverage map after each execution.
let observer = unsafe { ConstMapObserver::from_mut_ptr("signals", nonnull_raw_mut!(SIGNALS)) };
// Feedback: an input is interesting if it sets a map entry never set before.
let mut feedback = MaxMapFeedback::new(&observer);
// Objective: an input is a solution if the target crashes.
let mut objective = CrashFeedback::new();
// State: random source, corpus in memory, solutions on disk.
let mut state = StdState::new(
StdRand::with_seed(current_nanos()),
InMemoryCorpus::new(),
OnDiskCorpus::new(PathBuf::from("./crashes")).unwrap(),
&mut feedback,
&mut objective,
)
.unwrap();
let mon = SimpleMonitor::new(|s| println!("{s}"));
let mut mgr = SimpleEventManager::new(mon);
let scheduler = QueueScheduler::new();
let mut fuzzer = StdFuzzer::new(scheduler, feedback, objective);
// Executor: runs the harness in this process and catches crashes.
let mut executor = InProcessExecutor::builder()
.harness(&mut harness)
.observers(tuple_list!(observer))
.fuzzer(&mut fuzzer)
.state(&mut state)
.event_mgr(&mut mgr)
.build()
.expect("Failed to create the executor");
// Initial corpus: eight random printable inputs of up to 32 bytes.
let mut generator = RandPrintablesGenerator::new(nonzero!(32));
state
.generate_initial_inputs(&mut fuzzer, &mut executor, &mut generator, &mut mgr, 8)
.expect("Failed to generate the initial corpus");
// Mutational stage using AFL-style havoc mutations.
let mutator = HavocScheduledMutator::new(havoc_mutations());
let mut stages = tuple_list!(StdMutationalStage::new(mutator));
fuzzer
.fuzz_loop(&mut stages, &mut executor, &mut state, &mut mgr)
.expect("Error in the fuzzing loop");
}
Cargo.toml and src/main.rs: the header experiment assembled from LibAFL components.Each component of Table 2 appears explicitly. The observer reads the SIGNALS map; MaxMapFeedback keeps an input if it sets an entry that no earlier input set; CrashFeedback classifies a crash as a solution; the state stores retained inputs in memory and solutions on disk; and a single mutational stage applies AFL's havoc mutations to inputs chosen by a first-in, first-out scheduler. The release profile sets panic = "abort" so that a Rust panic terminates the process with a signal that the in-process executor can catch. The program was built with Rust 1.100.0 and run three times with a 30-second limit:
cargo build --release
timeout 30 ./target/release/fuzz_header
[Testcase #0] ... corpus: 1, objectives: 0, executions: 1, ... signals: 1/16 (6%)
[Testcase #0] ... corpus: 2, objectives: 0, executions: 834, ... signals: 2/16 (12%)
[Testcase #0] ... corpus: 3, objectives: 0, executions: 85027, ... signals: 3/16 (18%)
[Testcase #0] ... corpus: 4, objectives: 0, executions: 106970, ... signals: 4/16 (25%)
[Objective #0] ... corpus: 4, objectives: 1, executions: 110090, ... signals: 4/16 (25%)
The log shows the staircase described in Part 1, Section 5.4 directly. Each Testcase line records an input that set one more entry of the coverage map and was therefore added to the corpus, and the Objective line records the crash. Across the three runs the fuzzer found the crash after 34,909, 110,090 and 454,640 executions respectively, which is the same order of magnitude as libFuzzer's 33,000 to 137,000 in Part 1 and the same high variance between runs that Part 2, Section 4 warned of. The crashing input is written to the crashes directory.
3.3 From the example to real targets
The hand-made coverage map is the only part of Figure 3 that would not be used on a real target. For C and C++ code, LibAFL provides a compiler wrapper (libafl_cc) and runtime support (libafl_targets) that insert and read SanitizerCoverage instrumentation, the same instrumentation used by libFuzzer. For binaries without source, LibAFL provides executors that observe coverage through emulation or dynamic instrumentation: libafl_qemu for QEMU, libafl_frida for FRIDA, libafl_tinyinst for TinyInst, libafl_unicorn for the Unicorn emulator, libafl_nyx for snapshot-based fuzzing of whole virtual machines, and libafl_intelpt for Intel Processor Trace. The single-process event manager of Figure 3 can be replaced with one based on LibAFL's low-level message-passing layer, which runs one fuzzing client per core and shares interesting inputs between them.
For users who want LibAFL's runtime without assembling a fuzzer, the libafl_libfuzzer crate is a drop-in replacement for libFuzzer. According to its documentation, a Rust project that uses cargo-fuzz can switch to it by changing a single dependency in its fuzzing manifest, and C or C++ targets linked with -fsanitize=fuzzer can link against it instead; it requires a nightly Rust toolchain with the llvm-tools component [4]:
# fuzz/Cargo.toml: before
libfuzzer-sys = "0.4"
# after
libfuzzer-sys = { version = "0.16.1", package = "libafl_libfuzzer" }
3.4 Assessment
LibAFL is the most flexible of the three frameworks and the most demanding. It is the appropriate choice when no standard engine fits the target, for example an unusual processor, an embedded runtime or a stateful system that requires a custom executor, and when the goal is research on fuzzing itself, since individual components can be varied under controlled conditions. Its costs are the need for Rust, the effort of assembling a fuzzer explicitly, and an interface that is still evolving between releases: the executor constructor used in LibAFL's own introductory example was deprecated in version 0.16.1 in favour of the builder shown in Figure 3. Versions should therefore be pinned exactly, as in the manifest above.
4. WinAFL
4.1 How WinAFL works
WinAFL is a fork of the original AFL for Windows, maintained by Google Project Zero [2]. Because Windows software is usually distributed without source code, and because creating a new process on Windows is expensive, WinAFL combines two techniques. It obtains coverage by instrumenting the running binary, by default with the DynamoRIO dynamic binary instrumentation framework; alternative backends use Intel Processor Trace, TinyInst or static rewriting with Syzygy. And it avoids repeated process creation by running in a persistent mode in which a single target function inside the program is executed repeatedly [2].
The execution of a campaign proceeds as follows. The target program is started under instrumentation and runs normally until it reaches the target function. From that point WinAFL records coverage until the function returns. It then writes the next test input to the input file and redirects execution back to the start of the target function, restoring its arguments. After a configured number of iterations the process is terminated and restarted, which limits the accumulation of leaked memory and other state [2].
4.2 Choosing the target function
The persistent loop is valid only if the target function satisfies a set of requirements. The WinAFL documentation states that the function must open the input file, parse it, close the file, and return normally, without calling ExitProcess() or an equivalent [2]. The file must be opened within the function on every iteration, since WinAFL rewrites it between iterations, and it must be closed, otherwise WinAFL cannot replace it and must restart the process instead. If the program does not contain such a function, the analyst typically writes a small harness program that loads the target library and calls the parsing routine from a function that meets these requirements.
The function is identified either by name, if it is exported or symbols are available, with -target_method, or by its offset from the start of the module with -target_offset. The offset is obtained from a disassembler such as Ghidra or IDA by subtracting the module's preferred base address from the function's address. The analyst must also state the number of arguments the function takes, -nargs, so that WinAFL can save and restore them, and, where it differs from the platform default, its calling convention, -call_convention.
4.3 Verifying the set-up
The documentation recommends verifying every configuration in debug mode before fuzzing [2]. In this mode the WinAFL instrumentation runs without the fuzzer, executes the target function a fixed number of times, and writes a log file describing the loaded modules, the files opened and the coverage collected. The following command, adapted from the documentation's example of a GDI+ image-parsing harness, runs the target function ten times:
path\to\DynamoRIO\bin64\drrun.exe -c winafl.dll -debug ^
-target_module test_gdiplus.exe -target_offset 0x16e0 ^
-fuzz_iterations 10 -nargs 2 -- test_gdiplus.exe input.bmp
A correct configuration produces a log in which the handlers that run before and after the target function each appear exactly ten times and the input file is opened on every iteration. The log also lists the names of the loaded modules, which must match the names later passed to -coverage_module; module names are compared without regard to case [2].
4.4 Running a campaign
A WinAFL command line has three parts, separated by --: the options of afl-fuzz, the instrumentation options, and the target command line. The documentation's example fuzzes the GDI+ harness, recording coverage in the two libraries that perform the parsing:
afl-fuzz.exe -i in -o out -D C:\work\winafl\DynamoRIO\bin64 -t 20000 -- ^
-coverage_module gdiplus.dll -coverage_module WindowsCodecs.dll ^
-fuzz_iterations 5000 -target_module test_gdiplus.exe -target_offset 0x16e0 ^
-nargs 2 -- test_gdiplus.exe @@
The option -D gives the location of the DynamoRIO binaries, and -t sets the timeout in milliseconds. As in AFL++, @@ is replaced by the path of the current test input. Table 3 summarises the instrumentation options.
| Option | Meaning |
|---|---|
-coverage_module | A module whose coverage is recorded; may be repeated. Usually the libraries that do the parsing, not the executable. |
-target_module | The module containing the target function |
-target_method or -target_offset | The target function, by exported name or symbol, or by offset from the module start |
-nargs | The number of arguments of the target function, saved and restored between iterations |
-call_convention | The calling convention, if not the default: stdcall, fastcall, thiscall or ms64 |
-fuzz_iterations | The maximum number of iterations of the target function before the process is restarted |
-covtype | Basic-block coverage (bb, the default) or edge coverage (edge) |
-thread_coverage | Records coverage only from the thread that runs the target function |
-persistence_mode in_app | The application loops over inputs itself, so WinAFL does not redirect execution |
-debug | Runs the instrumentation without the fuzzer and writes a diagnostic log |
4.5 Troubleshooting
Most WinAFL failures are configuration errors, and the debug log of Section 4.3 is the first diagnostic tool for all of them. The most frequent problems are the following.
- “No instrumentation detected”. AFL-derived fuzzers report this when the initial dry run records no coverage at all. In WinAFL the usual causes are a
-coverage_modulename that does not match the module actually loaded, a target function that is never reached with the supplied input, or a mismatch between the bitness of the target and that of DynamoRIO andwinafl.dll. The debug log shows which modules were loaded and whether the target function ran. - Timeouts on the initial inputs. The documentation advises running in debug mode first and starting the fuzzer only after the log is correct [2].
- Very low throughput. Two documented causes are loading a library inside the target function, which forces DynamoRIO to re-translate the library on every iteration, and failing to close the input file, which forces WinAFL to restart the process [2].
- The meaning of
-fuzz_iterations. It does not limit the length of the campaign. It is the number of iterations after which the target process is restarted, a trade-off between speed and the accumulation of state; the documentation's example uses 5,000.
4.6 Platform requirements and alternatives
WinAFL targets x86 and x64 Windows. For this article it was not possible to run a campaign: the only Windows system available was Windows 11 on ARM64, and DynamoRIO (build 11.92) failed to instrument x86 and x64 programs under the operating system's emulation layer, crashing with an access violation in the 64-bit case and hanging in the 32-bit case. The commands and behaviour in this section are therefore taken from the WinAFL documentation [2], and readers should use an x86 or x64 Windows machine or virtual machine.
Two alternatives are worth knowing. Jackalope, also from Project Zero, is a newer fuzzer built on the TinyInst instrumentation library. LibAFL, described in Section 3, includes Windows examples built on FRIDA, such as a fuzzer for the same GDI+ parsing code, and offers a path towards a custom Windows fuzzer when WinAFL's fixed design is too restrictive.
5. Choosing among the frameworks
The three frameworks serve different users and seldom compete directly. Table 4 summarises the comparison.
| FuzzTest | LibAFL | WinAFL | |
|---|---|---|---|
| Primary user | Developers testing their own C++ code | Researchers and engineers with unusual targets | Analysts testing closed-source Windows software |
| Input representation | Typed values from domains | Any type implementing Input; usually bytes | Bytes in a file |
| Coverage source | Compiler instrumentation | Compiler instrumentation, emulation or dynamic instrumentation | Dynamic instrumentation, Intel PT or static rewriting |
| Platforms | Linux, Clang | Linux, macOS, Windows and others | x86 and x64 Windows |
| Main strength | Fuzz tests as ordinary unit tests | Every component can be replaced | Fuzzing without source or a harness |
| Main cost | C++ only; long first build | Rust; explicit assembly; evolving interface | Fragile configuration; target-function constraints |
A developer maintaining a C++ library should begin with FuzzTest, since its properties double as unit tests and its domains remove most harness code. An analyst assessing a Windows application without source should begin with WinAFL, or with Jackalope where WinAFL's assumptions do not hold. LibAFL becomes the right choice when neither of these fits: when the target requires a custom executor, when the analysis requires a custom feedback or scheduler, or when the work is itself research into fuzzing.
6. The tools of this series
Over five parts this series has introduced more than twenty fuzzing tools. Table 5 collects them in one place as a reference. Each row states what the tool is, the setting in which it is typically used, and the part of the series in which it is discussed. The categories follow the structure of the series: general coverage-guided engines first, then tools specialised by language, by target type and by input format.
| Category | Tool | What it is | Typical use | Part |
|---|---|---|---|---|
| Coverage-guided engines | libFuzzer | In-process, coverage-guided fuzzing engine built into the Clang compiler | Fuzzing individual C and C++ functions; widely used by OSS-Fuzz; now in maintenance | 1, 2 |
| AFL++ | The maintained successor to AFL; fuzzes whole programs that read a file or standard input, with source or binary-only instrumentation | Command-line tools, file parsers and research campaigns | 2 | |
| honggfuzz | A coverage-guided engine with software and hardware feedback | An alternative engine run alongside AFL++ for variety | 2 | |
| LibAFL | A Rust library of fuzzer components assembled into custom fuzzers | Unusual targets, custom executors and fuzzing research | 5 | |
| Property-based and test-integrated | FuzzTest | Google's C++ framework for property-based fuzz tests inside GoogleTest | Fuzzing one's own C++ code as part of ordinary unit testing | 5 |
| Hypothesis, fast-check | Property-based testing libraries for Python and JavaScript | Checking round trips, invariants and business rules | 1 | |
| Language fuzzers | Go native fuzzing, cargo-fuzz, Atheris, Jazzer, Jazzer.js | Coverage-guided fuzzers for Go, Rust, Python, the JVM and Node.js | Parsers and libraries in memory-safe languages | 2 |
| SharpFuzz, Foundry, Echidna | Fuzzers for .NET and for Solidity smart contracts | Managed code; invariant testing of contracts | 2 | |
| Binary-only and system | AFL++ QEMU and FRIDA modes | Run-time instrumentation of binaries without source | Closed-source Linux and Android binaries | 2 |
| WinAFL | An AFL fork that fuzzes a target function inside a running Windows binary | Closed-source Windows applications and libraries | 5 | |
| Jackalope | A Windows fuzzer from Project Zero built on TinyInst | An alternative where WinAFL's assumptions do not hold | 5 | |
| syzkaller | A system-call fuzzer that runs the kernel in disposable virtual machines | Operating-system kernels, notably Linux | 2 | |
| Web and API | ffuf, feroxbuster, gobuster | Wordlist-driven fuzzers for HTTP paths, parameters, headers and values | Content discovery and payload fuzzing in web testing, CTFs and bug bounties | 3 |
| Burp Intruder, ZAP Fuzzer | Fuzzers inside intercepting proxies | Authenticated or stateful web requests | 3 | |
| Schemathesis, RESTler | Fuzzers driven by an OpenAPI description | API testing in development pipelines; stateful sequences of REST calls | 3 | |
| Network protocols | boofuzz | A grammar-based protocol fuzzer descended from Sulley | Network services whose message format can be described | 3 |
| AFLNet | A greybox fuzzer with protocol-state feedback | Research on stateful network servers | 3 | |
| LLM applications | garak, promptfoo, PyRIT | Generators and evaluators of adversarial inputs for language models and their applications | Testing LLM applications and agents in staging | 4 |
| Continuous fuzzing | OSS-Fuzz, ClusterFuzzLite | Services that run fuzz targets continuously and report defects | Open-source projects; any project's CI pipeline | 2 |
Two patterns are visible in the table. Tools that can observe the program's internals, the coverage-guided engines and language fuzzers, dominate wherever source code or a binary is available, because coverage feedback makes them far more efficient than blind generation. Tools that cannot, the web, API, protocol and LLM tools, compensate with knowledge of the input format, in the form of wordlists, schemas, grammars or attack libraries, and depend correspondingly more on a well-defined oracle.
7. Conclusion
This article examined three frameworks that extend the engines of the earlier parts in different directions. FuzzTest expressed the packet properties of this series as typed fuzz tests: its unit-test mode found the length-truncation defect in about one second but missed the out-of-bounds read because it runs without a sanitizer, while its fuzzing mode found the read in under half a second and saved a replayable reproducer. LibAFL rebuilt the experiment of Part 1 from explicit components and reproduced its coverage staircase. WinAFL's persistent, dynamically instrumented design was described together with the configuration, verification and troubleshooting that its use requires. Finally, Table 5 gathered every tool covered by the series into a single reference. The principal points are the following.
- FuzzTest makes fuzz tests part of ordinary testing. A property with typed domains runs on every build and can also be fuzzed continuously, but memory-safety defects require its sanitized fuzzing mode.
- LibAFL makes the fuzzer itself programmable. Each component of the fuzzing loop can be replaced, which suits unusual targets and research, at the cost of explicit assembly and a changing interface.
- WinAFL makes closed-source Windows code fuzzable. Its effectiveness depends almost entirely on choosing a valid target function and verifying the configuration in debug mode before fuzzing.
- The choice follows from the target and the user. Own C++ code favours FuzzTest, closed Windows binaries favour WinAFL or Jackalope, and anything else is a candidate for LibAFL.
- The method is unchanged. Each framework still depends on a well-chosen oracle, a reproducible failing input and an honest account of what the campaign did not test.
Exercises
- Rewrite the record format of Part 1, Section 7.1 as a FuzzTest property, using
StringOfto generate names that may contain the delimiter, and confirm that unit-test mode finds the defect. - Modify Figure 3 so that the header is checked with a single comparison of four bytes, as in Part 1, Section 5.5. Observe how the coverage staircase disappears, and consider which LibAFL component would restore it.
- On an x64 Windows virtual machine, write a harness that loads a parsing library and satisfies the target-function requirements of Section 4.2, then verify it in WinAFL debug mode before fuzzing.
- On CyberLearner, the StackSmash binary can be fuzzed locally with AFL++ in QEMU mode, as in Part 2, Section 6, and then with a LibAFL QEMU executor, which allows the two approaches to be compared on the same target.
References
- Google, FuzzTest: README, CMake quickstart, domains reference and
FUZZ_TESTmacro documentation. - Google Project Zero, WinAFL: README and DynamoRIO mode documentation.
- A. Fioraldi, D. Maier, D. Zhang and D. Balzarotti, LibAFL: a framework to build modular and reusable fuzzers, Proc. ACM CCS, 2022; LibAFL repository.
- LibAFL project, libafl_libfuzzer documentation.
- LLVM Project, libFuzzer, status section.
- D. Wagner, Fuzzing intro, lecture notes, CS261, UC Berkeley, January 2026.
- Trail of Bits, Extending Ruzzy with LibAFL, April 2026.
Recorded runs, 30 November 2026: FuzzTest at commit 5d586d5 with Clang 18.1.3 on Ubuntu 24.04 (arm64); LibAFL 0.16.1 with Rust 1.100.0 on Debian bookworm (arm64). The libafl_libfuzzer and WinAFL material is documentation-checked; no WinAFL campaign was run, for the reason given in Section 4.6.