Use ListInput #2
riesentoaster
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
|
Good notes :) Do you want to add a PR to the README near the end about this? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
(I understand why one would want the simplicity of implementing a custom input type for this tutorial, but
ListInputenables a few cool features, hence this discussion entry, just to show it exists :) )LibAFL provides
ListInput, a wrapper for inputs that are lists of sub-parts. One other approach to building this fuzzer would involve using it. Steps for it to work:multipart_inputsfeature to thelibafldependency.PGMoveInput, which implementsInput, and consists of the data required for a single move (so car ID and direction).ListInput<PGMoveInput>. Replace any calls tomoveswithparts. Inserting and appending can be done directly usinginput.{insert,append}_part(). Other access functions are also available.One cool thing you can do is write a
Generatorand use it in combination withGenerateToAppendMutator(provided by LibAFL) to create essentially the same behavior as withPGTailMutator:Now, if you don't need more complicated mutators, using a custom input type (like
PGInput) works pretty well. But if you want to mutate existing parts of your input (instead of just inserting or appending parts), you can then a list of other mutators already implemented generically in LibAFL (all of these work on the list level, and don't mutate the list item contents themselves):RemoveLastEntryMutatorRemoveRandomEntryMutatorCrossoverInsertMutatorCrossoverReplaceMutatorYou can further write custom mutators (or use mutators provided by LibAFL) that target a single list entry and transform them to work on different parts of your list input with
ListInput::map_to_mutate_on_{last,random}_partusing LibAFL'sMappingMutators.Beta Was this translation helpful? Give feedback.
All reactions