HexHive / Gramatron

Coverage-guided grammar aware fuzzer that uses grammar automatons
Apache License 2.0
62 stars 5 forks source link

Gramatron

Gramatron is a coverage-guided fuzzer that uses grammar automatons to perform grammar-aware fuzzing. Technical details about our framework are available in our ISSTA'21 paper. The artifact to reproduce the experiments presented in our paper are present in artifact/. Instructions to run a sample campaign and incorporate new grammars is presented below:

Run a sample fuzz campaign

Adding and testing a new grammar

Eg. ./prep_automaton.sh ~/grammars/ruby/source.json PROGRAM

- If the grammar has no self-embedding rules then you do not need to pass the
  stack limit parameter. However, if it does have self-embedding rules then you
  need to pass the stack limit parameter. We recommend starting with `5` and
  then increasing it if you need more complexity
- To sanity-check that the automaton is generating inputs as expected you can use the `test` binary housed in `src/gramfuzz-mutator`

./test SanityCheck

Eg. ./test SanityCheck ~/grammars/ruby/source_automata.json


# Installing from scratch

If instead of using the provided Dockerfile you want to install Gramatron from scratch follow the instructions below: 

- Install `json-c` 

git clone https://github.com/json-c/json-c.git cd json-c && git reset --hard af8dd4a307e7b837f9fa2959549548ace4afe08b && sh autogen.sh && ./configure && make && make install


- Go into `src/` directory and run the `setup.sh` script