All Projects → planetis-m → libfuzzer

planetis-m / libfuzzer

Licence: MIT License
Thin interface for libFuzzer, an in-process, coverage-guided, evolutionary fuzzing engine.

Programming Languages

nim
578 projects

Projects that are alternatives of or similar to libfuzzer

Fast Check
Property based testing framework for JavaScript (like QuickCheck) written in TypeScript
Stars: ✭ 2,604 (+6576.92%)
Mutual labels:  unit-testing, fuzzing
Deepstate
A unit test-like interface for fuzzing and symbolic execution
Stars: ✭ 603 (+1446.15%)
Mutual labels:  unit-testing, fuzzing
VxFuzz
Some VxWorks fuzzing examples using Cisco-Kitty and WDBDbg framework
Stars: ✭ 16 (-58.97%)
Mutual labels:  fuzzing
clusterfuzzlite
ClusterFuzzLite - Simple continuous fuzzing that runs in CI.
Stars: ✭ 315 (+707.69%)
Mutual labels:  fuzzing
automock
A library for testing classes with auto mocking capabilities using jest-mock-extended
Stars: ✭ 26 (-33.33%)
Mutual labels:  unit-testing
fortran-unit-test
Another Fortran unit test library
Stars: ✭ 19 (-51.28%)
Mutual labels:  unit-testing
NBCndUnit
NetBeans C/C++ unit testing plugin – supporting CppUTest, GoogleTest (gtest) / GoogleMock (gmock) and libunittest C++.
Stars: ✭ 13 (-66.67%)
Mutual labels:  unit-testing
UltimateCMSWordlists
📚 An ultimate collection wordlists of the best-known CMS
Stars: ✭ 54 (+38.46%)
Mutual labels:  fuzzing
tracehash
Compress long exception traces down to short signatures
Stars: ✭ 20 (-48.72%)
Mutual labels:  fuzzing
EgorkaGame
A simple game to entertain a baby of 0-1 year.
Stars: ✭ 23 (-41.03%)
Mutual labels:  unit-testing
awesome-javascript-testing
🔧 Awesome JavaScript testing resources
Stars: ✭ 28 (-28.21%)
Mutual labels:  unit-testing
kgb
Python function spy support for unit tests
Stars: ✭ 46 (+17.95%)
Mutual labels:  unit-testing
libfuzzer-cov
Get actually nice HTML coverage overview on libfuzzer runs
Stars: ✭ 20 (-48.72%)
Mutual labels:  fuzzing
DailyNews
Daily News is a news app with good looking user interface ! Apps architecture is MVVM and used RxSwift for binding.
Stars: ✭ 31 (-20.51%)
Mutual labels:  unit-testing
MealsCatalogue
Flutter application using base architecture component like BLoC pattern, RxDart, Http, SQFlite, Flavor, Unit Testing (Mockito), Instrumentation Testing and etc 🔥
Stars: ✭ 45 (+15.38%)
Mutual labels:  unit-testing
KRFAnalysis
Collection of LLVM passes and triage tools for use with the KRF fuzzer
Stars: ✭ 26 (-33.33%)
Mutual labels:  fuzzing
tropic
🍍 Test Runner Library
Stars: ✭ 29 (-25.64%)
Mutual labels:  unit-testing
xspec
XSpec is a unit test and behaviour-driven development (BDD) framework for XSLT, XQuery, and Schematron.
Stars: ✭ 91 (+133.33%)
Mutual labels:  unit-testing
papers-as-modules
Software Papers as Software Modules: Towards a Culture of Reusable Results
Stars: ✭ 18 (-53.85%)
Mutual labels:  fuzzing
respect
RSpec inspired test framework for Reason/OCaml/Bucklescript.
Stars: ✭ 28 (-28.21%)
Mutual labels:  unit-testing

libFuzzer

Thin interface for LLVM/Clang libFuzzer, an in-process, coverage-guided, evolutionary fuzzing engine.

Introduction

Fuzzing is a type of automated testing which continuously manipulates inputs to a program to find issues such as panics or bugs. These semi-random data mutations can discover new code coverage that existing unit tests may miss, and uncover edge case bugs which would otherwise go unnoticed. Since fuzzing can reach these edge cases, fuzz testing is particularly valuable for finding security exploits and vulnerabilities.

Read the Documentation

Clang Sanitizers

Sanitizers are compiler build-in error detectors with relatively small runtime cost. Clang has:

For more information watch the talk Sanitize your C++ code [4] There are demos at the tests directory.

Example

In 95% of cases all you need is to define the procedure testOneInput in your file.

proc fuzzMe(data: openarray[byte]): bool =
  result = data.len >= 3 and
    data[0].char == 'F' and
    data[1].char == 'U' and
    data[2].char == 'Z' and
    data[3].char == 'Z' # :‑<

proc initialize(): cint {.exportc: "LLVMFuzzerInitialize".} =
  {.emit: "N_CDECL(void, NimMain)(void); NimMain();".}

proc testOneInput(data: ptr UncheckedArray[byte], len: int): cint {.
    exportc: "LLVMFuzzerTestOneInput", raises: [].} =
  result = 0
  discard fuzzMe(data.toOpenArray(0, len-1))

Compile with:

$ nim c --cc:clang -t:"-fsanitize=fuzzer,address,undefined" -l:"-fsanitize=fuzzer,address,undefined" -d:nosignalhandler --nomain:on -g tfuzz.nim

Coverage report

Use Clang Coverage to visualize and study your code coverage.

  • Include the standalone main procedure for fuzz targets.
  • Follow the instructions given at the test coverage example.
  • When running the executable, pass as parameter a list of test units.

Structure-Aware Fuzzing

But the lack of an input grammar can also result in inefficient fuzzing for complicated input types, where any traditional mutation (e.g. bit flipping) leads to an invalid input rejected by the target API in the early stage of parsing. With some additional effort, however, libFuzzer can be turned into a grammar-aware (i.e. structure-aware) fuzzing engine for a specific input type.

Structure-Aware Fuzzing with libFuzzer [5]

Take a look at the snappy compression example.

Installation

  • Copy the files libfuzzer/fuzztarget.{nim,nims}, libfuzzer/standalone.nim at your testing directory.
  • Fill in the implementations of the exported procedures.
  • Compile and run with an empty corpus directory as an argument.

Presentations

[1]Jonathan Metzman Fuzzing 101
[2]Kostya Serebryany Fuzz or lose...
[3]Kostya Serebryany Sanitize your C++ code

Further Readings

[4]libFuzzer Tutorial
[5]Structure-Aware Fuzzing with libFuzzer
[6]Efficient Fuzzing Guide
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].