Skip to content

Instantly share code, notes, and snippets.

@agustingianni
Created December 22, 2016 00:26
Show Gist options
  • Select an option

  • Save agustingianni/2862f0871b9bfb5ab3b3828e34ebacfb to your computer and use it in GitHub Desktop.

Select an option

Save agustingianni/2862f0871b9bfb5ab3b3828e34ebacfb to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
export SAMPLES_DIR=/Users/anon/workspace/fuzzing/tests
export TEST_PROGRAM=/Users/anon/workspace/retools/build/src/tools/binary_info/binary_info
export AFL_PATH=/Users/anon/Downloads/afl-2.35b
export MINIMIZED_SAMPLES_DIR=$SAMPLES_DIR/minimized
mkdir fuzzing_build
pushd fuzzing_build
CC=$AFL_PATH/afl-clang-fast CXX=$AFL_PATH/afl-clang-fast++ cmake ..
AFL_HARDEN=1 make
# Copy only the files that optimize coverage.
$AFL_PATH/afl-cmin -i $SAMPLES_DIR -o $MINIMIZED_SAMPLES_DIR -- $TEST_PROGRAM @@
for i in $MINIMIZED_SAMPLES_DIR/*; do
$AFL_PATH/afl-tmin -i $i -o $i.min -- $TEST_PROGRAM @@;
done;
$AFL_PATH/afl-fuzz -i $MINIMIZED_SAMPLES_DIR -o crashes $TEST_PROGRAM @@
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment