AFLplusplus / LibAFL

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

How to add custom metadata for solution? #2556

Closed Slava0135 closed 1 month ago

Slava0135 commented 1 month 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 month 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 month 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).

domenukk commented 1 month ago

It's not perfect but it's the way we do it right now. Feel free to open a PR to add documentation for clarification :)