DRAKVUF Dynamic Malware Analysis System
This project aims at fuzzing operating system drivers and system calls, without presence of an agent or kernel module inside the target. This project builds on drakvuf and the famous American fuzzy lop. Drakvuf provides the functionality to inject a processs into the guest OS (read libinjector. We extend this to inject arbitrary function calls. We also integrate this with AFL. In all tool takes the list of functions that user wants to inject with sample input and fuzzes the input file to generate new input files.
Fuzzer injects multiple functions and may cause blue screen of death. In such a event we need to restart the VM which reduces speed of fuzzing. To reduce the waiting time during the booting up of VM we save a VM once it starts and restore it when a restart is required. We provide restore_script.sh for this. restore_script.sh requires a saved VM and certain environment variables to be set. Follow the procedure given below to set it up
#xl create win.cfg
#xl save <name of vm> <vm-save-file>
echo OS_FUZZ_XEN_SAV_FILE=<vm-save-file> >> /etc/environment
echo OS_FUZZ_DOMAIN_SAVED_VOLUME=<path-to-saved-xen-lvm-volume> >> /etc/environment
echo OS_FUZZ_DOMAIN_VOLUME=<path-to-xen-lvm-volume> >> /etc/environment
#dd if=$OS_FUZZ_DOMAIN_VOLUME of=OS_FUZZ_DOMAIN_SAVED_VOLUME bs=1M
make
cd ..
sudo AFL/afl-fuzz -i <path to in> -o <path to out> -t 30000 -m 500 src/afl_injector -d <domain-name> -r <path-to-domain-rekall-profile> -f @@ -i <pid of process to be hijacked>
{
"calls": [
{
"module-name": "DummyDriver.sys",
"module-rekall-profile": "<path to rekall profile of module>",
"function-name": "add1",
"arguments": [
{
"type": "INTEGER",
"value": 20000
}
]
} ,
{
"module-rekall-profile": "<path to rekall profile of module>",
"function-name": "sub1",
"module-name": "DummyDriver.sys",
"arguments": [
{
"type": "INTEGER",
"value": 10001
}
]
}
]
}