#!/usr/bin/env bash # Run a fuzzing test using american fuzzy lop # Add input strings in input set -eux if [ $# -ne 0 ]; then echo "usage: $0 \n" exit 255 fi if [ ! -x /usr/local/lib/desock.so ] ; then echo "preeny desock.so not found" exit 255 fi MEGS=500 # memory limit for child process (50 MB) # remove input and input dirs #test ! -d input || rm -rf input test ! -d output || sudo rm -rf output # create if dirs dont exists #test -d input || mkdir input test -d output || mkdir output APPNAME=example cfg=conf.xml cat < $cfg $cfg *:* /usr/local/share/clixon clixon-example IPv4 4535 127.0.0.1 /usr/local/lib/$APPNAME/clispec /usr/local/lib/$APPNAME/cli $APPNAME /usr/local/var/$APPNAME/$APPNAME.pidfile /usr/local/var/$APPNAME init EOF # kill old sudo /usr/local/sbin/clixon_backend -Fz -f $cfg # Dryrun without afl (commit this for real run): #sudo LD_PRELOAD="/usr/local/lib/desock.so" /usr/local/sbin/clixon_backend -Fs init -f ./conf.xml < input/1.xml # Run script sudo LD_PRELOAD="/usr/local/lib/desock.so" afl-fuzz -i input -o output -d -m $MEGS -- /usr/local/sbin/clixon_backend -Fs init -f $cfg