mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-23 12:40:19 +01:00
071ecb491c
Prevents use of public corpus without API key.
34 lines
729 B
Bash
Executable file
34 lines
729 B
Bash
Executable file
#!/bin/bash
|
|
set -xe
|
|
|
|
# Validate arguments
|
|
if [ "$#" -ne 1 ]; then
|
|
echo "Usage: $0 <fuzz-type>"
|
|
exit 1
|
|
fi
|
|
|
|
# Configure
|
|
ROOT=./server
|
|
TYPE=$1
|
|
|
|
# Setup
|
|
export GO111MODULE="off"
|
|
go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
|
|
go get -d -v -u ./...
|
|
if [ ! -f fuzzit ]; then
|
|
wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.29/fuzzit_Linux_x86_64
|
|
chmod a+x fuzzit
|
|
fi
|
|
|
|
# Fuzz
|
|
function fuzz {
|
|
FUNC=Fuzz$1
|
|
TARGET=$2
|
|
DIR=${3:-$ROOT}
|
|
go-fuzz-build -libfuzzer -func $FUNC -o fuzzer.a $DIR
|
|
clang -fsanitize=fuzzer fuzzer.a -o fuzzer
|
|
./fuzzit create job --type $TYPE $TARGET fuzzer
|
|
}
|
|
fuzz Profile profile
|
|
fuzz HTTP http
|
|
fuzz HTTPS https
|