Skip to content

Instantly share code, notes, and snippets.

@oxagast
Last active December 7, 2017 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxagast/df155e59ce25a3edc1bfb78700a7611e to your computer and use it in GitHub Desktop.
Save oxagast/df155e59ce25a3edc1bfb78700a7611e to your computer and use it in GitHub Desktop.
# bermise_fuzz
# oxagast
mupr="64";
syslog_crashes=$(grep "traps:\|segfault" /var/log/syslog -c);
binname="$1";
binshort=$(echo $binname | awk -F "/" '{print $NF}')
echo fuzzing $binname;
randchars=1;
while [ $randchars -le 1 ]
do
kill_timer=`sleep 0.5; killall $binshort 2>/dev/null`;
fuzz=`dd if=/dev/urandom bs=1 count=$mupr 2>/dev/null`;
echo $fuzz > $binshort.tmp;
echo $fuzz | $@; echo $?;
mv $binshort.tmp $binshort.crash.bf;
cat $binshort.out.bf;
if [ `grep "traps:\|segfault" /var/log/syslog -c;` -gt $syslog_crashes ]
then
grep "traps:" /var/log/syslog | tail -n 1;
break;
fi;
done;
echo "Crash found!"
echo "Crash buffer left in: $binshort.crash.bf";
echo "Crash output left in: $binshort.out.bf";
echo;
echo "Crash data:";
od -x ./$binshort.crash.bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment