-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from KTH/wasm-fuzzer
- Loading branch information
Showing
29 changed files
with
1,227 additions
and
104 deletions.
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
103 changes: 0 additions & 103 deletions
103
benchmark_programs/valid_crow/Vigenère_cipher-Cryptanalysis.c
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
*.out | ||
*.dat |
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,35 @@ | ||
# Whether we are using AFL with Swam or just using dummy data | ||
DUMMY_TESTING_AFL=False | ||
|
||
# (Not being used yet..) Error, Warn, Info, Debug | ||
LOG_LEVEL=Error | ||
|
||
# Path to the parent directory of our local .wasm/.wat executable | ||
LOCAL_WASM=/tmp/fuzzer-wat_files | ||
|
||
# Name of our local .wasm/.wat executable | ||
WASM_EXECUTABLE=fibo.wat | ||
|
||
# Path on our local machine for us to read AFL's output | ||
LOCAL_AFL_OUTPUT=/tmp/afl_out | ||
|
||
# Path on our local machine for us to read our own logs | ||
LOCAL_LOGS=/tmp/fuzzer/fuzzerlogs | ||
|
||
# Path on our local machine for us to read SWAM's output (if any) | ||
# SWAM_OUTPUT_LOCAL=/tmp/swam-out | ||
|
||
# Function to be executed in .wasm/.wat ("_start" is default) | ||
TARGET_FUNCTION=clever | ||
|
||
# Parameter types for target function. Comma-separated list of types Int32, Int64, Float32, Float64. | ||
WASM_ARG_TYPES_LIST=Int64 | ||
|
||
# Sample input for target function. Comma-separated list of numbers. | ||
WASM_ARG_LIST=14 | ||
|
||
# Executable has wasi format | ||
WASI=False | ||
|
||
##### No need to change: ##### | ||
SWAM_SOCKET_PORT=9999 |
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,106 @@ | ||
# This Dockerfile aims to substitute the docker-compose configuration | ||
|
||
FROM aflplusplus/aflplusplus | ||
|
||
################ | ||
##### JVM ###### | ||
################ | ||
|
||
RUN yes | apt-get install curl | ||
RUN apt-get update | ||
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata | ||
RUN yes | apt-get install software-properties-common | ||
RUN apt-get update | ||
RUN yes | add-apt-repository ppa:openjdk-r/ppa | ||
RUN apt-get update | ||
RUN yes | apt-get install openjdk-12-jdk-headless | ||
|
||
####################### | ||
##### Supervisor ###### | ||
####################### | ||
|
||
RUN apt-get install -y supervisor | ||
|
||
######################### | ||
##### Scala & Mill ###### | ||
######################### | ||
|
||
# Env variables | ||
ENV SCALA_VERSION 2.13.2 | ||
ENV MILL_VERSION 0.7.0 | ||
|
||
# Define working directory | ||
WORKDIR /root | ||
|
||
# Install Scala | ||
## Piping curl directly in tar | ||
RUN \ | ||
curl -fsL https://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \ | ||
echo >> /root/.bashrc && \ | ||
echo "export PATH=~/scala-$SCALA_VERSION/bin:$PATH" >> /root/.bashrc | ||
|
||
# Install mill | ||
RUN \ | ||
curl -L -o /usr/local/bin/mill https://github.com/lihaoyi/mill/releases/download/$MILL_VERSION/$MILL_VERSION && \ | ||
chmod +x /usr/local/bin/mill && \ | ||
touch build.sc && \ | ||
mill -i resolve _ && \ | ||
rm build.sc | ||
|
||
################################ | ||
#### fuzzing-server (SWAM) ##### | ||
################################ | ||
|
||
ENV DOCKER_SWAM_SRC=/home/server/src | ||
ENV DOCKER_SWAM_OUTPUT=/home/server/out | ||
ENV DOCKER_WASM=/home/server/wasm | ||
|
||
# Create the appropriate directories | ||
RUN mkdir -p $DOCKER_SWAM_SRC | ||
RUN mkdir -p $DOCKER_SWAM_OUTPUT | ||
RUN mkdir -p $DOCKER_WASM | ||
|
||
WORKDIR $DOCKER_SWAM_SRC | ||
|
||
# TODO: Find way of installing dependencies with Mill without copying over entire repo | ||
# See: https://stackoverflow.com/questions/62834693/mill-build-tool-install-dependencies-without-compiling-source-code | ||
|
||
ADD ./fuzzing-server $DOCKER_SWAM_SRC | ||
|
||
RUN chmod +x $DOCKER_SWAM_SRC/entrypoint_mill_server.sh | ||
|
||
############################# | ||
#### fuzzing-client-afl ##### | ||
############################# | ||
|
||
ENV DOCKER_INTERFACE_SRC=/home/client/interface | ||
ENV DOCKER_AFL_INPUT=/home/client/in | ||
ENV DOCKER_AFL_OUTPUT=/home/client/out | ||
|
||
# Create the appropriate directories | ||
RUN mkdir -p $DOCKER_INTERFACE_SRC | ||
RUN mkdir -p $DOCKER_AFL_INPUT | ||
RUN mkdir -p $DOCKER_AFL_OUTPUT | ||
WORKDIR $DOCKER_INTERFACE_SRC | ||
|
||
ADD ./fuzzing-client-afl $DOCKER_INTERFACE_SRC | ||
|
||
RUN g++ -o ./prepare_wasm_input.out ./prepare_wasm_input.cpp ./utils.cpp | ||
RUN g++ -o ./getFileSize.out ./getFileSize.cpp ./utils.cpp | ||
RUN g++ -o ./wait_for_server.out ./wait_for_server.cpp ./utils.cpp ./socket_client.cpp | ||
RUN g++ -o ./interface.out ./interface.cpp ./socket_client.cpp ./utils.cpp | ||
|
||
RUN chmod +x $DOCKER_INTERFACE_SRC/entrypoint_afl.sh | ||
|
||
######################### | ||
######## Shared ######### | ||
######################### | ||
|
||
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
|
||
ENV DOCKER_SHARED=/home/shared | ||
ENV DOCKER_LOGS=$DOCKER_SHARED/logs | ||
|
||
RUN mkdir -p $DOCKER_LOGS | ||
|
||
ENTRYPOINT ["/usr/bin/supervisord"] |
Oops, something went wrong.