Fizzer
The name is an acronym, where SBT stands for Symbiotic
https://github.com/staticafi/symbiotic, and Fizzer is
a mixture of FI representing our faculty and fuzzer.
Fizzer is a codebase and playground for students
interested in dynamic program analysis and gray-box fuzzing in
particular.
License
Fizzer is available under the zlib license. It is included as
file LICENSE.txt into the repository: https://github.com/staticafi/fizzer-private
Target platforms
The primary target platform is PC running either Windows 10 (or later) or Ubuntu
22.04 (or later) operating systems.
NOTE: Although Fizzer can be built on Windows 10,
there are still issues running LLVM instrumentation. So, using
the project under Windows is still under construction.
Software dependencies
The following software must be installed on your computer before you can
start with the age project:
Downloading Fizzer
We do not provide Fizzer in binary form. That means you must
download the source code and then build it.
The recommended way of obtaining the source code is via Git. You can
either clone or fork Fizzer's repository. Cloning is recommended for
members of the Fizzer project with Developer rights. Forking is then for
everyone else. Both procedures are described in the subsections below.
NOTE: Alternatively, you can also download a ZIP package with the source
code from the project's website: https://github.com/staticafi/fizzer-private
Cloning
Create a new directory on the disk for Fizzer. Let <Fizzer-root-dir>
be the full path to that directory. Now open the console and type
there these commands:
cd <Fizzer-root-dir>
git clone https://github.com/staticafi/fizzer-private.git .
Forking
First, you need to go to GitHub and make a fork of Fizzer project:
Now clone the forked project. The procedure is the same as in the Cloning
subsection above, except the URL in the git clone command, which must
reference your forked repository.
Integrating vcpkg
Before we can build Fizzer in VS Code, we must let VS Code know
where vcpkg is installed (because it contains SW packages Fizzer
needs during the build process). We must create the file
<Fizzer-root-dir>/.vscode/settings.json
with this content:
{
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "<vcpkg-install-dir>/scripts/buildsystems/vcpkg.cmake",
"CMAKE_BUILD_TYPE": "${buildType}"
}
}
where <vcpkg-install-dir> must be replaced by the actual installation directory of vcpkg.
NOTE: When working on Windows, VS Code may have created a "global"
settings file here:
<user-dir>/AppData/Roaming/Code/User/settings.json
Instead of creating the new settings file as described above, you
can just update this existing "global" setting file by adding the section:
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "<vcpkg-install-dir>/scripts/buildsystems/vcpkg.cmake",
"CMAKE_BUILD_TYPE": "${buildType}"
}
The advantage of this approach is that the vcpkg integration
with VS Code would work for all CMake C++ projects on your computer
(including Fizzer of course).
Building Fizzer
Open Microsoft Visual Studio Code and in the main menu choose:
File/Open Folder... and open the Fizzer's directory <Fizzer-root-dir>.
Now you should be able to build Fizzer the same way as any other
CMake C++ application. All needed information is available here:
https://code.visualstudio.com/docs/cpp/introvideos-cpp
Once you successfully build the install target, you can find
the built binaries under the dist directory.
Usage
You can use the compiled binaries either via VS Code or manually in a terminal.
Running binaries in VS Code
First you need to build benchmark(s). So, go to the debugger
tab (Ctrl+Shift+D) and select the target Benman @ dbg.
Then press F5 to start benchmark building. By editing this
target in launch.json file under .vscode folder you can
specify what benchmarks to build. By default this
is set to all, meaning that all benchmarks are compiled.
Now you can debug the fuzzer (server). In the debugger tab
select the target run server. Then press F5 to start debugging.
By editing this target in launch.json file under .vscode
folder you can specify what benchmark will be analyzed during the
debug session. The default setting is one randomly chosen
benchmark.
Running binaries in terminal
The scripts/binaries are found in dist/tools
Instrumenting the target program:
fizzer_instrument [-h] [--output_dir OUTPUT_DIR] target_file
Building the fuzz target:
fizzer_build_target [-h] [--output_dir OUTPUT_DIR] [--no_instrument | --instrument FLAGS] target_file
Instrumenting, building, and running fuzzing in one:
fizzer [-h] [--output_dir OUTPUT_DIR] [--no_instrument | --instrument FLAGS] [--clang FLAGS] [--max_seconds SECONDS] target_file