rwhitworth-fuzzing / wren-fuzz

fuzzing results for https://github.com/munificent/wren
1 stars 0 forks source link

Add instructions about how to reproduce your test. #1

Open marcobambini opened 7 years ago

marcobambini commented 7 years ago

Hi, I'd be really interesting in setting up a American Fuzzy Lop to test my Gravity programming language: https://github.com/marcobambini/gravity but I have no idea where to start.

Can you please post more information about how to setup and produce that test? Thanks a lot.

rwhitworth commented 7 years ago

I've gathered all my knowledge of fuzzing from reading blogs. I don't use many of the more sophisticated methods (yet) and stick with really basic usage. The high level steps I follow are:

  1. Compile afl-fuzz from source and install into /usr/local/bin
  2. git clone repo to test
  3. compile software, often like LD=/usr/local/bin/afl-clang-fast CC=/usr/local/bin/afl-clang-fast CXX=/usr/local/bin/afl-clang-fast++ ./configure && make
  4. Create a directory called input that contains a single file with a very simple input (example: for perl I might use print 'hello';). The better example you start with the better the fuzzing output will be.
  5. Run afl-fuzz: afl-fuzz -i input -o output ./program-binary @@

For more information you can check these pages: http://lcamtuf.coredump.cx/afl/ - AFL homepage https://foxglovesecurity.com/2016/03/15/fuzzing-workflows-a-fuzz-job-from-start-to-finish/ https://foxglovesecurity.com/2016/06/13/finding-pearls-fuzzing-clamav/

Or email me and I'll try to write up better instructions with an example using gravity.

The biggest problem I've noticed so far is that without knowing the programming language well enough to provide a good input file, then there is a good chance the test cases will be non-ascii and completely unrealistic as input. Although the program still crashes it isn't as useful as valid input that causes the program to crash.

marcobambini commented 7 years ago

It really helps a lot. I'll try to setup afl-fuzz on my machine in order to automatically test all the new builds. Are you using brew to install afl?

rwhitworth commented 7 years ago

Sorry, I don't use OS X for fuzzing. AFL runs on OS X albeit slowly and with caveats. I use Debian Linux on VirtualBox and Ubuntu in AWS EC2