Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gfoidl committed Nov 5, 2019
1 parent b35862b commit a9bf691
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .azure/pipelines/jobs/fuzzing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- bash: |
cd fuzz
./run.sh $(TIMEOUT) ${{ parameters.method }}
displayName: run
displayName: run
- task: PublishBuildArtifacts@1
condition: failed()
Expand Down
23 changes: 23 additions & 0 deletions fuzz/init-system.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
#!/bin/bash

aptUpdated=0

# make, gcc, patch, etc. get installed if not available
which gcc > /dev/null
if [[ $? -ne 0 ]]; then
if [ $aptUpdated -eq 0 ]]; then
apt update
aptUpdated=1
fi

apt install -y build-essential
fi

which rename > /dev/null
if [[ $? -ne 0 ]]; then
if [ $aptUpdated -eq 0 ]]; then
apt update
aptUpdated=1
fi

apt install -y rename
fi

echo core > /proc/sys/kernel/core_pattern
2 changes: 2 additions & 0 deletions fuzz/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ mkdir -p ./instrumented
cp ../source/gfoidl.Base64/bin/Release/netcoreapp3.0/$lib ./instrumented/$lib

sharpfuzz ./instrumented/$lib

echo "$lib instrumented and ready to go"
5 changes: 5 additions & 0 deletions fuzz/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@ timeout --preserve-status $duration afl-fuzz -i testcases -o findings -m 10000 -

# when there are any reports in ./findings/crashes, so there are failures
if [[ $(ls ./findings/crashes | wc -l) -gt 0 ]]; then
cd findings/crashes

rename 's|:|-|g' *
ls -la

exit 1
fi
7 changes: 0 additions & 7 deletions fuzz/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

set -e

# make, gcc, patch, etc. get installed if not available
which gcc > /dev/null
if [[ $? -ne 0 ]]; then
apt update
apt install -y build-essential
fi

# Download and extract the latest afl-fuzz source package
wget http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz
tar -xvf afl-latest.tgz
Expand Down

0 comments on commit a9bf691

Please sign in to comment.