AFLplusplus / LibAFL

Advanced Fuzzing Library - Slot your Fuzzer together in Rust! Scales across cores and machines. For Windows, Android, MacOS, Linux, no_std, ...
Other
1.99k stars 306 forks source link

How to add custom metadata for solution? #2556

Open Slava0135 opened 1 week ago

Slava0135 commented 1 week ago

I have a differential fuzzer that reads output from stdout and compares it. I want to save the stdout in metadata so I can check the output of programs without rerunning them, but unable to figure out how to do so.

domenukk commented 1 week ago

You can eager_or an extra ToMetadata feedback that will do nothing but append metadata. Specifically, this one: StdOutToMetadataFeedback https://github.com/AFLplusplus/LibAFL/blob/4e54182b357403474edeaf36774502e7bf988e6a/libafl/src/feedbacks/stdio.rs#L107

(Using feedback_or!)

Slava0135 commented 1 week ago

I decided save data to Feedback struct and then use it in append_metadata, maybe this should be put in function description (unless this is not intentional way of doing things). I first thought it wouldn't be called for solution (only for corpus).