Hello,
I recently read Hanno's article on
lwn.net [1] and someone there
suggested using instrumentation capabilities from gcov instead of the
current instrumentation technique. I don't know enough about the current
technique AFL uses to judge whether it's actually doable and reasonable,
but I took a look at the source code of afl-fuzz.c and afl-gcc.c and had
the impression that AFL could greatly benefit from becoming more
modular, for example by splitting it into code units that solve the
following problems:
1. Instrumentation - "client" (fuzzed binary) and "server" (afl-fuzz)
functionality,
2. User interface, including CLI and fuzzer_stats,
3. Bare fuzzing algorithms,
4. Output analysis - detecting crashes and hangs, perhaps also
implementing other features: stdout analysis? Interfacing with debuggers?
5. AFL genetic algorithm,
6. Possibly other features that I missed
IMHO it would be perfect to turn all but the CLI code into a "libafl"
library that could be used for building fuzzers for different systems.
This would also make it easier to hack those parts and possibly
interface with AFL to a much greater extent.
I know that this is a big design change and wonder if Michał is
interested in this. Michał, if you are, could you suggest which
milestones would have to be achieved in order to gradually reach such
architecture? In other words, how could I help?
Cheers,
d33tah
[1]
https://lwn.net/Articles/657959/