Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/centic9/demo-fuzz
Minimal application for fuzzy-testing of Java code via the Jazzer fuzzer
https://github.com/centic9/demo-fuzz
Last synced: 2 days ago
JSON representation
Minimal application for fuzzy-testing of Java code via the Jazzer fuzzer
- Host: GitHub
- URL: https://github.com/centic9/demo-fuzz
- Owner: centic9
- License: apache-2.0
- Created: 2022-01-15T13:34:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-02T07:02:01.000Z (2 months ago)
- Last Synced: 2024-08-02T08:28:21.807Z (2 months ago)
- Language: Shell
- Size: 201 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
This is a small demo project for fuzzing with the [jazzer](https://github.com/CodeIntelligenceTesting/jazzer) fuzzing tool.
See [Fuzzing](https://en.wikipedia.org/wiki/Fuzzing) for a general description of the theory behind fuzzy testing.
Because Java uses a runtime environment which does not crash on invalid actions of an
application (unless native code is invoked), Fuzzing of Java-based applications
focuses on the following:* verify if only expected exceptions are thrown
* verify any JNI or native code calls
* find cases of unbounded memory allocations# How to fuzz
There are two Fuzz targets:
* [Fuzz.java](src/main/java/org/dstadler/fuzz/Fuzz.java) receives a randomized byte-array from Jazzer
* [FuzzWithProvider.java](src/main/java/org/dstadler/fuzz/FuzzWithProvider.java) requests randomized structured input from JazzerBoth show how Jazzer can quickly find "useful" cases via code-coverage guided fuzzing.
Build the fuzzing target:
./gradlew shadowJar
Create a directory for the corpus-directors
mkdir -p corpus
You can add documents from other testing-corpora as well. Valid documents
as well as slightly broken ones are good sources as this helps the fuzzer
to come up with interesting new cases.Download Jazzer from the [releases page](https://github.com/CodeIntelligenceTesting/jazzer/releases),
choose the latest version and select the file `jazzer--.tar.gz`Unpack the archive:
tar xzf jazzer-*.tar.gz
Invoke the fuzzing:
./jazzer --cp=build/libs/demo-fuzz-all.jar --instrumentation_includes=org.dstadler.** --target_class=org.dstadler.fuzz.Fuzz -rss_limit_mb=4096 corpus
In this mode Jazzer will stop whenever it detects an unexpected exception,
out of memoery or other crashes.You can use `--keep_going=10` to report a given number of exceptions before stopping.
See `./jazzer` for options which can control details of how Jazzer operates.
# License
Copyright 2022 Dominik Stadler
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.