A light-weight version of Moonbeam that uses AFL's internal tuples to generate bitvectors for processing by Moonshine.
python moonlite.py -i <IN_DIR> -o <OUT_DIR> [--input-prefix <IN_PREFIX>] [--output-prefix <OUT_PREFIX> ] [--show-progress]Where:
IN_DIRis the input directory containing all of the AFL tuples;OUT_DIRis the output directory where the bitvectors will be written to;IN_PREFIXis the prefix used by the input files that will be convereted to a bitvector file. The default isafltuples-;OUT_PREFIXis the prefix used by the output bitvector files. The default isexamplar-; and--show-progresswill show the current progress.
The input files are generated using afl-showmap on each seed file, e.g.:
for f in <CORPUS_DIR>/*; do
LD_LIBRARY_PATH=<LIB_PATH> afl-showmap -e -q -m 800 -o <TARGET_DIR>/afltuples-$(basename ${f}) <PUT> <PUT_PARAMS>
doneWhere:
-mspecifies the memory limit;-eignores the tuple hit count (Moonshine does not require it);-qsuppresses program output;-ospecifies the output path/file name. In the above example, the prefixafltuples-will be used;<PUT>is the program under test (PUT); and<PUT_PARAMS>are any arguments that the may take.
Additionally, the tuples are also a byproduct of running afl-cmin. Specify
the environment variable AFL_KEEP_TRACES=1 and the tuples will be located
inside the directory <CMIN_RESULT>/*.traces along with other CMIN
intermediary results.