AFLTriage icon indicating copy to clipboard operation
AFLTriage copied to clipboard

AFL_PRELOAD

Open WorksButNotTested opened this issue 3 years ago • 3 comments

AFLTriage is great, super easy to use. I've run into a small issue though. I would like to LD_PRELOAD a library into my target when it is run. However, I cannot seem to see a way to pass an environment variable to the target without it also being passed to afl-triage itself. Whilst in the most part, environment variables can just be allowed to propagate from parent to the child, in the case of LD_PRELOAD this causes an issue.

Obviously, you can't simply replace your target with a script, since the target then won't be the direct child of afl-triage, so for now, I've managed to workaround by making a small loader application which calls setenv and execve, but it would be awesome if you could just pass environment variables direct to afl-triage.

Maybe something like...

afl-triage -e LD_PRELOAD=mylib.so ...

WorksButNotTested avatar Dec 16 '21 09:12 WorksButNotTested

why not AFL_PRELOAD=… instead so it is compatible to afl?

vanhauser-thc avatar Dec 30 '21 09:12 vanhauser-thc

That should work fine for me. Just wondered if any other environment variables caused issues and something more generic was required? If not then similarity to AFL++ is probably more desirable.

WorksButNotTested avatar Dec 30 '21 09:12 WorksButNotTested

Hey there, thanks for the issue. This has been on my mental TODO for a bit. I like the idea of -e or -D to pass arbitrary environment variables. I'll work on getting this for you

quic-ghernand avatar Jan 12 '22 20:01 quic-ghernand