jwilk / python-afl

American Fuzzy Lop fork server and instrumentation for pure-Python code
https://jwilk.net/software/python-afl
MIT License
350 stars 33 forks source link
fuzzing security

This is experimental module that enables American Fuzzy Lop_ fork server and instrumentation for pure-Python code.

.. _American Fuzzy Lop: https://lcamtuf.coredump.cx/afl/

HOWTO

.. _trace function: https://docs.python.org/2/library/sys.html#sys.settrace

Environment variables

The following environment variables affect python-afl behavior:

PYTHON_AFL_SIGNAL If this variable is set, python-afl installs an exception hook that kills the current process with the selected signal. That way afl-fuzz can treat unhandled exceptions as crashes.

By default, py-afl-fuzz, py-afl-showmap, python-afl-cmin, and py-afl-tmin set this variable to SIGUSR1.

You can set PYTHON_AFL_SIGNAL to another signal; or set it to 0 to disable the exception hook.

PYTHON_AFL_PERSISTENT Persistent mode is enabled only if this variable is set.

py-afl-fuzz sets this variable automatically, so there should normally no need to set it manually.

PYTHON_AFL_TSTL TSTL_ test harness code is ignored if this variable is set; relevant only to users of TSTL interface to python-afl.

.. _TSTL: https://github.com/agroce/tstl

Bugs

Multi-threaded code is not supported.

Further reading

Prerequisites

To build the module, you will need:

py-afl-fuzz requires AFL proper to be installed.

.. vim:ft=rst ts=3 sts=3 sw=3 et