diff options
-rw-r--r-- | .github/workflows/build-push-test-container.yaml (renamed from .github/workflows/build_aflplusplus_docker.yaml) | 35 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 5 | ||||
-rw-r--r-- | .github/workflows/codeql-analysis.yml | 2 | ||||
-rw-r--r-- | .github/workflows/rust_custom_mutator.yml | 4 | ||||
-rw-r--r-- | Dockerfile | 14 | ||||
-rw-r--r-- | GNUmakefile | 58 | ||||
-rw-r--r-- | GNUmakefile.gcc_plugin | 2 | ||||
-rw-r--r-- | coresight_mode/GNUmakefile | 2 | ||||
-rwxr-xr-x | custom_mutators/grammar_mutator/build_grammar_mutator.sh | 2 | ||||
-rw-r--r-- | frida_mode/GNUmakefile | 2 |
10 files changed, 66 insertions, 60 deletions
diff --git a/.github/workflows/build_aflplusplus_docker.yaml b/.github/workflows/build-push-test-container.yaml index 7245a84e..8a6d77d1 100644 --- a/.github/workflows/build_aflplusplus_docker.yaml +++ b/.github/workflows/build-push-test-container.yaml @@ -1,4 +1,4 @@ -name: Publish Docker Images +name: Build, test and push container image on: push: @@ -9,29 +9,38 @@ on: - '*' jobs: - push_to_registry: - name: Push Docker images to Dockerhub + build: + name: Build, test and push container image runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + - uses: actions/checkout@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Build image + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64 + load: true + tags: aflplusplus/aflplusplus:test + - name: Test linux/amd64 image + run: docker run --rm --platform linux/amd64 aflplusplus/aflplusplus:test make tests + - name: Test linux/arm64 image + run: docker run --rm --platform linux/arm64 aflplusplus/aflplusplus:test make tests - name: Login to Dockerhub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - - name: Publish dev as dev to docker.io registry + - name: Publish ${{ github.ref_name }} to docker.io registry uses: docker/build-push-action@v3 with: context: . platforms: linux/amd64,linux/arm64 push: true tags: aflplusplus/aflplusplus:${{ github.ref_name }} - if: ${{ github.ref_name == 'dev' }} - - name: Publish stable as stable and latest to docker.io registry + if: ${{ github.ref_name != 'stable' }} + - name: Publish stable and latest to docker.io registry uses: docker/build-push-action@v3 with: context: . @@ -39,11 +48,3 @@ jobs: push: true tags: aflplusplus/aflplusplus:${{ github.ref_name }},aflplusplus/aflplusplus:latest if: ${{ github.ref_name == 'stable' }} - - name: Publish tagged release to docker.io registry - uses: docker/build-push-action@v3 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: aflplusplus/aflplusplus:${{ github.ref_name }} - if: ${{ github.ref_type == 'tag' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 799b72e7..9f0cacca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: AFL_SKIP_CPUFREQ: 1 AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES: 1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: debug run: apt-cache search plugin-dev | grep gcc-; echo; apt-cache search clang-format- | grep clang-format- - name: update @@ -38,7 +38,7 @@ jobs: AFL_SKIP_CPUFREQ: 1 AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES: 1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install run: brew install make gcc - name: fix install @@ -51,3 +51,4 @@ jobs: run: sudo -E ./afl-system-config; export CC=/usr/local/Cellar/llvm/*/bin/clang; export CXX="$CC"++; export PATH=/usr/local/Cellar/llvm/*/":/usr/local/bin:$PATH"; export LLVM_CONFIG=/usr/local/Cellar/llvm/*/bin/llvm-config; gmake tests - name: force frida test for MacOS run: export AFL_PATH=`pwd`; /usr/local/bin/gcc -o test-instr test-instr.c; mkdir in; echo > in/in; AFL_NO_UI=1 ./afl-fuzz -O -i in -o out -V 5 -- ./test-instr + \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index eda8dfd0..d5dce05f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Initialize CodeQL uses: github/codeql-action/init@v1 diff --git a/.github/workflows/rust_custom_mutator.yml b/.github/workflows/rust_custom_mutator.yml index c279439e..eb3e2581 100644 --- a/.github/workflows/rust_custom_mutator.yml +++ b/.github/workflows/rust_custom_mutator.yml @@ -17,7 +17,7 @@ jobs: matrix: os: [ubuntu-22.04, ubuntu-20.04] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Rust Toolchain uses: actions-rs/toolchain@v1 with: @@ -27,4 +27,4 @@ jobs: - name: Run General Tests run: cargo test - name: Run Tests for afl_internals feature flag - run: cd custom_mutator && cargo test --features=afl_internals \ No newline at end of file + run: cd custom_mutator && cargo test --features=afl_internals diff --git a/Dockerfile b/Dockerfile index 87ef1a91..21c229be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,11 +11,11 @@ ARG DEBIAN_FRONTEND=noninteractive ENV NO_ARCH_OPT 1 -RUN apt-get update && \ +RUN apt-get update && apt-get full-upgrade -y && \ apt-get -y install --no-install-recommends \ make cmake automake \ meson ninja-build bison flex \ - xz-utils \ + xz-utils libbz2-1.0 \ git \ python3 python3-dev python3-setuptools python-is-python3 \ libtool libtool-bin \ @@ -26,6 +26,9 @@ RUN apt-get update && \ gnuplot-nox && \ rm -rf /var/lib/apt/lists/* +RUN wget -qO- https://sh.rustup.rs | CARGO_HOME=/etc/cargo sh -s -- -y -q --no-modify-path +ENV PATH=$PATH:/etc/cargo/bin + ARG LLVM_VERSION=14 ARG GCC_VERSION=12 @@ -33,7 +36,7 @@ RUN mkdir -p /usr/local/share/keyrings && \ echo "deb [signed-by=/usr/local/share/keyrings/llvm-snapshot.gpg.key] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${LLVM_VERSION} main" > /etc/apt/sources.list.d/llvm.list && \ wget -qO /usr/local/share/keyrings/llvm-snapshot.gpg.key https://apt.llvm.org/llvm-snapshot.gpg.key -RUN apt-get update && apt-get full-upgrade -y && \ +RUN apt-get update && \ apt-get -y install --no-install-recommends \ gcc-${GCC_VERSION} g++-${GCC_VERSION} gcc-${GCC_VERSION}-plugin-dev gdb lcov \ clang-${LLVM_VERSION} clang-tools-${LLVM_VERSION} libc++1-${LLVM_VERSION} libc++-${LLVM_VERSION}-dev \ @@ -50,8 +53,9 @@ RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \ gcc-${GCC_VERSION}-multilib gcc-multilib; \ rm -rf /var/lib/apt/lists/*; \ fi -# RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${LLVM_VERSION} 0 && \ -# update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${LLVM_VERSION} 0 + +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 0 && \ + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 0 ENV LLVM_CONFIG=llvm-config-${LLVM_VERSION} ENV AFL_SKIP_CPUFREQ=1 diff --git a/GNUmakefile b/GNUmakefile index 42d48b68..fad619cf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -610,42 +610,42 @@ endif .PHONY: distrib distrib: all - -$(MAKE) -j4 -f GNUmakefile.llvm + $(MAKE) -j4 -f GNUmakefile.llvm ifneq "$(SYS)" "Darwin" - -$(MAKE) -f GNUmakefile.gcc_plugin -endif - -$(MAKE) -C utils/libdislocator - -$(MAKE) -C utils/libtokencap - -$(MAKE) -C utils/afl_network_proxy - -$(MAKE) -C utils/socket_fuzzing - -$(MAKE) -C utils/argv_fuzzing - # -$(MAKE) -C utils/plot_ui - -$(MAKE) -C frida_mode + $(MAKE) -f GNUmakefile.gcc_plugin +endif + $(MAKE) -C utils/libdislocator + $(MAKE) -C utils/libtokencap + $(MAKE) -C utils/afl_network_proxy + $(MAKE) -C utils/socket_fuzzing + $(MAKE) -C utils/argv_fuzzing + # $(MAKE) -C utils/plot_ui + $(MAKE) -C frida_mode ifneq "$(SYS)" "Darwin" ifeq "$(ARCH)" "aarch64" - -$(MAKE) -C coresight_mode + $(MAKE) -C coresight_mode endif ifeq "$(SYS)" "Linux" ifndef NO_NYX - -cd nyx_mode && ./build_nyx_support.sh + cd nyx_mode && ./build_nyx_support.sh endif endif - -cd qemu_mode && sh ./build_qemu_support.sh - -cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh + cd qemu_mode && sh ./build_qemu_support.sh + cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh endif .PHONY: binary-only binary-only: test_shm test_python ready $(PROGS) - -$(MAKE) -C utils/libdislocator - -$(MAKE) -C utils/libtokencap - -$(MAKE) -C utils/afl_network_proxy - -$(MAKE) -C utils/socket_fuzzing - -$(MAKE) -C utils/argv_fuzzing - # -$(MAKE) -C utils/plot_ui - -$(MAKE) -C frida_mode + $(MAKE) -C utils/libdislocator + $(MAKE) -C utils/libtokencap + $(MAKE) -C utils/afl_network_proxy + $(MAKE) -C utils/socket_fuzzing + $(MAKE) -C utils/argv_fuzzing + # $(MAKE) -C utils/plot_ui + $(MAKE) -C frida_mode ifneq "$(SYS)" "Darwin" ifeq "$(ARCH)" "aarch64" - -$(MAKE) -C coresight_mode + $(MAKE) -C coresight_mode endif ifeq "$(SYS)" "Linux" ifndef NO_NYX @@ -658,13 +658,13 @@ endif .PHONY: source-only source-only: all - -$(MAKE) -j4 -f GNUmakefile.llvm + $(MAKE) -j4 -f GNUmakefile.llvm ifneq "$(SYS)" "Darwin" - -$(MAKE) -f GNUmakefile.gcc_plugin + $(MAKE) -f GNUmakefile.gcc_plugin endif - -$(MAKE) -C utils/libdislocator - -$(MAKE) -C utils/libtokencap - # -$(MAKE) -C utils/plot_ui + $(MAKE) -C utils/libdislocator + $(MAKE) -C utils/libtokencap + # $(MAKE) -C utils/plot_ui ifeq "$(SYS)" "Linux" ifndef NO_NYX -cd nyx_mode && ./build_nyx_support.sh @@ -712,9 +712,9 @@ install: all $(MANPAGES) @if [ -f utils/afl_network_proxy/afl-network-server ]; then $(MAKE) -C utils/afl_network_proxy install; fi @if [ -f utils/aflpp_driver/libAFLDriver.a ]; then set -e; install -m 644 utils/aflpp_driver/libAFLDriver.a $${DESTDIR}$(HELPER_PATH); fi @if [ -f utils/aflpp_driver/libAFLQemuDriver.a ]; then set -e; install -m 644 utils/aflpp_driver/libAFLQemuDriver.a $${DESTDIR}$(HELPER_PATH); fi - -$(MAKE) -f GNUmakefile.llvm install + $(MAKE) -f GNUmakefile.llvm install ifneq "$(SYS)" "Darwin" - -$(MAKE) -f GNUmakefile.gcc_plugin install + $(MAKE) -f GNUmakefile.gcc_plugin install endif ln -sf afl-cc $${DESTDIR}$(BIN_PATH)/afl-gcc ln -sf afl-cc $${DESTDIR}$(BIN_PATH)/afl-g++ diff --git a/GNUmakefile.gcc_plugin b/GNUmakefile.gcc_plugin index e21203ae..5e651688 100644 --- a/GNUmakefile.gcc_plugin +++ b/GNUmakefile.gcc_plugin @@ -122,7 +122,7 @@ test_deps: # @echo "[*] Checking for gcc for plugin support..." # @$(CC) -v 2>&1 | grep -q -- --enable-plugin || ( echo "[-] Oops, this gcc has not been configured with plugin support."; exit 1 ) @echo "[*] Checking for gcc plugin development header files..." - @test -d `$(CC) -print-file-name=plugin`/include || ( echo "[-] Oops, can't find gcc header files. Be sure to install 'gcc-X-plugin-dev'."; exit 1 ) + -@test -d `$(CC) -print-file-name=plugin`/include || ( echo "[-] Oops, can't find gcc header files. Be sure to install 'gcc-X-plugin-dev'."; exit 1 ) @echo "[*] Checking for './afl-showmap'..." @test -f ./afl-showmap || ( echo "[-] Oops, can't find './afl-showmap'. Be sure to compile AFL first."; exit 1 ) @echo "[+] All set and ready to build." diff --git a/coresight_mode/GNUmakefile b/coresight_mode/GNUmakefile index 9ab30ff7..167b83fa 100644 --- a/coresight_mode/GNUmakefile +++ b/coresight_mode/GNUmakefile @@ -54,7 +54,7 @@ $(GLIBC_LDSO): | $(GLIBC_NAME).tar.xz $(MAKE) install $(GLIBC_NAME).tar.xz: - wget -O $@ $(GLIBC_URL_BASE)/$@ + wget -qO $@ $(GLIBC_URL_BASE)/$@ clean: $(MAKE) -C $(CS_TRACE) clean diff --git a/custom_mutators/grammar_mutator/build_grammar_mutator.sh b/custom_mutators/grammar_mutator/build_grammar_mutator.sh index e8594ba3..5121b07f 100755 --- a/custom_mutators/grammar_mutator/build_grammar_mutator.sh +++ b/custom_mutators/grammar_mutator/build_grammar_mutator.sh @@ -128,7 +128,7 @@ git pull >/dev/null 2>&1 sh -c 'git stash && git stash drop' 1>/dev/null 2>/dev/null git checkout "$GRAMMAR_VERSION" || exit 1 echo "[*] Downloading antlr..." -wget -c https://www.antlr.org/download/antlr-4.8-complete.jar +wget -q https://www.antlr.org/download/antlr-4.8-complete.jar cd .. echo diff --git a/frida_mode/GNUmakefile b/frida_mode/GNUmakefile index 014dcca5..28e570f9 100644 --- a/frida_mode/GNUmakefile +++ b/frida_mode/GNUmakefile @@ -275,7 +275,7 @@ endif else $(GUM_DEVKIT_TARBALL): | $(FRIDA_BUILD_DIR) - wget -O $@ $(GUM_DEVKIT_URL) || curl -L -o $@ $(GUM_DEVKIT_URL) + wget -qO $@ $(GUM_DEVKIT_URL) || curl -L -o $@ $(GUM_DEVKIT_URL) $(GUM_DEVIT_LIBRARY): $(GUM_DEVKIT_TARBALL) tar Jxvfm $(GUM_DEVKIT_TARBALL) -C $(FRIDA_BUILD_DIR) |