Note: Incorrect configurations will lead to unexpected behaviors of SEmu like low fuzzing block coverage or inaccurate simulation.
You can use the configuration files provided in our fuzz_tests.
-
If you have cloned SEmu, just cd
/pathto/SEmu/DataSet/fuzz_tests
. -
If not, clone it and cd DataSet:
git clone https://github.com/MCUSec/SEmu cd SEmu/DataSet/fuzz_tests
And use
semu-fuzz-helper
to generate all the configs:semu-fuzz-helper config base_configs.yml
-
You can run this command to see all the configuration files:
find . -maxdepth 3 -type f -name "*config*"
You will see one
base_configs.yml
and manysemu_config.yml
.
Now you can turn to next phrase.
If you want to test your own firmware, please refer to this intruction and our paper to edit the user configuration file.
When you finish it, you will get one base_configs.yml
and many semu_config.yml
.
Then you can turn to next phrase.
As mentioned above, semu_config.yml
is prepared in Phrase 1.
When running AFL, the input_file
is provided by AFL, but when not using AFL, you can provide any file of your choice.
-
Run without AFL:
semu-fuzz <pathto/input_file> <pathto/semu_config.yml>
Note: If you meet "Core dump" when run a single test, use
pip freeze
to determine your dependency. -
Run with AFl:
afl-fuzz -U -m none -i fuzz_tests/f429/CNC/base_inputs -o fuzz_tests/f429/CNC/output2 -t 10000 -- semu-fuzz @@ fuzz_tests/f429/CNC/semu_config.yml
Note: If you don't have
afl-fuzz
, please refer to ../ to install.
Recommend running by our semu-fuzz-helper
.
Run:
cd /pathto/testcase_path
semu-fuzz-helper run base_configs.yml
You can use
-t
to limit the time to run,-t 24
means run 24h test.
Note: If you meet error when run it, you can refer to the last part Run a single testcase, run testcases one by one to find out.
Recommend stating by our semu-fuzz-helper
.
Run:
cd /pathto/testcase_path
semu-fuzz-helper run base_configs.yml
You can use
-t
to set the xrange of images,-t 24
means xrange is 24h.
Note: Please don't change the code in semu-fuzz when stating.
- configuration.md: This document describes the composition of the configuration file for testcases and how to generate batch configuration files.
- debug_in_vscode.md: This documentation explains how to debug in vscode and how to generate batch vscode launch files of testcases.