an attempt to fuzz stream write/read
-
git clone https://github.com/brainflow-dev/brainflow.git
-
mkdir build
-
cd build
-
cmake -DCMAKE_CXX_COMPILER=afl-clang-fast++ ..
-
create
Makefile
& save -
Prepare harness.cpp
test_harness: harness.cpp
afl-clang-fast++ -v harness.cpp $(INC) ./CMakeFiles/BoardController.dir/third_party/ant_neuro/eemagine/sdk/wrapper.cc.o -o harness $(INCC) $(INCCC) -I../third_party/json/
- run afl-fuzz with default settings:
AFL_AUTORESEUME=1 afl-fuzz -D -L0 -i samples/ -t 80 -o sync_dir -M fuzzer00 -- ./harness @@
make test_brain
./test
test
##########################
###############TEST-CASE##
INCC = \
$(shell find ../cpp_package/ -type d -name "inc" | sed s/^/-I/)
INCCC = \
$(shell find ../src/ -type d -name "inc" | sed s/^/-I/)
INC = \
$(shell find . -type f -name "*.cpp.o" | sed 's/^/ /')
test_brain: test.cpp
afl-clang-fast++ -v test.cpp $(INC) ./CMakeFiles/BoardController.dir/third_party/ant_neuro/eemagine/sdk/wrapper.cc.o -o test $(INCC) $(INCCC) -I../third_party/json/
#########################
python -m pip install brainflow
- run
brainflow.py <CRASHER_NAME>
script with a sample - some files are working on
python
library, some of them are crashing oncpp
- This file also crashes
cpp
one but in python it is acting little bit weird, i couldnt manage to find the right time to analyze it to find out the root cause yet. You have to test this file with full path ofbrainflow.py
for ex:/home/user/brainflow.py id:000016,sig:07,src:000010,time:28990834,execs:64400173,op:MOpt_havoc,rep:8