3 # Note: build and _install_ the toolkit first!
7 if [ ${BASH_VERSINFO} -lt 3 ] ; then
8 echo 'Error: Your bash need to be version 3 or newer. Exiting.'
9 exit 1 # operators like =~ produce errors silently in old bash versions, so exit here
12 archive
='ftp://wireshark.org/automated/captures/'
13 show_output
='' # empty string evaluates to false
14 run_through
='' # empty string evaluates to false
19 if [ $# -gt 0 ] ; then
20 if [ "$1" = '-h' -o "$1" = '--help' -o "$1" = '--usage' ] ; then
21 echo 'Usage: dissector_fuzz [-s (show netsniff-ng output, default: no)] [-r (keep running on errors, default: no)] [netsniff-ng long-args]'
26 if [ "${opt}" = '-s' ] ; then
28 elif [ "${opt}" = '-r' ] ; then
31 netsniff_ng_opts
="${netsniff_ng_opts} ${opt}";
38 wget
-r -Nc -np -nd -A.pcap
"$archive" |
& grep -E "%|^--"
43 echo "Testing file $file ..."
44 if [ $show_output ]; then
45 netsniff-ng
--in "$file" "${netsniff_ng_opts}"
47 netsniff-ng
--in "$file" "${netsniff_ng_opts}" > /dev
/null
50 echo "Fuck, core dumped on $file!"
51 let count_cores
=count_cores
+1
52 if [ $run_through ]; then
60 if which cowsay
> /dev
/null
; then
66 ${echo_cmd} 'Your fuckup Score'
67 echo " * tested pcaps: $count_files"
68 echo " * core dumps: $count_cores"