
* step1 for tinyinst * step2: minimal executor * updated libafl * Tinyinst Update (#853) * Mac OS Autotokens (#723) * mac_tokens * more * win fix * fmt * fmt c * Use nightly fmt (#728) * Fix compilation for aarch64 qemu (#731) Typo lead to fail to compile for arm64 * Simd Fix (#729) * simd fix * fmt * Fixing readme & docs (#730) * fix * fix * add * add * fmt * 0.8.1 (#732) * New Pass Manager Arguments (#724) * new pm arguments * enable abgeana's code * Fix tui with 1 client (#734) * unbreak tui with 1 client * clippy * Add core affinity support for FreeBSD (#736) * NYX Executor (GSoC '22) (#693) * Add ccache * Update codecov.yml * Add libnyx * Fix * Add nyx build script * Fix build.sh && init executor.rs * Fix commit * Fix code * initialize `exector.rs` * refine API in `nyx_bridge.rs` * initialze `run_target` * add `test_nyxhelper` * initize `test_executor` * remove `nyx_beidge.rs` * make `test_executor` compile * Improve test * refine code * update version * fix docker * fix docker * Fix clippy * Fix build * fix build && add `set_timeout` * Fix and refine CI * fix CI * Fix CI * Add platform restrict * cargo fmt * add parallel mode * add example `nyx_libxml2_parallel` * fix fuzzer example * fix CI * add README * fix CI * fix CI * fix CI * remove unwrap and NyxResult * code format fix * add libnyx's rev * fix format * change Duration format && Fix CI * caego fmt * fix CI * fix CI * Add doc * test CI * Update test_all_fuzzers.sh * Update test_all_fuzzers.sh * Update test_all_fuzzers.sh * add cache for apt and cargo-install * Update build_and_test.yml * Update build_and_test.yml * tmp test CI * fix CI * remove debug cmd * remove test * code refine * code refine * code refine * code refine * add Makefile * fix example doc for nyx * add `NyxHelper::new_with_initial_timeout` * fix `NyxHelper::new` * fix curl parameter * code refine * add check for setup script * use afl-clang-fast in nyx * fix logic * fix makefile * fix CI * Update build_and_test.yml * Update build_and_test.yml * remove debug cmd Co-authored-by: syheliel <syheliel@gmail.com> Co-authored-by: Dominik Maier <dmnk@google.com> * Fix spelling error (#745) * OSX force_load option (#743) * Update clang.rs * fmt * Add continous JSON Logging monitor (#738) * Add simple JSON Monitor * Add documentation * Log global state * Fix formatting * Save state depending on closure outcome, have file opened all the time * Make OnDiskJSONMonitor cloneable * Switch to FnMut to allow stateful closures * Use &mut M: Monitor for the closure * Fix documentation of Rand::below (#747) * Netopenbsd build fix (#746) * core affinity netbsd implementation. * openbsd build fix * Fix autotokens doc (#751) * fix * remove wrong doc * Simplification for netbsd-specific code (#750) the cpuset api is already present in libc... * Add test case minimising stage (tmin) (#735) * add test case minimising stage * general purpose minimiser impl, with fuzzer example * reorganise, document, and other cleanup * correct python API return value * correct some docs * nit: versioning in fuzzers * ise -> ize * Implement a corpus minimiser (cmin) (#739) * initial try * correct case where cull attempts to fetch non-existent corpus entries * various on_remove, on_replace implementations * ise -> ize (consistency), use TestcaseScore instead of rolling our own * oops, feature gate * documentation! * link c++ * doc-nit: correction in opt explanation don't write documentation at 0300 * better linking * Skippable stage, generator wrapper for Grimoire (#748) * Skippable stage, generator wrapper for Grimoire * more fancy wrapper * MapFeedback: Adding support for with_name() (#752) * Adding support for with_name() * Adding with_name() function description * dragonflybsd build fix for core affinity. (#753) supporting most of linux sched api here. * CI for FreeBSD (#754) * CI for FreeBSD * rustup -y? * fixed path, switched to clippy * bsd don't source * added llvm * clippy * more yml * ? * testing ci * llvm? * llvm?? * more llvm, more tests * fixed testcase' * mem limits * more sudo * reenable all the CI * Fixes for new Clippy (#755) * New Clippy fixes for QEMU (#757) * Core affinity for FreeBSD pinning task to the wanted cpu (#756) * Do not zero-init struct in QEMU (#758) * New Clippy fixes for QEMU * no need to 0-initialize mem * clippy * Add doc for libafl_nyx (#759) Co-authored-by: syheliel <syheliel@gmail.com> * Adjust NyxExecutor trait bound to HasTargetBytes from HasBytesVec (#760) * adjust NyxExecutor trait bound to HasTargetBytes from HasBytesVec * oops actually use HasTargetBytes instead * libafl_frida: ASan hook adding Apple's memset_pattern* api. (#761) * Fix cargo doc on windows (#762) * add doc cfg * fix nostd docs * ignore CommandConfigurator doc test execution on non-unix platform * add cargo doc step pipeline on windows platform * Enable memset_patter ASan hooks for Apple on libafl_frida (#763) * Fix forkserver options (#771) * Stability improve (#773) * initial * add * fmt & fix * dbg remove * clp * clp * more * clippy * del * fix * remove unused * fix * doc * Fix doc (#780) * Add track_stability option to CalibrationStage (#781) * add * Update gramatron.rs * Update emu.rs * try * clp * Dump registers on freebsd x86_64 (#779) * Illumos support (#775) implementing core affinity too. * Reduce clang warnings for version output in libafl_cc. (#778) * Extend gramatron recursive mutator (#783) * Dump registers on NetBSD amd64 (#786) * Add support for ARMBE8 (#768) * Changes to build QEMU out-of-tree so that we don't need to clone the repo for each feature combination we build * Add be support to libafl_qemu * More config tweaks Co-authored-by: Your Name <you@example.com> * [AFLplusplus/LibAFL] dump registers on OpenBSD amd64 (PR #787) * dump registers on openbsd * write_crash implementations * Windows gdiplus (#789) * Initial steps * Harness code cleanup * don't panic on linux in order not to break the CI * formatting once again * restored cfg unix to unbreak linux build * Remove clang download from windows CI (#791) * Attempt to remove clang 12 setup * frida_gdiplus added to CI * Gdiplus comments (#792) * Attempt to remove clang 12 setup * frida_gdiplus added to CI * Redundancy note * formatting again :\ * mistake of directory name * Fix len miscalculation in grimoire string replace (#794) * Fix len miscalculation in grimoire string replace * ok Rust i was writing JS these days Co-authored-by: Andrea Fioraldi <andrea.fioraldi@trellix.com> * Fix doc typos (#796) * Fix CI (#798) * bump (#799) * Support for write_crash on netbsd (#788) * Support for bolts::cpu::read_time_counter on arm64 (#790) * Add ability to use virtual dispatch to StagesTuple (#801) * Add ability to use virtual dispatch to stagesTuple * Fix lint * Adding CPSR register for arm qemu (#800) * trying to add in observer * writing test * got up to running with instrumentation but i still need to get the map * fixing fuzzer code * adding tinyinst fuzzer * adding ffi to store all the map data into vec. * adding some new things * adding somewhat state of how i would like it should work * fixing some things * alot of false positives. * fixing before adding args * updated to use FileInput! * adding build script to pull tinyinst * fixing git issue * writing instruction to run how to run tinyinst fuzzer Co-authored-by: Dongjia Zhang <tokazerkje@outlook.com> Co-authored-by: Dominik Maier <dmnk@google.com> Co-authored-by: Phan Thanh Duy <phanthanhduypr@gmail.com> Co-authored-by: Nicholas Lang <97475577+nicklangsysdig@users.noreply.github.com> Co-authored-by: David CARLIER <devnexen@gmail.com> Co-authored-by: syheliel <45957390+syheliel@users.noreply.github.com> Co-authored-by: syheliel <syheliel@gmail.com> Co-authored-by: Aiden Hall <AidenRHall@users.noreply.github.com> Co-authored-by: Sönke <eknoes@users.noreply.github.com> Co-authored-by: Sirui Mu <msrlancern@gmail.com> Co-authored-by: Addison Crump <me@addisoncrump.info> Co-authored-by: Patrick Gersch <gersch.patrick@gmail.com> Co-authored-by: Teddy Heinen <teddy@heinen.dev> Co-authored-by: Vincent <space_white@yahoo.com> Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com> Co-authored-by: WorksButNotTested <62701594+WorksButNotTested@users.noreply.github.com> Co-authored-by: Your Name <you@example.com> Co-authored-by: expend20 <36543551+expend20@users.noreply.github.com> Co-authored-by: Andrea Fioraldi <andrea.fioraldi@trellix.com> Co-authored-by: Ben Davis <ben@thebendavis.net> Co-authored-by: radl97 <radl97@users.noreply.github.com> * fix * fmt * Submodule * Submodule? * Tinyinst Update V2 (#905) * updated to lastest libafl * going to replace tinyinst to more like jackalope with tinyinstrumentation * fixing clippy * keep working on cpp ffi. sad * updating litecov to tinyinst. also start making our own litecov * revert to map instead of list. not sure why its not working * making fuzzer listobserver * working with listobserver!: * cleaning up * adding cargo make run * updating cargo for tinyinst * updating readme * readme, clippy * fmt * fmt * fix * fix * docker * fix * fmt Co-authored-by: Dominik Maier <dmnk@google.com> Co-authored-by: biazo <eric.l.biazo@gmail.com> Co-authored-by: Phan Thanh Duy <phanthanhduypr@gmail.com> Co-authored-by: Nicholas Lang <97475577+nicklangsysdig@users.noreply.github.com> Co-authored-by: David CARLIER <devnexen@gmail.com> Co-authored-by: syheliel <45957390+syheliel@users.noreply.github.com> Co-authored-by: syheliel <syheliel@gmail.com> Co-authored-by: Aiden Hall <AidenRHall@users.noreply.github.com> Co-authored-by: Sönke <eknoes@users.noreply.github.com> Co-authored-by: Sirui Mu <msrlancern@gmail.com> Co-authored-by: Addison Crump <me@addisoncrump.info> Co-authored-by: Patrick Gersch <gersch.patrick@gmail.com> Co-authored-by: Teddy Heinen <teddy@heinen.dev> Co-authored-by: Vincent <space_white@yahoo.com> Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com> Co-authored-by: WorksButNotTested <62701594+WorksButNotTested@users.noreply.github.com> Co-authored-by: Your Name <you@example.com> Co-authored-by: expend20 <36543551+expend20@users.noreply.github.com> Co-authored-by: Andrea Fioraldi <andrea.fioraldi@trellix.com> Co-authored-by: Ben Davis <ben@thebendavis.net> Co-authored-by: radl97 <radl97@users.noreply.github.com> Co-authored-by: Dominik Maier <domenukk@gmail.com>
160 lines
6.5 KiB
Markdown
160 lines
6.5 KiB
Markdown
# LibAFL, the fuzzer library.
|
|
|
|
<img align="right" src="https://github.com/AFLplusplus/Website/raw/master/static/logo_256x256.png" alt="AFL++ Logo">
|
|
|
|
Advanced Fuzzing Library - Slot your own fuzzers together and extend their features using Rust.
|
|
|
|
LibAFL is written and maintained by
|
|
|
|
* [Andrea Fioraldi](https://twitter.com/andreafioraldi) <andrea@aflplus.plus>
|
|
* [Dominik Maier](https://twitter.com/domenuk) <dominik@aflplus.plus>
|
|
* [s1341](https://twitter.com/srubenst1341) <github@shmarya.net>
|
|
* [Dongjia Zhang](https://github.com/tokatoka) <toka@aflplus.plus>
|
|
|
|
## Why LibAFL?
|
|
|
|
LibAFL gives you many of the benefits of an off-the-shelf fuzzer, while being completely customizable.
|
|
Some highlight features currently include:
|
|
- `fast`: We do everything we can at compile time, keeping runtime overhead minimal. Users reach 120k execs/sec in frida-mode on a phone (using all cores).
|
|
- `scalable`: `Low Level Message Passing`, `LLMP` for short, allows LibAFL to scale almost linearly over cores, and via TCP to multiple machines.
|
|
- `adaptable`: You can replace each part of LibAFL. For example, `BytesInput` is just one potential form input:
|
|
feel free to add an AST-based input for structured fuzzing, and more.
|
|
- `multi platform`: LibAFL was confirmed to work on *Windows*, *MacOS*, *Linux*, and *Android* on *x86_64* and *aarch64*. `LibAFL` can be built in `no_std` mode to inject LibAFL into obscure targets like embedded devices and hypervisors.
|
|
- `bring your own target`: We support binary-only modes, like Frida-Mode, as well as multiple compilation passes for sourced-based instrumentation. Of course it's easy to add custom instrumentation backends.
|
|
|
|
## Overview
|
|
|
|
LibAFL is a collection of reusable pieces of fuzzers, written in Rust.
|
|
It is fast, multi-platform, no_std compatible, and scales over cores and machines.
|
|
|
|
It offers a main crate that provide building blocks for custom fuzzers, [libafl](./libafl), a library containing common code that can be used for targets instrumentation, [libafl_targets](./libafl_targets), and a library providing facilities to wrap compilers, [libafl_cc](./libafl_cc).
|
|
|
|
LibAFL offers integrations with popular instrumentation frameworks. At the moment, the supported backends are:
|
|
|
|
+ SanitizerCoverage, in [libafl_targets](./libafl_targets)
|
|
+ Frida, in [libafl_frida](./libafl_frida)
|
|
+ QEMU user-mode, in [libafl_qemu](./libafl_qemu)
|
|
+ TinyInst, in [libafl_tinyinst](./libafl_tinyinst) by [elbiazo](https://github.com/elbiazo)
|
|
|
|
## Getting started
|
|
|
|
1. Install the Dependecies
|
|
- The Rust development language.
|
|
We highly recommend *not* to use e.g. your Linux distribition package as this is likely outdated. So rather install
|
|
Rust directly, instructions can be found [here](https://www.rust-lang.org/tools/install).
|
|
|
|
- LLVM tools
|
|
The LLVM tools are needed (newer than LLVM 11.0.0 but older than LLVM 15.0.0)
|
|
|
|
- Cargo-make
|
|
We use cargo-make to build the fuzzers in `fuzzers/` directory. You can install it with
|
|
|
|
```
|
|
cargo install cargo-make
|
|
```
|
|
|
|
2. Clone the LibAFL repository with
|
|
|
|
```
|
|
git clone https://github.com/AFLplusplus/LibAFL
|
|
```
|
|
|
|
3. Build the library using
|
|
|
|
```
|
|
cargo build --release
|
|
```
|
|
|
|
4. Build the API documentation with
|
|
|
|
```
|
|
cargo doc
|
|
```
|
|
|
|
5. Browse the LibAFL book (WIP!) with (requires [mdbook](https://github.com/rust-lang/mdBook))
|
|
|
|
```
|
|
cd docs && mdbook serve
|
|
```
|
|
|
|
We collect all example fuzzers in [`./fuzzers`](./fuzzers/).
|
|
Be sure to read their documentation (and source), this is *the natural way to get started!*
|
|
|
|
You can run each example fuzzer with
|
|
```
|
|
cargo make run
|
|
```
|
|
as long as the fuzzer directory has `Makefile.toml` file.
|
|
|
|
The best-tested fuzzer is [`./fuzzers/libfuzzer_libpng`](./fuzzers/libfuzzer_libpng), a multicore libfuzzer-like fuzzer using LibAFL for a libpng harness.
|
|
|
|
## Resources
|
|
|
|
+ [Installation guide](./docs/src/getting_started/setup.md)
|
|
|
|
+ [Online API documentation](https://docs.rs/libafl/)
|
|
|
|
+ The LibAFL book (WIP) [online](https://aflplus.plus/libafl-book) or in the [repo](./docs/src/)
|
|
|
|
+ Our research [paper](https://www.s3.eurecom.fr/docs/ccs22_fioraldi.pdf)
|
|
|
|
+ Our RC3 [talk](http://www.youtube.com/watch?v=3RWkT1Q5IV0 "Fuzzers Like LEGO") explaining the core concepts
|
|
|
|
+ Our Fuzzcon Europe [talk](https://www.youtube.com/watch?v=PWB8GIhFAaI "LibAFL: The Advanced Fuzzing Library") with a (a bit but not so much outdated) step-by-step discussion on how to build some example fuzzers
|
|
|
|
+ The Fuzzing101 [solutions](https://github.com/epi052/fuzzing-101-solutions) & series of [blog posts](https://epi052.gitlab.io/notes-to-self/blog/2021-11-01-fuzzing-101-with-libafl/) by [epi](https://github.com/epi052)
|
|
|
|
+ Blogpost on binary-only fuzzing lib libaf_qemu, [Hacking TMNF - Fuzzing the game server](https://blog.bricked.tech/posts/tmnf/part1/), by [RickdeJager](https://github.com/RickdeJager).
|
|
|
|
## Contributing
|
|
|
|
For bugs, feel free to open issues or contact us directly. Thank you for your support. <3
|
|
|
|
Even though we will gladly assist you in finishing up your PR, try to
|
|
- keep all the crates compiling with *stable* rust (hide the eventual non-stable code under [`cfg`s](https://github.com/AFLplusplus/LibAFL/blob/main/libafl/build.rs#L26))
|
|
- run `cargo fmt` on your code before pushing
|
|
- check the output of `cargo clippy --all` or `./clippy.sh`
|
|
- run `cargo build --no-default-features` to check for `no_std` compatibility (and possibly add `#[cfg(feature = "std")]`) to hide parts of your code.
|
|
|
|
Some of the parts in this list may be hard, don't be afraid to open a PR if you cannot fix them by yourself, so we can help.
|
|
|
|
## Cite
|
|
|
|
If you use LibAFL for your academic work, please cite the following paper:
|
|
|
|
```bibtex
|
|
@inproceedings{libafl,
|
|
author = {Andrea Fioraldi and Dominik Maier and Dongjia Zhang and Davide Balzarotti},
|
|
title = {{LibAFL: A Framework to Build Modular and Reusable Fuzzers}},
|
|
booktitle = {Proceedings of the 29th ACM conference on Computer and communications security (CCS)},
|
|
series = {CCS '22},
|
|
year = {2022},
|
|
month = {November},
|
|
location = {Los Angeles, U.S.A.},
|
|
publisher = {ACM},
|
|
}
|
|
```
|
|
|
|
#### License
|
|
|
|
<sup>
|
|
Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
|
|
2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
|
|
</sup>
|
|
|
|
<br>
|
|
|
|
<sub>
|
|
Unless you explicitly state otherwise, any contribution intentionally submitted
|
|
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
|
|
be dual licensed as above, without any additional terms or conditions.
|
|
</sub>
|
|
|
|
<br>
|
|
|
|
<sub>
|
|
Dependencies under more restrictive licenses, such as GPL or AGPL, can be enabled
|
|
using the respective feature in each crate when it is present, such as the
|
|
'agpl' feature of the libafl crate.
|
|
</sub>
|