about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2019-11-05 18:41:35 +0100
committerAndrea Fioraldi <andreafioraldi@gmail.com>2019-11-05 18:41:35 +0100
commit4d9a463297a7f8e7855cd2d1cd1106dcef568138 (patch)
tree266e9e4eee0f613be1723ddafa312533ab920253
parente13fdfb2ce4d3f97c8fa4ef3adfaa93e84835e39 (diff)
parent48388b9eaa2fff97292e968b5eade153ebf2386d (diff)
downloadafl++-4d9a463297a7f8e7855cd2d1cd1106dcef568138.tar.gz
Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus
-rw-r--r--Dockerfile27
-rw-r--r--README.md8
-rw-r--r--docs/ChangeLog1
-rw-r--r--docs/QuickStartGuide.txt2
-rw-r--r--libtokencap/libtokencap.so.c8
5 files changed, 43 insertions, 3 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..558968d8
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,27 @@
+FROM ubuntu:eoan
+MAINTAINER David Carlier <devnexen@gmail.com>
+LABEL "about"="AFLplusplus docker image"
+RUN apt-get update && apt-get install -y --no-install-recommends \
+    automake \
+    bison \
+    build-essential \
+    clang \
+    clang-9 \
+    flex \
+    gcc-9 \
+    gcc-9-plugin-dev \
+    libc++-9-dev \
+    libtool \
+    libtool-bin \
+    libglib2.0-dev \
+    llvm-9-tools \
+    python-setuptools \
+    wget \
+    && rm -fr /var/lib/apt/lists/*
+RUN mkdir /app
+WORKDIR ["/app"]
+COPY . .
+ENV CC=gcc-9
+ENV CXX=g++-9
+ENV LLVM_CONFIG=llvm-config-9
+RUN make clean && make distrib && make install
diff --git a/README.md b/README.md
index e8d4e6a8..583b7df8 100644
--- a/README.md
+++ b/README.md
@@ -115,6 +115,14 @@ afl++ binaries by passing the STATIC=1 argument to make:
 $ make all STATIC=1
 ```
 
+Note that afl++ is faster and better the newer the compilers used.
+Hence gcc-9 and especially llvm-9 should be the compilers of choice.
+If your distribution does not have them, you can use the Dockerfile:
+
+```shell
+$ docker build -t aflplusplus
+```
+
 
 ## 1) Challenges of guided fuzzing
 
diff --git a/docs/ChangeLog b/docs/ChangeLog
index 3a5961ad..3924226e 100644
--- a/docs/ChangeLog
+++ b/docs/ChangeLog
@@ -23,6 +23,7 @@ Version ++2.58d (dev):
   - llvm_mode: float splitting is now configured via AFL_LLVM_LAF_SPLIT_FLOATS
   - libtokencap: support for *BSD/OSX added
   - libcompcov floating point splitting support for qemu and unicorn
+  - Dockerfile by courtesy of devnexen
   - ripped regex.dictionary from Google afl PR
   - removed unnecessary warnings
 
diff --git a/docs/QuickStartGuide.txt b/docs/QuickStartGuide.txt
index 9190dc98..723611e3 100644
--- a/docs/QuickStartGuide.txt
+++ b/docs/QuickStartGuide.txt
@@ -45,6 +45,8 @@ how to hit the ground running:
 7) compile and use llvm_mode (afl-clang-fast/afl-clang-fast++) as it is way
    faster and has a few cool features
 
+8) There is a basic docker build with 'docker build -t aflplusplus .'
+
 That's it. Sit back, relax, and - time permitting - try to skim through the
 following files:
 
diff --git a/libtokencap/libtokencap.so.c b/libtokencap/libtokencap.so.c
index 7495180d..467be05b 100644
--- a/libtokencap/libtokencap.so.c
+++ b/libtokencap/libtokencap.so.c
@@ -51,6 +51,7 @@ static struct mapping { void *st, *en; } __tokencap_ro[MAX_MAPPINGS];
 static u32   __tokencap_ro_cnt;
 static u8    __tokencap_ro_loaded;
 static int __tokencap_out_file = -1;
+static pid_t __tokencap_pid = -1;
 
 /* Identify read-only regions in memory. Only parameters that fall into these
    ranges are worth dumping when passed to strcmp() and so on. Read-write
@@ -115,11 +116,11 @@ static void __tokencap_load_mappings(void) {
 #elif defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__
 
 #if defined __FreeBSD__
-  int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, -1};
+  int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, __tokencap_pid};
 #elif defined __OpenBSD__
-  int mib[] = {CTL_KERN, KERN_PROC_VMMAP, getpid()};
+  int mib[] = {CTL_KERN, KERN_PROC_VMMAP, __tokencap_pid};
 #elif defined __NetBSD__
-  int mib[] = {CTL_VM, VM_PROC, VM_PROC_MAP, getpid(), sizeof(struct kinfo_vmentry)};
+  int mib[] = {CTL_VM, VM_PROC, VM_PROC_MAP, __tokencap_pid, sizeof(struct kinfo_vmentry)};
 #endif
   char *buf, *low, *high;
   size_t miblen = sizeof(mib)/sizeof(mib[0]);
@@ -431,6 +432,7 @@ __attribute__((constructor)) void __tokencap_init(void) {
   u8* fn = getenv("AFL_TOKEN_FILE");
   if (fn) __tokencap_out_file = open(fn, O_RDWR | O_CREAT | O_APPEND, 0655);
   if (__tokencap_out_file == -1) __tokencap_out_file = STDERR_FILENO;
+  __tokencap_pid = getpid();
 
 }