-
Notifications
You must be signed in to change notification settings - Fork 99
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
AFL synchronization mode #327
Comments
So I've looked into this some ,with an eye towards proposing a pull request to close the issue. From AFL's parallel_fuzzing.txt
As I understand it, DeepState does not support running parallelized individual fuzzers, so a normal |
I think we shouldn't add new flag Anyway, implementing ensembler first is a priority afaik. Then we can auto-detect when to use
Don't know any, but would be useful. |
@GrosQuildu - My team has implemented an ensemble afl class for deepstate that we currently use for fleet fuzzing with AFL. It toggles -M and -S depending on args. It also uses tgz files for syncing, just like the afl parallel fuzzing guide suggests. Are you interested in this as a pull request? |
Its rather question for @agroce. But I think yeah, we may see the PR. |
Sounds interesting for sure! |
Ok, our team is wrapping up work on our fuzzer system for now, I'll put it in as a pull req for your consideration at the end of the week. |
Let us know when this is ready! |
Sorry for the delay. You may want to take a quick look at this commit: This contains the afl-ensemble class we use. A few notes/thoughts for review. |
Added a few comments in your repo. In general, there is too much code repetition imho. New class should inherit from AFL or AFL class should be extended. Arguments Also have some concerns about directory structure. Each fuzzer outdir will have (after sync cycle): its own directory ( As for tars: afl docs suggests to pack testcases and send them via ssh or something like that. To avoid using of network shares. Now the tars seems to be unnecessary complication if So in current state it's in a direction of how ensembler could be, but for AFL only. To merge it, we should handle all supported fuzzers, just replacing current ensembler class ;) (plus comments above ofc). |
Thanks Pawel for the feedback. I will explain a few details that may help. Regarding code repetition, i agree. If the deepstate team was strongly considering merging this class, I would replace the existing afl.py with this one and merge some of the existing checks and behaviors into this class. For example, the compile step is removed in the ensemble version, but could easily be replaced. In our code base, we simply use this one instead. It can be used to run a single fuzzer or several. Arguments fuzzer_node_id and fuzzer_id are not really redundant. The problem this solves is having multiple fuzzers on the same 'node' each with a distinct queue. The original afl class sets up a local sync directory (output directory), but hardcodes 'the_fuzzer' as the name of every fuzzer on that system. In order to share queues between running fuzzers, they must share a local sync directory, but have a unique name in the subdirectory with its queue and fuzzer stats. The fuzzer_id allows this. The node ID, allows queues to be synched across fuzzer nodes. For example, node 0 will pull the queues for node 1, and 2 and extract them to a sync dir. The seeds must remain in individual fuzzer queues. So after a sync cycle, the local sync_dir will look like this: each fuzzer directory has a queue and fuzzer stats. On this system, there are 2 fuzzers running (node id 0, fuzzer id 1 and fuzzer id 2). The other queues are automatically pulled from by afl. fuzzers on any node cannot shared a queue. Every 'output_dir' is the same on all fuzzers and nodes (/blah/blah/workspace/myLocal/SyncDir). The original ensembler code was attempting to synchronize seeds, not queues. This is not consistent with how afl generates new test cases from seeds. Once the fuzzer is running, you cannot simply drop seeds into the existing queues of running fuzzers without re-naming them following the correct scheme (id:00xxxx,...), otherwise you have to restart the fuzzer to allow it to re-order the input seeds. By sharing queues, the fuzzers pull from their neighbors when they find interesting new seeds. From this perspective, this class doesn't really follow model of the other "ensemble" fuzzers, so yes, you are correct, this strategy is 'AFL' only. I am happy to help code up any direction the team would like to take, but please note my commit on the branch was meant to help others in a similar situation to my team (run a whole bunch of AFL fuzzers on one target, share seeds, and use deepstate to drive it). As an aside, our system works great! =) Also regarding tars, it was just a convenient mechanism for quick file transfer. We began with rsync (like deepstate ensemble) but ran into several issues with missing and extraneous seeds. We also have routines (outside of deepstate) that run minimize and other seed analysis, so it worked well within our infrastructure. So, all that said, is this a good candidate to just replace the afl class? Or is there work to do with the core ensembler to understand this strategy? |
Currently, AFL executor (
deepstate-afl
) always runs the fuzzer in master mode (-M
argument). Code here.We should detect when to run it in slave mode (
-S
). Thus not running deterministic step. Consult AFL documentation (parallel_fuzzing.txt) for more informations.The text was updated successfully, but these errors were encountered: