tinyFuzzer is a project for studying fuzzing based on the book "The Fuzzing Book". It includes fuzzers, runners, targets, and a code coverage system.
Directory for storing fuzzing artifacts.
Directory for storing the initial corpus for fuzzers.
A directory for development and testing various concepts from the book. Added to the index to avoid losing potentially useful files.
Contains the main codebase for fuzzers, coverage collectors, and runners.
Directory for coverage collection functionality.
coverage/base_coverage.py
coverage/branch_coverage.py
Coverage collection is implemented using a function tracing approach. Example:
with Coverage() as cov:
function_to_be_traced()
c = cov.coverage()
Upon entering the with
block, the function tracing is passed to the Coverage()
class. When exiting, tracing is restored to the previous function.
Currently, standard coverage collection and branch-coverage simulation are implemented. The branch coverage approach analyzes sequentially executed lines, but its correctness is still under evaluation.
Directory for fuzzers.
fuzzer/base_fuzzer.py
fuzzer/random_fuzzer.py
A fuzzer is responsible for generating random input data. It passes this data to a runner, which executes the target program with the generated input.
base_fuzzer.py
– a template class for other fuzzers, without actual fuzzing logic.random_fuzzer.py
– generates a random string of a specified length (str
).
Directory containing various runner implementations.
runner/base_runner.py
runner/binary_program_runner.py
runner/print_runner.py
runner/program_runner.py
runner/troff_runner.py
A runner is responsible for executing a target program with given input data. The main function is the constructor, which typically sets the fuzzing target, and the run()
method, which takes arguments for the target function and executes it (usually via subprocess
).
base_runner.py
– a template class for other runners.print_runner.py
– a dummy runner that simply prints output.program_runner.py
andbinary_program_runner.py
– execute a specified program, but the binary runner converts input data into a binary format.troff_runner.py
– a simulated runner for thetroff
program.
Actual fuzzing implementations.
cgi_decode_fuzzer.py
real_troff_fuzzer.py
troff_fuzzer.py
A fuzzer in this context is an infrastructure for testing. It usually combines a runner and a fuzzer.
troff_fuzzer.py
– simulates fuzzing of thetroff
utility.real_troff_fuzzer.py
– an actual fuzzer fortroff
.cgi_decode_fuzzer.py
– fuzzes thecgi_decode
function (located in/tests/helpers/cgi_decode.py
).- Integrated with coverage collection.
- Generates a graph showing how coverage evolves with each fuzzing iteration.
Various utility scripts.
demo_coverage.py
Explicitly declared fuzzing targets.
troff_check.py
Directory containing test cases.
Run the fuzzers using the following commands:
python3 -m fuzzers.troff_fuzzer
python3 -m fuzzers.real_troff_fuzzer
python3 -m core.runner.troff_runner
Run all tests using:
python3 -m unittest discover -s tests
- Use
python3 -m <module>
to run scripts. - Set the
PYTHONPATH
environment variable for proper fuzzer execution:PYTHONPATH=$(pwd) python3 fuzzers/real_troff_fuzzer.py
This project is licensed under the GNU General Public License v3.0 (GPLv3).
The full text of the license is available in the LICENSE
file.