about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWorksButNotTested <62701594+WorksButNotTested@users.noreply.github.com>2021-06-30 09:36:32 +0100
committerGitHub <noreply@github.com>2021-06-30 10:36:32 +0200
commit5d5624b930d95cc576624d22f68d5682c968ad97 (patch)
treebbbec342b8294ca5abfcc7b314a24fa52154bcf5
parent7da632065f079b887d07b17a63ba1787e4240e69 (diff)
downloadafl++-5d5624b930d95cc576624d22f68d5682c968ad97.tar.gz
Many Linux Support (#1000)
Co-authored-by: Your Name <you@example.com>
-rw-r--r--frida_mode/many-linux/Dockerfile24
-rw-r--r--frida_mode/many-linux/GNUmakefile20
-rw-r--r--frida_mode/many-linux/Makefile9
-rw-r--r--frida_mode/many-linux/README.md8
-rw-r--r--frida_mode/many-linux/realpath2
5 files changed, 63 insertions, 0 deletions
diff --git a/frida_mode/many-linux/Dockerfile b/frida_mode/many-linux/Dockerfile
new file mode 100644
index 00000000..08c24eae
--- /dev/null
+++ b/frida_mode/many-linux/Dockerfile
@@ -0,0 +1,24 @@
+FROM fridadotre/manylinux-x86_64
+
+COPY realpath /bin/realpath
+RUN chmod +x /bin/realpath
+
+RUN yum -y install xz
+RUN yum -y install vim-common
+
+WORKDIR /
+RUN git clone https://github.com/AFLplusplus/AFLplusplus.git
+
+WORKDIR /AFLplusplus
+RUN mkdir -p /AFLplusplus/frida_mode/build/frida/
+RUN curl -L -o /AFLplusplus/frida_mode/build/frida/frida-gumjs-devkit-14.2.18-linux-x86_64.tar.xz "https://github.com/frida/frida/releases/download/14.2.18/frida-gumjs-devkit-14.2.18-linux-x86_64.tar.xz"
+
+WORKDIR /AFLplusplus
+RUN git checkout dev
+WORKDIR /AFLplusplus/frida_mode
+ENV CFLAGS="\
+    -DADDR_NO_RANDOMIZE=0x0040000 \
+    -D_POSIX_C_SOURCE=200809L \
+    -Wno-implicit-function-declaration \
+    "
+RUN make
diff --git a/frida_mode/many-linux/GNUmakefile b/frida_mode/many-linux/GNUmakefile
new file mode 100644
index 00000000..2ac44dc2
--- /dev/null
+++ b/frida_mode/many-linux/GNUmakefile
@@ -0,0 +1,20 @@
+PWD:=$(shell pwd)/
+BUILD_DIR:=$(PWD)build/
+
+.PHONY: all clean shell
+
+all: | $(BUILD_DIR)
+	docker build --tag many-afl-frida .
+	docker run --rm \
+		-v $(PWD)build/:/export \
+		many-afl-frida \
+		cp /AFLplusplus/afl-frida-trace.so /export
+
+$(BUILD_DIR):
+	mkdir -p $@
+
+clean:
+	rm -rf $(BUILD_DIR)
+
+shell:
+	docker run -ti --rm many-afl-frida /bin/bash
diff --git a/frida_mode/many-linux/Makefile b/frida_mode/many-linux/Makefile
new file mode 100644
index 00000000..f3c3cd55
--- /dev/null
+++ b/frida_mode/many-linux/Makefile
@@ -0,0 +1,9 @@
+all:
+	@echo trying to use GNU make...
+	@gmake all || echo please install GNUmake
+
+clean:
+	@gmake clean
+
+shell:
+	@gmake shell
diff --git a/frida_mode/many-linux/README.md b/frida_mode/many-linux/README.md
new file mode 100644
index 00000000..2c7b6823
--- /dev/null
+++ b/frida_mode/many-linux/README.md
@@ -0,0 +1,8 @@
+# many-linux
+
+This folder contains a Docker image to allow the building of
+`afl-frida-trace.so` using the `many-linux` docker image. This docker image is
+based on CentOS Linux 5. By building `afl-frida-trace.so` for such an old
+version of Linux, given the strong backward compatibility of Linux, this should
+work on the majority of Linux environments. This may be useful for targetting
+Linux distributions other than your development environment.
\ No newline at end of file
diff --git a/frida_mode/many-linux/realpath b/frida_mode/many-linux/realpath
new file mode 100644
index 00000000..1fdc49a7
--- /dev/null
+++ b/frida_mode/many-linux/realpath
@@ -0,0 +1,2 @@
+#!/bin/sh
+readlink -f -- "$@"