
* add stub runtime that links with symcc common runtime code * implement tracing runtime to generate message file * move ShMemCursor to libafl proper * qualify enum imports to make clippy happy * fix warnings * formatting * update symcc submodule to point to AFL++ org repo * fix naming of ShMemCursor and remove std requirement * ensure runtime is named correctly after compilation * add devcontainer files for easier development (will be removed later) * move rust nightly install into devcontainer.json this makes it run after the container has been built * dev container: install recommended packages * switch to building rust runtime from SymCC cmake * install corrosion in dev container for cmake-cargo integration * add smoke test for symcc-runtime integration * update symcc submodule * add rustfmt to devcontainer * properly mark the end of a constraint trace Using a special "End" message * small tool to dump constraints from a traced process * extend smoke test to include parsing & printing of constraints * update symcc submodule * first draft of expression filters for concolic * fix type in runtime method name * update symcc submodule * implement extensions to serdeany map: * remove -> Option<T> * insert_boxed(Box<T>) (avoids allocation if value is already boxed) * implement std::io::Seek for ShMemCursor * implement framing for in-memory traces this allows to efficiently get the length of trace. this is important for efficiently copying the trace out of the shared memory region. * fix for serdeany map * fuzzer that associates concolic traces with test case * ensure runtime can handle 0-expressions * move metadata, observer and feedback into separate files * convert executor to command executor and move to separate file * refactoring and streamlining * move panic mode configuration to cmake script * compile cmake from source, because debians version is too old......... * use separate stage for tracing * fix dockerfile * move runtime into the workspace using prior work on compilation flags from cmake * actually make use of selective symbolication filter * update to support latest symcc changes * implement hitmap for concolic runtime * clippy * implement selective symbolization and coverage map for dump_constraints tool * use concolic runtime coverage for concolic fuzzer feedback * actually kill process on timeout * be extra careful after killing process * increase command executor busy wait to 5ms * implement concolic tracing stage * address naming issue * implement floating point expression filter for runtime * rename expression filters to be less verbose * implement expression pruning * implement ConcolicMutationalStage * refactor command executor and remove busy loop * implement generic command executor * remove debug prints * refactor + documentation * refactor * add stub runtime that links with symcc common runtime code * implement tracing runtime to generate message file * move ShMemCursor to libafl proper * qualify enum imports to make clippy happy * fix warnings * formatting * update symcc submodule to point to AFL++ org repo * fix naming of ShMemCursor and remove std requirement * ensure runtime is named correctly after compilation * add devcontainer files for easier development (will be removed later) * move rust nightly install into devcontainer.json this makes it run after the container has been built * dev container: install recommended packages * switch to building rust runtime from SymCC cmake * install corrosion in dev container for cmake-cargo integration * add smoke test for symcc-runtime integration * update symcc submodule * add rustfmt to devcontainer * properly mark the end of a constraint trace Using a special "End" message * small tool to dump constraints from a traced process * extend smoke test to include parsing & printing of constraints * update symcc submodule * first draft of expression filters for concolic * fix type in runtime method name * update symcc submodule * implement extensions to serdeany map: * remove -> Option<T> * insert_boxed(Box<T>) (avoids allocation if value is already boxed) * implement std::io::Seek for ShMemCursor * implement framing for in-memory traces this allows to efficiently get the length of trace. this is important for efficiently copying the trace out of the shared memory region. * fix for serdeany map * fuzzer that associates concolic traces with test case * ensure runtime can handle 0-expressions * move metadata, observer and feedback into separate files * convert executor to command executor and move to separate file * refactoring and streamlining * move panic mode configuration to cmake script * compile cmake from source, because debians version is too old......... * use separate stage for tracing * fix dockerfile * move runtime into the workspace using prior work on compilation flags from cmake * actually make use of selective symbolication filter * update to support latest symcc changes * implement hitmap for concolic runtime * clippy * implement selective symbolization and coverage map for dump_constraints tool * use concolic runtime coverage for concolic fuzzer feedback * actually kill process on timeout * be extra careful after killing process * increase command executor busy wait to 5ms * implement concolic tracing stage * address naming issue * implement floating point expression filter for runtime * rename expression filters to be less verbose * implement expression pruning * implement ConcolicMutationalStage * refactor command executor and remove busy loop * implement generic command executor * remove debug prints * refactor + documentation * refactor * fixed build, clippy * no_std * implement WithObservers executor as discussed * add symqemu as a submodule * fix symqemu submodule URL to be relative * update the concolic runtime to match the new interface * update the trace file header regularly to save constraints in case the program crashes * add build dependencies for symqemu * handle full mesage buffer properly * better policy for updating trace header * less aggregiously inefficient GC information serialization * move concolic runtime hitmap count to filter this is in preparation for the new runtime interface * very WIP new runtime interface * use more convenient types in rust runtime * EmptyRuntime -> NopRuntime * hide cpp_runtime and formatting * implement tracing runtime using new runtime interface * implement filters with new runtime interface * use a local checkout for symcc_runtime * make test runtime tracing * use test_runtime in smoke test * fix formatting * make the clippy overlord happy? * disable symcc build on everything but linux * make more of symcc_runtime linux only * fix linking symcc_runtime with C++ stdlib * will clippy ever be happy? * formatting * don't export symcc runtime when compiling tests * clippy... * "don't export symcc runtime when compiling tests" for runtime crate as well * clippy * move command executor to LibAFL * move concolic crate into LibAFL * move concolic{metada,observer} into LibAFL * move ConcolicFeedback into LibAFL * move ConolicStage into LibAFL * fix bug in symcc part of concolic runtime * stb_image fuzzer with concolic as example fuzzer * clean up basic_concolic_fuzzer * clean up and document concolic example fuzzer * formatting * clippy * remove basic_concolic_fuzzer (it is now part of the examples) * remove the runtime crate in favor of symcc_runtime * re-architect concolic smoke test and remove git submodules * remove old submodule directories * make coverage filter public * focker docker build * clippy * clippy fixes * fix ubuntu as well * remove .gitmodules * move concolic mutational stage into libafl behind feature flag * script to install dependencies for concolic smoke test * fix bug * clippy * add github action to run smoke test * fix action * ensure smoke test is run in correct directory * remove devcontainer files * address feedback * clippy * more clippy * address more feedback Co-authored-by: Dominik Maier <domenukk@gmail.com>
22 lines
1.7 KiB
Markdown
22 lines
1.7 KiB
Markdown
# Hybrid Fuzzing for stb_image
|
|
|
|
This folder contains an example hybrid fuzzer for stb_image using SymCC.
|
|
It is based on the stb_image fuzzer that is also part of the examples.
|
|
It has been tested on Linux only, as SymCC only works on linux.
|
|
|
|
The fuzzer itself is in the `fuzzer` directory and the concolic runtime lives in `runtime`.
|
|
|
|
## Build
|
|
|
|
To build this example, run `cargo build --release` in the `runtime` and `fuzzer` directories separately (and in that order).
|
|
This will build the fuzzer like it does in the stb_image case, but _additionally_ builds a version of the target that is instrumented with SymCC concolic instrumentation (`harness_symcc.c`).
|
|
This separate version also doesn't conform to LibFuzzer's interface, but rather is a simple program that has the same behaviour as the LibFuzzer version (`harness.c`), because the SymCC runtime expects targets it's environment to be destroyed after a single execution (ie. it doesn't clean up it's resources).
|
|
Building the separate concolic version of the target also requires a concolic runtime, which is part of the `runtime` folder.
|
|
The build script of the fuzzer will check that the runtime has been built, but triggering the build command needs to be done manually (ie. run `cargo build (--release)` the runtime folder before building the fuzzer).
|
|
The build script will also build SymCC.
|
|
Therefore, all build depencies for SymCC should be available beforehand.
|
|
|
|
## Run
|
|
|
|
The first time you run the binary (`target/release/libfuzzer_stb_image_concolic`), the broker will open a tcp port (currently on port `1337`), waiting for fuzzer clients to connect. This port is local and only used for the initial handshake. All further communication happens via shared map, to be independent of the kernel.
|