diff --git a/fuzzing/README.rst b/fuzzing/README.rst index 6fb4c9ad..1fc00802 100644 --- a/fuzzing/README.rst +++ b/fuzzing/README.rst @@ -5,11 +5,9 @@ Uses `python-afl `__ and `afl `__ * Install afl, for example ``sudo apt install afl++`` on Debian/Ubuntu -* ``poetry install`` +* ``poetry install -E fuzzing-dev`` * ``poetry shell`` * Add some example files into ``_examples`` * ``./run.sh`` will start multiple afl-fuzz instances -* Run ``watch -n 1 -c afl-whatsup -s _results`` to see a summary - of all active runners * CTRL+C to stop * Run ``./check_crashes.sh`` to get a summary of the errors found diff --git a/fuzzing/poetry.lock b/fuzzing/poetry.lock deleted file mode 100644 index 7f997150..00000000 --- a/fuzzing/poetry.lock +++ /dev/null @@ -1,58 +0,0 @@ -[[package]] -category = "main" -description = "The Cython compiler for writing C extensions for the Python language." -name = "cython" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -version = "0.29.15" - -[[package]] -category = "main" -description = "American Fuzzy Lop fork server and instrumentation for pure-Python code" -name = "python-afl" -optional = false -python-versions = "*" -version = "0.7.2" - -[metadata] -content-hash = "fc4dfa7c4da7ef463d501e3a9c82a038616e032e6739fb81e7f679e1554ff61e" -python-versions = "^3.6" - -[metadata.files] -cython = [ - {file = "Cython-0.29.15-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:1dc973bdea03c65f03f41517e4f0fc2b717d71cfbcf4ec34adac7e5bee71303e"}, - {file = "Cython-0.29.15-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:214a53257c100e93e7673e95ab448d287a37626a3902e498025993cc633647ae"}, - {file = "Cython-0.29.15-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9a5f0cf8b95c0c058e413679a650f70dcc97764ccb2a6d5ccc6b08d44c9b334c"}, - {file = "Cython-0.29.15-cp27-cp27m-win32.whl", hash = "sha256:61e505379497b624d6316dd67ef8100aaadca0451f48f8c6fff8d622281cd121"}, - {file = "Cython-0.29.15-cp27-cp27m-win_amd64.whl", hash = "sha256:30462d61e7e290229a64e1c3682b4cc758ffc441e59cc6ce6fae059a05df305b"}, - {file = "Cython-0.29.15-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:6f6de0bee19c70cb01e519634f0c35770de623006e4876e649ee4a960a147fec"}, - {file = "Cython-0.29.15-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:c3d778304209cc39f8287da22f2180f34d2c2ee46cd55abd82e48178841b37b1"}, - {file = "Cython-0.29.15-cp34-cp34m-manylinux1_i686.whl", hash = "sha256:34c888a57f419c63bef63bc0911c5bb407b93ed5d6bdeb1587dca2cd1dd56ad1"}, - {file = "Cython-0.29.15-cp34-cp34m-manylinux1_x86_64.whl", hash = "sha256:ea3b61bff995de49b07331d1081e0056ea29901d3e995aa989073fe2b1be0cb7"}, - {file = "Cython-0.29.15-cp34-cp34m-win32.whl", hash = "sha256:9f2839396d21d5537bc9ff53772d44db39b0efb6bf8b6cac709170483df53a5b"}, - {file = "Cython-0.29.15-cp34-cp34m-win_amd64.whl", hash = "sha256:f91b16e73eca996f86d1943be3b2c2b679b03e068ed8c82a5506c1e65766e4a6"}, - {file = "Cython-0.29.15-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:ea5f987b4da530822fa797cf2f010193be77ea9e232d07454e3194531edd8e58"}, - {file = "Cython-0.29.15-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:34004f60b1e79033b0ca29b9ab53a86c12bcaab56648b82fbe21c007cd73d867"}, - {file = "Cython-0.29.15-cp35-cp35m-win32.whl", hash = "sha256:d282b030ed5c736e4cdb1713a0c4fad7027f4e3959dc4b8fdb7c75042d83ed1b"}, - {file = "Cython-0.29.15-cp35-cp35m-win_amd64.whl", hash = "sha256:bb6d90180eff72fc5a30099c442b8b0b5a620e84bf03ef32a55e3f7bd543f32e"}, - {file = "Cython-0.29.15-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b8ba4b4ee3addc26bc595a51b6240b05a80e254b946d624fff6506439bc323d1"}, - {file = "Cython-0.29.15-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:77ac051b7caf02938a32ea0925f558534ab2a99c0c98c681cc905e3e8cba506e"}, - {file = "Cython-0.29.15-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:d8c73fe0ec57a0e4fdf5d2728b5e18b63980f55f1baf51b6bac6a73e8cbb7186"}, - {file = "Cython-0.29.15-cp36-cp36m-win32.whl", hash = "sha256:d114f9c0164df8fcd2880e4ba96986d7b0e7218f6984acc4989ff384c5d3d512"}, - {file = "Cython-0.29.15-cp36-cp36m-win_amd64.whl", hash = "sha256:4e5acf3b856a50d0aaf385f06a7b56a128a296322a9740f5f279c96619244308"}, - {file = "Cython-0.29.15-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3dd0cba13b36ff969232930bd6db08d3da0798f1fac376bd1fa4458f4b55d802"}, - {file = "Cython-0.29.15-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:c562bc316040097e21357e783286e5eca056a5b2750e89d9d75f9541c156b6dc"}, - {file = "Cython-0.29.15-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e7f1dcc0e8c3e18fa2fddca4aecdf71c5651555a8dc9a0cd3a1d164cbce6cb35"}, - {file = "Cython-0.29.15-cp37-cp37m-win32.whl", hash = "sha256:7e4d74515d92c4e2be7201aaef7a51705bd3d5957df4994ddfe1b252195b5e27"}, - {file = "Cython-0.29.15-cp37-cp37m-win_amd64.whl", hash = "sha256:0e078e793a9882bf48194b8b5c9b40c75769db1859cd90b210a4d7bf33cda2b1"}, - {file = "Cython-0.29.15-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:01d566750e7c08e5f094419f8d1ee90e7fa286d8d77c4569748263ed5f05280a"}, - {file = "Cython-0.29.15-cp38-cp38-manylinux1_i686.whl", hash = "sha256:1a3842be21d1e25b7f3440a0c881ef44161937273ea386c30c0e253e30c63740"}, - {file = "Cython-0.29.15-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:072cb90e2fe4b5cc27d56de12ec5a00311eee781c2d2e3f7c98a82319103c7ed"}, - {file = "Cython-0.29.15-cp38-cp38-win32.whl", hash = "sha256:993837bbf0849e3b176e1ef6a50e9b8c2225e895501b85d56f4bb65a67f5ea25"}, - {file = "Cython-0.29.15-cp38-cp38-win_amd64.whl", hash = "sha256:e5c8f4198e25bc4b0e4a884377e0c0e46ca273993679e3bcc212ef96d4211b83"}, - {file = "Cython-0.29.15-py2.py3-none-any.whl", hash = "sha256:7ea18a5c87cacdd6e4feacf8badf13643775b6f69c3aa8b50417834b9ce0e627"}, - {file = "Cython-0.29.15.tar.gz", hash = "sha256:60d859e1efa5cc80436d58aecd3718ff2e74b987db0518376046adedba97ac30"}, -] -python-afl = [ - {file = "python-afl-0.7.2.tar.gz", hash = "sha256:deb47007655188757fdb880c7efcc58e53c346c469ba8755bc105bd8c6bbcc66"}, -] diff --git a/fuzzing/pyproject.toml b/fuzzing/pyproject.toml deleted file mode 100644 index cf63f9a4..00000000 --- a/fuzzing/pyproject.toml +++ /dev/null @@ -1,16 +0,0 @@ -[tool.poetry] -name = "mutagen-fuzzing" -version = "0.1.0" -description = "" -authors = ["Christoph Reiter "] - -[tool.poetry.dependencies] -python = "^3.6" -cython = "^0.29.15" -python-afl = "^0.7.2" - -[tool.poetry.dev-dependencies] - -[build-system] -requires = ["poetry>=0.12"] -build-backend = "poetry.masonry.api" diff --git a/fuzzing/run.sh b/fuzzing/run.sh index e7d721c2..17be3c2c 100755 --- a/fuzzing/run.sh +++ b/fuzzing/run.sh @@ -18,6 +18,6 @@ for i in `seq 2 $(nproc)`; do py-afl-fuzz -i "$EXAMPLES" -o "$RESULTS" -S "worker-$i" -- $(which python) sut.py > /dev/null 2>&1 & done -py-afl-fuzz -i "$EXAMPLES" -o "$RESULTS" -M "main" -- $(which python) sut.py # > /dev/null 2>&1 & -#watch -n 1 -c afl-whatsup -s "$RESULTS" +py-afl-fuzz -i "$EXAMPLES" -o "$RESULTS" -M "main" -- $(which python) sut.py > /dev/null 2>&1 & +watch -n 1 -c afl-whatsup -s "$RESULTS" pkill afl-fuzz \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b77469c5..7ab6729f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,10 @@ authors = [] [tool.poetry.dependencies] python = "^3.6" +python-afl = {version = "^0.7.3", optional = true} + +[tool.poetry.extras] +fuzzing-dev = ["python-afl"] [tool.poetry.dev-dependencies] pytest = "^6.2.2"