1*08b48e0bSAndroid Build Coastguard Worker# American Fuzzy Lop plus plus (AFL++) 2*08b48e0bSAndroid Build Coastguard Worker 3*08b48e0bSAndroid Build Coastguard Worker<img align="right" src="https://raw.githubusercontent.com/AFLplusplus/Website/main/static/aflpp_bg.svg" alt="AFL++ logo" width="250" heigh="250"> 4*08b48e0bSAndroid Build Coastguard Worker 5*08b48e0bSAndroid Build Coastguard WorkerRelease version: [4.10c](https://github.com/AFLplusplus/AFLplusplus/releases) 6*08b48e0bSAndroid Build Coastguard Worker 7*08b48e0bSAndroid Build Coastguard WorkerGitHub version: 4.10c 8*08b48e0bSAndroid Build Coastguard Worker 9*08b48e0bSAndroid Build Coastguard WorkerRepository: 10*08b48e0bSAndroid Build Coastguard Worker[https://github.com/AFLplusplus/AFLplusplus](https://github.com/AFLplusplus/AFLplusplus) 11*08b48e0bSAndroid Build Coastguard Worker 12*08b48e0bSAndroid Build Coastguard WorkerAFL++ is maintained by: 13*08b48e0bSAndroid Build Coastguard Worker 14*08b48e0bSAndroid Build Coastguard Worker* Marc "van Hauser" Heuse <[email protected]> 15*08b48e0bSAndroid Build Coastguard Worker* Dominik Maier <[email protected]> 16*08b48e0bSAndroid Build Coastguard Worker* Andrea Fioraldi <[email protected]> 17*08b48e0bSAndroid Build Coastguard Worker* Heiko "hexcoder-" Eissfeldt <[email protected]> 18*08b48e0bSAndroid Build Coastguard Worker* frida_mode is maintained by @Worksbutnottested 19*08b48e0bSAndroid Build Coastguard Worker* Documentation: Jana Aydinbas <[email protected]> 20*08b48e0bSAndroid Build Coastguard Worker 21*08b48e0bSAndroid Build Coastguard WorkerOriginally developed by Michal "lcamtuf" Zalewski. 22*08b48e0bSAndroid Build Coastguard Worker 23*08b48e0bSAndroid Build Coastguard WorkerAFL++ is a superior fork to Google's AFL - more speed, more and better 24*08b48e0bSAndroid Build Coastguard Workermutations, more and better instrumentation, custom module support, etc. 25*08b48e0bSAndroid Build Coastguard Worker 26*08b48e0bSAndroid Build Coastguard WorkerYou are free to copy, modify, and distribute AFL++ with attribution under the 27*08b48e0bSAndroid Build Coastguard Workerterms of the Apache-2.0 License. See the [LICENSE](LICENSE) for details. 28*08b48e0bSAndroid Build Coastguard Worker 29*08b48e0bSAndroid Build Coastguard Worker## Getting started 30*08b48e0bSAndroid Build Coastguard Worker 31*08b48e0bSAndroid Build Coastguard WorkerHere is some information to get you started: 32*08b48e0bSAndroid Build Coastguard Worker 33*08b48e0bSAndroid Build Coastguard Worker* For an overview of the AFL++ documentation and a very helpful graphical guide, 34*08b48e0bSAndroid Build Coastguard Worker please visit [docs/README.md](docs/README.md). 35*08b48e0bSAndroid Build Coastguard Worker* To get you started with tutorials, go to 36*08b48e0bSAndroid Build Coastguard Worker [docs/tutorials.md](docs/tutorials.md). 37*08b48e0bSAndroid Build Coastguard Worker* For releases, see the 38*08b48e0bSAndroid Build Coastguard Worker [Releases tab](https://github.com/AFLplusplus/AFLplusplus/releases) and 39*08b48e0bSAndroid Build Coastguard Worker [branches](#branches). The best branches to use are, however, `stable` or 40*08b48e0bSAndroid Build Coastguard Worker `dev` - depending on your risk appetite. Also take a look at the list of 41*08b48e0bSAndroid Build Coastguard Worker [important changes in AFL++](docs/important_changes.md) and the list of 42*08b48e0bSAndroid Build Coastguard Worker [features](docs/features.md). 43*08b48e0bSAndroid Build Coastguard Worker* If you want to use AFL++ for your academic work, check the 44*08b48e0bSAndroid Build Coastguard Worker [papers page](https://aflplus.plus/papers/) on the website. 45*08b48e0bSAndroid Build Coastguard Worker* To cite our work, look at the [Cite](#cite) section. 46*08b48e0bSAndroid Build Coastguard Worker* For comparisons, use the fuzzbench `aflplusplus` setup, or use 47*08b48e0bSAndroid Build Coastguard Worker `afl-clang-fast` with `AFL_LLVM_CMPLOG=1`. You can find the `aflplusplus` 48*08b48e0bSAndroid Build Coastguard Worker default configuration on Google's 49*08b48e0bSAndroid Build Coastguard Worker [fuzzbench](https://github.com/google/fuzzbench/tree/master/fuzzers/aflplusplus). 50*08b48e0bSAndroid Build Coastguard Worker 51*08b48e0bSAndroid Build Coastguard Worker## Building and installing AFL++ 52*08b48e0bSAndroid Build Coastguard Worker 53*08b48e0bSAndroid Build Coastguard WorkerTo have AFL++ easily available with everything compiled, pull the image directly 54*08b48e0bSAndroid Build Coastguard Workerfrom the Docker Hub (available for both x86_64 and arm64): 55*08b48e0bSAndroid Build Coastguard Worker 56*08b48e0bSAndroid Build Coastguard Worker```shell 57*08b48e0bSAndroid Build Coastguard Workerdocker pull aflplusplus/aflplusplus 58*08b48e0bSAndroid Build Coastguard Workerdocker run -ti -v /location/of/your/target:/src aflplusplus/aflplusplus 59*08b48e0bSAndroid Build Coastguard Worker``` 60*08b48e0bSAndroid Build Coastguard Worker 61*08b48e0bSAndroid Build Coastguard WorkerThis image is automatically published when a push to the stable branch happens 62*08b48e0bSAndroid Build Coastguard Worker(see [branches](#branches)). If you use the command above, you will find your 63*08b48e0bSAndroid Build Coastguard Workertarget source code in `/src` in the container. 64*08b48e0bSAndroid Build Coastguard Worker 65*08b48e0bSAndroid Build Coastguard WorkerNote: you can also pull `aflplusplus/aflplusplus:dev` which is the most current 66*08b48e0bSAndroid Build Coastguard Workerdevelopment state of AFL++. 67*08b48e0bSAndroid Build Coastguard Worker 68*08b48e0bSAndroid Build Coastguard WorkerTo build AFL++ yourself - *which we recommend* - continue at 69*08b48e0bSAndroid Build Coastguard Worker[docs/INSTALL.md](docs/INSTALL.md). 70*08b48e0bSAndroid Build Coastguard Worker 71*08b48e0bSAndroid Build Coastguard Worker## Quick start: Fuzzing with AFL++ 72*08b48e0bSAndroid Build Coastguard Worker 73*08b48e0bSAndroid Build Coastguard Worker*NOTE: Before you start, please read about the 74*08b48e0bSAndroid Build Coastguard Worker[common sense risks of fuzzing](docs/fuzzing_in_depth.md#0-common-sense-risks).* 75*08b48e0bSAndroid Build Coastguard Worker 76*08b48e0bSAndroid Build Coastguard WorkerThis is a quick start for fuzzing targets with the source code available. To 77*08b48e0bSAndroid Build Coastguard Workerread about the process in detail, see 78*08b48e0bSAndroid Build Coastguard Worker[docs/fuzzing_in_depth.md](docs/fuzzing_in_depth.md). 79*08b48e0bSAndroid Build Coastguard Worker 80*08b48e0bSAndroid Build Coastguard WorkerTo learn about fuzzing other targets, see: 81*08b48e0bSAndroid Build Coastguard Worker* Binary-only targets: 82*08b48e0bSAndroid Build Coastguard Worker [docs/fuzzing_binary-only_targets.md](docs/fuzzing_binary-only_targets.md) 83*08b48e0bSAndroid Build Coastguard Worker* Network services: 84*08b48e0bSAndroid Build Coastguard Worker [docs/best_practices.md#fuzzing-a-network-service](docs/best_practices.md#fuzzing-a-network-service) 85*08b48e0bSAndroid Build Coastguard Worker* GUI programs: 86*08b48e0bSAndroid Build Coastguard Worker [docs/best_practices.md#fuzzing-a-gui-program](docs/best_practices.md#fuzzing-a-gui-program) 87*08b48e0bSAndroid Build Coastguard Worker 88*08b48e0bSAndroid Build Coastguard WorkerStep-by-step quick start: 89*08b48e0bSAndroid Build Coastguard Worker 90*08b48e0bSAndroid Build Coastguard Worker1. Compile the program or library to be fuzzed using `afl-cc`. A common way to 91*08b48e0bSAndroid Build Coastguard Worker do this would be: 92*08b48e0bSAndroid Build Coastguard Worker 93*08b48e0bSAndroid Build Coastguard Worker ``` 94*08b48e0bSAndroid Build Coastguard Worker CC=/path/to/afl-cc CXX=/path/to/afl-c++ ./configure --disable-shared 95*08b48e0bSAndroid Build Coastguard Worker make clean all 96*08b48e0bSAndroid Build Coastguard Worker ``` 97*08b48e0bSAndroid Build Coastguard Worker 98*08b48e0bSAndroid Build Coastguard Worker2. Get a small but valid input file that makes sense to the program. When 99*08b48e0bSAndroid Build Coastguard Worker fuzzing verbose syntax (SQL, HTTP, etc.), create a dictionary as described in 100*08b48e0bSAndroid Build Coastguard Worker [dictionaries/README.md](dictionaries/README.md), too. 101*08b48e0bSAndroid Build Coastguard Worker 102*08b48e0bSAndroid Build Coastguard Worker3. If the program reads from stdin, run `afl-fuzz` like so: 103*08b48e0bSAndroid Build Coastguard Worker 104*08b48e0bSAndroid Build Coastguard Worker ``` 105*08b48e0bSAndroid Build Coastguard Worker ./afl-fuzz -i seeds_dir -o output_dir -- \ 106*08b48e0bSAndroid Build Coastguard Worker /path/to/tested/program [...program's cmdline...] 107*08b48e0bSAndroid Build Coastguard Worker ``` 108*08b48e0bSAndroid Build Coastguard Worker 109*08b48e0bSAndroid Build Coastguard Worker To add a dictionary, add `-x /path/to/dictionary.txt` to afl-fuzz. 110*08b48e0bSAndroid Build Coastguard Worker 111*08b48e0bSAndroid Build Coastguard Worker If the program takes input from a file, you can put `@@` in the program's 112*08b48e0bSAndroid Build Coastguard Worker command line; AFL++ will put an auto-generated file name in there for you. 113*08b48e0bSAndroid Build Coastguard Worker 114*08b48e0bSAndroid Build Coastguard Worker4. Investigate anything shown in red in the fuzzer UI by promptly consulting 115*08b48e0bSAndroid Build Coastguard Worker [docs/afl-fuzz_approach.md#understanding-the-status-screen](docs/afl-fuzz_approach.md#understanding-the-status-screen). 116*08b48e0bSAndroid Build Coastguard Worker 117*08b48e0bSAndroid Build Coastguard Worker5. You will find found crashes and hangs in the subdirectories `crashes/` and 118*08b48e0bSAndroid Build Coastguard Worker `hangs/` in the `-o output_dir` directory. You can replay the crashes by 119*08b48e0bSAndroid Build Coastguard Worker feeding them to the target, e.g. if your target is using stdin: 120*08b48e0bSAndroid Build Coastguard Worker 121*08b48e0bSAndroid Build Coastguard Worker ``` 122*08b48e0bSAndroid Build Coastguard Worker cat output_dir/crashes/id:000000,* | /path/to/tested/program [...program's cmdline...] 123*08b48e0bSAndroid Build Coastguard Worker ``` 124*08b48e0bSAndroid Build Coastguard Worker 125*08b48e0bSAndroid Build Coastguard Worker You can generate cores or use gdb directly to follow up the crashes. 126*08b48e0bSAndroid Build Coastguard Worker 127*08b48e0bSAndroid Build Coastguard Worker6. We cannot stress this enough - if you want to fuzz effectively, read the 128*08b48e0bSAndroid Build Coastguard Worker [docs/fuzzing_in_depth.md](docs/fuzzing_in_depth.md) document! 129*08b48e0bSAndroid Build Coastguard Worker 130*08b48e0bSAndroid Build Coastguard Worker## Contact 131*08b48e0bSAndroid Build Coastguard Worker 132*08b48e0bSAndroid Build Coastguard WorkerQuestions? Concerns? Bug reports? 133*08b48e0bSAndroid Build Coastguard Worker 134*08b48e0bSAndroid Build Coastguard Worker* The contributors can be reached via (e.g., by creating an issue): 135*08b48e0bSAndroid Build Coastguard Worker [https://github.com/AFLplusplus/AFLplusplus](https://github.com/AFLplusplus/AFLplusplus). 136*08b48e0bSAndroid Build Coastguard Worker* Take a look at our [FAQ](docs/FAQ.md). If you find an interesting or important 137*08b48e0bSAndroid Build Coastguard Worker question missing, submit it via 138*08b48e0bSAndroid Build Coastguard Worker [https://github.com/AFLplusplus/AFLplusplus/discussions](https://github.com/AFLplusplus/AFLplusplus/discussions). 139*08b48e0bSAndroid Build Coastguard Worker* Best: join the [Awesome Fuzzing](https://discord.gg/gCraWct) Discord server. 140*08b48e0bSAndroid Build Coastguard Worker* There is a (not really used) mailing list for the AFL/AFL++ project 141*08b48e0bSAndroid Build Coastguard Worker ([browse archive](https://groups.google.com/group/afl-users)). To compare 142*08b48e0bSAndroid Build Coastguard Worker notes with other users or to get notified about major new features, send an 143*08b48e0bSAndroid Build Coastguard Worker email to <[email protected]>, but note that this is not 144*08b48e0bSAndroid Build Coastguard Worker managed by us. 145*08b48e0bSAndroid Build Coastguard Worker 146*08b48e0bSAndroid Build Coastguard Worker## Branches 147*08b48e0bSAndroid Build Coastguard Worker 148*08b48e0bSAndroid Build Coastguard WorkerThe following branches exist: 149*08b48e0bSAndroid Build Coastguard Worker 150*08b48e0bSAndroid Build Coastguard Worker* [release](https://github.com/AFLplusplus/AFLplusplus/tree/release): the latest 151*08b48e0bSAndroid Build Coastguard Worker release 152*08b48e0bSAndroid Build Coastguard Worker* [stable/trunk](https://github.com/AFLplusplus/AFLplusplus/): stable state of 153*08b48e0bSAndroid Build Coastguard Worker AFL++ - it is synced from dev from time to time when we are satisfied with its 154*08b48e0bSAndroid Build Coastguard Worker stability 155*08b48e0bSAndroid Build Coastguard Worker* [dev](https://github.com/AFLplusplus/AFLplusplus/tree/dev): development state 156*08b48e0bSAndroid Build Coastguard Worker of AFL++ - bleeding edge and you might catch a checkout which does not compile 157*08b48e0bSAndroid Build Coastguard Worker or has a bug. **We only accept PRs (pull requests) for the 'dev' branch!** 158*08b48e0bSAndroid Build Coastguard Worker* (any other): experimental branches to work on specific features or testing new 159*08b48e0bSAndroid Build Coastguard Worker functionality or changes. 160*08b48e0bSAndroid Build Coastguard Worker 161*08b48e0bSAndroid Build Coastguard Worker## Help wanted 162*08b48e0bSAndroid Build Coastguard Worker 163*08b48e0bSAndroid Build Coastguard WorkerWe have several [ideas](docs/ideas.md) we would like to see in AFL++ to make it 164*08b48e0bSAndroid Build Coastguard Workereven better. However, we already work on so many things that we do not have the 165*08b48e0bSAndroid Build Coastguard Workertime for all the big ideas. 166*08b48e0bSAndroid Build Coastguard Worker 167*08b48e0bSAndroid Build Coastguard WorkerThis can be your way to support and contribute to AFL++ - extend it to do 168*08b48e0bSAndroid Build Coastguard Workersomething cool. 169*08b48e0bSAndroid Build Coastguard Worker 170*08b48e0bSAndroid Build Coastguard WorkerFor everyone who wants to contribute (and send pull requests), please read our 171*08b48e0bSAndroid Build Coastguard Worker[contributing guidelines](CONTRIBUTING.md) before you submit. 172*08b48e0bSAndroid Build Coastguard Worker 173*08b48e0bSAndroid Build Coastguard Worker## Special thanks 174*08b48e0bSAndroid Build Coastguard Worker 175*08b48e0bSAndroid Build Coastguard WorkerMany of the improvements to the original AFL and AFL++ wouldn't be possible 176*08b48e0bSAndroid Build Coastguard Workerwithout feedback, bug reports, or patches from our contributors. 177*08b48e0bSAndroid Build Coastguard Worker 178*08b48e0bSAndroid Build Coastguard WorkerThank you! (For people sending pull requests - please add yourself to this list 179*08b48e0bSAndroid Build Coastguard Worker:-) 180*08b48e0bSAndroid Build Coastguard Worker 181*08b48e0bSAndroid Build Coastguard Worker<details> 182*08b48e0bSAndroid Build Coastguard Worker 183*08b48e0bSAndroid Build Coastguard Worker <summary>List of contributors</summary> 184*08b48e0bSAndroid Build Coastguard Worker 185*08b48e0bSAndroid Build Coastguard Worker ``` 186*08b48e0bSAndroid Build Coastguard Worker Jann Horn Hanno Boeck 187*08b48e0bSAndroid Build Coastguard Worker Felix Groebert Jakub Wilk 188*08b48e0bSAndroid Build Coastguard Worker Richard W. M. Jones Alexander Cherepanov 189*08b48e0bSAndroid Build Coastguard Worker Tom Ritter Hovik Manucharyan 190*08b48e0bSAndroid Build Coastguard Worker Sebastian Roschke Eberhard Mattes 191*08b48e0bSAndroid Build Coastguard Worker Padraig Brady Ben Laurie 192*08b48e0bSAndroid Build Coastguard Worker @dronesec Luca Barbato 193*08b48e0bSAndroid Build Coastguard Worker Tobias Ospelt Thomas Jarosch 194*08b48e0bSAndroid Build Coastguard Worker Martin Carpenter Mudge Zatko 195*08b48e0bSAndroid Build Coastguard Worker Joe Zbiciak Ryan Govostes 196*08b48e0bSAndroid Build Coastguard Worker Michael Rash William Robinet 197*08b48e0bSAndroid Build Coastguard Worker Jonathan Gray Filipe Cabecinhas 198*08b48e0bSAndroid Build Coastguard Worker Nico Weber Jodie Cunningham 199*08b48e0bSAndroid Build Coastguard Worker Andrew Griffiths Parker Thompson 200*08b48e0bSAndroid Build Coastguard Worker Jonathan Neuschaefer Tyler Nighswander 201*08b48e0bSAndroid Build Coastguard Worker Ben Nagy Samir Aguiar 202*08b48e0bSAndroid Build Coastguard Worker Aidan Thornton Aleksandar Nikolich 203*08b48e0bSAndroid Build Coastguard Worker Sam Hakim Laszlo Szekeres 204*08b48e0bSAndroid Build Coastguard Worker David A. Wheeler Turo Lamminen 205*08b48e0bSAndroid Build Coastguard Worker Andreas Stieger Richard Godbee 206*08b48e0bSAndroid Build Coastguard Worker Louis Dassy teor2345 207*08b48e0bSAndroid Build Coastguard Worker Alex Moneger Dmitry Vyukov 208*08b48e0bSAndroid Build Coastguard Worker Keegan McAllister Kostya Serebryany 209*08b48e0bSAndroid Build Coastguard Worker Richo Healey Martijn Bogaard 210*08b48e0bSAndroid Build Coastguard Worker rc0r Jonathan Foote 211*08b48e0bSAndroid Build Coastguard Worker Christian Holler Dominique Pelle 212*08b48e0bSAndroid Build Coastguard Worker Jacek Wielemborek Leo Barnes 213*08b48e0bSAndroid Build Coastguard Worker Jeremy Barnes Jeff Trull 214*08b48e0bSAndroid Build Coastguard Worker Guillaume Endignoux ilovezfs 215*08b48e0bSAndroid Build Coastguard Worker Daniel Godas-Lopez Franjo Ivancic 216*08b48e0bSAndroid Build Coastguard Worker Austin Seipp Daniel Komaromy 217*08b48e0bSAndroid Build Coastguard Worker Daniel Binderman Jonathan Metzman 218*08b48e0bSAndroid Build Coastguard Worker Vegard Nossum Jan Kneschke 219*08b48e0bSAndroid Build Coastguard Worker Kurt Roeckx Marcel Boehme 220*08b48e0bSAndroid Build Coastguard Worker Van-Thuan Pham Abhik Roychoudhury 221*08b48e0bSAndroid Build Coastguard Worker Joshua J. Drake Toby Hutton 222*08b48e0bSAndroid Build Coastguard Worker Rene Freingruber Sergey Davidoff 223*08b48e0bSAndroid Build Coastguard Worker Sami Liedes Craig Young 224*08b48e0bSAndroid Build Coastguard Worker Andrzej Jackowski Daniel Hodson 225*08b48e0bSAndroid Build Coastguard Worker Nathan Voss Dominik Maier 226*08b48e0bSAndroid Build Coastguard Worker Andrea Biondo Vincent Le Garrec 227*08b48e0bSAndroid Build Coastguard Worker Khaled Yakdan Kuang-che Wu 228*08b48e0bSAndroid Build Coastguard Worker Josephine Calliotte Konrad Welc 229*08b48e0bSAndroid Build Coastguard Worker Thomas Rooijakkers David Carlier 230*08b48e0bSAndroid Build Coastguard Worker Ruben ten Hove Joey Jiao 231*08b48e0bSAndroid Build Coastguard Worker fuzzah @intrigus-lgtm 232*08b48e0bSAndroid Build Coastguard Worker Yaakov Saxon Sergej Schumilo 233*08b48e0bSAndroid Build Coastguard Worker ``` 234*08b48e0bSAndroid Build Coastguard Worker 235*08b48e0bSAndroid Build Coastguard Worker</details> 236*08b48e0bSAndroid Build Coastguard Worker 237*08b48e0bSAndroid Build Coastguard Worker## Cite 238*08b48e0bSAndroid Build Coastguard Worker 239*08b48e0bSAndroid Build Coastguard WorkerIf you use AFL++ in scientific work, consider citing 240*08b48e0bSAndroid Build Coastguard Worker[our paper](https://www.usenix.org/conference/woot20/presentation/fioraldi) 241*08b48e0bSAndroid Build Coastguard Workerpresented at WOOT'20: 242*08b48e0bSAndroid Build Coastguard Worker 243*08b48e0bSAndroid Build Coastguard Worker Andrea Fioraldi, Dominik Maier, Heiko Eißfeldt, and Marc Heuse. “AFL++: Combining incremental steps of fuzzing research”. In 14th USENIX Workshop on Offensive Technologies (WOOT 20). USENIX Association, Aug. 2020. 244*08b48e0bSAndroid Build Coastguard Worker 245*08b48e0bSAndroid Build Coastguard Worker<details> 246*08b48e0bSAndroid Build Coastguard Worker 247*08b48e0bSAndroid Build Coastguard Worker<summary>BibTeX</summary> 248*08b48e0bSAndroid Build Coastguard Worker 249*08b48e0bSAndroid Build Coastguard Worker ```bibtex 250*08b48e0bSAndroid Build Coastguard Worker @inproceedings {AFLplusplus-Woot20, 251*08b48e0bSAndroid Build Coastguard Worker author = {Andrea Fioraldi and Dominik Maier and Heiko Ei{\ss}feldt and Marc Heuse}, 252*08b48e0bSAndroid Build Coastguard Worker title = {{AFL++}: Combining Incremental Steps of Fuzzing Research}, 253*08b48e0bSAndroid Build Coastguard Worker booktitle = {14th {USENIX} Workshop on Offensive Technologies ({WOOT} 20)}, 254*08b48e0bSAndroid Build Coastguard Worker year = {2020}, 255*08b48e0bSAndroid Build Coastguard Worker publisher = {{USENIX} Association}, 256*08b48e0bSAndroid Build Coastguard Worker month = aug, 257*08b48e0bSAndroid Build Coastguard Worker } 258*08b48e0bSAndroid Build Coastguard Worker ``` 259*08b48e0bSAndroid Build Coastguard Worker 260*08b48e0bSAndroid Build Coastguard Worker</details> 261