american fuzzy lop (fuzzer)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

american fuzzy lop
american fuzzy lop's afl-fuzz running on a test program
american fuzzy lop's afl-fuzz running on a test program
Developer(s) Michał Zalewski
Stable release
2.52b / 4 November 2017; 7 months ago (2017-11-04)[1]
Written in C, assembly
Operating system Cross-platform
Type Fuzzer
License Apache License 2.0
Website lcamtuf.coredump.cx/afl/

american fuzzy lop is a fuzzer that employs genetic algorithms in order to efficiently increase code coverage of the test cases. So far it helped in detection of significant software bugs in dozens of major free software projects, including X.Org Server,[2] PHP,[3] OpenSSL,[4][5] pngcrush, bash,[6] Firefox,[7] BIND[8][9] and Qt.[10]

american fuzzy lop's source code is open and is hosted by Michał Zalewski on his website. The program attracts a relatively large and active community - as of 27 Aug 2015, its main mailing list gathers 392 users and developers and generates an average of over 100 posts per month.[11] Its name is a reference to a breed of rabbit, American Fuzzy Lop.

Typical usage[edit]

The program requires the user to provide a sample command that runs the tested application and at least one small example input file. For example, in case of an audio player, american fuzzy lop can be instructed to open a short sound file with it. Then, the fuzzer attempts to actually execute the specified command and if that succeeds, it tries to reduce the input file to the smallest one that triggers the same behavior.

After this initial phase, AFL begins the actual process of fuzzing by applying various modifications to the input file. When the tested program crashes or hangs, this might suggest the discovery of a new bug, possibly a security vulnerability. In this case, the modified input file is saved for further user inspection.

In order to maximize the fuzzing performance, american fuzzy lop expects the tested program to be compiled with the aid of a utility program that instruments the code with helper functions which track control flow. This allows the fuzzer to detect when the target's behavior changes in response to the input. In cases when this is not possible, black-box testing is supported as well.

Features[edit]

Fuzzing engine[edit]

AFL's Logo from fuzzed input stitched together as a single GIF.[12]

The fuzzing engine of american fuzzy lop uses several algorithms whose goal is to trigger unexpected behavior, including bit flips or replacing bytes of input file with various integers that can trigger edge cases.[13] Apart from that, it can generate test cases based on sample keywords, which helps during fuzzing of programs that employed text-based grammar, such as SQLite.[14] Generated test cases that exercise different parts of the program's code can later be used as input for more specialized diagnostic programs. While performing the fuzzing, a hang can be detected when the process does not exit within the specified timeout and crash is assumed when a signal handler kills the process.

The fuzzed input can be fed to the tested program either via standard input or as an input file specified in the process command line. Fuzzing networked programs is currently not directly supported, although in some cases there are feasible solutions to this problem.[15]

Performance features[edit]

One of the challenges american fuzzy lop had to solve involved an efficient spawning of hundreds of processes per second. Apart from the original engine that spawned every process from scratch, american fuzzy lop offers the default engine that relies heavily on fork system call.[16] This can further be sped up by leveraging LLVM deferred forkserver mode, but this comes at the cost of having to modify the tested program. Also, american fuzzy lop supports fuzzing the same program over the network.

User interface[edit]

american fuzzy lop features a colorful command line interface that displays real-time statistics about the fuzzing process. Various settings may be triggered by either command line options or environment variables. Apart from that, programs may read runtime statistics from files in a machine-readable format.

Utility programs[edit]

In addition to afl-fuzz and tools that can be used for binary instrumentation, american fuzzy lop features utility programs meant for monitoring of the fuzzing process. Apart from that, there is afl-cmin and afl-tmin, which can be used for test case and test corpus minimization. This can be useful when the test cases generated by afl-fuzz would be used by other fuzzers.

References[edit]

  1. ^ "Index of /afl/releases". Retrieved 21 December 2017. 
  2. ^ "Advisory-2015-03-17". x.org. 
  3. ^ "NVD - Detail". nist.gov. 
  4. ^ "NVD - Detail". nist.gov. 
  5. ^ "NVD - Detail". nist.gov. 
  6. ^ "CVE - CVE-2014-6278". mitre.org. 
  7. ^ "CVE - CVE-2014-8637". mitre.org. 
  8. ^ "How to fuzz a server with American Fuzzy Lop". Fastly. 
  9. ^ "CVE - CVE-2015-5477". mitre.org. 
  10. ^ "[Announce] Qt Project Security Advisory - Multiple Vulnerabilities in Qt Image Format Handling". qt-project.org. 
  11. ^ "Google Groups". google.com. 
  12. ^ "Logo for afl-fuzz". Michał Zalewski. 
  13. ^ "lcamtuf's blog". lcamtuf.blogspot.com. 
  14. ^ "lcamtuf's blog". lcamtuf.blogspot.com. 
  15. ^ Technion. "Fuzzing nginx - Hunting vulnerabilities with afl-fuzz". lolware.net. 
  16. ^ "lcamtuf's blog". lcamtuf.blogspot.com. 

Further reading[edit]