Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nyx-net fuzzing for afl++ without specs #29

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Cleaned up commented out code
jausten committed Aug 25, 2023
commit 73d9d51eebeb604d671ffa37ec3f1a1be63cc267
5 changes: 2 additions & 3 deletions packer/common/config.py
Original file line number Diff line number Diff line change
@@ -264,10 +264,9 @@ def __load_config(self):
self.config_values = ConfigReader(os.path.dirname(os.path.realpath(__file__))+"/../nyx.ini", self.__config_section, self.__config_default).get_values()

def __load_arguments(self):
modes = ["afl", "spec", "nyxnet"]
modes = ["afl", "spec"]
modes_help = 'afl\t\t - pack target for an AFL-like fuzzer (such as AFL++, kAFL, Nautilus)\n' \
'spec\t\t - pack target for a spec fuzzer (such as Nyx\'s spec-fuzzer)\n' \
'nyxnet\t\t - pack target for an AFL-like fuzzer while using nyx-net'
'spec\t\t - pack target for a spec fuzzer (such as Nyx\'s spec-fuzzer)\n'

coverage_modes = ["instrumentation", "processor_trace"]
coverage_modes_help = 'instrumentation\t - use compile-time instrumentation (target has to be compiled with an proper compiler)\n' \
22 changes: 1 addition & 21 deletions packer/nyx_packer.py
Original file line number Diff line number Diff line change
@@ -314,24 +314,6 @@ def compile(config):

download_script += dependencies

# if not LEGACY_MODE:
# protobuf_lib_file = "/usr/local/lib/libprotobuf.so.32"
# copyfile(protobuf_lib_file, "%s/%s"%(config.argument_values["output_dir"], os.path.basename(protobuf_lib_file)))
# cpp_lib_file = "/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
# copyfile(cpp_lib_file, "%s/%s"%(config.argument_values["output_dir"], os.path.basename(cpp_lib_file)))
# m_lib_file = "/lib/x86_64-linux-gnu/libm.so.6"
# copyfile(m_lib_file, "%s/%s"%(config.argument_values["output_dir"], os.path.basename(m_lib_file)))
# gcc_lib_file = "/lib/x86_64-linux-gnu/libgcc_s.so.1"
# copyfile(gcc_lib_file, "%s/%s"%(config.argument_values["output_dir"], os.path.basename(gcc_lib_file)))
# z_lib_file = "/lib/x86_64-linux-gnu/libz.so.1"
# copyfile(z_lib_file, "%s/%s"%(config.argument_values["output_dir"], os.path.basename(z_lib_file)))

# download_script += "./hget %s %s\n"%(os.path.basename(protobuf_lib_file), os.path.basename(protobuf_lib_file))
# download_script += "./hget %s %s\n"%(os.path.basename(cpp_lib_file), os.path.basename(cpp_lib_file))
# download_script += "./hget %s %s\n"%(os.path.basename(m_lib_file), os.path.basename(m_lib_file))
# download_script += "./hget %s %s\n"%(os.path.basename(gcc_lib_file), os.path.basename(gcc_lib_file))
# download_script += "./hget %s %s\n"%(os.path.basename(z_lib_file), os.path.basename(z_lib_file))

download_script += "echo \"Let's get our target executable...\" | ./hcat\n"
copyfile(config.argument_values["binary_file"], "%s/%s"%(config.argument_values["output_dir"], os.path.basename(config.argument_values["binary_file"])))
download_script += "./hget %s target_executable\n"%(os.path.basename(config.argument_values["binary_file"]))
@@ -432,9 +414,7 @@ def compile(config):
download_script += "cat stdout.txt | ./hcat\n"
download_script += "cat stderr.txt | ./hcat\n"
else:
#download_script += " > /dev/null 2> /dev/null\n"
download_script += "2>&1 | ./hcat\n"

download_script += " > /dev/null 2> /dev/null\n"

download_script += "dmesg | grep segfault | ./hcat\n"
download_script += "./habort \"Target has terminated without initializing the fuzzing agent ...\"\n"