From a3b3951eeea43f49bb39224c25d6cc0594e5434b Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Tue, 24 Sep 2019 12:02:14 +0200 Subject: [PATCH] [build] Add a helper to run multiple fuzzers easily --- build/scenario/afl.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 build/scenario/afl.py diff --git a/build/scenario/afl.py b/build/scenario/afl.py new file mode 100644 index 000000000..d78ce3c0e --- /dev/null +++ b/build/scenario/afl.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +import subprocess + +NUMBER_OF_FUZZERS=8 + +def afl_command(name): + return ["afl-fuzz", "-t", "10000", "-i", "scenari", "-o", "afl_out", "-M", "epsilon-fuzz-" + name, "./epsilon.bin"] + +def run_afl(commands, name): + # Launch the fuzzer + subprocess.run(["tmux"] + commands + [" ".join(afl_command(name))]) + # Re-tile the window (so more fuzzers can be added) + subprocess.run(["tmux", "select-layout", "tiled"]) + +# Clean up the "afl_out" folder +subprocess.run(["rm", "-rf", "afl_out"]) + +# Launch fuzzers +run_afl(["new", "-d"], "master") +for i in range(NUMBER_OF_FUZZERS-1): + run_afl(["split-window"], "slave-"+str(i))