4a2ca67771
This enables building the `aflplusplus` package with nyx mode via a new `withNyx` boolean flag. If it's set, the dependencies for nyx mode (libnyx, packer, QEMU-Nyx) will be built in separate derivations.
99 lines
3.3 KiB
Diff
99 lines
3.3 KiB
Diff
diff --git a/nyx_mode/build_nyx_support.sh b/nyx_mode/build_nyx_support.sh
|
|
index 9b75b7bf..b7ec92e8 100755
|
|
--- a/nyx_mode/build_nyx_support.sh
|
|
+++ b/nyx_mode/build_nyx_support.sh
|
|
@@ -7,7 +7,8 @@ echo " Nyx build script"
|
|
echo "================================================="
|
|
echo
|
|
|
|
-echo "[*] Performing basic sanity checks..."
|
|
+echo "[+] Nyx mode dependencies are built in other derivations, skipping ..."
|
|
+exit 1
|
|
|
|
if [ "$CI" = "true" ]; then
|
|
|
|
diff --git a/test/test-nyx-mode.sh b/test/test-nyx-mode.sh
|
|
index 7aaa8c5b..5f624ada 100755
|
|
--- a/test/test-nyx-mode.sh
|
|
+++ b/test/test-nyx-mode.sh
|
|
@@ -4,78 +4,7 @@
|
|
|
|
$ECHO "$BLUE[*] Testing: nyx_mode"
|
|
|
|
-test "$CI" = "true" && {
|
|
- $ECHO "$YELLOW[-] nyx_mode cannot be tested in the Github CI, skipping ..."
|
|
-} || {
|
|
-
|
|
- unset AFL_CC
|
|
-
|
|
- test -e ../libnyx.so && {
|
|
- ../afl-cc -o test-instr ../test-instr.c > errors 2>&1
|
|
- test -e test-instr && {
|
|
- {
|
|
- rm -rf nyx-test in out
|
|
- $ECHO "$GREY[*] running nyx_packer"
|
|
- python3 ../nyx_mode/packer/packer/nyx_packer.py \
|
|
- ./test-instr \
|
|
- nyx-test \
|
|
- afl \
|
|
- instrumentation \
|
|
- --fast_reload_mode \
|
|
- --purge > /dev/null 2>&1
|
|
-
|
|
- test -e nyx-test/test-instr && {
|
|
-
|
|
- $ECHO "$GREY[*] running nyx_config_gen"
|
|
- python3 ../nyx_mode/packer/packer/nyx_config_gen.py nyx-test Kernel > /dev/null 2>&1
|
|
-
|
|
- test -e nyx-test/config.ron && {
|
|
- sudo modprobe -r kvm-intel
|
|
- sudo modprobe -r kvm
|
|
- sudo modprobe kvm enable_vmware_backdoor=y
|
|
- sudo modprobe kvm-intel
|
|
- #cat /sys/module/kvm/parameters/enable_vmware_backdoor
|
|
-
|
|
- mkdir -p in
|
|
- echo 00000 > in/in
|
|
- $ECHO "$GREY[*] running afl-fuzz for nyx_mode, this will take approx 10 seconds"
|
|
- {
|
|
- AFL_DEBUG=1 ../afl-fuzz -i in -o out -V05 -X -- ./nyx-test >>errors 2>&1
|
|
- } >>errors 2>&1
|
|
- test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
|
|
- $ECHO "$GREEN[+] afl-fuzz is working correctly with nyx_mode"
|
|
- RUNTIME=`grep execs_done out/default/fuzzer_stats | awk '{print$3}'`
|
|
- rm -rf errors nyx-test test-instr in out
|
|
- } || {
|
|
- echo CUT------------------------------------------------------------------CUT
|
|
- cat errors
|
|
- echo CUT------------------------------------------------------------------CUT
|
|
- $ECHO "$RED[!] afl-fuzz is not working correctly with nyx_mode"
|
|
- CODE=1
|
|
- }
|
|
- } || {
|
|
- $ECHO "$RED[!] nyx_packer failed, likely install requirements not met."
|
|
- CODE=1
|
|
- }
|
|
- } || {
|
|
- $ECHO "$RED[!] nyx_packer failed, likely install requirements not met."
|
|
- CODE=1
|
|
- }
|
|
- #rm -rf test-instr in out errors nyx-test
|
|
- }
|
|
- } || {
|
|
- echo CUT------------------------------------------------------------------CUT
|
|
- cat errors
|
|
- echo CUT------------------------------------------------------------------CUT
|
|
- $ECHO "$RED[!] afl-cc compilation of test targets failed - what is going on??"
|
|
- CODE=1
|
|
- }
|
|
- } || {
|
|
- $ECHO "$YELLOW[-] nyx_mode is not compiled, cannot test"
|
|
- INCOMPLETE=1
|
|
- }
|
|
-
|
|
-}
|
|
+$ECHO "$GREY[-] nyx_mode cannot be tested inside the sandbox"
|
|
|
|
. ./test-post.sh
|
|
|