Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
This is a README that contains directions for setting up and compiling the
fuzzing target.

Set up fuzzer:
Run ./setup.sh
This script contains two parts: install packages and compiling the
fuzzer.
This script will install the necessary packages needed by the fuzzer
and check for which version of the service is installed. The script
should be run in a clean fuzzing-specific directory named "fuzzing".
Later steps will not work if the directory is not named "fuzzing".
This script will then Git clone and setup the OptFuzz directory,
creating an OptFuzz subdirectory.
Compiling the target:
Navigate to the directory jsoncpp, which should be located as a sub-directory
in the fuzzing-specific directory. This script will only work if the
fuzzing-specific directory is named "fuzzing".
Run ./new_build_aflpp.sh
The script will clean out the jsoncpp subdirectory, run the pre-
installation script, and set various enviornment variables. It
will the perform various other operations to compile the target.
38 changes: 38 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

#install packages

sudo apt-get update && sudo apt-get -y install --no-install-suggests --no-install-recommends automake cmake meson ninja-build bison flex build-essential git python3 python3-dev python3-setuptools python-is-python3 libtool libtool-bin libglib2.0-dev libcairo2-dev wget vim jupp nano bash-completion less apt-utils apt-transport-https ca-certificates gnupg dialog libpixman-1-dev gnuplot-nox unzip screen beanstalkd python3-pip python3-venv && sudo rm -rf /var/lib/apt/lists/*

sudo apt-get update && sudo apt-get -y install --no-install-suggests --no-install-recommends lsb-release wget software-properties-common gnupg

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 15

sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 10 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-15 --slave /usr/bin/opt opt /usr/bin/opt-15

sudo update-alternatives --install /usr/lib/llvm llvm /usr/lib/llvm-15 20 --slave /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-15 --slave /usr/bin/llvm-link llvm-link /usr/bin/llvm-link-15

# Import and setup OptFuzz

# Check if OptFuzzer directory exists
if [ ! -d "OptFuzzer" ]; then
echo "OptFuzzer directory does not exist. Cloning repository..."
git clone https://github.com/FOX-Fuzz/FOX.git OptFuzzer
else
echo "OptFuzzer directory already exists. Skipping git clone."
fi

cd ./OptFuzzer
export CC=clang-15 && export CXX=clang++-15 && make clean && \
make

# Check if the symbolic link already exists
if [ ! -L /usr/local/bin/llvm-nm ]; then
echo "Creating symbolic link for llvm-nm..."
sudo ln -s /usr/bin/llvm-nm-15 /usr/local/bin/llvm-nm
else
echo "Symbolic link for llvm-nm already exists. Skipping this step."
fi