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

Refactor libafl_frida #307

Closed
andreafioraldi opened this issue Sep 29, 2021 · 6 comments
Closed

Refactor libafl_frida #307

andreafioraldi opened this issue Sep 29, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@andreafioraldi
Copy link
Member

IMO we should generalize a bit the code for frida.
For sure, it's time to move the Executor from the example to the lib https://github.com/AFLplusplus/LibAFL/blob/main/fuzzers/frida_libpng/src/fuzzer.rs#L61
Then, I think we should split the FridaInstrumentationHelper. Instead of having flags like cmplog_enabled atc. we should offer the option to stack different helpers into one (like we do for Feedback for instance), so then the user can for instance use CmpLog mixing FridaEdgeCoverageHelper with FridaCmpLogHelper and even write its own helper

@andreafioraldi andreafioraldi added the enhancement New feature or request label Sep 29, 2021
@andreafioraldi
Copy link
Member Author

andreafioraldi commented Sep 29, 2021

In additions, there are some buggy patterns like https://github.com/AFLplusplus/LibAFL/blob/main/libafl_frida/src/helper.rs#L147
Here the unpoison works well for BytesInput, but fails target_bytes return an owned vector, the slice address will be on stack and different from the one used in the harness. Still, I don't have a solution in mind right now, but better to note this problem here.

edit (toka):
permalink

let target_bytes = input.target_bytes();

@s1341
Copy link
Collaborator

s1341 commented Sep 30, 2021

Sounds good. I just have to find time to actually do it!

@andreafioraldi
Copy link
Member Author

We have to add too some code to run binaries not just shared objects. Should be easy, just hook libc start main, compile the fuzzer as a shared object and inject into the target with LD_PRELOAD.

@domenukk
Copy link
Member

This is done, right? cc @s1341

@s1341
Copy link
Collaborator

s1341 commented May 27, 2022

Yes.

@tokatoka
Copy link
Member

We have to add too some code to run binaries not just shared objects. Should be easy, just hook libc start main, compile the fuzzer as a shared object and inject into the target with LD_PRELOAD.

This part is not done yet.
but well, I'll open another issue then

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

No branches or pull requests

4 participants