-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: support the real coverage in fuzzer #59
Merged
+276
−222
Merged
Changes from 17 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
95ce04f
Executing no docker wafl
Jacarte d07abf8
Building locally script
Jacarte b7c4623
Adding timeout and killng the server at the end
Jacarte 4269c9f
WIP
Jacarte 2be9760
RM swam as submodule
Jacarte b34001e
Downloading and building swam in wafl
Jacarte 7e15592
Infering init values from seed all equal
Jacarte 4e3ee3e
Merge branch 'wasm-fuzzer' into feature/handle-crashed-server
Jacarte b52053c
Merge pull request #60 from KTH/feature/handle-crashed-server
Jacarte e333f3d
HOTFIX: LOG function not found
Jacarte b176502
Removed everything related to docker-compose
olapiv 3998e1a
Put SWAM_SOCKET_HOST into ./env
olapiv 167bf64
Being sure about CURRENT_DIR in build.sh && included run_client.cpp
olapiv e513bdd
Renamed DOCKER_ envs && put wafl.sh as entrypoint
olapiv 100055f
Placed all directory preparations from wafl to prepare_env && placed …
olapiv 90bbbca
Added arguments to docker run; Adjusted README; Re-did .env for Docke…
olapiv cafea9e
Using default temp DIR when running locally; Also parsing arguments w…
olapiv 2f5740a
Uncommented multi-processing again
olapiv 2a7fd0f
Moved all cpp_out into wafl-temp folder
olapiv 87be841
Sourcing prepare_env.sh
olapiv 2d1c564
Fixed supervisord path in Dockerfile
olapiv 653f195
Changed SWAM_CMD
olapiv b4e3860
Adjusted references to files
olapiv d55f941
SWAM in master branch
Jacarte bbcf302
Fixed Code references in build.sh
olapiv b872bf5
Using pwd for mounting Docker volumes
olapiv 743ccb9
Merge branch 'wasm-fuzzer' of https://github.com/KTH/slumps into wasm…
Jacarte 5a2238e
HOTFIX: build script looking for server-wasm swam
Jacarte 1c066ca
Merge branch 'feature/handle-crashed-server' into wasm-fuzzer
olapiv 930e4bd
Merge branch 'wasm-fuzzer' of https://github.com/KTH/slumps into wasm…
olapiv 982f9ff
FIX
Jacarte b816879
FIX: Fixing mill-server-entrypoint script with logs
Jacarte 321b2f9
Changing supervisord entrypoin script location
Jacarte 5891f92
Updating Dockerfile for wafl
Jacarte b9b1a4d
Adjusted entrypoint_mill_server.sh reference in Dockerfile
olapiv 6ccd3bc
Adjusted multi-processing.sh with wafl-temp dir
olapiv 08dc80b
Merge branch 'master' into wasm-fuzzer
olapiv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
aflpp | ||
wafl | ||
out* | ||
fuzzing-server-swam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
echo "Cloning swam" | ||
|
||
|
||
if [ ! -d fuzzing-server-swam ]; then | ||
git clone --single-branch --branch feature/swam-server https://github.com/KTH/swam.git fuzzing-server-swam | ||
fi | ||
|
||
echo "Building SWAM..." | ||
|
||
cd fuzzing-server-swam | ||
git pull | ||
./millw cli.assembly | ||
export SWAM_JAR=$(pwd)/fuzzing-server-swam/out/cli/assembly/dest/out.jar | ||
echo $SWAM_JAR | ||
cd .. | ||
|
||
|
||
# Download afl plus plus | ||
if [ ! -d aflpp ]; then | ||
echo "Downloading aflplusplus..." | ||
git clone https://github.com/AFLplusplus/AFLplusplus.git aflpp | ||
|
||
echo "Building aflplusplus..." | ||
cd aflpp | ||
make distrib | ||
sudo make install | ||
cd .. | ||
fi | ||
|
||
|
||
echo "Building the wafl interface..." | ||
|
||
mkdir -p wafl | ||
|
||
g++ -o wafl/prepare_wasm_input.out ./fuzzing-client-afl/prepare_wasm_input.cpp ./fuzzing-client-afl/utils.cpp | ||
g++ -o wafl/getFileSize.out ./fuzzing-client-afl/getFileSize.cpp ./fuzzing-client-afl/utils.cpp | ||
g++ -o wafl/wait_for_server.out ./fuzzing-client-afl/wait_for_server.cpp ./fuzzing-client-afl/utils.cpp ./fuzzing-client-afl/socket_client.cpp | ||
g++ -o wafl/interface.out ./fuzzing-client-afl/interface.cpp ./fuzzing-client-afl/socket_client.cpp ./fuzzing-client-afl/utils.cpp | ||
|
||
|
||
echo "DONE !" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,17 @@ if [ $? != 0 ]; then | |
exit 1 | ||
fi | ||
|
||
if [[ $LOCAL_AFL != "True" ]]; then | ||
AFL='afl-fuzz' | ||
fi | ||
|
||
# AFL Docs: | ||
# afl-fuzz starts by performing an array of deterministic fuzzing steps, | ||
# which can take several days, but tend to produce neat test cases. | ||
# If you want quick & dirty results right away - akin to zzuf and other | ||
# traditional fuzzers - add the -d option to the command line. | ||
|
||
echo "afl-fuzz -i $DOCKER_AFL_INPUT -o $DOCKER_AFL_OUTPUT $RANK -d -- ${DOCKER_INTERFACE_SRC}/interface.out @@ $REQUIRED_BYTES" | ||
exec afl-fuzz -i $DOCKER_AFL_INPUT -o $DOCKER_AFL_OUTPUT $RANK -d -- "${DOCKER_INTERFACE_SRC}/interface.out" @@ $REQUIRED_BYTES | ||
|
||
echo "$AFL -i $DOCKER_AFL_INPUT -o $DOCKER_AFL_OUTPUT $RANK -d -- ${DOCKER_INTERFACE_SRC}/interface.out @@ $REQUIRED_BYTES" | ||
$AFL -i "$DOCKER_AFL_INPUT" -o $DOCKER_AFL_OUTPUT $RANK -t 12000 -d -- "${DOCKER_INTERFACE_SRC}/interface.out" @@ $REQUIRED_BYTES | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This timeout should not be in master imo. According to AFL it really screws the performance. The timeout is a multiple of the time taken of the first test cases anyways, so we shouldn't worry about it. |
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,6 @@ | |
#include <sys/wait.h> | ||
#include <stdlib.h> | ||
#include <algorithm> | ||
#include <signal.h> | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "exec" is actually quite important for it to work properly with supervisord in Docker. You can't "supervise" detached processes. If I recall correctly, the script will just start again if the main process exits.