about summary refs log tree commit diff
path: root/Dockerfile
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-01-26 15:14:23 +0100
committervan Hauser <vh@thc.org>2020-01-26 15:14:23 +0100
commit2d68cb399e42ae4e8a90093968652fbeac5b0060 (patch)
tree04f11b510f0a0b3f417b73b3f01fdabd8a7d343c /Dockerfile
parent77f20d8e4d855fa9585e786ad879aeebdb3fb5d0 (diff)
downloadafl-dyninst-2d68cb399e42ae4e8a90093968652fbeac5b0060.tar.gz
better docu and greater dockerfile
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile36
1 files changed, 24 insertions, 12 deletions
diff --git a/Dockerfile b/Dockerfile
index d28f75b..444e3ff 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,8 +1,8 @@
-FROM ubuntu:trusty
-MAINTAINER rjohnson@moflow.org/vh@thc.org
+FROM kalilinux/kali-rolling AS afl-dyninst-base
+MAINTAINER mh@mh-sec.de
 
-# dyninst ubuntu 14.04/x64
-RUN apt-get update && apt-get install -y \
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get upgrade && apt-get install -y \
         build-essential \
         gcc \
         g++ \
@@ -14,33 +14,45 @@ RUN apt-get update && apt-get install -y \
         gzip \
         vim \
         curl \
+        apt-utils \
         libelf-dev \
         libelf1 \
         libiberty-dev \
         libboost-all-dev \
-    && rm -rf /var/lib/apt/lists/*
+        libtbb2 \
+        libtbb-dev \
+    && apt-get -y autoremove && rm -rf /var/lib/apt/lists/*
 
 RUN git clone https://github.com/dyninst/dyninst \
         && cd dyninst && mkdir build && cd build \
         && cmake .. \
         && make \
         && make install \
-        && cd ../..
+        && cd .. ; rm -rf build ; cd ..
 
-RUN curl http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz | tar -zxvf - \
-        && cd afl-* \
-        && make \
+RUN git clone https://github.com/vanhauser-thc/AFLplusplus \
+        && cd AFLplusplus \
+        && make source-only \
         && make install \
+        && make clean \
         && cd ..
 
 RUN git clone https://github.com/vanhauser-thc/afl-dyninst \
         && cd afl-dyninst \
-        && ln -s `ls -d1 ../afl-2* | tail -1` afl \
+        && ln -s ../AFLplusplus afl \
         && make \
         && make install \
+        && make clean \
         && cd .. \
         && echo "/usr/local/lib" > /etc/ld.so.conf.d/dyninst.conf && ldconfig \
         && echo "export DYNINSTAPI_RT_LIB=/usr/local/lib/libdyninstAPI_RT.so" >> .bashrc
 
-# output usage and give a shell 
-CMD afl-dyninst ; /bin/bash -i
+ENV DYNINSTAPI_RT_LIB /usr/local/lib/libdyninstAPI_RT.so
+
+# the afl-dyninst image:
+FROM afl-dyninst-base AS afl-dyninst
+CMD afl-dyninst.sh
+
+# the afl-fuzz-dyninst image (with afl++):
+FROM afl-dyninst-base AS afl-fuzz-dyninst
+CMD afl-fuzz-dyninst.sh