Skip to content

Misc Instructions

Prashast Srivastava edited this page Oct 1, 2024 · 2 revisions

Docker misc instructions

  • Restart the image
docker start optfuzz_eval

Compilation/Run instructions

  • Build fuzzer (re-run whenever you make any changes on the fuzzer side)
cd /workspace/OptFuzzer
DEBUG=1 CC=clang-15 CXX=clang++-15 make
  • Build target (eg. libxml2)
cd /workspace/fuzzopt-eval/fuzzdeployment/targets/libxml2
./preinstall.sh
./build_aflpp.sh optfuzz_nogllvm
  • Run target
cd /workspace/fuzzopt-eval/fuzzdeployment/targets/libxml2/binaries/optfuzz_build
/worskpace/OptFuzzer/afl-fuzz -k -p wd_scheduler -i ../../seeds -o out -- ./xmllint @@
  • Debug target
cd /workspace/fuzzopt-eval/fuzzdeployment/targets/libxml2/binaries/optfuzz_build
gdb --args /worskpace/OptFuzzer/afl-fuzz -k -p wd_scheduler -i ../../seeds -o out -- ./xmllint @@
  • Setup fuzz-specific args
#!/bin/bash

# Pre-requisites for setting up  environment for AFL
sudo bash -c "echo core >/proc/sys/kernel/core_pattern"
cd /sys/devices/system/cpu

# If running inside a VM there will be no scaling governor
if [ -f cpu0/cpufreq/scaling_governor ]; then
    sudo bash -c "echo performance | tee cpu*/cpufreq/scaling_governor"
else
    echo "[X] Running inside a VM, no scaling governor found." 
fi
cd -

Clone this wiki locally