csilva & GuiS
What is Fuzzing
AFL
AFL all the things
Generate test cases
Record test cases or any other information
Interface with the target to insert inputs
Detect crashes
Samples of valid input are mutated to produce malformed input
Saves inputs and replays them after mutating them
Proxy that mutates the requests
Generate the input from scratch based on some form of inteligence
Given a feedback the input generation is adjusted
mkdir testcases
mkdir results
cat >> test.txt << EOF
input1
input2
input3
EOF
afl-gcc -fno-stack-protector -z execstack <Input_file.c> -o <Output>
afl-fuzz -i ./testcases/ -o ./results/ ./<Bin>
cd results/crashes
ls
id:000000,sig:11,src:000000,op:havoc,rep:64
id:000001,sig:11,src:000002,op:havoc,rep:4
-Q (Qemu mode)
@@ (File input)
-t (timeout)
-m (max memory)
-d (dumb)
afl fork-server
Sockets
Check preeny
mkdir test_cases_after_cmin
mkdir test_cases_after_tmin
afl-cmin -i ./test_cases -o ./test_cases_after_cmin -- ./<Code> -i @@
afl_tmin -i ./test_cases_after_cmin/test_file.extension \
-o ./test_cases_after_tmin/test_file.extension -- ./<Code> -i @@
Use Code/Edge Coverage Feedback
Create good test cases (download/feedback/grammar)
Minimize samples in size and number
Use sanitizers/heap libraries during fuzzing
Modify mutation engine to fit input data
Only instrument code to be tested
Mock everything
Don't fix checksums inside fuzzer, remove them