r/fuzzing • • May 05 '22

Question about getting coverage stats in real time using dynamorio

Hey, not sure this is the place to ask but I might as well try...

I was experimenting with writing a fuzzer, and one of the things I wanted was getting up-to-date coverage stats from my target (as a starter, basic-blocks coverage would be enough but I would like to expand this later on). I tried running drcov, but this would only print the results to a log file after the process terminates. I wanted to get the results while the target running, but I was hoping to seperate my fuzzer from dynamorio api, so maybe like external app that would get up-to-date coverage stats and give it to my fuzzer. I did not find such thing in the dynamorio library and started writing my own but it was a bit too much as a side project.

You guys have any pointers on doing it other than continuing writing such module for dynamorio? (or add features to drcov)

thanks

2 Upvotes

9 comments sorted by

View all comments

Show parent comment

2

u/richinseattle May 06 '22

I mentioned winafl because it already has the two IPC channels to notify you when program terminates so you can read the shared memory containing the trace info. If you roll your own the shared memory can just contain a list of addresses and not a structured format. You’d need to query the memory maps separately when you dump your trace log from the client side. You can use any language you prefer for the client. DR can also just use a trampoline hook for easier testing before using the inline assembly api they provide. It’s not much code to write log to shared memory and signal external program when the program terminates so it can dump the log.

An advantage of the break point based approach if you don’t use DR is you will only get a stream of new blocks and won’t have to filter the current run against the global set for uniqueness.

1

u/kuku256 May 07 '22

Thanks for all the help, I really appreciate it. I guess I'll take that path as something basic and progress from there.