Skip to content

Commit 8219da3

Browse files
committed
Merge branch 'dev' into real_time_benchmarks
2 parents 2b6b369 + 86f62ef commit 8219da3

File tree

41 files changed

+664
-461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+664
-461
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "fuzzers/qemufuzzer/qemu-fuzz"]
2-
path = fuzzers/qemufuzzer/qemu-fuzz
3-
url = git@github.com:AFLplusplus/qemu-fuzz.git

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ exclude = [
1616
"fuzzers/libfuzzer_stb_image",
1717
"fuzzers/libfuzzer_libmozjpeg",
1818
"fuzzers/frida_libpng",
19-
"fuzzers/qemu_user",
19+
"fuzzers/baby_fuzzer",
2020
]

README.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ Advanced Fuzzing Library - Slot your own fuzzers together and extend their featu
44

55
LibAFL is written and maintained by Andrea Fioraldi <andreafioraldi@gmail.com> and Dominik Maier <mail@dmnk.co>.
66

7-
It is released as Open Source Software under the [Apache v2](LICENSE-APACHE) or [MIT](LICENSE-MIT) licenses.
7+
## What
8+
9+
LibAFL is a collection of reusable pieces of fuzzers, written in Rust.
10+
11+
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).
12+
13+
LibAFL is fast, multi-platform, no_std compatible, and scales over cores (and machines in the near future!).
814

915
## Getting started
1016

@@ -20,29 +26,50 @@ Build the library using
2026
cargo build --release
2127
```
2228

23-
Build the documentation with
29+
Build the API documentation with
2430

2531
```
2632
cargo doc
2733
```
2834

29-
We collect example fuzzers in `./fuzzers`. They can be build using `cargo build --example [fuzzer_name] --release`.
35+
Browse the LibAFL book with (requires [mdbook](https://github.com/rust-lang/mdBook))
36+
37+
```
38+
cd docs && mdbook serve
39+
```
40+
41+
We collect example fuzzers in [`./fuzzers`](./fuzzers/).
3042

31-
The best-tested fuzzer is `./fuzzers/libfuzzer_libpng`, a clone of libfuzzer using libafl for a libpng harness.
32-
See its readme [here](./fuzzers/libfuzzer_libpng/README.md).
43+
The best-tested fuzzer is [`./fuzzers/libfuzzer_libpng`](./fuzzers/libfuzzer_libpng), a multicore libfuzzer-like fuzzer using LibAFL for a libpng harness.
3344

34-
## The Core Concepts
45+
## Resources
3546

36-
The entire library is based on some core concepts that we think can generalize Fuzz Testing.
47+
+ [Installation guide](./docs/src/getting_started/setup.md)
3748

38-
We're still working on extending the documentation.
49+
+ Our RC3 [talk](http://www.youtube.com/watch?v=3RWkT1Q5IV0 "Fuzzers Like LEGO") explaining the core concepts
3950

40-
In the meantime, you can watch the Video from last year's RC3, here:
51+
+ [Online API documentation](https://docs.rs/libafl/)
4152

42-
[![Video explaining libAFL's core concepts](http://img.youtube.com/vi/3RWkT1Q5IV0/3.jpg)](http://www.youtube.com/watch?v=3RWkT1Q5IV0 "Fuzzers Like LEGO")
53+
+ The LibAFL book (very WIP) [online](https://aflplus.plus/libafl-book) or in the [repo](./docs/src/)
4354

4455
## Contributing
4556

4657
Check the [TODO.md](./TODO.md) file for features that we plan to support.
4758

4859
For bugs, feel free to open issues or contact us directly. Thank you for your support. <3
60+
61+
#### License
62+
63+
<sup>
64+
Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
65+
2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
66+
</sup>
67+
68+
<br>
69+
70+
<sub>
71+
Unless you explicitly state otherwise, any contribution intentionally submitted
72+
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
73+
be dual licensed as above, without any additional terms or conditions.
74+
</sub>
75+

TODO.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# TODOs
22

3-
- [x] ~~Minset corpus scheduler~~ still doc missing
4-
- [ ] Win32 shared mem and crash handler to have Windows in-process executor
5-
- [x] Other feedbacks examples (e.g. maximize allocations to spot OOMs)
63
- [ ] Other objectives examples (e.g. execution of a given program point)
74
- [ ] Objective-Specific Corpuses (named per objective)
8-
- [x] A macro crate with derive directives (e.g. for SerdeAny impl).
95
- [ ] Good documentation
10-
- [ ] LLMP brotli compression
6+
- [ ] LLMP compression
117
- [ ] AFL-Style Forkserver Executor
12-
- [x] Restarting EventMgr could use forks on unix
13-
- [ ] Android Ashmem support
148
- [ ] Restart Count in Fuzzing Loop
159
- [ ] LAIN / structured fuzzing example
16-
- [ ] Errors in the Fuzzer should exit the fuzz run
1710
- [ ] More informative outpus, deeper introspection (stats, what mutation did x, etc.)
18-
- [x] Timeouts for executors
1911
- [ ] Timeout handling for llmp clients (no ping for n seconds -> treat as disconnected)
2012
- [ ] LLMP Cross Machine Link (2 brokers connected via TCP)
2113
- [ ] "Launcher" example that spawns broker + n clients
2214
- [ ] Heap for signal handling (bumpallo or llmp directly?)
15+
- [x] ~~Minset corpus scheduler~~ still doc missing
16+
- [x] Win32 shared mem and crash handler to have Windows in-process executor
17+
- [x] Other feedbacks examples (e.g. maximize allocations to spot OOMs)
18+
- [x] A macro crate with derive directives (e.g. for SerdeAny impl).
19+
- [x] Restarting EventMgr could use forks on unix
20+
- [x] Android Ashmem support
21+
- [x] Errors in the Fuzzer should exit the fuzz run
22+
- [x] Timeouts for executors

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This project contains the out-of-source LibAFL documentation as a book.
44

5-
Here you can find tutorials, examples and detailed explanations.
5+
Here you can find tutorials, examples, and detailed explanations.
66

77
For the API documentation instead, run `cargo doc` in the LibAFl root folder.
88

docs/src/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
- [Design](./design/design.md)
1515
- [Core Concepts](./design/core_concepts.md)
1616
- [Architecture](./design/architecture.md)
17-
- [The State](./design/state.md)
1817

1918
- [Understanding Metadata](./medatata/metadata.md)
2019
- [Definition](./medatata/definition.md)

docs/src/design/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ The LibAFL code reuse meachanism is so based on components rather than sub-class
88

99
Thinking about similar fuzzers, you can observe that most of the times the data structures that are modified are the ones related to testcases and the fuzzer global state.
1010

11-
Beside the entities described previously, we then introduce the Testcase and State entities. The Testcase is a container for an Input stored in the Corpus and its metadata (so, in the implementation, the Corpus stores Testcases) and the State contains all the metadata that are evolved while running the fuzzer, Corpus included.
11+
Beside the entities described previously, we introduce the Testcase and State entities. The Testcase is a container for an Input stored in the Corpus and its metadata (so, in the implementation, the Corpus stores Testcases) and the State contains all the metadata that are evolved while running the fuzzer, Corpus included.
1212

1313

docs/src/design/state.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/src/getting_started/build.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ LibAFL, as most of the Rust projects, can be built using `cargo` from the root d
66
$ cargo build --release
77
```
88

9-
Note that the `--release` flag is optional for development, but it is needed for fuzzing at a decent speed,
10-
otherwise you will experience a slowdown of even more than 10x.
9+
Note that the `--release` flag is optional for development, but you needed to add it to fuzzing at a decent speed.
10+
Slowdowns of 10x or more are not uncommon for Debug builds.
1111

12-
The LibAFL repository is composed by multiple crates, and the top-level Cargo.toml is just an orchestrator that groups these crates
13-
in a workspace. Building from the root directory will build all the crates in the workspace.
12+
The LibAFL repository is composed of multiple crates.
13+
The top-level Cargo.toml is the workspace file grouping these crates.
14+
Calling `cargo build` from the root directory will compile all crates in the workspace.
1415

15-
## Build example fuzzers
16+
## Build Example Fuzzers
1617

17-
You can notice that in the repository there is a `fuzzers/` folder.
18-
This folder contains a set of crates that are not part of the workspace, so that are not built issuing `cargo build` from the top-level directory.
18+
We group example fuzzers in the `./fuzzers` directory of the LibAFL repository.
19+
The directory contains a set of crates that are not part of the workspace.
1920

20-
These crates are examples of fuzzers using particular features of LibAFL combined sometimes with instrumentation backends (e.g. [SanitizerCoverage](https://clang.llvm.org/docs/SanitizerCoverage.html), [Frida](https://frida.re/), ...).
21+
Each of these example fuzzers uses particular features of LibAFL, sometimes combined with different instrumentation backends (e.g. [SanitizerCoverage](https://clang.llvm.org/docs/SanitizerCoverage.html), [Frida](https://frida.re/), ...).
2122

22-
The user can use these crates as examples and as skeleton for its custom fuzzer using a similar set of features.
23+
You can use these crates as examples and as skeletons for custom fuzzers with similar featuresets.
2324

24-
To build an example fuzzer you have to invoke cargo from its folder (`fuzzers/[FUZZER_NAME]).
25+
To build an example fuzzer you have to invoke cargo from its respective folder (`fuzzers/[FUZZER_NAME]).

docs/src/introduction.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
# Introduction
22

3-
Fuzzers are important assets in the pockets of security researchers and even developers nowadays.
4-
A wide range of cool state-of-the-art tools like [AFL++](https://github.com/AFLplusplus/AFLplusplus), [libFuzzer](https://llvm.org/docs/LibFuzzer.html) or [honggfuzz](https://github.com/google/honggfuzz) are avaiable to users and they do their job in a very effective way.
3+
Fuzzers are important assets in the pockets of security researchers and developers alike.
4+
A wide range of cool state-of-the-art tools like [AFL++](https://github.com/AFLplusplus/AFLplusplus), [libFuzzer](https://llvm.org/docs/LibFuzzer.html) or [honggfuzz](https://github.com/google/honggfuzz) are available to users. They do their job in a very effective way, finding thousands of bugs.
55

6-
From the power user perspective, however, these tools are limited because not designed with the extensibility as first-class citizen.
7-
Usually, a fuzzer developer has to choose if fork one of these existing tools with the result of having a tons of fuzzers derived from others which are in any case incompatible with each other, or creating a new fuzzer from scratch, reinventing the wheel and usually giving up on features that are complex to reimplement.
6+
From the power user perspective, however, these tools are limited.
7+
Their design does not treat extensibility as a first-class citizen.
8+
Usually, a fuzzer developer can choose to either fork one of these existing tools, or to create a new fuzzer from scratch.
9+
In any case, researchers end up with tons of fuzzers, all of which are incompatible with each other.
10+
Their outstanding features can not just be combined for new projects.
11+
Instead, we keep reinventing the wheel and may completely miss out on features that are complex to reimplement.
812

9-
Here comes LibAFL, a library that IS NOT a fuzzer, but a collection of reusable pieces of fuzzers written in Rust.
10-
LibAFL helps you writing your own custom fuzzer, tailored for a specific target or for a particular instrumentation backend, without reinventing the wheel or forking an existing fuzzer.
13+
Here comes LibAFL, a library that IS NOT a fuzzer, but a collection of reusable pieces of fuzzers, written in Rust.
14+
LibAFL helps you develop your own custom fuzzer, tailored for your specific needs.
15+
Be it a specific target, a particular instrumentation backend, or a custom mutator, you can leverage existing bits and pieces to craft the fastest and most efficient fuzzer you can envision.
1116

12-
## Why you should use LibAFL
17+
## Why LibAFL?
1318

14-
TODO list here killer features (no_std, multi platform, scalability, ...)
19+
LibAFL gives you many of the benefits of an off-the-shelf fuzzer, while being completely customizable.
20+
Some highlight features currently include:
21+
- `multi platform`: LibAFL works pretty much anywhere you can find a Rust compiler for. We already used it on *Windows*, *Android*, *MacOS*, and *Linux*, on *x86_64*, *aarch64*, ...
22+
- `portable`: `LibAFL` can be built in `no_std` mode. This means it does not require a specific OS-dependent runtime to function. Define an allocator and a way to map pages, you should be good to inject LibAFL in obscure targets like embedded devices, hypervisors, or maybe even WebAssembly?
23+
- `adaptable`: Given year of experience fine-tuning *AFLplusplus* and our academic fuzzing background, we could incorporate recent fuzzing trends into LibAFL's deign and make it future-proof.
24+
To give an example, as opposed to old-skool fuzzers, a `BytesInput` is just one of the potential forms of inputs:
25+
feel free to use and mutate an Abstract Syntax Tree instead, for structured fuzzing.
26+
- `scalable`: As part of LibAFL, we developed `Low Level Message Passing`, `LLMP` for short, which allows LibAFL to scale almost linearly over cores. That is, if you chose to use this feature - it is your fuzzer, after all. Scaling to multiple machines over TCP is on the near road-map.
27+
- `fast`: We do everything we can at compiletime so that the runtime overhead is as minimal as it can get.
28+
- `bring your own target`: We support binary-only modes, like Frida-Mode with ASAN and CmpLog, as well as multiple compilation passes for sourced-based instrumentation, and of course supoprt custom instrumentation.
29+
- `usable`: This one is on you to decide. Dig right in!

0 commit comments

Comments
 (0)