Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage based minimizer #195

Closed
project-repo opened this issue Feb 26, 2018 · 3 comments
Closed

Coverage based minimizer #195

project-repo opened this issue Feb 26, 2018 · 3 comments

Comments

@project-repo
Copy link

Hi,
While using honggfuzz in practice, I noticed that it would be useful to have a coverage based test case minimizer for honggfuzz comparable to afl-minimize for the american fuzzy lop. This uses the instrumentation to try and minimize a file so as to retain it's entire coverage. It may be that this already exists and I have simply missed it in which case it might make sense to include it in the USAGE file or somewhere comparable.
cheers
project-repo

@ghedo
Copy link

ghedo commented Sep 25, 2019

Yes, afl has afl-cmin/afl-tmin and libfuzzer has the -merge flag. It's unfortunate that honggfuzz doesn't seem to have an equivalent of those.

@robertswiecki
Copy link
Collaborator

robertswiecki commented Oct 2, 2019

There is, just called not very intuitively. You can use --covdir_all <dir> to save all non-duplicating testcases to a directory. It could be definitely better (e.g. first sorting by overall coverage per input, and then running it), but it's something for the future.

@robertswiecki
Copy link
Collaborator

Ok, I've implemented a coverage-based minimizer.

It works as follows

W/o the output dir (unnecessary files in the input dir will be deleted)

honggfuzz -M -f input_dir -- binary/to/fuzz

or with the output dir (interesting files will be copied to the --output directory)

honggfuzz -M -f input_dir --output output_dir -- binary/to/fuzz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants