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

Input file extension #30

Closed
hdbreaker opened this issue Feb 26, 2022 · 4 comments
Closed

Input file extension #30

hdbreaker opened this issue Feb 26, 2022 · 4 comments

Comments

@hdbreaker
Copy link

Hey guys how are you? My fuzzing target needs the file extension in "input_ {{ThreadID}}" to determinate which dll must load to parse the content.

I was trying to modify the fuzzer.cpp code to add this functionality but I didn't find the correct function/line to add this functionality.

Can you help me to improve/add this feature to the app? In which part of the code the file input_ is written? and how can I add the file extension to that input file?

Thank you ahead!

@ifratric
Copy link
Collaborator

Hi, the filename is constructed here:

string outfile = DirJoin(out_dir, string("input_") + std::to_string(tc->thread_id));

So you can change that line to something like
string outfile = DirJoin(out_dir, string("input_") + std::to_string(tc->thread_id) + string(".ext"));

@hdbreaker
Copy link
Author

I already identify the line but the problem is that I’m fuzzing multi format file extensions, so I need a way to dynamically change the extension, and not fixed to an specific extension

@ifratric
Copy link
Collaborator

In that case, you can try, before DeliverSample() call here:

if (!tc->sampleDelivery->DeliverSample(sample)) {

do the following:

  • compute the new file name with extension (based on content of the sample?)
  • call ((FileSampleDelivery*)(tc->sampleDelivery))->SetFilename(...)
  • replace the filename in the correct place in tc->target_argv

An easier option though would be to have one fuzzer instance per extension. If you want them to share corpus/coverage set, you can have all instances connect to the same coverage server.

@hdbreaker
Copy link
Author

I was able to fix it just adding a dumb extension! thank you so much!

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

2 participants