Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions conf-fuzz-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export PYTHONPATH=/home/pamusuo/research/rtos-fuzzing/AFLplusplus/custom_mutators/packetdrill
export AFL_NO_STARTUP_CALIBRATION=1
export AFL_DEBUG=1
export AFL_SKIP_CPUFREQ=1
export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1
export AFL_PYTHON_MODULE=example
export PD_ENABLE_TAP=1

echo "Configured 6 environmment variables"
2 changes: 2 additions & 0 deletions custom_mutators/packetdrill/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/fuzz_in*/
/fuzz_udp_in
40 changes: 40 additions & 0 deletions custom_mutators/packetdrill/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python
# encoding: utf-8
"""
Module containing functions shared between multiple AFL modules

@author: Christian Holler (:decoder)

@license:

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

@contact: choller@mozilla.com
"""

from __future__ import print_function
import random
import os
import re


def randel(l):
if not l:
return None
return l[random.randint(0, len(l) - 1)]


def randel_pop(l):
if not l:
return None
return l.pop(random.randint(0, len(l) - 1))


def write_exc_example(data, exc):
exc_name = re.sub(r"[^a-zA-Z0-9]", "_", repr(exc))

if not os.path.exists(exc_name):
with open(exc_name, "w") as f:
f.write(data)
Loading