Skip to content
Snippets Groups Projects
setup-afl.sh 572 B
Newer Older
#!/bin/bash

echo
Anh Nguyen-Tuong's avatar
Anh Nguyen-Tuong committed
echo "Building Fuzzing Support ($ZFUZZ_HOME)"
Anh Nguyen-Tuong's avatar
Anh Nguyen-Tuong committed
if [ -z "$ZFUZZ_HOME" ]; then
	echo "error: environment var $ZFUZZ_HOME is undefined"
	exit 1
fi

cd $ZFUZZ_HOME
Anh Nguyen-Tuong's avatar
Anh Nguyen-Tuong committed

afl_loc=$(which afl-fuzz)
if [ -z "$afl_loc" ]; then
	echo
	echo Setup AFL
	echo 
	wget http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz
	tar -xzvf afl-latest.tgz && rm afl-latest.tgz
Anh Nguyen-Tuong's avatar
Anh Nguyen-Tuong committed
	if [ -d afl ]; then
		rm -fr afl
	fi
	mv afl-* afl
	cd afl
	make
Anh Nguyen-Tuong's avatar
Anh Nguyen-Tuong committed
	sudo make install
#	cd qemu_mode && ./build_qemu_support.sh

	# afl wants this
	sudo $ZFUZZ_HOME/util/afl_setup_core_pattern.sh
fi