From 1d2bbea346539e0a69d2d958d6d52bc5332ab338 Mon Sep 17 00:00:00 2001 From: Sven Nobis <snobis@ernw.de> Date: Tue, 9 Apr 2019 10:39:14 +0200 Subject: [PATCH 01/95] made run-nmap.sh executable --- packaging/run-nmap.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 packaging/run-nmap.sh diff --git a/packaging/run-nmap.sh b/packaging/run-nmap.sh old mode 100644 new mode 100755 From d212aac2faae7504b9d036900cbe6c4464b74f64 Mon Sep 17 00:00:00 2001 From: Sven Nobis <snobis@ernw.de> Date: Tue, 9 Apr 2019 10:49:58 +0200 Subject: [PATCH 02/95] call nmap executable in run-nmap.sh directory --- packaging/run-nmap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packaging/run-nmap.sh b/packaging/run-nmap.sh index 2036b18..9d979a1 100755 --- a/packaging/run-nmap.sh +++ b/packaging/run-nmap.sh @@ -1,2 +1,4 @@ #!/bin/bash -NMAPDIR=data ./nmap $@ +SOURCE="${BASH_SOURCE[0]}" +SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +NMAPDIR="$SCRIPT_DIR/data" "$SCRIPT_DIR/nmap" $@ From 2e95cb4f0f2d360c15388e1c8d223d003c8ac211 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 15 Jul 2020 22:13:51 +0200 Subject: [PATCH 03/95] Added GitHub Actions and updated build framework --- .github/README.md | 43 ++++ .github/workflows/build-gdb-x86_64.yml | 25 ++ .github/workflows/build-nmap-aarch64.yml | 35 +++ .github/workflows/build-nmap-armhf.yml | 35 +++ .github/workflows/build-nmap-x86.yml | 35 +++ .github/workflows/build-nmap-x86_64.yml | 34 +++ .github/workflows/build-openssh-aarch64.yml | 25 ++ .github/workflows/build-openssh-armhf.yml | 25 ++ .github/workflows/build-openssh-x86.yml | 25 ++ .github/workflows/build-openssh-x86_64.yml | 25 ++ .github/workflows/build-socat-aarch64.yml | 34 +++ .github/workflows/build-socat-armhf.yml | 34 +++ .github/workflows/build-socat-x86.yml | 27 ++ .github/workflows/build-socat-x86_64.yml | 27 ++ README.md | 56 ++-- build/lib.sh | 267 ++++++++++++++++++++ build/targets/build_gdb.sh | 110 ++++++++ build/targets/build_nmap.sh | 70 +++++ build/targets/build_openssh.sh | 51 ++++ build/targets/build_socat.sh | 43 ++++ package/targets/nmap/package.sh | 63 +++++ package/targets/nmap/run-nmap.ps1 | 3 + package/targets/nmap/run-nmap.sh | 4 + 23 files changed, 1065 insertions(+), 31 deletions(-) create mode 100644 .github/README.md create mode 100644 .github/workflows/build-gdb-x86_64.yml create mode 100644 .github/workflows/build-nmap-aarch64.yml create mode 100644 .github/workflows/build-nmap-armhf.yml create mode 100644 .github/workflows/build-nmap-x86.yml create mode 100644 .github/workflows/build-nmap-x86_64.yml create mode 100644 .github/workflows/build-openssh-aarch64.yml create mode 100644 .github/workflows/build-openssh-armhf.yml create mode 100644 .github/workflows/build-openssh-x86.yml create mode 100644 .github/workflows/build-openssh-x86_64.yml create mode 100644 .github/workflows/build-socat-aarch64.yml create mode 100644 .github/workflows/build-socat-armhf.yml create mode 100644 .github/workflows/build-socat-x86.yml create mode 100644 .github/workflows/build-socat-x86_64.yml create mode 100755 build/lib.sh create mode 100755 build/targets/build_gdb.sh create mode 100755 build/targets/build_nmap.sh create mode 100755 build/targets/build_openssh.sh create mode 100755 build/targets/build_socat.sh create mode 100755 package/targets/nmap/package.sh create mode 100644 package/targets/nmap/run-nmap.ps1 create mode 100755 package/targets/nmap/run-nmap.sh diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 0000000..c6add17 --- /dev/null +++ b/.github/README.md @@ -0,0 +1,43 @@ +# static-toolbox + +This repository includes prebuild static binaries and build-recipes for various tools like Nmap and OpenSSH. + +The Linux versions are compiled with the musl-cross toolchain and the openssl-pm-snapshot fork of OpenSSL in order to support a wide range of SSL/TLS features (Warning: some of them are insecure!). + +Compilation is done automatically with GitHub Actions. + +## Tools + +### Nmap + + + + + + + + + +### OpenSSH + + + + + + + + + +### socat + + + + + + + + + +### GDB + + \ No newline at end of file diff --git a/.github/workflows/build-gdb-x86_64.yml b/.github/workflows/build-gdb-x86_64.yml new file mode 100644 index 0000000..0c88a12 --- /dev/null +++ b/.github/workflows/build-gdb-x86_64.yml @@ -0,0 +1,25 @@ +name: GDB x86_64 +on: + workflow_dispatch +jobs: + build: + name: Build GDB x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Checkout + uses: actions/checkout@v2 + - name: Build GDB + id: build_gdb + run: $GITHUB_WORKSPACE/build/targets/build_gdb.sh x86_64 + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} + path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-nmap-aarch64.yml b/.github/workflows/build-nmap-aarch64.yml new file mode 100644 index 0000000..17be34a --- /dev/null +++ b/.github/workflows/build-nmap-aarch64.yml @@ -0,0 +1,35 @@ +name: Nmap AARCH64 +on: + workflow_dispatch +jobs: + build: + name: Build Nmap AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Checkout + uses: actions/checkout@v2 + - name: Build Nmap + run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh aarch64 + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Package Nmap + id: package_nmap + run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output aarch64 + - name: List packaged artifacts + run: ls -la /packaged + - name: Upload tarball + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} + path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} + - name: Upload zip + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} + path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} + diff --git a/.github/workflows/build-nmap-armhf.yml b/.github/workflows/build-nmap-armhf.yml new file mode 100644 index 0000000..1c16942 --- /dev/null +++ b/.github/workflows/build-nmap-armhf.yml @@ -0,0 +1,35 @@ +name: Nmap ARMHF +on: + workflow_dispatch +jobs: + build: + name: Build Nmap ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:armel-linux-musleabihf + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Checkout + uses: actions/checkout@v2 + - name: Build Nmap + run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh armhf + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Package Nmap + id: package_nmap + run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output armhf + - name: List packaged artifacts + run: ls -la /packaged + - name: Upload tarball + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} + path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} + - name: Upload zip + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} + path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} + diff --git a/.github/workflows/build-nmap-x86.yml b/.github/workflows/build-nmap-x86.yml new file mode 100644 index 0000000..9b734e4 --- /dev/null +++ b/.github/workflows/build-nmap-x86.yml @@ -0,0 +1,35 @@ +name: Nmap x86 +on: + workflow_dispatch +jobs: + build: + name: Build Nmap x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Checkout + uses: actions/checkout@v2 + - name: Build Nmap + run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh x86 + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Package Nmap + id: package_nmap + run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output x86 + - name: List packaged artifacts + run: ls -la /packaged + - name: Upload tarball + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} + path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} + - name: Upload zip + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} + path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} + diff --git a/.github/workflows/build-nmap-x86_64.yml b/.github/workflows/build-nmap-x86_64.yml new file mode 100644 index 0000000..06e42f4 --- /dev/null +++ b/.github/workflows/build-nmap-x86_64.yml @@ -0,0 +1,34 @@ +name: Nmap x86_64 +on: + workflow_dispatch +jobs: + build: + name: Build Nmap x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Checkout + uses: actions/checkout@v2 + - name: Build Nmap + run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh x86_64 + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Package Nmap + id: package_nmap + run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output x86_64 + - name: List packaged artifacts + run: ls -la /packaged + - name: Upload tarball + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} + path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} + - name: Upload zip + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} + path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} diff --git a/.github/workflows/build-openssh-aarch64.yml b/.github/workflows/build-openssh-aarch64.yml new file mode 100644 index 0000000..e13f539 --- /dev/null +++ b/.github/workflows/build-openssh-aarch64.yml @@ -0,0 +1,25 @@ +name: OpenSSH AARCH64 +on: + workflow_dispatch +jobs: + build: + name: Build OpenSSH AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Checkout + uses: actions/checkout@v2 + - name: Build OpenSSH + id: build_openssh + run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh aarch64 + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} + path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-openssh-armhf.yml b/.github/workflows/build-openssh-armhf.yml new file mode 100644 index 0000000..79af80e --- /dev/null +++ b/.github/workflows/build-openssh-armhf.yml @@ -0,0 +1,25 @@ +name: OpenSSH ARMHF +on: + workflow_dispatch +jobs: + build: + name: Build OpenSSH ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:armel-linux-musleabihf + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Checkout + uses: actions/checkout@v2 + - name: Build OpenSSH + id: build_openssh + run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh armhf + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} + path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-openssh-x86.yml b/.github/workflows/build-openssh-x86.yml new file mode 100644 index 0000000..3fbd630 --- /dev/null +++ b/.github/workflows/build-openssh-x86.yml @@ -0,0 +1,25 @@ +name: OpenSSH x86 +on: + workflow_dispatch +jobs: + build: + name: Build OpenSSH x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Checkout + uses: actions/checkout@v2 + - name: Build OpenSSH + id: build_openssh + run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh x86 + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} + path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-openssh-x86_64.yml b/.github/workflows/build-openssh-x86_64.yml new file mode 100644 index 0000000..45522c3 --- /dev/null +++ b/.github/workflows/build-openssh-x86_64.yml @@ -0,0 +1,25 @@ +name: OpenSSH x86_64 +on: + workflow_dispatch +jobs: + build: + name: Build OpenSSH x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Checkout + uses: actions/checkout@v2 + - name: Build OpenSSH + id: build_openssh + run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh x86_64 + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} + path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-socat-aarch64.yml b/.github/workflows/build-socat-aarch64.yml new file mode 100644 index 0000000..604c90a --- /dev/null +++ b/.github/workflows/build-socat-aarch64.yml @@ -0,0 +1,34 @@ +name: socat AARCH64 +on: + workflow_dispatch +jobs: + build: + name: Build socat AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + - name: Checkout + uses: actions/checkout@v2 + - name: Build socat + id: build_socat + run: $GITHUB_WORKSPACE/build/targets/build_socat.sh aarch64 + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-socat-armhf.yml b/.github/workflows/build-socat-armhf.yml new file mode 100644 index 0000000..f83148d --- /dev/null +++ b/.github/workflows/build-socat-armhf.yml @@ -0,0 +1,34 @@ +name: socat ARMHF +on: + workflow_dispatch +jobs: + build: + name: Build socat ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:armel-linux-musleabihf + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + - name: Checkout + uses: actions/checkout@v2 + - name: Build socat + id: build_socat + run: $GITHUB_WORKSPACE/build/targets/build_socat.sh armhf + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-socat-x86.yml b/.github/workflows/build-socat-x86.yml new file mode 100644 index 0000000..61f54e8 --- /dev/null +++ b/.github/workflows/build-socat-x86.yml @@ -0,0 +1,27 @@ +name: socat x86 +on: + workflow_dispatch +jobs: + build: + name: Build socat x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + - name: Checkout + uses: actions/checkout@v2 + - name: Build socat + id: build_socat + run: $GITHUB_WORKSPACE/build/targets/build_socat.sh x86 + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-socat-x86_64.yml b/.github/workflows/build-socat-x86_64.yml new file mode 100644 index 0000000..3692a24 --- /dev/null +++ b/.github/workflows/build-socat-x86_64.yml @@ -0,0 +1,27 @@ +name: socat x86_64 +on: + workflow_dispatch +jobs: + build: + name: Build socat x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + - name: Checkout + uses: actions/checkout@v2 + - name: Build socat + id: build_socat + run: $GITHUB_WORKSPACE/build/targets/build_socat.sh x86_64 + - name: List build directory + run: ls -la /build + - name: List build artifacts + run: ls -la /output + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} diff --git a/README.md b/README.md index 5dac028..c6add17 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,43 @@ # static-toolbox -This repository includes prebuild static binaries and build-recipes for various tools like Nmap. +This repository includes prebuild static binaries and build-recipes for various tools like Nmap and OpenSSH. -The Linux versions are compiled with the [musl-cross](https://github.com/takeshixx/musl-cross) toolchain and the [openssl-pm-snapshot](https://github.com/drwetter/openssl-pm-snapshot) fork of OpenSSL in order to support a wide range of SSL/TLS features (Warning: some of them are insecure!). +The Linux versions are compiled with the musl-cross toolchain and the openssl-pm-snapshot fork of OpenSSL in order to support a wide range of SSL/TLS features (Warning: some of them are insecure!). -## Release Packages +Compilation is done automatically with GitHub Actions. -Precompiled and packaged releases are available in the tags/release section. +## Tools -## Nmap +### Nmap -Precompiled versions of Nmap are available for the following operating systems/architectures: + -* Linux x86 (nmap, ncat, nping) -* Linux x86_64 (nmap, ncat, nping) -* Linux armhf (nmap, ncat, nping) -* Linux aarch64 (nmap, ncat, nping) -* Windows x86 (nmap) + -## Socat + -Precompiled versions of socat are available for the following operating systems/architectures: + -* Linux x86 -* Linux x86_64 +### OpenSSH -## GDB + -Precompiled versions of `gdb` and `gdbserver` are available for the following operating systems/architecturs: + -* Linux x86 -* Linux x86_64 -* Linux armhf -* Linux aarch64 + -# Building with Vagrant + -The recipes are supposed to be built in Docker containers. In case Docker is not available, it is recommended to use Vagrant to built everything in a VM, e.g. Nmap for Linux x86: +### socat -``` -vagrant up -vagrant ssh -cd /vagrant/recipes/nmap/linux_x86 -sudo docker build -t static-toolbox-nmap-x86 . -sudo docker run -v $(pwd)/output:/output static-toolbox-nmap-x86 -``` + -This is also the recommended way to run the build scripts without Docker without creating directories like `/build` and `/output` on your host system. + + + + + + +### GDB + + \ No newline at end of file diff --git a/build/lib.sh b/build/lib.sh new file mode 100755 index 0000000..e4eaa43 --- /dev/null +++ b/build/lib.sh @@ -0,0 +1,267 @@ +#!/bin/bash +GIT_OPENSSL="https://github.com/drwetter/openssl-pm-snapshot.git" +GIT_BINUTILS_GDB="https://github.com/bminor/binutils-gdb.git" +GIT_READLINE="https://git.savannah.gnu.org/git/readline.git" +GIT_NCURSES="https://github.com/ThomasDickey/ncurses-snapshots.git" + +BUILD_DIRECTORY="/build" +OUTPUT_DIRECTORY="/output" +GCC_OPTS="-static -fPIC" +GXX_OPTS="-static -static-libstdc++ -fPIC" +TMP_DIR=$(mktemp -dt building_lib.XXXXXX) +trap "rm -rf ${TMP_DIR}" EXIT TERM + +# The init function that has to +# be called before running any +# other function. Should be used +# to configure the building env. +init_lib(){ + CURRENT_ARCH="$1" + if [ ! -d "$BUILD_DIRECTORY" ];then + mkdir -p $BUILD_DIRECTORY + fi + if [ ! -d "$OUTPUT_DIRECTORY" ];then + mkdir -p $OUTPUT_DIRECTORY + fi +} + +# Set a HTTP proxy for fetching +# software via HTTP and Git. +set_http_proxy(){ + proxy=$1 + export http_proxy="$proxy" + export https_proxy="$proxy" + git config --global http.proxy "$proxy" +} + +# Return a host triple for the +# selected architecture. +get_host_triple(){ + local host + if [ "$CURRENT_ARCH" == "x86" ];then + host="i486-linux-musl" + elif [ "$CURRENT_ARCH" == "x86_64" ];then + host="x86_64-unknown-linux-musl" + elif [ "$CURRENT_ARCH" == "armhf" ];then + host="arm-linux-musleabihf" + elif [ "$CURRENT_ARCH" == "aarch64" ];then + host="aarch64-linux-musleabi" + fi + echo $host +} + +# Fetch and extract a resource via +# HTTP or clone a Git repository. +fetch(){ + if [ "$#" -ne 3 ];then + echo "fetch() requires a source, destination and method." + echo "Example: fetch http://github.com/test.git /build/test git" + exit 1 + fi + source=$1 + shift + destination=$1 + shift + method=$@ + # TODO: check if $source is a valid URL + if [ -d "$destination" ] || [ -f "$destination" ];then + echo "Destination ${destination} already exists, skipping." + return + fi + if [ "${method,,}" == "http" ];then + cd /tmp || { echo "Could not cd to /tmp"; exit 1; } + headers=$(mktemp headers.XXXXXX) + curl -L -D "$headers" -sOJ "$source" + filename=$(cat "$headers" | grep -o -E 'filename=.*$' | sed -e 's/filename=//') + filename=$(trim "$filename") + extract "$filename" "$destination" + trap "rm -rf ${headers} /tmp/'${filename}'" EXIT TERM + elif [ "${method,,}" == "git" ];then + git clone "$source" "$destination" + else + echo "Invalid method ${method}" + exit 1 + fi +} + +# Extract an archive to a +# destination directory. +extract(){ + if [ "$#" -ne 2 ];then + echo "extract() requires a source and destination." + exit 1 + fi + source=$1 + destination=$2 + if [ ! -d "$destination" ];then + mkdir -p "$destination" + fi + if [ -f "$source" ] ; then + case $source in + *.tar.bz2) tar xjf "$source" -C "$destination" --strip-components 1 ;; + *.tar.gz) tar xzf "$source" -C "$destination" --strip-components 1 ;; + *.tar.xz) tar xvfJ "$source" -C "$destination" --strip-components 1 ;; + *.tar) tar xf "$source" -C "$destination" --strip-components 1 ;; + *.tbz2) tar xjf "$source" -C "$destination" --strip-components 1 ;; + *.tgz) tar xzf "$source" -C "$destination" --strip-components 1 ;; + *) echo "'${source}' cannot be extracted via extract()" ;; + esac + else + echo "'${source}' is not a valid file" + fi +} + +# Remove leading and +# trailing whitespaces. +trim(){ + local var="$*" + var="${var#"${var%%[![:space:]]*}"}" + var="${var%"${var##*[![:space:]]}"}" + echo -n "$var" +} + +# Determine the version of +# a binary after building. +get_version(){ + local cmd="$1" + if [ -z "$cmd" ];then + echo "Please provide a command to determine the version" >&2 + echo "Example: /build/test --version | awk '{print \$2}'" >&2 + exit 1 + fi + local version="-" + if [ "$CURRENT_ARCH" == "armhf" ];then + if which qemu-arm 1>&2 2>/dev/null;then + cmd="qemu-arm ${cmd}" + version+=$(eval "$cmd") + else + echo "qemu-arm not found, skipping ARMHF version checks." >&2 + fi + elif [ "$CURRENT_ARCH" == "aarch64" ];then + if which qemu-aarch64 1>&2 2>/dev/null;then + cmd="qemu-aarch64 ${cmd}" + version+=$(eval "$cmd") + else + echo "qemu-aarch64 not found, skipping AARCH64 version checks." >&2 + fi + else + version+=$(eval "$cmd") + fi + if [ "$version" == "-" ];then + version+="${CURRENT_ARCH}" + else + version+="-${CURRENT_ARCH}" + fi + echo "$version" +} + +lib_create_tmp_dir(){ + local tmp_dir=$(mktemp -dt -p ${TMP_DIR} tmpdir.XXXXXX) + echo "$tmp_dir" +} + +lib_check_lib_arch(){ + lib=$1 + if [ ! -f "$lib" ];then + echo "" + return + fi + local tmp_dir=$(lib_create_tmp_dir) + cp "$lib" "$tmp_dir" + bash -c "cd ${tmp_dir}; ar x $(basename ${lib})" + local output=$(find "${tmp_dir}" -name "*.o" -exec file {} \;) + if echo "$output" | grep -q "Intel 80386";then + echo "Arch of ${lib} is x86" >&2 + echo "x86" + elif echo "$output" | grep -q "x86-64";then + echo "Arch of ${lib} is x86_64" >&2 + echo "x86_64" + elif echo "$output" | grep -q "ARM aarch64";then + echo "Arch of ${lib} is armhf" >&2 + echo "armhf" + elif echo "$output" | grep -q "ARM,";then + echo "Arch of ${lib} is aarch64" >&2 + echo "aarch64" + else + echo "Could not determine arch of library ${lib}" >&2 + echo "" + fi +} + +lib_build_openssl(){ + local version=$1 + fetch "$GIT_OPENSSL" "${BUILD_DIRECTORY}/openssl" git + cd "${BUILD_DIRECTORY}/openssl" || { echo "Cannot cd to ${BUILD_DIRECTORY}/openssl"; exit 1; } + if [ -n "$version" ];then + git checkout "$version" || echo "Version ${version} not found, continuing with master." + fi + if [ -f "${BUILD_DIRECTORY}/openssl/libssl.a" ];then + lib_arch=$(lib_check_lib_arch "${BUILD_DIRECTORY}/openssl/libssl.a") + if [ "$lib_arch" != "$CURRENT_ARCH" ];then + echo "Rebuild for current arch" + git clean -fdx || true + else + echo "[+] OpenSSL already available for current arch, skipping building" + return + fi + fi + local openssl_arch + if [ "${CURRENT_ARCH}" == "x86" ] || + [ "${CURRENT_ARCH}" == "armhf" ];then + openssl_arch="linux-generic32" + elif [ "${CURRENT_ARCH}" == "x86_64" ];then + openssl_arch="linux-x86_64" + elif [ "${CURRENT_ARCH}" == "aarch64" ];then + openssl_arch="linux-generic64" + fi + CFLAGS="${GCC_OPTS}" \ + ./Configure \ + no-shared \ + "$openssl_arch" + make -j4 + echo "[+] Finished building OpenSSL ${CURRENT_ARCH}" +} + +lib_build_zlib(){ + fetch "$GIT_BINUTILS_GDB" "${BUILD_DIRECTORY}/binutils-gdb" git + cd "${BUILD_DIRECTORY}/binutils-gdb/zlib" || { echo "Cannot cd to ${BUILD_DIRECTORY}/binutils-gdb/zlib"; exit 1; } + git clean -fdx + CC="gcc ${GCC_OPTS}" \ + CXX="g++ ${GXX_OPTS}" \ + /bin/bash ./configure \ + --host="$(get_host_triple)" \ + --enable-static + make -j4 + echo "[+] Finished building zlib ${CURRENT_ARCH}" +} + +lib_build_readline(){ + fetch "$GIT_READLINE" "${BUILD_DIRECTORY}/readline" git + cd "${BUILD_DIRECTORY}/readline" || { echo "Cannot cd to ${BUILD_DIRECTORY}/readline"; exit 1; } + git clean -fdx + CFLAGS="${GCC_OPTS}" \ + CXXFLAGS="${GXX_OPTS}" \ + ./configure \ + --host="$(get_host_triple)" \ + --disable-shared \ + --enable-static + make -j4 + echo "[+] Finished building readline ${CURRENT_ARCH}" +} + +lib_build_ncurses(){ + fetch "$GIT_NCURSES" "${BUILD_DIRECTORY}/ncurses" git + cd "${BUILD_DIRECTORY}/ncurses" || { echo "Cannot cd to ${BUILD_DIRECTORY}/ncurses"; exit 1; } + git clean -fdx + git checkout v6_2 + + CMD="CFLAGS=\"${GCC_OPTS}\" " + CMD+="CXXFLAGS=\"${GXX_OPTS}\" " + CMD+="./configure --host=$(get_host_triple) --disable-shared --enable-static" + if [ "$CURRENT_ARCH"!="x86" -a "$CURRENT_ARCH"!="x86_64" ];then + CMD+=" --with-build-cc=/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc" + fi + eval "$CMD" + make -j4 + echo "[+] Finished building ncurses ${CURRENT_ARCH}" +} diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh new file mode 100755 index 0000000..059e402 --- /dev/null +++ b/build/targets/build_gdb.sh @@ -0,0 +1,110 @@ +#!/bin/bash +set -e +set -o pipefail +set -x +if [ "$#" -ne 1 ];then + echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" + echo "Example: ${0} x86_64" + exit 1 +fi +source $GITHUB_WORKSPACE/build/lib.sh +init_lib $1 + +build_gdb() { + fetch "$GIT_BINUTILS_GDB" "${BUILD_DIRECTORY}/binutils-gdb" git + cd "${BUILD_DIRECTORY}/binutils-gdb/" || { echo "Cannot cd to ${BUILD_DIRECTORY}/binutils-gdb/"; exit 1; } + git checkout binutils-2_35-branch + #git clean -fdx + + cd "${BUILD_DIRECTORY}/binutils-gdb/bfd" + CC="gcc ${GCC_OPTS}" \ + CXX="g++ ${GXX_OPTS}" \ + ./configure \ + --host="$(get_host_triple)" \ + --disable-shared \ + --enable-static + make -j4 + + cd "${BUILD_DIRECTORY}/binutils-gdb/readline" + CC="gcc ${GCC_OPTS}" \ + CXX="g++ ${GXX_OPTS}" \ + ./configure \ + --host="$(get_host_triple)" \ + --disable-shared \ + --enable-static + make -j4 + + cd "${BUILD_DIRECTORY}/binutils-gdb/opcodes" + CC="gcc ${GCC_OPTS}" \ + CXX="g++ ${GXX_OPTS}" \ + ./configure \ + --host="$(get_host_triple)" \ + --disable-shared \ + --enable-static + make -j4 + + cd "${BUILD_DIRECTORY}/binutils-gdb/libiberty" + CC="gcc ${GCC_OPTS}" \ + CXX="g++ ${GXX_OPTS}" \ + ./configure \ + --host="$(get_host_triple)" \ + --disable-shared \ + --enable-static + make -j4 + + cd "${BUILD_DIRECTORY}/binutils-gdb/libdecnumber" + CC="gcc ${GCC_OPTS}" \ + CXX="g++ ${GXX_OPTS}" \ + ./configure \ + --host="$(get_host_triple)" \ + --disable-shared \ + --enable-static + make -j4 + + cd "${BUILD_DIRECTORY}/binutils-gdb/zlib" + CC="gcc ${GCC_OPTS}" \ + CXX="g++ ${GXX_OPTS}" \ + /bin/bash ./configure \ + --host="$(get_host_triple)" \ + --enable-static + make -j4 + + cd "${BUILD_DIRECTORY}/binutils-gdb/gdb" + CC="gcc ${GCC_OPTS}" \ + CXX="g++ ${GXX_OPTS}" \ + ./configure \ + --enable-static=yes \ + --host="$(get_host_triple)" \ + --disable-interprocess-agent + make -j4 + + cd "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver" + CC="gcc ${GCC_OPTS}" \ + CXX="g++ ${GXX_OPTS}" \ + ./configure \ + --enable-static=yes \ + --host="$(get_host_triple)" \ + --disable-interprocess-agent + make -j4 + + strip "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" +} + +main() { + build_gdb + if [ ! -f "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" -o \ + ! -f "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" ];then + echo "[-] Building GDB ${CURRENT_ARCH} failed!" + exit 1 + fi + GDB_VERSION=$(get_version "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb --version |head -n1 |awk '{print \$4}'") + GDBSERVER_VERSION=$(get_version "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver --version |head -n1 |awk '{print \$4}'") + cp "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" "${OUTPUT_DIRECTORY}/gdb${GDB_VERSION}" + cp "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" "${OUTPUT_DIRECTORY}/gdbserver${GDBSERVER_VERSION}" + echo "[+] Finished building GDB ${CURRENT_ARCH}" + + echo ::set-output name=PACKAGED_NAME::"gdb${GDB_VERSION}" + echo ::set-output name=PACKAGED_NAME_PATH::"/output/*" +} + +main diff --git a/build/targets/build_nmap.sh b/build/targets/build_nmap.sh new file mode 100755 index 0000000..564528f --- /dev/null +++ b/build/targets/build_nmap.sh @@ -0,0 +1,70 @@ +#!/bin/bash +set -e +set -x +set -o pipefail +if [ "$#" -ne 1 ];then + echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" + echo "Example: ${0} x86_64" + exit 1 +fi +source $GITHUB_WORKSPACE/build/lib.sh +init_lib $1 + +build_nmap() { + fetch "https://github.com/nmap/nmap.git" "${BUILD_DIRECTORY}/nmap" git + cd "${BUILD_DIRECTORY}/nmap" + git clean -fdx || true + # make sure we only build the static libraries + sed -i '/build-zlib: $(ZLIBDIR)\/Makefile/!b;n;c\\t@echo Compiling zlib; cd $(ZLIBDIR) && $(MAKE) static;' "${BUILD_DIRECTORY}/nmap/Makefile.in" + CC='gcc -static -fPIC' \ + CXX='g++ -static -static-libstdc++ -fPIC' \ + LD=ld \ + LDFLAGS="-L/build/openssl" \ + ./configure \ + --host="$(get_host_triple)" \ + --without-ndiff \ + --without-zenmap \ + --without-nmap-update \ + --without-libssh2 \ + --with-pcap=linux \ + --with-openssl="${BUILD_DIRECTORY}/openssl" + sed -i -e "s/shared\: /shared\: #/" "${BUILD_DIRECTORY}/nmap/libpcap/Makefile" + make + strip nmap ncat/ncat nping/nping +} + +main() { + lib_build_openssl + build_nmap + if [ ! -f "${BUILD_DIRECTORY}/nmap/nmap" -o \ + ! -f "${BUILD_DIRECTORY}/nmap/ncat/ncat" -o \ + ! -f "${BUILD_DIRECTORY}/nmap/nping/nping" ];then + echo "[-] Building Nmap ${CURRENT_ARCH} failed!" + exit 1 + fi + VERSION_CMD=$(get_version "${BUILD_DIRECTORY}/nmap/nmap --version") + NMAP_VERSION=$(echo "$VERSION_CMD" | grep "Nmap version" | awk '{print $3}') + if [ -n "$NMAP_VERSION" ];then + NMAP_VERSION="-${NMAP_VERSION}" + fi + cp "${BUILD_DIRECTORY}/nmap/nmap" "${OUTPUT_DIRECTORY}/nmap${NMAP_VERSION}" + cp "${BUILD_DIRECTORY}/nmap/ncat/ncat" "${OUTPUT_DIRECTORY}/ncat${NMAP_VERSION}" + cp "${BUILD_DIRECTORY}/nmap/nping/nping" "${OUTPUT_DIRECTORY}/nping${NMAP_VERSION}" + echo "[+] Finished building Nmap ${CURRENT_ARCH}" + NMAP_COMMIT=$(cd "${BUILD_DIRECTORY}/nmap/" && git rev-parse --short HEAD) + NMAP_DIR="${OUTPUT_DIRECTORY}/nmap-data${NMAP_VERSION}-${NMAP_COMMIT}" + if [ ! -d "$NMAP_DIR" ];then + echo "[-] ${NMAP_DIR} does not exist, creating it" + mkdir -p "${NMAP_DIR}" + fi + if [ -n "$(ls $NMAP_DIR)" ];then + echo "[+] Data directory is not empty" + exit + fi + cd "${BUILD_DIRECTORY}/nmap" + make install + cp -r /usr/local/share/nmap/* $NMAP_DIR + echo "[+] Copied data to Nmap data dir" +} + +main diff --git a/build/targets/build_openssh.sh b/build/targets/build_openssh.sh new file mode 100755 index 0000000..cb5c130 --- /dev/null +++ b/build/targets/build_openssh.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -e +set -x +set -o pipefail +if [ "$#" -ne 1 ];then + echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" + echo "Example: ${0} x86_64" + exit 1 +fi +source $GITHUB_WORKSPACE/build/lib.sh +init_lib $1 + +build_openssh() { + fetch "https://github.com/openssh/openssh-portable.git" "${BUILD_DIRECTORY}/openssh-portable" git + cd "${BUILD_DIRECTORY}/openssh-portable" + git checkout V_7_9 + git clean -fdx + autoreconf -i + CC="gcc ${GCC_OPTS}" \ + CXX="g++ ${GXX_OPTS}" \ + CXXFLAGS="-I${BUILD_DIRECTORY}/openssl -I${BUILD_DIRECTORY}/binutils-gdb/zlib" \ + ./configure \ + --with-ssl-engine \ + --with-ssl-dir="${BUILD_DIRECTORY}/openssl" \ + --with-zlib="${BUILD_DIRECTORY}/binutils-gdb/zlib" \ + --with-ldflags=-static \ + --host="$(get_host_triple)" + make -j4 + strip ssh sshd +} + +main() { + lib_build_openssl + lib_build_zlib + build_openssh + if [ ! -f "${BUILD_DIRECTORY}/openssh-portable/ssh" -o \ + ! -f "${BUILD_DIRECTORY}/openssh-portable/sshd" ];then + echo "[-] Building OpenSSH ${CURRENT_ARCH} failed!" + exit 1 + fi + OPENSSH_VERSION=$(get_version "${BUILD_DIRECTORY}/openssh-portable/ssh -V 2>&1 | awk '{print \$1}' | sed 's/,//g'") + cp "${BUILD_DIRECTORY}/openssh-portable/ssh" "${OUTPUT_DIRECTORY}/ssh${OPENSSH_VERSION}" + cp "${BUILD_DIRECTORY}/openssh-portable/sshd" "${OUTPUT_DIRECTORY}/sshd${OPENSSH_VERSION}" + echo "[+] Finished building OpenSSH ${CURRENT_ARCH}" + + OPENSSH_VERSION=$(echo $OPENSSH_VERSION | sed 's/-//') + echo ::set-output name=PACKAGED_NAME::"${OPENSSH_VERSION}" + echo ::set-output name=PACKAGED_NAME_PATH::"/output/*" +} + +main diff --git a/build/targets/build_socat.sh b/build/targets/build_socat.sh new file mode 100755 index 0000000..f74fbd6 --- /dev/null +++ b/build/targets/build_socat.sh @@ -0,0 +1,43 @@ +#!/bin/bash +set -e +set -x +set -o pipefail +if [ "$#" -ne 1 ];then + echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" + echo "Example: ${0} x86_64" + exit 1 +fi +source $GITHUB_WORKSPACE/build/lib.sh +init_lib "$1" + +build_socat() { + fetch "http://repo.or.cz/socat.git" "${BUILD_DIRECTORY}/socat" git + cd "${BUILD_DIRECTORY}/socat" + git clean -fdx + autoconf + CFLAGS="${GCC_OPTS}" \ + CXXFLAGS="${GXX_OPTS}" \ + CPPFLAGS="-I${BUILD_DIRECTORY} -I${BUILD_DIRECTORY}/openssl/include -DNETDB_INTERNAL=-1" \ + LDFLAGS="-L${BUILD_DIRECTORY}/readline -L${BUILD_DIRECTORY}/ncurses/lib -L${BUILD_DIRECTORY}/openssl" \ + ./configure \ + --host="$(get_host_triple)" + make -j4 + strip socat +} + +main() { + #sudo apt install yodl + lib_build_openssl + lib_build_ncurses + lib_build_readline + build_socat + local version + version=$(get_version "${BUILD_DIRECTORY}/socat/socat -V | grep 'socat version' | awk '{print \$3}'") + cp "${BUILD_DIRECTORY}/socat/socat" "${OUTPUT_DIRECTORY}/socat${version}" + echo "[+] Finished building socat ${CURRENT_ARCH}" + + echo ::set-output name=PACKAGED_NAME::"socat${version}" + echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" +} + +main diff --git a/package/targets/nmap/package.sh b/package/targets/nmap/package.sh new file mode 100755 index 0000000..c2363a6 --- /dev/null +++ b/package/targets/nmap/package.sh @@ -0,0 +1,63 @@ +#!/bin/bash +set -x +if [ $# -lt 2 ];then + echo "Usage: ${0} <output directory> <arch>" >&2 + echo "Example: ${0} /output x86_64" >&2 + exit 2 +fi +output_dir=$1 +arch=$2 +tmp_dir=$(mktemp -dt packaging.XXXXXX) +trap exit_script EXIT TERM + +if [ ! -d "$output_dir" ];then + echo "Invalid directory ${output_dir}" + exit 1 +fi + +exit_script(){ + rm -rf "$tmp_dir" +} + +echo "tmp_dir: ${tmp_dir}" + +version="" + +for f in $(ls "$output_dir");do + case "$f" in + nmap-data*) + mv "${output_dir}/${f}" "${tmp_dir}/data" + ;; + nmap*) + mv "${output_dir}/${f}" "${tmp_dir}/nmap" + version=${f//nmap-/} + ;; + nping*) + mv "${output_dir}/${f}" "${tmp_dir}/nping" + ;; + ncat*) + mv "${output_dir}/${f}" "${tmp_dir}/ncat" + ;; + *) + echo "This file should not be there: ${output_dir}/${f}" + ;; + esac +done + +if [ ! -d /packaged ];then + mkdir /packaged +fi +cp $GITHUB_WORKSPACE/package/targets/nmap/run-nmap.sh "$tmp_dir" +cd "$tmp_dir" + +TARBALL="nmap-${version}-${arch}-portable.tar.gz" +tar czf "${output}/${TARBALL}" -C "$tmp_dir" . +cp "${output}/${TARBALL}" /packaged +echo ::set-output name=PACKAGED_TARBALL::${TARBALL} +echo ::set-output name=PACKAGED_TARBALL_PATH::"/packaged/${TARBALL}" + +ZIP="nmap-${version}-${arch}-portable.zip" +zip -r -q "${output}/${ZIP}" . +cp "${output}/${ZIP}" /packaged +echo ::set-output name=PACKAGED_ZIP::${ZIP} +echo ::set-output name=PACKAGED_ZIP_PATH::"/packaged/${ZIP}" diff --git a/package/targets/nmap/run-nmap.ps1 b/package/targets/nmap/run-nmap.ps1 new file mode 100644 index 0000000..fe96f5b --- /dev/null +++ b/package/targets/nmap/run-nmap.ps1 @@ -0,0 +1,3 @@ +$allArgs = $PsBoundParameters.Values + $args +$env:NMAPDIR = "data" +.\nmap.exe $allArgs diff --git a/package/targets/nmap/run-nmap.sh b/package/targets/nmap/run-nmap.sh new file mode 100755 index 0000000..9d979a1 --- /dev/null +++ b/package/targets/nmap/run-nmap.sh @@ -0,0 +1,4 @@ +#!/bin/bash +SOURCE="${BASH_SOURCE[0]}" +SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +NMAPDIR="$SCRIPT_DIR/data" "$SCRIPT_DIR/nmap" $@ From 047017e20029c0568855dc11a99c067f0ea9c289 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 15 Jul 2020 22:15:09 +0200 Subject: [PATCH 04/95] Removed old build scripts --- Vagrantfile | 26 ---- packaging/package.sh | 61 -------- packaging/run-nmap.ps1 | 3 - packaging/run-nmap.sh | 4 - recipes/gdb/README.md | 28 ---- recipes/gdb/linux_aarch64/Dockerfile | 25 ---- recipes/gdb/linux_aarch64/build_aarch64.sh | 146 ------------------- recipes/gdb/linux_armhf/Dockerfile | 25 ---- recipes/gdb/linux_armhf/build_armhf.sh | 148 -------------------- recipes/gdb/linux_x86/Dockerfile | 24 ---- recipes/gdb/linux_x86/build_x86.sh | 134 ------------------ recipes/gdb/linux_x86_64/Dockerfile | 24 ---- recipes/gdb/linux_x86_64/build_x86_64.sh | 132 ----------------- recipes/nmap/README.md | 37 ----- recipes/nmap/linux_aarch64/Dockerfile | 19 --- recipes/nmap/linux_aarch64/build_aarch64.sh | 102 -------------- recipes/nmap/linux_armhf/Dockerfile | 19 --- recipes/nmap/linux_armhf/build_armhf.sh | 104 -------------- recipes/nmap/linux_x86/Dockerfile | 19 --- recipes/nmap/linux_x86/build_x86.sh | 110 --------------- recipes/nmap/linux_x86_64/Dockerfile | 19 --- recipes/nmap/linux_x86_64/build_x86_64.sh | 108 -------------- recipes/socat/Dockerfile | 18 --- recipes/socat/build.sh | 139 ------------------ 24 files changed, 1474 deletions(-) delete mode 100644 Vagrantfile delete mode 100755 packaging/package.sh delete mode 100644 packaging/run-nmap.ps1 delete mode 100755 packaging/run-nmap.sh delete mode 100644 recipes/gdb/README.md delete mode 100644 recipes/gdb/linux_aarch64/Dockerfile delete mode 100644 recipes/gdb/linux_aarch64/build_aarch64.sh delete mode 100644 recipes/gdb/linux_armhf/Dockerfile delete mode 100644 recipes/gdb/linux_armhf/build_armhf.sh delete mode 100644 recipes/gdb/linux_x86/Dockerfile delete mode 100644 recipes/gdb/linux_x86/build_x86.sh delete mode 100644 recipes/gdb/linux_x86_64/Dockerfile delete mode 100644 recipes/gdb/linux_x86_64/build_x86_64.sh delete mode 100644 recipes/nmap/README.md delete mode 100644 recipes/nmap/linux_aarch64/Dockerfile delete mode 100644 recipes/nmap/linux_aarch64/build_aarch64.sh delete mode 100644 recipes/nmap/linux_armhf/Dockerfile delete mode 100644 recipes/nmap/linux_armhf/build_armhf.sh delete mode 100644 recipes/nmap/linux_x86/Dockerfile delete mode 100644 recipes/nmap/linux_x86/build_x86.sh delete mode 100644 recipes/nmap/linux_x86_64/Dockerfile delete mode 100644 recipes/nmap/linux_x86_64/build_x86_64.sh delete mode 100644 recipes/socat/Dockerfile delete mode 100644 recipes/socat/build.sh diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 28e2b46..0000000 --- a/Vagrantfile +++ /dev/null @@ -1,26 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - config.vm.box = "ubuntu/artful64" - - config.vm.provider "virtualbox" do |vb| - vb.memory = "4096" - vb.cpus = 4 - end - - config.vm.provision "shell", inline: <<-SHELL - apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D - echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" > /etc/apt/sources.list.d/docker.list - apt update - apt install -y linux-image-extra-$(uname -r) linux-image-extra-virtual - apt install -y docker-engine - service docker start - apt install -y python3-pip - pip3 install --upgrade pip - pip3 install docker-compose - systemctl daemon-reload - systemctl restart docker - apt install -y qemu - SHELL -end diff --git a/packaging/package.sh b/packaging/package.sh deleted file mode 100755 index 59c8ca4..0000000 --- a/packaging/package.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -if [ $# -lt 2 ];then - echo "Usage: ${0} <commit> <version?" >&2 - echo "Example: ${0} b5bd185 7.70SVN" >&2 - exit 2 -fi - -commit=$1 -version=$2 -architectures=(aarch64 armhf x86 x86_64) -tmp_dir=$(mktemp -dt packaging.XXXXXX) -trap exit_script EXIT TERM - -exit_script(){ - rm -rf "$tmp_dir" -} - -echo "tmp_dir: ${tmp_dir}" - -for arch in "${architectures[@]}";do - arch_dir="${tmp_dir}/nmap-${version}-${commit}-${arch}-portable" - mkdir -p "$arch_dir" - find ../bin/linux/${arch}/ -name "*-${commit}" -exec cp {} "${arch_dir}" \; - echo "version: ${version}" - ls -la "$arch_dir" - if [ -s "${arch_dir}/nmap-${version}-${commit}" ];then - mv "${arch_dir}/nmap-${version}-${commit}" "${arch_dir}/nmap" - mv "${arch_dir}/ncat-${version}-${commit}" "${arch_dir}/ncat" - # Note: Nping version starts with "0.". - mv "${arch_dir}/nping-0.${version}-${commit}" "${arch_dir}/nping" - elif [ -s "${arch_dir}/nmap-${commit}" ];then - mv "${arch_dir}/nmap-${commit}" "${arch_dir}/nmap" - mv "${arch_dir}/ncat-${commit}" "${arch_dir}/ncat" - mv "${arch_dir}/nping-${commit}" "${arch_dir}/nping" - else - echo "Nmap binaries for ${arch} not found!" - read - continue - fi - if [ -d "../data/nmap-data-${version}-${commit}" ];then - cp -r "../data/nmap-data-${version}-${commit}" "${arch_dir}/data" - elif [ -d "../data/nmap-data-0.${version}-${commit}" ];then - cp -r "../data/nmap-data-0.${version}-${commit}" "${arch_dir}/data" - else - echo "Nmap data directory not found!" - read - continue - fi - cp run-nmap.sh "$arch_dir" - tar czf "${tmp_dir}/nmap-${version}-${commit}-${arch}-portable.tar.gz" -C "$tmp_dir" "nmap-${version}-${commit}-${arch}-portable" - cd "$tmp_dir" - zip -r -q "${tmp_dir}/nmap-${version}-${commit}-${arch}-portable.zip" "nmap-${version}-${commit}-${arch}-portable" - cd - - rm -rf "$arch_dir" -done - -echo "Finished packing. Got the following releases:" -ls -la "$tmp_dir" -echo "Ready to copy them. Press CTRL+C to arbort, RETURN to continue...." -read -cp "${tmp_dir}/"* ../packaged diff --git a/packaging/run-nmap.ps1 b/packaging/run-nmap.ps1 deleted file mode 100644 index fe96f5b..0000000 --- a/packaging/run-nmap.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -$allArgs = $PsBoundParameters.Values + $args -$env:NMAPDIR = "data" -.\nmap.exe $allArgs diff --git a/packaging/run-nmap.sh b/packaging/run-nmap.sh deleted file mode 100755 index 9d979a1..0000000 --- a/packaging/run-nmap.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -SOURCE="${BASH_SOURCE[0]}" -SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -NMAPDIR="$SCRIPT_DIR/data" "$SCRIPT_DIR/nmap" $@ diff --git a/recipes/gdb/README.md b/recipes/gdb/README.md deleted file mode 100644 index 88a5803..0000000 --- a/recipes/gdb/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# GDB - -## Build Linux x86 - -``` -sudo docker build -t static-toolbox-gdb-x86 . -sudo docker run -v $(pwd)/output:/output static-toolbox-gdb-x86 -``` - -## Build Linux x86_64 - -``` -sudo docker build -t static-toolbox-gdb-x86-64 . -sudo docker run -v $(pwd)/output:/output static-toolbox-gdb-x86-64 -``` - -## Build Linux armhf - -``` -sudo docker build -t static-toolbox-gdb-armhf . -sudo docker run -v $(pwd)/output:/output static-toolbox-gdb-armhf -``` - -## Build Linux aarch64 - -``` -sudo docker build -t static-toolbox-gdb-aarch64 . -sudo docker run -v $(pwd)/output:/output static-toolbox-gdb-aarch64 diff --git a/recipes/gdb/linux_aarch64/Dockerfile b/recipes/gdb/linux_aarch64/Dockerfile deleted file mode 100644 index a1151b8..0000000 --- a/recipes/gdb/linux_aarch64/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM ubuntu:xenial -RUN apt-get update && \ - apt upgrade -yy && \ - apt install -yy \ - automake \ - cmake \ - build-essential \ - checkinstall \ - libgmp-dev \ - libmpfr-dev \ - libmpc-dev \ - wget \ - git \ - pkg-config \ - python \ - binutils-dev \ - lib32z1-dev \ - byacc \ - flex \ - texinfo \ - qemu -RUN mkdir /build -ADD . /build -RUN chmod +x /build/build_aarch64.sh -CMD /build/build_aarch64.sh diff --git a/recipes/gdb/linux_aarch64/build_aarch64.sh b/recipes/gdb/linux_aarch64/build_aarch64.sh deleted file mode 100644 index 47e61d3..0000000 --- a/recipes/gdb/linux_aarch64/build_aarch64.sh +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/bash -#set -e -set -o pipefail -set -x -NMAP_COMMIT= - -fetch(){ - if [ ! -d "/build/musl" ];then - #git clone https://github.com/GregorR/musl-cross.git /build/musl - git clone https://github.com/takeshixx/musl-cross.git /build/musl - fi - if [ ! -d "/build/binutils-gdb" ];then - git clone https://github.com/bminor/binutils-gdb.git /build/binutils-gdb - fi - cd /build/binutils-gdb - git checkout binutils-2_30 - cd - -} - -build_musl_aarch64() { - cd /build/musl - git clean -fdx - echo "ARCH=arm64" >> config.sh - echo "GCC_BUILTIN_PREREQS=yes" >> config.sh - echo "TRIPLE=aarch64-linux-musleabi" >> config.sh - ./build.sh - echo "[+] Finished building musl-cross aarch64" -} - -build_gdb_aarch64() { - cd /build/binutils-gdb - git clean -fdx - make clean || true - - cd /build/binutils-gdb/bfd - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static -fPIC' \ - CXX='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-ld \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=aarch64-none-linux-gnueabi - make -j4 - - cd /build/binutils-gdb/readline - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static -fPIC' \ - CXX='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-ld \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=aarch64-none-linux-gnueabi \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/opcodes - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static -fPIC' \ - CXX='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-ld \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=aarch64-none-linux-gnueabi \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/libiberty - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static -fPIC' \ - CXX='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-ld \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=aarch64-none-linux-gnueabi \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/libdecnumber - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static -fPIC' \ - CXX='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-ld \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=aarch64-none-linux-gnueabi \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/zlib - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static -fPIC' \ - CXX='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-g++ -static -static-libstdc++ -fPIC' \ - cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_LINKER=/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-ld . - make zlibstatic - - cd /build/binutils-gdb/gdb - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static -fPIC' \ - CXX='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-ld \ - LDFLAGS='-static' \ - ./configure \ - --enable-static=yes \ - --host=x86_64-linux-gnu \ - --target=aarch64-none-linux-gnueabi \ - --disable-interprocess-agent - make -j4 - - cd /build/binutils-gdb/gdb/gdbserver/ - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static -fPIC' \ - CXX='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-ld \ - LDFLAGS='-static' \ - ./configure \ - --enable-static=yes \ - --host=x86_64-linux-gnu \ - --target=aarch64-none-linux-gnueabi \ - --disable-interprocess-agent - make -j4 - - /opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-strip /build/binutils-gdb/gdb/gdb /build/binutils-gdb/gdb/gdbserver/gdbserver -} - -build_aarch64(){ - OUT_DIR=/output/`uname | tr 'A-Z' 'a-z'`/aarch64 - mkdir -p $OUT_DIR - build_musl_aarch64 - build_gdb_aarch64 - GDB_VERSION= - GDBSERVER_VERSION= - if which qemu-aarch64 >/dev/null;then - GDB_VERSION="-$(qemu-aarch64 /build/binutils-gdb/gdb/gdb --version |head -n1 |awk '{print $4}')" - GDBSERVER_VERSION="-$(qemu-aarch64 /build/binutils-gdb/gdb/gdbserver/gdbserver --version |head -n1 |awk '{print $4}')" - fi - cp /build/binutils-gdb/gdb/gdb "${OUT_DIR}/gdb-aarch64${GDB_VERSION}" - cp /build/binutils-gdb/gdb/gdbserver/gdbserver "${OUT_DIR}/gdbserver-aarch64${GDBSERVER_VERSION}" - echo "[+] Finished building aarch64" -} - -main() { - if [ ! -d "/output" ];then - echo "[-] /output does not exist, creating it" - mkdir /output - fi - fetch - build_aarch64 -} - -main diff --git a/recipes/gdb/linux_armhf/Dockerfile b/recipes/gdb/linux_armhf/Dockerfile deleted file mode 100644 index c0f9b40..0000000 --- a/recipes/gdb/linux_armhf/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM ubuntu:xenial -RUN apt-get update && \ - apt upgrade -yy && \ - apt install -yy \ - automake \ - cmake \ - build-essential \ - checkinstall \ - libgmp-dev \ - libmpfr-dev \ - libmpc-dev \ - wget \ - git \ - pkg-config \ - python \ - binutils-dev \ - lib32z1-dev \ - byacc \ - flex \ - texinfo \ - qemu -RUN mkdir /build -ADD . /build -RUN chmod +x /build/build_armhf.sh -CMD /build/build_armhf.sh diff --git a/recipes/gdb/linux_armhf/build_armhf.sh b/recipes/gdb/linux_armhf/build_armhf.sh deleted file mode 100644 index 1c08c7b..0000000 --- a/recipes/gdb/linux_armhf/build_armhf.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/bash -#set -e -set -o pipefail -set -x -NMAP_COMMIT= - -fetch(){ - if [ ! -d "/build/musl" ];then - #git clone https://github.com/GregorR/musl-cross.git /build/musl - git clone https://github.com/takeshixx/musl-cross.git /build/musl - fi - if [ ! -d "/build/binutils-gdb" ];then - git clone https://github.com/bminor/binutils-gdb.git /build/binutils-gdb - fi - cd /build/binutils-gdb - git checkout binutils-2_30 - cd - -} - -build_musl_armhf() { - cd /build/musl - git clean -fdx - echo "ARCH=arm" >> config.sh - echo "GCC_BUILTIN_PREREQS=yes" >> config.sh - echo "TRIPLE=arm-linux-musleabihf" >> config.sh - echo "GCC_BOOTSTRAP_CONFFLAGS='--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16'" >> config.sh - echo "GCC_CONFFLAGS='--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16'" >> config.sh - ./build.sh - echo "[+] Finished building musl-cross armhf" -} - -build_gdb_armhf() { - cd /build/binutils-gdb - git clean -fdx - make clean || true - - cd /build/binutils-gdb/bfd - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static -fPIC' \ - CXX='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-ld \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=arm-none-linux-gnueabi - make -j4 - - cd /build/binutils-gdb/readline - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static -fPIC' \ - CXX='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-ld \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=arm-none-linux-gnueabi \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/opcodes - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static -fPIC' \ - CXX='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-ld \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=arm-none-linux-gnueabi \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/libiberty - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static -fPIC' \ - CXX='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-ld \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=arm-none-linux-gnueabi \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/libdecnumber - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static -fPIC' \ - CXX='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-ld \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=arm-none-linux-gnueabi \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/zlib - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static -fPIC' \ - CXX='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-g++ -static -static-libstdc++ -fPIC' \ - cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_LINKER=/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-ld . - make zlibstatic - - cd /build/binutils-gdb/gdb - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static -fPIC' \ - CXX='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-ld \ - LDFLAGS='-static' \ - ./configure \ - --enable-static=yes \ - --host=x86_64-linux-gnu \ - --target=arm-none-linux-gnueabi \ - --disable-interprocess-agent - make -j4 - - cd /build/binutils-gdb/gdb/gdbserver/ - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static -fPIC' \ - CXX='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-ld \ - LDFLAGS='-static' \ - ./configure \ - --host=x86_64-linux-gnu \ - --target=arm-none-linux-gnueabi \ - --enable-static=yes \ - --disable-interprocess-agent - make -j4 - - /opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-strip /build/binutils-gdb/gdb/gdb /build/binutils-gdb/gdb/gdbserver/gdbserver -} - -build_armhf(){ - OUT_DIR=/output/`uname | tr 'A-Z' 'a-z'`/armhf - mkdir -p $OUT_DIR - build_musl_armhf - build_gdb_armhf - GDB_VERSION= - GDBSERVER_VERSION= - if which qemu-arm >/dev/null;then - GDB_VERSION="-$(qemu-arm /build/binutils-gdb/gdb/gdb --version |head -n1 |awk '{print $4}')" - GDBSERVER_VERSION="-$(qemu-arm /build/binutils-gdb/gdb/gdbserver/gdbserver --version |head -n1 |awk '{print $4}')" - fi - cp /build/binutils-gdb/gdb/gdb "${OUT_DIR}/gdb-armhf${GDB_VERSION}" - cp /build/binutils-gdb/gdb/gdbserver/gdbserver "${OUT_DIR}/gdbserver-armhf${GDBSERVER_VERSION}" - echo "[+] Finished building armhf" -} - -main() { - if [ ! -d "/output" ];then - echo "[-] /output does not exist, creating it" - mkdir /output - fi - fetch - build_armhf -} - -main diff --git a/recipes/gdb/linux_x86/Dockerfile b/recipes/gdb/linux_x86/Dockerfile deleted file mode 100644 index 8e4b25c..0000000 --- a/recipes/gdb/linux_x86/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM ubuntu:xenial -RUN apt-get update && \ - apt upgrade -yy && \ - apt install -yy \ - automake \ - cmake \ - build-essential \ - checkinstall \ - libgmp-dev \ - libmpfr-dev \ - libmpc-dev \ - wget \ - git \ - pkg-config \ - python \ - binutils-dev \ - lib32z1-dev \ - byacc \ - flex \ - texinfo -RUN mkdir /build -ADD . /build -RUN chmod +x /build/build_x86.sh -CMD /build/build_x86.sh diff --git a/recipes/gdb/linux_x86/build_x86.sh b/recipes/gdb/linux_x86/build_x86.sh deleted file mode 100644 index 8efe9af..0000000 --- a/recipes/gdb/linux_x86/build_x86.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash -set -e -set -o pipefail -set -x -NMAP_COMMIT= - -fetch(){ - if [ ! -d "/build/musl" ];then - #git clone https://github.com/GregorR/musl-cross.git /build/musl - git clone https://github.com/takeshixx/musl-cross.git /build/musl - fi - if [ ! -d "/build/binutils-gdb" ];then - git clone https://github.com/bminor/binutils-gdb.git /build/binutils-gdb - fi - cd /build/binutils-gdb - git checkout binutils-2_30 - cd - -} - -build_musl_x86() { - cd /build/musl - git clean -fdx - echo "ARCH=i486" >> config.sh - echo "GCC_BUILTIN_PREREQS=yes" >> config.sh - ./build.sh - echo "[+] Finished building musl-cross x86" -} - -build_gdb_x86() { - cd /build/binutils-gdb - git clean -fdx - make clean || true - - cd /build/binutils-gdb/bfd - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/i486-linux-musl/bin/i486-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/i486-linux-musl/bin/i486-linux-musl-ld \ - LDFLAGS="" \ - ./configure - make -j4 - - cd /build/binutils-gdb/readline - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/i486-linux-musl/bin/i486-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/i486-linux-musl/bin/i486-linux-musl-ld \ - ./configure \ - --target=i686-linux-gnu \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/opcodes - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/i486-linux-musl/bin/i486-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/i486-linux-musl/bin/i486-linux-musl-ld \ - ./configure \ - --target=i686-linux-gnu \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/libiberty - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/i486-linux-musl/bin/i486-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/i486-linux-musl/bin/i486-linux-musl-ld \ - ./configure \ - --target=i686-linux-gnu \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/libdecnumber - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/i486-linux-musl/bin/i486-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/i486-linux-musl/bin/i486-linux-musl-ld \ - ./configure \ - --target=i686-linux-gnu \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/zlib - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/i486-linux-musl/bin/i486-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_LINKER=/opt/cross/i486-linux-musl/bin/i486-linux-musl-ld . - make zlibstatic - - cd /build/binutils-gdb/gdb - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -m32 -static -fPIC' \ - CXX='/opt/cross/i486-linux-musl/bin/i486-linux-musl-g++ -m32 -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/i486-linux-musl/bin/i486-linux-musl-ld \ - ./configure \ - --enable-static=yes \ - --host=x86_64-linux-gnu \ - --target=i686-linux-gnu \ - --disable-interprocess-agent - make -j4 - - cd /build/binutils-gdb/gdb/gdbserver/ - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -m32 -static -fPIC' \ - CXX='/opt/cross/i486-linux-musl/bin/i486-linux-musl-g++ -m32 -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/i486-linux-musl/bin/i486-linux-musl-ld \ - ./configure \ - --enable-static=yes \ - --host=x86_64-linux-gnu \ - --target=i686-linux-gnu \ - --disable-interprocess-agent - make -j4 - - /opt/cross/i486-linux-musl/bin/i486-linux-musl-strip /build/binutils-gdb/gdb/gdb /build/binutils-gdb/gdb/gdbserver/gdbserver -} - -build_x86(){ - OUT_DIR=/output/`uname | tr 'A-Z' 'a-z'`/x86 - mkdir -p $OUT_DIR - build_musl_x86 - build_gdb_x86 - GDB_VERSION="-$(/build/binutils-gdb/gdb/gdb --version |head -n1 |awk '{print $4}')" - GDBSERVER_VERSION="-$(/build/binutils-gdb/gdb/gdbserver/gdbserver --version |head -n1 |awk '{print $4}')" - cp /build/binutils-gdb/gdb/gdb "${OUT_DIR}/gdb-x86${GDB_VERSION}" - cp /build/binutils-gdb/gdb/gdbserver/gdbserver "${OUT_DIR}/gdbserver-x86${GDBSERVER_VERSION}" - echo "[+] Finished building x86" -} - -main() { - if [ ! -d "/output" ];then - echo "[-] /output does not exist, creating it" - mkdir /output - fi - fetch - build_x86 -} - -main diff --git a/recipes/gdb/linux_x86_64/Dockerfile b/recipes/gdb/linux_x86_64/Dockerfile deleted file mode 100644 index 9732d8d..0000000 --- a/recipes/gdb/linux_x86_64/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM ubuntu:xenial -RUN apt-get update && \ - apt upgrade -yy && \ - apt install -yy \ - automake \ - cmake \ - build-essential \ - checkinstall \ - libgmp-dev \ - libmpfr-dev \ - libmpc-dev \ - wget \ - git \ - pkg-config \ - python \ - binutils-dev \ - lib32z1-dev \ - byacc \ - flex \ - texinfo -RUN mkdir /build -ADD . /build -RUN chmod +x /build/build_x86_64.sh -CMD /build/build_x86_64.sh diff --git a/recipes/gdb/linux_x86_64/build_x86_64.sh b/recipes/gdb/linux_x86_64/build_x86_64.sh deleted file mode 100644 index 9ebf25f..0000000 --- a/recipes/gdb/linux_x86_64/build_x86_64.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -set -e -set -o pipefail -set -x -NMAP_COMMIT= - -fetch(){ - if [ ! -d "/build/musl" ];then - #git clone https://github.com/GregorR/musl-cross.git /build/musl - git clone https://github.com/takeshixx/musl-cross.git /build/musl - fi - if [ ! -d "/build/binutils-gdb" ];then - git clone https://github.com/bminor/binutils-gdb.git /build/binutils-gdb - fi - cd /build/binutils-gdb - git checkout binutils-2_30 - cd - -} - -build_musl_x86_64() { - cd /build/musl - git clean -fdx - ./build.sh - echo "[+] Finished building musl-cross x86_64" -} - -build_gdb_x86_64() { - cd /build/binutils-gdb - git clean -fdx - make clean || true - - cd /build/binutils-gdb/bfd - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-ld \ - LDFLAGS="" \ - ./configure - make -j4 - - cd /build/binutils-gdb/readline - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-ld \ - ./configure \ - --target=x86_64-linux-gnu \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/opcodes - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-ld \ - ./configure \ - --target=x86_64-linux-gnu \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/libiberty - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-ld \ - ./configure \ - --target=x86_64-linux-gnu \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/libdecnumber - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-ld \ - ./configure \ - --target=x86_64-linux-gnu \ - --disable-shared \ - --enable-static - make -j4 - - cd /build/binutils-gdb/zlib - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_LINKER=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-ld - make zlibstatic - - cd /build/binutils-gdb/gdb - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-ld \ - LDFLAGS='-static' \ - ./configure \ - --enable-static=yes \ - --host=x86_64-linux-gnu \ - --target=x86_64-linux-gnu \ - --disable-interprocess-agent - make -j4 - - cd /build/binutils-gdb/gdb/gdbserver/ - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - LD=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-ld \ - LDFLAGS='-static' \ - ./configure \ - --enable-static=yes \ - --disable-interprocess-agent - make -j4 - - /opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-strip /build/binutils-gdb/gdb/gdb /build/binutils-gdb/gdb/gdbserver/gdbserver -} - -build_x86_64(){ - OUT_DIR_x86=/output/`uname | tr 'A-Z' 'a-z'`/x86_64 - mkdir -p $OUT_DIR_x86 - build_musl_x86_64 - build_gdb_x86_64 - GDB_VERSION="-$(/build/binutils-gdb/gdb/gdb --version |head -n1 |awk '{print $4}')" - GDBSERVER_VERSION="-$(/build/binutils-gdb/gdb/gdbserver/gdbserver --version |head -n1 |awk '{print $4}')" - cp /build/binutils-gdb/gdb/gdb "${OUT_DIR}/gdb-x86_64${GDB_VERSION}" - cp /build/binutils-gdb/gdb/gdbserver/gdbserver "${OUT_DIR}/gdbserver-x86_64${GDBSERVER_VERSION}" - echo "[+] Finished building x86_64" -} - -main() { - if [ ! -d "/output" ];then - echo "[-] /output does not exist, creating it" - mkdir /output - fi - fetch - build_x86_64 -} - -main diff --git a/recipes/nmap/README.md b/recipes/nmap/README.md deleted file mode 100644 index 4e5d76a..0000000 --- a/recipes/nmap/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Nmap - -## Build Linux x86 - -``` -sudo docker build -t static-toolbox-nmap-x86 . -sudo docker run -v $(pwd)/output:/output static-toolbox-nmap-x86 -``` - -## Build Linux x86_64 - -``` -sudo docker build -t static-toolbox-nmap-x86-64 . -sudo docker run -v $(pwd)/output:/output static-toolbox-nmap-x86-64 -``` - -## Build Linux armhf - -``` -sudo docker build -t static-toolbox-nmap-armhf . -sudo docker run -v $(pwd)/output:/output static-toolbox-nmap-armhf -``` - -## Build Linux aarch64 - -``` -sudo docker build -t static-toolbox-nmap-aarch64 . -sudo docker run -v $(pwd)/output:/output static-toolbox-nmap-aarch64 -``` - -## Using the Nmap data directory - -In order to use features like script scanning, we also need the Nmap data files that are typically installed into `/usr/share/nmap`. They are available in the `data/nmap` directory. Just copy this directory to the target system, e.g. into `/tmp/nmap-data` and run Nmap like this: - -``` -NMAPDIR=/tmp/nmap-data ./nmap -``` diff --git a/recipes/nmap/linux_aarch64/Dockerfile b/recipes/nmap/linux_aarch64/Dockerfile deleted file mode 100644 index 91d395e..0000000 --- a/recipes/nmap/linux_aarch64/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM ubuntu:xenial -RUN apt-get update && \ - apt upgrade -yy && \ - apt install -yy \ - automake \ - cmake \ - build-essential \ - checkinstall \ - libgmp-dev \ - libmpfr-dev \ - libmpc-dev \ - wget \ - git \ - pkg-config \ - python -RUN mkdir /build -ADD . /build -RUN chmod +x /build/build_aarch64.sh -CMD /build/build_aarch64.sh diff --git a/recipes/nmap/linux_aarch64/build_aarch64.sh b/recipes/nmap/linux_aarch64/build_aarch64.sh deleted file mode 100644 index 94908dc..0000000 --- a/recipes/nmap/linux_aarch64/build_aarch64.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -#set -e -set -o pipefail -set -x -NMAP_COMMIT= - -fetch(){ - if [ ! -d "/build/musl" ];then - #git clone https://github.com/GregorR/musl-cross.git /build/musl - git clone https://github.com/takeshixx/musl-cross.git /build/musl - fi - if [ ! -d "/build/openssl" ];then - git clone https://github.com/drwetter/openssl-pm-snapshot.git /build/openssl - fi - if [ ! -d "/build/nmap" ];then - git clone https://github.com/nmap/nmap.git /build/nmap - fi - NMAP_COMMIT=$(cd /build/nmap/ && git rev-parse --short HEAD) -} - -build_musl_aarch64() { - cd /build/musl - git clean -fdx - echo "ARCH=arm64" >> config.sh - echo "GCC_BUILTIN_PREREQS=yes" >> config.sh - echo "TRIPLE=aarch64-linux-musleabi" >> config.sh - ./build.sh - echo "[+] Finished building musl-cross aarch64" -} - -build_openssl_aarch64() { - cd /build/openssl - git clean -fdx - make clean - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static' ./Configure no-shared linux-generic64 - make -j4 - echo "[+] Finished building OpenSSL aarch64" -} - -build_nmap_aarch64() { - cd /build/nmap - git clean -fdx - make clean - cd /build/nmap/libz - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static -fPIC' \ - CXX='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-g++ -static -static-libstdc++ -fPIC' \ - cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_LINKER=/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-ld . - make zlibstatic - cd /build/nmap - CC='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-gcc -static -fPIC' \ - CXX='/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-g++ -static -static-libstdc++ -fPIC' \ - CXXFLAGS="-I/build/nmap/libz" \ - LD=/opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-ld \ - LDFLAGS="-L/build/openssl -L/build/nmap/libz" \ - ./configure \ - --host=aarch64-none-linux-gnueabi \ - --without-ndiff \ - --without-zenmap \ - --without-nmap-update \ - --without-libssh2 \ - --with-pcap=linux \ - --with-libz=/build/nmap/libz \ - --with-openssl=/build/openssl \ - --with-liblua=included - sed -i -e 's/shared\: /shared\: #/' libpcap/Makefile - sed -i 's|LIBS = |& libz/libz.a |' Makefile - make -j4 - if [ ! -f "/build/nmap/nmap" -o ! -f "/build/nmap/ncat/ncat" -o ! -f "/build/nmap/nping/nping" ];then - echo "[-] Building Nmap armhf failed!" - exit 1 - fi - if [ -f "/build/nmap/nmap" -a -f "/build/nmap/ncat/ncat" -a -f "/build/nmap/nping/nping" ];then - /opt/cross/aarch64-linux-musleabi/bin/aarch64-linux-musleabi-strip nmap ncat/ncat nping/nping - fi -} - -build_aarch64(){ - OUT_DIR_AARCH64=/output/`uname | tr 'A-Z' 'a-z'`/aarch64 - mkdir -p $OUT_DIR_AARCH64 - build_musl_aarch64 - build_openssl_aarch64 - build_nmap_aarch64 - if [ ! -f "/build/nmap/nmap" -o ! -f "/build/nmap/ncat/ncat" -o ! -f "/build/nmap/nping/nping" ];then - echo "[-] Building Nmap aarch64 failed!" - exit 1 - fi - cp /build/nmap/nmap "${OUT_DIR_AARCH64}/nmap-${NMAP_COMMIT}" - cp /build/nmap/ncat/ncat "${OUT_DIR_AARCH64}/ncat-${NMAP_COMMIT}" - cp /build/nmap/nping/nping "${OUT_DIR_AARCH64}/nping-${NMAP_COMMIT}" - echo "[+] Finished building Nmap aarch64" -} - -main() { - if [ ! -d "/output" ];then - echo "[-] /output does not exist, creating it" - mkdir /output - fi - fetch - build_aarch64 -} - -main diff --git a/recipes/nmap/linux_armhf/Dockerfile b/recipes/nmap/linux_armhf/Dockerfile deleted file mode 100644 index 2a3103c..0000000 --- a/recipes/nmap/linux_armhf/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM ubuntu:xenial -RUN apt-get update && \ - apt upgrade -yy && \ - apt install -yy \ - automake \ - cmake \ - build-essential \ - checkinstall \ - libgmp-dev \ - libmpfr-dev \ - libmpc-dev \ - wget \ - git \ - pkg-config \ - python -RUN mkdir /build -ADD . /build -RUN chmod +x /build/build_armhf.sh -CMD /build/build_armhf.sh diff --git a/recipes/nmap/linux_armhf/build_armhf.sh b/recipes/nmap/linux_armhf/build_armhf.sh deleted file mode 100644 index 49c1b78..0000000 --- a/recipes/nmap/linux_armhf/build_armhf.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/bash -#set -e -set -o pipefail -set -x -NMAP_COMMIT= - -fetch(){ - if [ ! -d "/build/musl" ];then - #git clone https://github.com/GregorR/musl-cross.git /build/musl - git clone https://github.com/takeshixx/musl-cross.git /build/musl - fi - if [ ! -d "/build/openssl" ];then - git clone https://github.com/drwetter/openssl-pm-snapshot.git /build/openssl - fi - if [ ! -d "/build/nmap" ];then - git clone https://github.com/nmap/nmap.git /build/nmap - fi - NMAP_COMMIT=$(cd /build/nmap/ && git rev-parse --short HEAD) -} - -build_musl_armhf() { - cd /build/musl - git clean -fdx - echo "ARCH=arm" >> config.sh - echo "GCC_BUILTIN_PREREQS=yes" >> config.sh - echo "TRIPLE=arm-linux-musleabihf" >> config.sh - echo "GCC_BOOTSTRAP_CONFFLAGS='--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16'" >> config.sh - echo "GCC_CONFFLAGS='--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16'" >> config.sh - ./build.sh - echo "[+] Finished building musl-cross armhf" -} - -build_openssl_armhf() { - cd /build/openssl - git clean -fdx - make clean - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static' ./Configure no-shared linux-generic32 - make -j4 - echo "[+] Finished building OpenSSL armhf" -} - -build_nmap_armhf() { - cd /build/nmap - git clean -fdx - make clean - cd /build/nmap/libz - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static -fPIC' \ - CXX='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-g++ -static -static-libstdc++ -fPIC' \ - cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_LINKER=/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-ld . - make zlibstatic - cd /build/nmap - CC='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-gcc -static -fPIC' \ - CXX='/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-g++ -static -static-libstdc++ -fPIC' \ - CXXFLAGS="-I/build/nmap/libz" \ - LD=/opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-ld \ - LDFLAGS="-L/build/openssl -L/build/nmap/libz" \ - ./configure \ - --host=arm-none-linux-gnueabi \ - --without-ndiff \ - --without-zenmap \ - --without-nmap-update \ - --without-libssh2 \ - --with-pcap=linux \ - --with-libz=/build/nmap/libz \ - --with-openssl=/build/openssl \ - --with-liblua=included - sed -i -e 's/shared\: /shared\: #/' libpcap/Makefile - sed -i 's|LIBS = |& libz/libz.a |' Makefile - make -j4 - if [ ! -f "/build/nmap/nmap" -o ! -f "/build/nmap/ncat/ncat" -o ! -f "/build/nmap/nping/nping" ];then - echo "[-] Building Nmap armhf failed!" - exit 1 - fi - if [ -f "/build/nmap/nmap" -a -f "/build/nmap/ncat/ncat" -a -f "/build/nmap/nping/nping" ];then - /opt/cross/arm-linux-musleabihf/bin/arm-linux-musleabihf-strip nmap ncat/ncat nping/nping - fi -} - -build_armhf(){ - OUT_DIR_ARMHF=/output/`uname | tr 'A-Z' 'a-z'`/armhf - mkdir -p $OUT_DIR_ARMHF - build_musl_armhf - build_openssl_armhf - build_nmap_armhf - if [ ! -f "/build/nmap/nmap" -o ! -f "/build/nmap/ncat/ncat" -o ! -f "/build/nmap/nping/nping" ];then - echo "[-] Building Nmap armhf failed!" - exit 1 - fi - cp /build/nmap/nmap "${OUT_DIR_ARMHF}/nmap-${NMAP_COMMIT}" - cp /build/nmap/ncat/ncat "${OUT_DIR_ARMHF}/ncat-${NMAP_COMMIT}" - cp /build/nmap/nping/nping "${OUT_DIR_ARMHF}/nping-${NMAP_COMMIT}" - echo "[+] Finished building Nmap armhf" -} - -main() { - if [ ! -d "/output" ];then - echo "[-] /output does not exist, creating it" - mkdir /output - fi - fetch - build_armhf -} - -main diff --git a/recipes/nmap/linux_x86/Dockerfile b/recipes/nmap/linux_x86/Dockerfile deleted file mode 100644 index 4a1d5cc..0000000 --- a/recipes/nmap/linux_x86/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM ubuntu:xenial -RUN apt-get update && \ - apt upgrade -yy && \ - apt install -yy \ - automake \ - cmake \ - build-essential \ - checkinstall \ - libgmp-dev \ - libmpfr-dev \ - libmpc-dev \ - wget \ - git \ - pkg-config \ - python -RUN mkdir /build -ADD . /build -RUN chmod +x /build/build_x86.sh -CMD /build/build_x86.sh diff --git a/recipes/nmap/linux_x86/build_x86.sh b/recipes/nmap/linux_x86/build_x86.sh deleted file mode 100644 index 86f0acf..0000000 --- a/recipes/nmap/linux_x86/build_x86.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash -#set -e -set -o pipefail -set -x -NMAP_COMMIT= - -fetch(){ - if [ ! -d "/build/musl" ];then - #git clone https://github.com/GregorR/musl-cross.git /build/musl - git clone https://github.com/takeshixx/musl-cross.git /build/musl - fi - if [ ! -d "/build/openssl" ];then - git clone https://github.com/drwetter/openssl-pm-snapshot.git /build/openssl - fi - if [ ! -d "/build/nmap" ];then - git clone https://github.com/nmap/nmap.git /build/nmap - fi - NMAP_COMMIT=$(cd /build/nmap/ && git rev-parse --short HEAD) -} - -build_musl_x86() { - cd /build/musl - git clean -fdx - echo "ARCH=i486" >> config.sh - echo "GCC_BUILTIN_PREREQS=yes" >> config.sh - ./build.sh - echo "[+] Finished building musl-cross x86" -} - -build_openssl_x86() { - cd /build/openssl - git clean -fdx - make clean - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static' ./Configure no-shared -m32 linux-generic32 - make -j4 - echo "[+] Finished building OpenSSL x86" -} - -build_nmap_x86() { - cd /build/nmap - git clean -fdx - make clean - cd /build/nmap/libz - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/i486-linux-musl/bin/i486-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_LINKER=/opt/cross/i486-linux-musl/bin/i486-linux-musl-ld . - make zlibstatic - cd /build/nmap - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/i486-linux-musl/bin/i486-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - CXXFLAGS="-I/build/nmap/libz" \ - LD=/opt/cross/i486-linux-musl/bin/i486-linux-musl-ld \ - LDFLAGS="-L/build/openssl -L/build/nmap/libz" \ - ./configure \ - --without-ndiff \ - --without-zenmap \ - --without-nmap-update \ - --without-libssh2 \ - --with-pcap=linux \ - --with-libz=/build/nmap/libz \ - --with-openssl=/build/openssl - - sed -i -e 's/shared\: /shared\: #/' libpcap/Makefile - sed -i 's|LIBS = |& libz/libz.a |' Makefile - make -j4 - /opt/cross/i486-linux-musl/bin/i486-linux-musl-strip nmap ncat/ncat nping/nping -} - -build_x86(){ - OUT_DIR_x86=/output/`uname | tr 'A-Z' 'a-z'`/x86 - mkdir -p $OUT_DIR_x86 - build_musl_x86 - build_openssl_x86 - build_nmap_x86 - if [ ! -f "/build/nmap/nmap" -o ! -f "/build/nmap/ncat/ncat" -o ! -f "/build/nmap/nping/nping" ];then - echo "[-] Building Nmap x86 failed!" - exit 1 - fi - NMAP_VERSION=$(/build/nmap/nmap --version |grep "Nmap version" | awk '{print $3}') - NCAT_VERSION=$(/build/nmap/ncat/ncat --version 2>&1 |grep "Ncat: Version" | awk '{print $3}') - NPING_VERSION=$(/build/nmap/nping/nping --version |grep "Nping version" | awk '{print $3}') - cp /build/nmap/nmap "${OUT_DIR_x86}/nmap-${NMAP_VERSION}-${NMAP_COMMIT}" - cp /build/nmap/ncat/ncat "${OUT_DIR_x86}/ncat-${NCAT_VERSION}-${NMAP_COMMIT}" - cp /build/nmap/nping/nping "${OUT_DIR_x86}/nping-${NPING_VERSION}-${NMAP_COMMIT}" - echo "[+] Finished building x86" -} - -main() { - if [ ! -d "/output" ];then - echo "[-] /output does not exist, creating it" - mkdir /output - fi - fetch - build_x86 - NMAP_DIR=/output/nmap-data-${NPING_VERSION}-${NMAP_COMMIT} - if [ ! -d "$NMAP_DIR" ];then - echo "[-] ${NMAP_DIR} does not exist, creating it" - mkdir -p "${NMAP_DIR}" - fi - if [ -n "$(ls $NMAP_DIR)" ];then - echo "[+] Data directory is not empty" - exit - fi - cd /build/nmap - make install - cp -r /usr/local/share/nmap/* $NMAP_DIR - echo "[+] Copied data to data dir" -} - -main diff --git a/recipes/nmap/linux_x86_64/Dockerfile b/recipes/nmap/linux_x86_64/Dockerfile deleted file mode 100644 index 848703c..0000000 --- a/recipes/nmap/linux_x86_64/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM ubuntu:xenial -RUN apt-get update && \ - apt upgrade -yy && \ - apt install -yy \ - automake \ - cmake \ - build-essential \ - checkinstall \ - libgmp-dev \ - libmpfr-dev \ - libmpc-dev \ - wget \ - git \ - pkg-config \ - python -RUN mkdir /build -ADD . /build -RUN chmod +x /build/build_x86_64.sh -CMD /build/build_x86_64.sh diff --git a/recipes/nmap/linux_x86_64/build_x86_64.sh b/recipes/nmap/linux_x86_64/build_x86_64.sh deleted file mode 100644 index 0b28b19..0000000 --- a/recipes/nmap/linux_x86_64/build_x86_64.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -#set -e -set -o pipefail -set -x -NMAP_COMMIT= - -fetch(){ - if [ ! -d "/build/musl" ];then - #git clone https://github.com/GregorR/musl-cross.git /build/musl - git clone https://github.com/takeshixx/musl-cross.git /build/musl - fi - if [ ! -d "/build/openssl" ];then - git clone https://github.com/drwetter/openssl-pm-snapshot.git /build/openssl - fi - if [ ! -d "/build/nmap" ];then - git clone https://github.com/nmap/nmap.git /build/nmap - fi - NMAP_COMMIT=$(cd /build/nmap/ && git rev-parse --short HEAD) -} - -build_musl() { - cd /build/musl - git clean -fdx - ./build.sh - echo "[+] Finished building musl-cross x86_64" -} - -build_openssl() { - cd /build/openssl - git clean -fdx - make clean - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static' ./Configure no-shared linux-x86_64 - make -j4 - echo "[+] Finished building OpenSSL x86_64" -} - -build_nmap() { - cd /build/nmap - git clean -fdx - make clean - cd /build/nmap/libz - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_LINKER=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-ld . - make zlibstatic - cd /build/nmap - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static -fPIC' \ - CXX='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -static -static-libstdc++ -fPIC' \ - CXXFLAGS="-I/build/nmap/libz" \ - LD=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-ld \ - LDFLAGS="-L/build/openssl -L/build/nmap/libz" \ - ./configure \ - --without-ndiff \ - --without-zenmap \ - --without-nmap-update \ - --without-libssh2 \ - --with-pcap=linux \ - --with-libz=/build/nmap/libz \ - --with-openssl=/build/openssl - - sed -i -e 's/shared\: /shared\: #/' libpcap/Makefile - sed -i 's|LIBS = |& libz/libz.a |' Makefile - make -j4 - /opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-strip nmap ncat/ncat nping/nping -} - -build_x86_64(){ - OUT_DIR_x86_64=/output/`uname | tr 'A-Z' 'a-z'`/x86_64 - mkdir -p $OUT_DIR_x86_64 - build_musl - build_openssl - build_nmap - if [ ! -f "/build/nmap/nmap" -o ! -f "/build/nmap/ncat/ncat" -o ! -f "/build/nmap/nping/nping" ];then - echo "[-] Building Nmap x86_64 failed!" - exit 1 - fi - NMAP_VERSION=$(/build/nmap/nmap --version |grep "Nmap version" | awk '{print $3}') - NCAT_VERSION=$(/build/nmap/ncat/ncat --version 2>&1 |grep "Ncat: Version" | awk '{print $3}') - NPING_VERSION=$(/build/nmap/nping/nping --version |grep "Nping version" | awk '{print $3}') - cp /build/nmap/nmap "${OUT_DIR_x86_64}/nmap-${NMAP_VERSION}-${NMAP_COMMIT}" - cp /build/nmap/ncat/ncat "${OUT_DIR_x86_64}/ncat-${NCAT_VERSION}-${NMAP_COMMIT}" - cp /build/nmap/nping/nping "${OUT_DIR_x86_64}/nping-${NPING_VERSION}-${NMAP_COMMIT}" - echo "[+] Finished building x86_64" -} - -main() { - if [ ! -d "/output" ];then - echo "[-] /output does not exist, creating it" - mkdir /output - fi - fetch - build_x86_64 - NMAP_DIR=/output/nmap-data-${NPING_VERSION}-${NMAP_COMMIT} - if [ ! -d "$NMAP_DIR" ];then - echo "[-] ${NMAP_DIR} does not exist, creating it" - mkdir -p "${NMAP_DIR}" - fi - if [ -n "$(ls $NMAP_DIR)" ];then - echo "[+] Data directory is not empty" - exit - fi - cd /build/nmap - make install - cp -r /usr/local/share/nmap/* $NMAP_DIR - echo "[+] Copied data to data dir" -} - -main diff --git a/recipes/socat/Dockerfile b/recipes/socat/Dockerfile deleted file mode 100644 index 87dd49c..0000000 --- a/recipes/socat/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM ubuntu:zesty -RUN apt-get update && \ - apt upgrade -yy && \ - apt install -yy \ - automake \ - autoconf \ - yodl \ - build-essential \ - libgmp-dev \ - libmpfr-dev \ - libmpc-dev \ - wget \ - git \ - pkg-config \ - python -RUN mkdir /build -ADD . /build -CMD /build/build.sh \ No newline at end of file diff --git a/recipes/socat/build.sh b/recipes/socat/build.sh deleted file mode 100644 index a0d06cc..0000000 --- a/recipes/socat/build.sh +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/bash -set -e -set -x -set -o pipefail - -fetch(){ - #git clone https://github.com/GregorR/musl-cross.git /build/musl - git clone https://github.com/takeshixx/musl-cross.git /build/musl - git clone https://github.com/drwetter/openssl-pm-snapshot.git /build/openssl - git clone https://git.savannah.gnu.org/git/readline.git /build/readline - git clone https://github.com/mirror/ncurses.git /build/ncurses - git clone http://repo.or.cz/socat.git /build/socat -} - -build_musl() { - cd /build/musl - git clean -fdx - ./build.sh - echo "[+] Finished building musl-cross x86_64" -} - -build_musl_x86() { - cd /build/musl - git clean -fdx - echo "ARCH=i486" >> config.sh - echo "GCC_BUILTIN_PREREQS=yes" >> config.sh - ./build.sh - echo "[+] Finished building musl-cross x86" -} - -build_openssl() { - cd /build/openssl - git clean -fdx - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static' ./Configure no-shared linux-x86_64 - make - echo "[+] Finished building OpenSSL x86_64" -} - -build_openssl_x86() { - cd /build/openssl - git clean -fdx - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static' ./Configure no-shared -m32 linux-generic32 - make - echo "[+] Finished building OpenSSL x86" -} - -build_ncurses() { - cd /build/ncurses - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static' CFLAGS='-fPIC' ./configure \ - --disable-shared \ - --enable-static - echo "[+] Finished building ncurses x86_64" -} - -build_ncurses_x86() { - cd /build/ncurses - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static' CFLAGS='-fPIC' ./configure \ - --disable-shared \ - --enable-static - echo "[+] Finished building ncurses x86" -} - -build_readline() { - cd /build/readline - git clean -fdx - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static' CFLAGS='-fPIC' ./configure \ - --disable-shared \ - --enable-static - make -j4 - echo "[+] Finished building readline x86_64" -} - -build_readline_x86() { - cd /build/readline - git clean -fdx - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static' CFLAGS='-fPIC' ./configure \ - --disable-shared \ - --enable-static - make -j4 - echo "[+] Finished building readline x86" -} - -build_socat() { - cd /build/socat - git clean -fdx - autoconf - CC='/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -static' \ - CFLAGS='-fPIC' \ - CPPFLAGS='-I/build -I/build/openssl/include -DNETDB_INTERNAL=-1' \ - LDFLAGS="-L/build/readline -L/build/ncurses/lib -L/build/openssl" \ - ./configure - make -j4 - /opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-strip socat -} - -build_socat_x86() { - cd /build/socat - git clean -fdx - autoconf - CC='/opt/cross/i486-linux-musl/bin/i486-linux-musl-gcc -static' \ - CFLAGS='-fPIC' \ - CPPFLAGS='-I/build -I/build/openssl/include -DNETDB_INTERNAL=-1' \ - LDFLAGS="-L/build/readline -L/build/ncurses/lib -L/build/openssl" \ - ./configure - make -j4 - /opt/cross/i486-linux-musl/bin/i486-linux-musl-strip socat -} - -main() { - if [ ! -d /output ];then - echo "[-] /output does not exist" - exit - fi - fetch - - build_musl - build_openssl - build_ncurses - build_readline - build_socat - - OUT_DIR=/output/`uname | tr 'A-Z' 'a-z'`/x86_64 - mkdir -p $OUT_DIR - cp /build/socat/socat $OUT_DIR/ - echo "[+] Finished building socat x86_64" - - build_musl_x86 - build_openssl_x86 - build_ncurses_x86 - build_readline_x86 - build_socat_x86 - - OUT_DIR=/output/`uname | tr 'A-Z' 'a-z'`/x86 - mkdir -p $OUT_DIR - cp /build/socat/socat $OUT_DIR/ - echo "[+] Finished building socat x86" -} - -main From a40969a5ba7f853901da80221fa9b2d50c903524 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 15 Jul 2020 22:17:14 +0200 Subject: [PATCH 05/95] Removed .github/README.md --- .github/README.md | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 .github/README.md diff --git a/.github/README.md b/.github/README.md deleted file mode 100644 index c6add17..0000000 --- a/.github/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# static-toolbox - -This repository includes prebuild static binaries and build-recipes for various tools like Nmap and OpenSSH. - -The Linux versions are compiled with the musl-cross toolchain and the openssl-pm-snapshot fork of OpenSSL in order to support a wide range of SSL/TLS features (Warning: some of them are insecure!). - -Compilation is done automatically with GitHub Actions. - -## Tools - -### Nmap - - - - - - - - - -### OpenSSH - - - - - - - - - -### socat - - - - - - - - - -### GDB - - \ No newline at end of file From d33b2d21ff2b1fb9e6872c0160a8d99a82128673 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 15 Jul 2020 22:23:12 +0200 Subject: [PATCH 06/95] Updated README.md --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c6add17..ba14de5 100644 --- a/README.md +++ b/README.md @@ -10,34 +10,34 @@ Compilation is done automatically with GitHub Actions. ### Nmap - + - + - + - + ### OpenSSH - + - + - + - + ### socat - + - + - + - + ### GDB - \ No newline at end of file + \ No newline at end of file From 33ac2a622a357c50594a41bf78931c191807e256 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Tue, 21 Jul 2020 09:39:32 +0200 Subject: [PATCH 07/95] Added tcpdump x86_64 workflow --- .github/workflows/build-tcpdump-x86_64.yml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/build-tcpdump-x86_64.yml diff --git a/.github/workflows/build-tcpdump-x86_64.yml b/.github/workflows/build-tcpdump-x86_64.yml new file mode 100644 index 0000000..58b6d0d --- /dev/null +++ b/.github/workflows/build-tcpdump-x86_64.yml @@ -0,0 +1,39 @@ +name: tcpdump x86_64 +on: + workflow_dispatch +jobs: + build: + name: Build tcpdump x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + + - name: Build tcpdump + run: | + cd + apk update && apk add flex bison wget make + wget https://www.tcpdump.org/release/libpcap-1.9.1.tar.gz + tar xzf libpcap-1.9.1.tar.gz + cd libpcap-1.9.1/ + ./configure --with-pcap=linux + make -j2 + export LIBPCAP_PATH=$(pwd) + cd + wget https://www.tcpdump.org/release/tcpdump-4.9.3.tar.gz + tar xzf tcpdump-4.9.3.tar.gz + cd tcpdump-4.9.3/ + export CFLAGS="-static -I${LIBPCAP_PATH} -L${LIBPCAP_PATH}" + export CPPFLAGS=-static + export LDFLAGS=-static + ./configure + make -j2 + pwd + + - name: List build dir + run: ls -la + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: tcpdump-4.9.3 + path: /github/home/tcpdump-4.9.3/tcpdump From 1c32053ecbf78c256189eb683183f8211665b157 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Tue, 21 Jul 2020 11:58:43 +0200 Subject: [PATCH 08/95] Added strace x86_64 workflow --- .github/workflows/build-strace-x86_64.yml | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/build-strace-x86_64.yml diff --git a/.github/workflows/build-strace-x86_64.yml b/.github/workflows/build-strace-x86_64.yml new file mode 100644 index 0000000..ecf4da5 --- /dev/null +++ b/.github/workflows/build-strace-x86_64.yml @@ -0,0 +1,31 @@ +name: strace x86_64 +on: + workflow_dispatch +jobs: + build: + name: Build strace x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + + - name: Build strace + run: | + apk update && apk add git make gawk autoconf automake coreutils + git clone https://github.com/strace/strace + cd strace + git checkout v5.7 + ./bootstrap + export LDFLAGS='-static -pthread' + ./configure + make CFLAGS="-w" -j4 + + - name: List build dir + run: | + pwd + ls -la + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: strace-5.7 + path: /__w/workflow-test/workflow-test/strace/strace From 98be6d8119e3772a29b0669ff4372976e4693c19 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Tue, 21 Jul 2020 12:04:02 +0200 Subject: [PATCH 09/95] Updated strace x86_64 workflow --- .github/workflows/build-strace-x86_64.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-strace-x86_64.yml b/.github/workflows/build-strace-x86_64.yml index ecf4da5..8ec496e 100644 --- a/.github/workflows/build-strace-x86_64.yml +++ b/.github/workflows/build-strace-x86_64.yml @@ -28,4 +28,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: strace-5.7 - path: /__w/workflow-test/workflow-test/strace/strace + path: /__w/static-toolbox/static-toolbox/strace/strace From 235c902c688d62760c48f5fcd7f7815bec8e2d64 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Fri, 24 Jul 2020 10:05:58 +0200 Subject: [PATCH 10/95] Added additional tcpdump workflows --- .github/workflows/build-tcpdump-aarch64.yml | 31 +++++++++++++++++++++ .github/workflows/build-tcpdump-armhf.yml | 31 +++++++++++++++++++++ .github/workflows/build-tcpdump-x86.yml | 31 +++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 .github/workflows/build-tcpdump-aarch64.yml create mode 100644 .github/workflows/build-tcpdump-armhf.yml create mode 100644 .github/workflows/build-tcpdump-x86.yml diff --git a/.github/workflows/build-tcpdump-aarch64.yml b/.github/workflows/build-tcpdump-aarch64.yml new file mode 100644 index 0000000..5771e6a --- /dev/null +++ b/.github/workflows/build-tcpdump-aarch64.yml @@ -0,0 +1,31 @@ +name: tcpdump AARCH64 +on: + workflow_dispatch +jobs: + build: + name: Build tcpdump AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool file texinfo zip wget + + - name: Checkout + uses: actions/checkout@v2 + + - name: Build tcpdump + id: build_tcpdump + run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh aarch64 + + - name: List build directory + run: ls -la /build + + - name: List build artifacts + run: ls -la /output + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} + path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-tcpdump-armhf.yml b/.github/workflows/build-tcpdump-armhf.yml new file mode 100644 index 0000000..f66d8a2 --- /dev/null +++ b/.github/workflows/build-tcpdump-armhf.yml @@ -0,0 +1,31 @@ +name: tcpdump ARMHF +on: + workflow_dispatch +jobs: + build: + name: Build tcpdump ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:armel-linux-musleabihf + steps: + + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool file texinfo zip wget + + - name: Checkout + uses: actions/checkout@v2 + + - name: Build tcpdump + id: build_tcpdump + run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh armhf + + - name: List build directory + run: ls -la /build + + - name: List build artifacts + run: ls -la /output + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} + path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-tcpdump-x86.yml b/.github/workflows/build-tcpdump-x86.yml new file mode 100644 index 0000000..b071533 --- /dev/null +++ b/.github/workflows/build-tcpdump-x86.yml @@ -0,0 +1,31 @@ +name: tcpdump x86 +on: + workflow_dispatch +jobs: + build: + name: Build tcpdump x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + steps: + + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool file texinfo zip wget + + - name: Checkout + uses: actions/checkout@v2 + + - name: Build tcpdump + id: build_tcpdump + run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh x86 + + - name: List build directory + run: ls -la /build + + - name: List build artifacts + run: ls -la /output + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} + path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} From ef2d5fa0dd084e1532dd233b454be2adac775f62 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Fri, 24 Jul 2020 10:24:19 +0200 Subject: [PATCH 11/95] Updated tcpdump workflows --- .github/workflows/build-tcpdump-x86_64.yml | 40 +++++++++------------ build/targets/build_tcpdump.sh | 41 ++++++++++++++++++++++ 2 files changed, 57 insertions(+), 24 deletions(-) create mode 100755 build/targets/build_tcpdump.sh diff --git a/.github/workflows/build-tcpdump-x86_64.yml b/.github/workflows/build-tcpdump-x86_64.yml index 58b6d0d..dc60964 100644 --- a/.github/workflows/build-tcpdump-x86_64.yml +++ b/.github/workflows/build-tcpdump-x86_64.yml @@ -8,32 +8,24 @@ jobs: container: muslcc/x86_64:x86_64-linux-musl steps: - - name: Build tcpdump - run: | - cd - apk update && apk add flex bison wget make - wget https://www.tcpdump.org/release/libpcap-1.9.1.tar.gz - tar xzf libpcap-1.9.1.tar.gz - cd libpcap-1.9.1/ - ./configure --with-pcap=linux - make -j2 - export LIBPCAP_PATH=$(pwd) - cd - wget https://www.tcpdump.org/release/tcpdump-4.9.3.tar.gz - tar xzf tcpdump-4.9.3.tar.gz - cd tcpdump-4.9.3/ - export CFLAGS="-static -I${LIBPCAP_PATH} -L${LIBPCAP_PATH}" - export CPPFLAGS=-static - export LDFLAGS=-static - ./configure - make -j2 - pwd + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip wget - - name: List build dir - run: ls -la + - name: Checkout + uses: actions/checkout@v2 + + - name: Build tcpdump + id: build_tcpdump + run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh x86_64 + + - name: List build directory + run: ls -la /build + + - name: List build artifacts + run: ls -la /output - name: Upload artifacts uses: actions/upload-artifact@v2 with: - name: tcpdump-4.9.3 - path: /github/home/tcpdump-4.9.3/tcpdump + name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} + path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} diff --git a/build/targets/build_tcpdump.sh b/build/targets/build_tcpdump.sh new file mode 100755 index 0000000..730954f --- /dev/null +++ b/build/targets/build_tcpdump.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -e +set -x +set -o pipefail +if [ "$#" -ne 1 ];then + echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" + echo "Example: ${0} x86_64" + exit 1 +fi +source $GITHUB_WORKSPACE/build/lib.sh +init_lib "$1" + +build_tcpdump() { + fetch "https://github.com/the-tcpdump-group/tcpdump.git" "${BUILD_DIRECTORY}/tcpdump" git + cd "${BUILD_DIRECTORY}/tcpdump" + git clean -fdx + git checkout tcpdump-4.9.3 + export LIBPCAP_PATH="${BUILD_DIRECTORY}/libpcap" + CFLAGS="${GCC_OPTS} -I${LIBPCAP_PATH} -L${LIBPCAP_PATH}" \ + CXXFLAGS="${GXX_OPTS}" \ + CPPFLAGS="-static" \ + LDFLAGS="-static" \ + ./configure \ + --host="$(get_host_triple)" + make -j4 + strip tcpdump +} + +main() { + lib_build_libpcap + build_tcpdump + local version + version=$(get_version "${BUILD_DIRECTORY}/tcpdump/tcpdump --version 2>&1 | head -n1 | awk '{print \$3}'") + cp "${BUILD_DIRECTORY}/tcpdump/tcpdump" "${OUTPUT_DIRECTORY}/tcpdump" + echo "[+] Finished building tcpdump ${CURRENT_ARCH}" + + echo ::set-output name=PACKAGED_NAME::"tcpdump${version}" + echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" +} + +main From d5feb6a32b8ae7c3c39cfacf09e335a010798a7d Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Fri, 24 Jul 2020 11:00:17 +0200 Subject: [PATCH 12/95] Updated lib.sh --- build/lib.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build/lib.sh b/build/lib.sh index e4eaa43..371a0f9 100755 --- a/build/lib.sh +++ b/build/lib.sh @@ -3,6 +3,7 @@ GIT_OPENSSL="https://github.com/drwetter/openssl-pm-snapshot.git" GIT_BINUTILS_GDB="https://github.com/bminor/binutils-gdb.git" GIT_READLINE="https://git.savannah.gnu.org/git/readline.git" GIT_NCURSES="https://github.com/ThomasDickey/ncurses-snapshots.git" +GIT_LIBPCAP="https://github.com/the-tcpdump-group/libpcap.git" BUILD_DIRECTORY="/build" OUTPUT_DIRECTORY="/output" @@ -265,3 +266,19 @@ lib_build_ncurses(){ make -j4 echo "[+] Finished building ncurses ${CURRENT_ARCH}" } + +lib_build_libpcap(){ + fetch "$GIT_LIBPCAP" "${BUILD_DIRECTORY}/libpcap" git + cd "${BUILD_DIRECTORY}/libpcap" || { echo "Cannot cd to ${BUILD_DIRECTORY}/libpcap"; exit 1; } + git clean -fdx + git checkout libpcap-1.9.1 + CFLAGS="${GCC_OPTS}" \ + CXXFLAGS="${GXX_OPTS}" \ + ./configure \ + --host="$(get_host_triple)" \ + --with-pcap=linux \ + --disable-shared \ + --enable-static + make -j4 + echo "[+] Finished building libpcap ${CURRENT_ARCH}" +} \ No newline at end of file From 4c5ed84507e1f84a20596bc987e133758910ee0a Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 29 Jul 2020 17:51:12 +0200 Subject: [PATCH 13/95] Added GDB workflows --- .github/workflows/build-gdb-aarch64.yml | 38 +++++++++++++++++++++++++ .github/workflows/build-gdb-armhf.yml | 38 +++++++++++++++++++++++++ .github/workflows/build-gdb-x86.yml | 30 +++++++++++++++++++ .github/workflows/build-gdb-x86_64.yml | 5 ++++ 4 files changed, 111 insertions(+) create mode 100644 .github/workflows/build-gdb-aarch64.yml create mode 100644 .github/workflows/build-gdb-armhf.yml create mode 100644 .github/workflows/build-gdb-x86.yml diff --git a/.github/workflows/build-gdb-aarch64.yml b/.github/workflows/build-gdb-aarch64.yml new file mode 100644 index 0000000..2fb3bf8 --- /dev/null +++ b/.github/workflows/build-gdb-aarch64.yml @@ -0,0 +1,38 @@ +name: GDB AARCH64 +on: + workflow_dispatch +jobs: + build: + name: Build GDB AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + + - name: Checkout + uses: actions/checkout@v2 + + - name: Build GDB + id: build_gdb + run: $GITHUB_WORKSPACE/build/targets/build_gdb.sh aarch64 + + - name: List build directory + run: ls -la /build + + - name: List build artifacts + run: ls -la /output + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} + path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-gdb-armhf.yml b/.github/workflows/build-gdb-armhf.yml new file mode 100644 index 0000000..0e085fb --- /dev/null +++ b/.github/workflows/build-gdb-armhf.yml @@ -0,0 +1,38 @@ +name: GDB ARMHF +on: + workflow_dispatch +jobs: + build: + name: Build GDB ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:armel-linux-musleabihf + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + + - name: Checkout + uses: actions/checkout@v2 + + - name: Build GDB + id: build_gdb + run: $GITHUB_WORKSPACE/build/targets/build_gdb.sh armhf + + - name: List build directory + run: ls -la /build + + - name: List build artifacts + run: ls -la /output + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} + path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-gdb-x86.yml b/.github/workflows/build-gdb-x86.yml new file mode 100644 index 0000000..0c6c5ea --- /dev/null +++ b/.github/workflows/build-gdb-x86.yml @@ -0,0 +1,30 @@ +name: GDB x86 +on: + workflow_dispatch +jobs: + build: + name: Build GDB x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + steps: + - name: Install dependencies + run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + + - name: Checkout + uses: actions/checkout@v2 + + - name: Build GDB + id: build_gdb + run: $GITHUB_WORKSPACE/build/targets/build_gdb.sh x86 + + - name: List build directory + run: ls -la /build + + - name: List build artifacts + run: ls -la /output + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} + path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-gdb-x86_64.yml b/.github/workflows/build-gdb-x86_64.yml index 0c88a12..8115b0d 100644 --- a/.github/workflows/build-gdb-x86_64.yml +++ b/.github/workflows/build-gdb-x86_64.yml @@ -9,15 +9,20 @@ jobs: steps: - name: Install dependencies run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip + - name: Checkout uses: actions/checkout@v2 + - name: Build GDB id: build_gdb run: $GITHUB_WORKSPACE/build/targets/build_gdb.sh x86_64 + - name: List build directory run: ls -la /build + - name: List build artifacts run: ls -la /output + - name: Upload artifacts uses: actions/upload-artifact@v2 with: From 083fdd6e71103f399eef0025e6605c1b409309a7 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Thu, 30 Jul 2020 09:15:09 +0200 Subject: [PATCH 14/95] Updated build_gdb.sh --- build/targets/build_gdb.sh | 71 ++++++++++++-------------------------- 1 file changed, 22 insertions(+), 49 deletions(-) diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index 059e402..b737856 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -13,78 +13,51 @@ init_lib $1 build_gdb() { fetch "$GIT_BINUTILS_GDB" "${BUILD_DIRECTORY}/binutils-gdb" git cd "${BUILD_DIRECTORY}/binutils-gdb/" || { echo "Cannot cd to ${BUILD_DIRECTORY}/binutils-gdb/"; exit 1; } - git checkout binutils-2_35-branch - #git clean -fdx + git clean -fdx + git checkout gdb-8.3.1-release + + CMD="CFLAGS=\"${GCC_OPTS}\" " + CMD+="CXXFLAGS=\"${GXX_OPTS}\" " + CMD+="LDFLAGS=\"-static -pthread\" " + if [ "$CURRENT_ARCH" != "x86" ] && "$CURRENT_ARCH" != "x86_64" ];then + CMD+="CC_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc\" " + CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++\" " + fi + CMD+="./configure --target=$(get_host_triple) --host=x86_64-unknown-linux-musl " + CMD+="--disable-shared --enable-static" + + GDB_CMD="${CMD} --disable-interprocess-agent" cd "${BUILD_DIRECTORY}/binutils-gdb/bfd" - CC="gcc ${GCC_OPTS}" \ - CXX="g++ ${GXX_OPTS}" \ - ./configure \ - --host="$(get_host_triple)" \ - --disable-shared \ - --enable-static + eval "$CMD" make -j4 cd "${BUILD_DIRECTORY}/binutils-gdb/readline" - CC="gcc ${GCC_OPTS}" \ - CXX="g++ ${GXX_OPTS}" \ - ./configure \ - --host="$(get_host_triple)" \ - --disable-shared \ - --enable-static + eval "$CMD" make -j4 cd "${BUILD_DIRECTORY}/binutils-gdb/opcodes" - CC="gcc ${GCC_OPTS}" \ - CXX="g++ ${GXX_OPTS}" \ - ./configure \ - --host="$(get_host_triple)" \ - --disable-shared \ - --enable-static + eval "$CMD" make -j4 cd "${BUILD_DIRECTORY}/binutils-gdb/libiberty" - CC="gcc ${GCC_OPTS}" \ - CXX="g++ ${GXX_OPTS}" \ - ./configure \ - --host="$(get_host_triple)" \ - --disable-shared \ - --enable-static + eval "$CMD" make -j4 cd "${BUILD_DIRECTORY}/binutils-gdb/libdecnumber" - CC="gcc ${GCC_OPTS}" \ - CXX="g++ ${GXX_OPTS}" \ - ./configure \ - --host="$(get_host_triple)" \ - --disable-shared \ - --enable-static + eval "$CMD" make -j4 cd "${BUILD_DIRECTORY}/binutils-gdb/zlib" - CC="gcc ${GCC_OPTS}" \ - CXX="g++ ${GXX_OPTS}" \ - /bin/bash ./configure \ - --host="$(get_host_triple)" \ - --enable-static + eval "$CMD" make -j4 cd "${BUILD_DIRECTORY}/binutils-gdb/gdb" - CC="gcc ${GCC_OPTS}" \ - CXX="g++ ${GXX_OPTS}" \ - ./configure \ - --enable-static=yes \ - --host="$(get_host_triple)" \ - --disable-interprocess-agent + eval "$GDB_CMD" make -j4 cd "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver" - CC="gcc ${GCC_OPTS}" \ - CXX="g++ ${GXX_OPTS}" \ - ./configure \ - --enable-static=yes \ - --host="$(get_host_triple)" \ - --disable-interprocess-agent + eval "$GDB_CMD" make -j4 strip "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" From cd1f893b5b39e6653d73a3a749b755fb0cde623e Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 9 Sep 2020 11:45:59 +0200 Subject: [PATCH 15/95] Updated README.md --- README.md | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index ba14de5..8c6ec42 100644 --- a/README.md +++ b/README.md @@ -8,36 +8,11 @@ Compilation is done automatically with GitHub Actions. ## Tools -### Nmap +| x86 | x86_64 | ARMHF | AARCH64 | +| --- | ------ | ----- | ------- | +||||| +||||| +|||| +||||| +||||| - - - - - - - - -### OpenSSH - - - - - - - - - -### socat - - - - - - - - - -### GDB - - \ No newline at end of file From 2ac931cf71325688a638b3996a753d856e126d4e Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 9 Sep 2020 11:50:15 +0200 Subject: [PATCH 16/95] Updated README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8c6ec42..9826e39 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ Compilation is done automatically with GitHub Actions. ## Tools -| x86 | x86_64 | ARMHF | AARCH64 | -| --- | ------ | ----- | ------- | -||||| -||||| -|||| -||||| -||||| +|| x86 | x86_64 | ARMHF | AARCH64 | +| - | --- | ------ | ----- | ------- | +|[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)||||| +[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)||||| +|[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|||| +|[GDB](https://github.com/ernw/static-toolbox/actions?query=workflow%3AGDB)||||| +|[tcpdump](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22tcpdump%22)||||| From 92464c069e1317e72e4fab9941bc399ed2ec2b85 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 9 Sep 2020 11:57:24 +0200 Subject: [PATCH 17/95] Minor build script cleanup --- build/lib.sh | 11 +++++++---- build/targets/build_gdb.sh | 4 ++-- build/targets/build_nmap.sh | 8 ++++---- build/targets/build_openssh.sh | 6 +++--- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/build/lib.sh b/build/lib.sh index 371a0f9..ec604e8 100755 --- a/build/lib.sh +++ b/build/lib.sh @@ -157,20 +157,23 @@ get_version(){ } lib_create_tmp_dir(){ - local tmp_dir=$(mktemp -dt -p ${TMP_DIR} tmpdir.XXXXXX) + local tmp_dir + tmp_dir=$(mktemp -dt -p "${TMP_DIR}" tmpdir.XXXXXX) echo "$tmp_dir" } lib_check_lib_arch(){ lib=$1 + local tmp_dir + local output if [ ! -f "$lib" ];then echo "" return fi - local tmp_dir=$(lib_create_tmp_dir) + tmp_dir=$(lib_create_tmp_dir) cp "$lib" "$tmp_dir" bash -c "cd ${tmp_dir}; ar x $(basename ${lib})" - local output=$(find "${tmp_dir}" -name "*.o" -exec file {} \;) + output=$(find "${tmp_dir}" -name "*.o" -exec file {} \;) if echo "$output" | grep -q "Intel 80386";then echo "Arch of ${lib} is x86" >&2 echo "x86" @@ -259,7 +262,7 @@ lib_build_ncurses(){ CMD="CFLAGS=\"${GCC_OPTS}\" " CMD+="CXXFLAGS=\"${GXX_OPTS}\" " CMD+="./configure --host=$(get_host_triple) --disable-shared --enable-static" - if [ "$CURRENT_ARCH"!="x86" -a "$CURRENT_ARCH"!="x86_64" ];then + if [ "$CURRENT_ARCH" != "x86" ] && [ "$CURRENT_ARCH" != "x86_64" ];then CMD+=" --with-build-cc=/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc" fi eval "$CMD" diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index b737856..8c1bc60 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -65,8 +65,8 @@ build_gdb() { main() { build_gdb - if [ ! -f "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" -o \ - ! -f "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" ];then + if [ ! -f "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" ] || \ + [ ! -f "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" ];then echo "[-] Building GDB ${CURRENT_ARCH} failed!" exit 1 fi diff --git a/build/targets/build_nmap.sh b/build/targets/build_nmap.sh index 564528f..20bd7ee 100755 --- a/build/targets/build_nmap.sh +++ b/build/targets/build_nmap.sh @@ -36,9 +36,9 @@ build_nmap() { main() { lib_build_openssl build_nmap - if [ ! -f "${BUILD_DIRECTORY}/nmap/nmap" -o \ - ! -f "${BUILD_DIRECTORY}/nmap/ncat/ncat" -o \ - ! -f "${BUILD_DIRECTORY}/nmap/nping/nping" ];then + if [ ! -f "${BUILD_DIRECTORY}/nmap/nmap" ] || \ + [ ! -f "${BUILD_DIRECTORY}/nmap/ncat/ncat" ] || \ + [ ! -f "${BUILD_DIRECTORY}/nmap/nping/nping" ];then echo "[-] Building Nmap ${CURRENT_ARCH} failed!" exit 1 fi @@ -63,7 +63,7 @@ main() { fi cd "${BUILD_DIRECTORY}/nmap" make install - cp -r /usr/local/share/nmap/* $NMAP_DIR + cp -r /usr/local/share/nmap/* "$NMAP_DIR" echo "[+] Copied data to Nmap data dir" } diff --git a/build/targets/build_openssh.sh b/build/targets/build_openssh.sh index cb5c130..14a2744 100755 --- a/build/targets/build_openssh.sh +++ b/build/targets/build_openssh.sh @@ -33,8 +33,8 @@ main() { lib_build_openssl lib_build_zlib build_openssh - if [ ! -f "${BUILD_DIRECTORY}/openssh-portable/ssh" -o \ - ! -f "${BUILD_DIRECTORY}/openssh-portable/sshd" ];then + if [ ! -f "${BUILD_DIRECTORY}/openssh-portable/ssh" ] || \ + [ ! -f "${BUILD_DIRECTORY}/openssh-portable/sshd" ];then echo "[-] Building OpenSSH ${CURRENT_ARCH} failed!" exit 1 fi @@ -43,7 +43,7 @@ main() { cp "${BUILD_DIRECTORY}/openssh-portable/sshd" "${OUTPUT_DIRECTORY}/sshd${OPENSSH_VERSION}" echo "[+] Finished building OpenSSH ${CURRENT_ARCH}" - OPENSSH_VERSION=$(echo $OPENSSH_VERSION | sed 's/-//') + OPENSSH_VERSION=$(echo "$OPENSSH_VERSION" | sed 's/-//') echo ::set-output name=PACKAGED_NAME::"${OPENSSH_VERSION}" echo ::set-output name=PACKAGED_NAME_PATH::"/output/*" } From 5e9e4969004d51c90253b988fcbfd0631eab97bc Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Fri, 9 Oct 2020 11:26:28 +0200 Subject: [PATCH 18/95] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 9826e39..a81379e 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,11 @@ The Linux versions are compiled with the musl-cross toolchain and the openssl-pm Compilation is done automatically with GitHub Actions. +## Current Limitations + +* Downloading of build artifacts in GitHub Ations currently requires a GitHub account +* Blobs in build artifacts are zipped by the GitHub frontend by default, even zip files themselves! Build artifact zips may contain other zip files. + ## Tools || x86 | x86_64 | ARMHF | AARCH64 | From 78f9fd02ec27ca7ac84e139e0702e6d9cf5c6824 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 12 Oct 2020 18:01:35 +0200 Subject: [PATCH 19/95] Update build_gdb.sh --- build/targets/build_gdb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index 8c1bc60..c9a8b69 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -19,7 +19,7 @@ build_gdb() { CMD="CFLAGS=\"${GCC_OPTS}\" " CMD+="CXXFLAGS=\"${GXX_OPTS}\" " CMD+="LDFLAGS=\"-static -pthread\" " - if [ "$CURRENT_ARCH" != "x86" ] && "$CURRENT_ARCH" != "x86_64" ];then + if [ "$CURRENT_ARCH" != "x86" ] && [ "$CURRENT_ARCH" != "x86_64" ];then CMD+="CC_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc\" " CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++\" " fi From 9451cae95c2721cb9e03a4d4868d5043ce6dff7a Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 12 Oct 2020 18:08:13 +0200 Subject: [PATCH 20/95] Update build_gdb.sh --- build/targets/build_gdb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index c9a8b69..10980c8 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -14,7 +14,7 @@ build_gdb() { fetch "$GIT_BINUTILS_GDB" "${BUILD_DIRECTORY}/binutils-gdb" git cd "${BUILD_DIRECTORY}/binutils-gdb/" || { echo "Cannot cd to ${BUILD_DIRECTORY}/binutils-gdb/"; exit 1; } git clean -fdx - git checkout gdb-8.3.1-release + git checkout gdb-9.2-release CMD="CFLAGS=\"${GCC_OPTS}\" " CMD+="CXXFLAGS=\"${GXX_OPTS}\" " From 440c56b2efeebce9ea0b172719dbe2dc9af860bc Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 12 Oct 2020 18:28:58 +0200 Subject: [PATCH 21/95] Update build_gdb.sh --- build/targets/build_gdb.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index 10980c8..0fd86f6 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -51,6 +51,10 @@ build_gdb() { cd "${BUILD_DIRECTORY}/binutils-gdb/zlib" eval "$CMD" make -j4 + + cd "${BUILD_DIRECTORY}/binutils-gdb/gnulib" + eval "$CMD" + make -j4 cd "${BUILD_DIRECTORY}/binutils-gdb/gdb" eval "$GDB_CMD" From 19ae03413e14ac488976ad77e2a606c02732851a Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 12 Oct 2020 18:36:19 +0200 Subject: [PATCH 22/95] Update build_gdb.sh --- build/targets/build_gdb.sh | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index 0fd86f6..fe24699 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -28,39 +28,7 @@ build_gdb() { GDB_CMD="${CMD} --disable-interprocess-agent" - cd "${BUILD_DIRECTORY}/binutils-gdb/bfd" - eval "$CMD" - make -j4 - - cd "${BUILD_DIRECTORY}/binutils-gdb/readline" - eval "$CMD" - make -j4 - - cd "${BUILD_DIRECTORY}/binutils-gdb/opcodes" - eval "$CMD" - make -j4 - - cd "${BUILD_DIRECTORY}/binutils-gdb/libiberty" - eval "$CMD" - make -j4 - - cd "${BUILD_DIRECTORY}/binutils-gdb/libdecnumber" - eval "$CMD" - make -j4 - - cd "${BUILD_DIRECTORY}/binutils-gdb/zlib" - eval "$CMD" - make -j4 - - cd "${BUILD_DIRECTORY}/binutils-gdb/gnulib" - eval "$CMD" - make -j4 - - cd "${BUILD_DIRECTORY}/binutils-gdb/gdb" - eval "$GDB_CMD" - make -j4 - - cd "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver" + cd "${BUILD_DIRECTORY}/binutils-gdb/" eval "$GDB_CMD" make -j4 From 4284ed35a8ad5c7f5ca1b153047e4a4d3c8b11e5 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 12 Oct 2020 18:41:49 +0200 Subject: [PATCH 23/95] Update build_gdb.sh --- build/targets/build_gdb.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index fe24699..55bf623 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -23,12 +23,14 @@ build_gdb() { CMD+="CC_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc\" " CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++\" " fi - CMD+="./configure --target=$(get_host_triple) --host=x86_64-unknown-linux-musl " + CMD+="${BUILD_DIRECTORY}/binutils-gdb/configure --target=$(get_host_triple) --host=x86_64-unknown-linux-musl " CMD+="--disable-shared --enable-static" GDB_CMD="${CMD} --disable-interprocess-agent" cd "${BUILD_DIRECTORY}/binutils-gdb/" + mkdir build + cd build eval "$GDB_CMD" make -j4 From 5400f0350f318b819434d575df7f962198b1142a Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 12 Oct 2020 18:49:29 +0200 Subject: [PATCH 24/95] Update build_gdb.sh --- build/targets/build_gdb.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index 55bf623..90eeb3b 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -32,6 +32,7 @@ build_gdb() { mkdir build cd build eval "$GDB_CMD" + ls -la make -j4 strip "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" From 9a2da7f51c33ff8dfaf84cb7286dc68878bc8341 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 12 Oct 2020 19:09:44 +0200 Subject: [PATCH 25/95] Update build_gdb.sh --- build/targets/build_gdb.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index 90eeb3b..f26e9b3 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -33,6 +33,22 @@ build_gdb() { cd build eval "$GDB_CMD" ls -la + + cd "${BUILD_DIRECTORY}/binutils-gdb/" + MAKE_PROG="${MAKE-make}" + MAKE="${MAKE_PROG} AR=true LINK=true" + export MAKE + ${MAKE} $* all-libiberty + ${MAKE} $* all-intl + ${MAKE} $* all-bfd + cd binutils + MAKE="${MAKE_PROG}" + export MAKE + ${MAKE} $* ar_DEPENDENCIES= ar_LDADD='../bfd/*.o ../libiberty/*.o `if test -f ../intl/gettext.o; then echo '../intl/*.o'; fi`' ar + ls -la + cp ar /usr/bin + + cd "${BUILD_DIRECTORY}/binutils-gdb/build" make -j4 strip "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" From e268031c5ece8e75fc7269d29bf50b8203e3a64b Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 4 Nov 2020 12:38:46 +0100 Subject: [PATCH 26/95] Added new workflows --- .github/workflows/build-gdb-aarch64.yml | 38 ----- .github/workflows/build-gdb-armhf.yml | 38 ----- .github/workflows/build-gdb-x86.yml | 30 ---- .github/workflows/build-gdb-x86_64.yml | 30 ---- .github/workflows/build-gdb.yml | 149 ++++++++++++++++++++ .github/workflows/build-nmap-aarch64.yml | 35 ----- .github/workflows/build-nmap-armhf.yml | 35 ----- .github/workflows/build-nmap-x86.yml | 35 ----- .github/workflows/build-nmap-x86_64.yml | 34 ----- .github/workflows/build-nmap.yml | 124 ++++++++++++++++ .github/workflows/build-openssh-aarch64.yml | 25 ---- .github/workflows/build-openssh-armhf.yml | 25 ---- .github/workflows/build-openssh-x86.yml | 25 ---- .github/workflows/build-openssh-x86_64.yml | 25 ---- .github/workflows/build-openssh.yml | 87 ++++++++++++ .github/workflows/build-socat-aarch64.yml | 34 ----- .github/workflows/build-socat-armhf.yml | 34 ----- .github/workflows/build-socat-x86.yml | 27 ---- .github/workflows/build-socat-x86_64.yml | 27 ---- .github/workflows/build-socat.yml | 115 +++++++++++++++ .github/workflows/build-strace-x86_64.yml | 31 ---- .github/workflows/build-tcpdump-aarch64.yml | 31 ---- .github/workflows/build-tcpdump-armhf.yml | 31 ---- .github/workflows/build-tcpdump-x86.yml | 31 ---- .github/workflows/build-tcpdump-x86_64.yml | 31 ---- .github/workflows/build-tcpdump.yml | 87 ++++++++++++ 26 files changed, 562 insertions(+), 652 deletions(-) delete mode 100644 .github/workflows/build-gdb-aarch64.yml delete mode 100644 .github/workflows/build-gdb-armhf.yml delete mode 100644 .github/workflows/build-gdb-x86.yml delete mode 100644 .github/workflows/build-gdb-x86_64.yml create mode 100644 .github/workflows/build-gdb.yml delete mode 100644 .github/workflows/build-nmap-aarch64.yml delete mode 100644 .github/workflows/build-nmap-armhf.yml delete mode 100644 .github/workflows/build-nmap-x86.yml delete mode 100644 .github/workflows/build-nmap-x86_64.yml create mode 100644 .github/workflows/build-nmap.yml delete mode 100644 .github/workflows/build-openssh-aarch64.yml delete mode 100644 .github/workflows/build-openssh-armhf.yml delete mode 100644 .github/workflows/build-openssh-x86.yml delete mode 100644 .github/workflows/build-openssh-x86_64.yml create mode 100644 .github/workflows/build-openssh.yml delete mode 100644 .github/workflows/build-socat-aarch64.yml delete mode 100644 .github/workflows/build-socat-armhf.yml delete mode 100644 .github/workflows/build-socat-x86.yml delete mode 100644 .github/workflows/build-socat-x86_64.yml create mode 100644 .github/workflows/build-socat.yml delete mode 100644 .github/workflows/build-strace-x86_64.yml delete mode 100644 .github/workflows/build-tcpdump-aarch64.yml delete mode 100644 .github/workflows/build-tcpdump-armhf.yml delete mode 100644 .github/workflows/build-tcpdump-x86.yml delete mode 100644 .github/workflows/build-tcpdump-x86_64.yml create mode 100644 .github/workflows/build-tcpdump.yml diff --git a/.github/workflows/build-gdb-aarch64.yml b/.github/workflows/build-gdb-aarch64.yml deleted file mode 100644 index 2fb3bf8..0000000 --- a/.github/workflows/build-gdb-aarch64.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: GDB AARCH64 -on: - workflow_dispatch -jobs: - build: - name: Build GDB AARCH64 - runs-on: ubuntu-latest - container: muslcc/x86_64:aarch64-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - - name: Install build compiler - run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl - TEMP: /tmp - USER: 0 - - - name: Checkout - uses: actions/checkout@v2 - - - name: Build GDB - id: build_gdb - run: $GITHUB_WORKSPACE/build/targets/build_gdb.sh aarch64 - - - name: List build directory - run: ls -la /build - - - name: List build artifacts - run: ls -la /output - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} - path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-gdb-armhf.yml b/.github/workflows/build-gdb-armhf.yml deleted file mode 100644 index 0e085fb..0000000 --- a/.github/workflows/build-gdb-armhf.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: GDB ARMHF -on: - workflow_dispatch -jobs: - build: - name: Build GDB ARMHF - runs-on: ubuntu-latest - container: muslcc/x86_64:armel-linux-musleabihf - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - - name: Install build compiler - run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl - TEMP: /tmp - USER: 0 - - - name: Checkout - uses: actions/checkout@v2 - - - name: Build GDB - id: build_gdb - run: $GITHUB_WORKSPACE/build/targets/build_gdb.sh armhf - - - name: List build directory - run: ls -la /build - - - name: List build artifacts - run: ls -la /output - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} - path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-gdb-x86.yml b/.github/workflows/build-gdb-x86.yml deleted file mode 100644 index 0c6c5ea..0000000 --- a/.github/workflows/build-gdb-x86.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: GDB x86 -on: - workflow_dispatch -jobs: - build: - name: Build GDB x86 - runs-on: ubuntu-latest - container: muslcc/x86_64:i686-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - - name: Checkout - uses: actions/checkout@v2 - - - name: Build GDB - id: build_gdb - run: $GITHUB_WORKSPACE/build/targets/build_gdb.sh x86 - - - name: List build directory - run: ls -la /build - - - name: List build artifacts - run: ls -la /output - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} - path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-gdb-x86_64.yml b/.github/workflows/build-gdb-x86_64.yml deleted file mode 100644 index 8115b0d..0000000 --- a/.github/workflows/build-gdb-x86_64.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: GDB x86_64 -on: - workflow_dispatch -jobs: - build: - name: Build GDB x86_64 - runs-on: ubuntu-latest - container: muslcc/x86_64:x86_64-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - - name: Checkout - uses: actions/checkout@v2 - - - name: Build GDB - id: build_gdb - run: $GITHUB_WORKSPACE/build/targets/build_gdb.sh x86_64 - - - name: List build directory - run: ls -la /build - - - name: List build artifacts - run: ls -la /output - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} - path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml new file mode 100644 index 0000000..6074e1b --- /dev/null +++ b/.github/workflows/build-gdb.yml @@ -0,0 +1,149 @@ +name: GDB & gdbserver +on: + workflow_dispatch +jobs: + + build-x86: + name: Build GDB & gdbserver x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install build compiler + run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + + - name: Install dependencies workaround + run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: i686-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + + - name: Build GDB + id: build_gdb + run: | + export PATH="$PATH:/i686-linux-musl-cross/bin" + $GITHUB_WORKSPACE/build/targets/build_gdb.sh x86 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} + path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} + + build-x86_64: + name: Build GDB & gdbserver x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build GDB + id: build_gdb + run: | + $GITHUB_WORKSPACE/build/targets/build_gdb.sh x86_64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} + path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} + + + build-armhf: + name: Build GDB & gdbserver ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:arm-linux-musleabihf + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install build compiler + run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + + - name: Install dependencies workaround + run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: arm-linux-musleabihf + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + + - name: Build gdb + id: build_gdb + run: | + export PATH="$PATH:/arm-linux-musleabihf-cross/bin" + $GITHUB_WORKSPACE/build/targets/build_gdb.sh armhf + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} + path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} + + + build-aarch64: + name: Build GDB & gdbserver AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install build compiler + run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + + - name: Install dependencies workaround + run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: aarch64-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + + - name: Patch headers + run: | + patch /aarch64-linux-musl-cross/aarch64-linux-musl/include/asm/sigcontext.h < $GITHUB_WORKSPACE/patches/gdb/gdb-aarch64-header-sigcontext-fix.patch + + - name: Build GDB + id: build_gdb + run: | + export PATH="$PATH:/aarch64-linux-musl-cross/bin" + $GITHUB_WORKSPACE/build/targets/build_gdb.sh aarch64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} + path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} \ No newline at end of file diff --git a/.github/workflows/build-nmap-aarch64.yml b/.github/workflows/build-nmap-aarch64.yml deleted file mode 100644 index 17be34a..0000000 --- a/.github/workflows/build-nmap-aarch64.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Nmap AARCH64 -on: - workflow_dispatch -jobs: - build: - name: Build Nmap AARCH64 - runs-on: ubuntu-latest - container: muslcc/x86_64:aarch64-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Checkout - uses: actions/checkout@v2 - - name: Build Nmap - run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh aarch64 - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Package Nmap - id: package_nmap - run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output aarch64 - - name: List packaged artifacts - run: ls -la /packaged - - name: Upload tarball - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} - path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} - - name: Upload zip - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} - path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} - diff --git a/.github/workflows/build-nmap-armhf.yml b/.github/workflows/build-nmap-armhf.yml deleted file mode 100644 index 1c16942..0000000 --- a/.github/workflows/build-nmap-armhf.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Nmap ARMHF -on: - workflow_dispatch -jobs: - build: - name: Build Nmap ARMHF - runs-on: ubuntu-latest - container: muslcc/x86_64:armel-linux-musleabihf - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Checkout - uses: actions/checkout@v2 - - name: Build Nmap - run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh armhf - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Package Nmap - id: package_nmap - run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output armhf - - name: List packaged artifacts - run: ls -la /packaged - - name: Upload tarball - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} - path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} - - name: Upload zip - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} - path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} - diff --git a/.github/workflows/build-nmap-x86.yml b/.github/workflows/build-nmap-x86.yml deleted file mode 100644 index 9b734e4..0000000 --- a/.github/workflows/build-nmap-x86.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Nmap x86 -on: - workflow_dispatch -jobs: - build: - name: Build Nmap x86 - runs-on: ubuntu-latest - container: muslcc/x86_64:i686-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Checkout - uses: actions/checkout@v2 - - name: Build Nmap - run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh x86 - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Package Nmap - id: package_nmap - run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output x86 - - name: List packaged artifacts - run: ls -la /packaged - - name: Upload tarball - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} - path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} - - name: Upload zip - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} - path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} - diff --git a/.github/workflows/build-nmap-x86_64.yml b/.github/workflows/build-nmap-x86_64.yml deleted file mode 100644 index 06e42f4..0000000 --- a/.github/workflows/build-nmap-x86_64.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Nmap x86_64 -on: - workflow_dispatch -jobs: - build: - name: Build Nmap x86_64 - runs-on: ubuntu-latest - container: muslcc/x86_64:x86_64-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Checkout - uses: actions/checkout@v2 - - name: Build Nmap - run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh x86_64 - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Package Nmap - id: package_nmap - run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output x86_64 - - name: List packaged artifacts - run: ls -la /packaged - - name: Upload tarball - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} - path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} - - name: Upload zip - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} - path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml new file mode 100644 index 0000000..d2d92c7 --- /dev/null +++ b/.github/workflows/build-nmap.yml @@ -0,0 +1,124 @@ +name: Nmap +on: + workflow_dispatch +jobs: + + build-x86: + name: Build Nmap x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build Nmap + run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh x86 + + - name: Package Nmap + id: package_nmap + run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output x86 + + - name: Upload tarball + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} + path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} + + - name: Upload zip + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} + path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} + + build-x86_64: + name: Build Nmap x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build Nmap + run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh x86_64 + + - name: Package Nmap + id: package_nmap + run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output x86_64 + + - name: Upload tarball + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} + path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} + + - name: Upload zip + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} + path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} + + build-armhf: + name: Build Nmap ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:arm-linux-musleabihf + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build Nmap + run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh armhf + + - name: Package Nmap + id: package_nmap + run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output armhf + + - name: Upload tarball + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} + path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} + + - name: Upload zip + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} + path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} + + build-aarch64: + name: Build Nmap AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build Nmap + run: $GITHUB_WORKSPACE/build/targets/build_nmap.sh aarch64 + + - name: Package Nmap + id: package_nmap + run: $GITHUB_WORKSPACE/package/targets/nmap/package.sh /output aarch64 + + - name: Upload tarball + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL }} + path: ${{ steps.package_nmap.outputs.PACKAGED_TARBALL_PATH }} + + - name: Upload zip + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} + path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} \ No newline at end of file diff --git a/.github/workflows/build-openssh-aarch64.yml b/.github/workflows/build-openssh-aarch64.yml deleted file mode 100644 index e13f539..0000000 --- a/.github/workflows/build-openssh-aarch64.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: OpenSSH AARCH64 -on: - workflow_dispatch -jobs: - build: - name: Build OpenSSH AARCH64 - runs-on: ubuntu-latest - container: muslcc/x86_64:aarch64-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Checkout - uses: actions/checkout@v2 - - name: Build OpenSSH - id: build_openssh - run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh aarch64 - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} - path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-openssh-armhf.yml b/.github/workflows/build-openssh-armhf.yml deleted file mode 100644 index 79af80e..0000000 --- a/.github/workflows/build-openssh-armhf.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: OpenSSH ARMHF -on: - workflow_dispatch -jobs: - build: - name: Build OpenSSH ARMHF - runs-on: ubuntu-latest - container: muslcc/x86_64:armel-linux-musleabihf - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Checkout - uses: actions/checkout@v2 - - name: Build OpenSSH - id: build_openssh - run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh armhf - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} - path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-openssh-x86.yml b/.github/workflows/build-openssh-x86.yml deleted file mode 100644 index 3fbd630..0000000 --- a/.github/workflows/build-openssh-x86.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: OpenSSH x86 -on: - workflow_dispatch -jobs: - build: - name: Build OpenSSH x86 - runs-on: ubuntu-latest - container: muslcc/x86_64:i686-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Checkout - uses: actions/checkout@v2 - - name: Build OpenSSH - id: build_openssh - run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh x86 - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} - path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-openssh-x86_64.yml b/.github/workflows/build-openssh-x86_64.yml deleted file mode 100644 index 45522c3..0000000 --- a/.github/workflows/build-openssh-x86_64.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: OpenSSH x86_64 -on: - workflow_dispatch -jobs: - build: - name: Build OpenSSH x86_64 - runs-on: ubuntu-latest - container: muslcc/x86_64:x86_64-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Checkout - uses: actions/checkout@v2 - - name: Build OpenSSH - id: build_openssh - run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh x86_64 - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} - path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-openssh.yml b/.github/workflows/build-openssh.yml new file mode 100644 index 0000000..45403dd --- /dev/null +++ b/.github/workflows/build-openssh.yml @@ -0,0 +1,87 @@ +name: OpenSSH +on: + workflow_dispatch +jobs: + build-x86: + name: Build OpenSSH x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build OpenSSH + id: build_openssh + run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh x86 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} + path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} + + build-x86_64: + name: Build OpenSSH x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build OpenSSH + id: build_openssh + run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh x86_64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} + path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} + + build-armhf: + name: Build OpenSSH ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:arm-linux-musleabihf + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build OpenSSH + id: build_openssh + run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh armhf + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} + path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} + + build-aarch64: + name: Build OpenSSH AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build OpenSSH + id: build_openssh + run: $GITHUB_WORKSPACE/build/targets/build_openssh.sh aarch64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} + path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} \ No newline at end of file diff --git a/.github/workflows/build-socat-aarch64.yml b/.github/workflows/build-socat-aarch64.yml deleted file mode 100644 index 604c90a..0000000 --- a/.github/workflows/build-socat-aarch64.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: socat AARCH64 -on: - workflow_dispatch -jobs: - build: - name: Build socat AARCH64 - runs-on: ubuntu-latest - container: muslcc/x86_64:aarch64-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Install testing dependencies - run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl - - name: Install build compiler - run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl - TEMP: /tmp - USER: 0 - - name: Checkout - uses: actions/checkout@v2 - - name: Build socat - id: build_socat - run: $GITHUB_WORKSPACE/build/targets/build_socat.sh aarch64 - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} - path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-socat-armhf.yml b/.github/workflows/build-socat-armhf.yml deleted file mode 100644 index f83148d..0000000 --- a/.github/workflows/build-socat-armhf.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: socat ARMHF -on: - workflow_dispatch -jobs: - build: - name: Build socat ARMHF - runs-on: ubuntu-latest - container: muslcc/x86_64:armel-linux-musleabihf - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Install testing dependencies - run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl - - name: Install build compiler - run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl - TEMP: /tmp - USER: 0 - - name: Checkout - uses: actions/checkout@v2 - - name: Build socat - id: build_socat - run: $GITHUB_WORKSPACE/build/targets/build_socat.sh armhf - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} - path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-socat-x86.yml b/.github/workflows/build-socat-x86.yml deleted file mode 100644 index 61f54e8..0000000 --- a/.github/workflows/build-socat-x86.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: socat x86 -on: - workflow_dispatch -jobs: - build: - name: Build socat x86 - runs-on: ubuntu-latest - container: muslcc/x86_64:i686-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Install testing dependencies - run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl - - name: Checkout - uses: actions/checkout@v2 - - name: Build socat - id: build_socat - run: $GITHUB_WORKSPACE/build/targets/build_socat.sh x86 - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} - path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-socat-x86_64.yml b/.github/workflows/build-socat-x86_64.yml deleted file mode 100644 index 3692a24..0000000 --- a/.github/workflows/build-socat-x86_64.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: socat x86_64 -on: - workflow_dispatch -jobs: - build: - name: Build socat x86_64 - runs-on: ubuntu-latest - container: muslcc/x86_64:x86_64-linux-musl - steps: - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip - - name: Install testing dependencies - run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl - - name: Checkout - uses: actions/checkout@v2 - - name: Build socat - id: build_socat - run: $GITHUB_WORKSPACE/build/targets/build_socat.sh x86_64 - - name: List build directory - run: ls -la /build - - name: List build artifacts - run: ls -la /output - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} - path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml new file mode 100644 index 0000000..87a6740 --- /dev/null +++ b/.github/workflows/build-socat.yml @@ -0,0 +1,115 @@ +name: socat +on: + workflow_dispatch +jobs: + build-x86: + name: Build socat x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Build socat + id: build_socat + run: $GITHUB_WORKSPACE/build/targets/build_socat.sh x86 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} + + build-x86_64: + name: Build socat x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Build socat + id: build_socat + run: $GITHUB_WORKSPACE/build/targets/build_socat.sh x86_64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} + + build-armhf: + name: Build socat ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:arm-linux-musleabihf + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + + - name: Build socat + id: build_socat + run: $GITHUB_WORKSPACE/build/targets/build_socat.sh armhf + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} + + build-aarch64: + name: Build socat AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + TEMP: /tmp + USER: 0 + + - name: Build socat + id: build_socat + run: $GITHUB_WORKSPACE/build/targets/build_socat.sh aarch64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} \ No newline at end of file diff --git a/.github/workflows/build-strace-x86_64.yml b/.github/workflows/build-strace-x86_64.yml deleted file mode 100644 index 8ec496e..0000000 --- a/.github/workflows/build-strace-x86_64.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: strace x86_64 -on: - workflow_dispatch -jobs: - build: - name: Build strace x86_64 - runs-on: ubuntu-latest - container: muslcc/x86_64:x86_64-linux-musl - steps: - - - name: Build strace - run: | - apk update && apk add git make gawk autoconf automake coreutils - git clone https://github.com/strace/strace - cd strace - git checkout v5.7 - ./bootstrap - export LDFLAGS='-static -pthread' - ./configure - make CFLAGS="-w" -j4 - - - name: List build dir - run: | - pwd - ls -la - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: strace-5.7 - path: /__w/static-toolbox/static-toolbox/strace/strace diff --git a/.github/workflows/build-tcpdump-aarch64.yml b/.github/workflows/build-tcpdump-aarch64.yml deleted file mode 100644 index 5771e6a..0000000 --- a/.github/workflows/build-tcpdump-aarch64.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: tcpdump AARCH64 -on: - workflow_dispatch -jobs: - build: - name: Build tcpdump AARCH64 - runs-on: ubuntu-latest - container: muslcc/x86_64:aarch64-linux-musl - steps: - - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool file texinfo zip wget - - - name: Checkout - uses: actions/checkout@v2 - - - name: Build tcpdump - id: build_tcpdump - run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh aarch64 - - - name: List build directory - run: ls -la /build - - - name: List build artifacts - run: ls -la /output - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} - path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-tcpdump-armhf.yml b/.github/workflows/build-tcpdump-armhf.yml deleted file mode 100644 index f66d8a2..0000000 --- a/.github/workflows/build-tcpdump-armhf.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: tcpdump ARMHF -on: - workflow_dispatch -jobs: - build: - name: Build tcpdump ARMHF - runs-on: ubuntu-latest - container: muslcc/x86_64:armel-linux-musleabihf - steps: - - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool file texinfo zip wget - - - name: Checkout - uses: actions/checkout@v2 - - - name: Build tcpdump - id: build_tcpdump - run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh armhf - - - name: List build directory - run: ls -la /build - - - name: List build artifacts - run: ls -la /output - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} - path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-tcpdump-x86.yml b/.github/workflows/build-tcpdump-x86.yml deleted file mode 100644 index b071533..0000000 --- a/.github/workflows/build-tcpdump-x86.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: tcpdump x86 -on: - workflow_dispatch -jobs: - build: - name: Build tcpdump x86 - runs-on: ubuntu-latest - container: muslcc/x86_64:i686-linux-musl - steps: - - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool file texinfo zip wget - - - name: Checkout - uses: actions/checkout@v2 - - - name: Build tcpdump - id: build_tcpdump - run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh x86 - - - name: List build directory - run: ls -la /build - - - name: List build artifacts - run: ls -la /output - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} - path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-tcpdump-x86_64.yml b/.github/workflows/build-tcpdump-x86_64.yml deleted file mode 100644 index dc60964..0000000 --- a/.github/workflows/build-tcpdump-x86_64.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: tcpdump x86_64 -on: - workflow_dispatch -jobs: - build: - name: Build tcpdump x86_64 - runs-on: ubuntu-latest - container: muslcc/x86_64:x86_64-linux-musl - steps: - - - name: Install dependencies - run: apk update && apk add bash git perl make cmake flex bison automake autoconf libtool qemu-arm qemu-aarch64 file texinfo zip wget - - - name: Checkout - uses: actions/checkout@v2 - - - name: Build tcpdump - id: build_tcpdump - run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh x86_64 - - - name: List build directory - run: ls -la /build - - - name: List build artifacts - run: ls -la /output - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} - path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} diff --git a/.github/workflows/build-tcpdump.yml b/.github/workflows/build-tcpdump.yml new file mode 100644 index 0000000..1990ee9 --- /dev/null +++ b/.github/workflows/build-tcpdump.yml @@ -0,0 +1,87 @@ +name: tcpdump +on: + workflow_dispatch +jobs: + build-x86: + name: Build tcpdump x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build tcpdump + id: build_tcpdump + run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh x86 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} + path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} + + build-x86_64: + name: Build tcpdump x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build tcpdump + id: build_tcpdump + run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh x86_64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} + path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} + + build-armhf: + name: Build tcpdump ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:arm-linux-musleabihf + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build tcpdump + id: build_tcpdump + run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh armhf + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} + path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} + + build: + name: Build tcpdump AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Build tcpdump + id: build_tcpdump + run: $GITHUB_WORKSPACE/build/targets/build_tcpdump.sh aarch64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} + path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} From 4c96c26d7d46dbd476bed79eaf5e96da040d1c40 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 4 Nov 2020 12:40:44 +0100 Subject: [PATCH 27/95] Updated README.md --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9826e39..80eb16d 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,9 @@ Compilation is done automatically with GitHub Actions. ## Tools -|| x86 | x86_64 | ARMHF | AARCH64 | -| - | --- | ------ | ----- | ------- | -|[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)||||| -[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)||||| -|[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|||| -|[GDB](https://github.com/ernw/static-toolbox/actions?query=workflow%3AGDB)||||| -|[tcpdump](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22tcpdump%22)||||| +|[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| +|[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| +|[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|| +|[GDB](https://github.com/ernw/static-toolbox/actions?query=workflow%3AGDB)|| +|[tcpdump](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| From 4a9365f57a539e7e11f5b9a535a7caa98c2ddc29 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 4 Nov 2020 12:41:52 +0100 Subject: [PATCH 28/95] Updated building framework --- build/install_deps_alpine.sh | 28 +++++++++ build/lib.sh | 17 +++--- build/targets/build_gdb.sh | 50 +++++----------- build/targets/build_nmap.sh | 8 +-- build/targets/build_openssh.sh | 6 +- build/targets/build_strace.sh | 43 ++++++++++++++ build/targets/build_tcpreplay.sh | 57 +++++++++++++++++++ .../gdb-aarch64-header-sigcontext-fix.patch | 18 ++++++ 8 files changed, 175 insertions(+), 52 deletions(-) create mode 100755 build/install_deps_alpine.sh create mode 100755 build/targets/build_strace.sh create mode 100755 build/targets/build_tcpreplay.sh create mode 100644 patches/gdb/gdb-aarch64-header-sigcontext-fix.patch diff --git a/build/install_deps_alpine.sh b/build/install_deps_alpine.sh new file mode 100755 index 0000000..f76b2ec --- /dev/null +++ b/build/install_deps_alpine.sh @@ -0,0 +1,28 @@ +#!/bin/sh +apk update +apk add \ + bash \ + git \ + perl \ + make \ + cmake \ + flex \ + bison \ + automake \ + autoconf \ + libtool \ + qemu-arm \ + qemu-aarch64 \ + file \ + texinfo \ + zip \ + wget \ + coreutils \ + gawk \ + gmp-dev \ + libunistring-dev \ + libffi-dev \ + lttng-ust-dev \ + curl \ + rsync \ + util-linux \ No newline at end of file diff --git a/build/lib.sh b/build/lib.sh index ec604e8..8107faa 100755 --- a/build/lib.sh +++ b/build/lib.sh @@ -40,13 +40,13 @@ set_http_proxy(){ get_host_triple(){ local host if [ "$CURRENT_ARCH" == "x86" ];then - host="i486-linux-musl" + host="i686-linux-musl" elif [ "$CURRENT_ARCH" == "x86_64" ];then - host="x86_64-unknown-linux-musl" + host="x86_64-linux-musl" elif [ "$CURRENT_ARCH" == "armhf" ];then host="arm-linux-musleabihf" elif [ "$CURRENT_ARCH" == "aarch64" ];then - host="aarch64-linux-musleabi" + host="aarch64-linux-musl" fi echo $host } @@ -157,23 +157,20 @@ get_version(){ } lib_create_tmp_dir(){ - local tmp_dir - tmp_dir=$(mktemp -dt -p "${TMP_DIR}" tmpdir.XXXXXX) + local tmp_dir=$(mktemp -dt -p ${TMP_DIR} tmpdir.XXXXXX) echo "$tmp_dir" } lib_check_lib_arch(){ lib=$1 - local tmp_dir - local output if [ ! -f "$lib" ];then echo "" return fi - tmp_dir=$(lib_create_tmp_dir) + local tmp_dir=$(lib_create_tmp_dir) cp "$lib" "$tmp_dir" bash -c "cd ${tmp_dir}; ar x $(basename ${lib})" - output=$(find "${tmp_dir}" -name "*.o" -exec file {} \;) + local output=$(find "${tmp_dir}" -name "*.o" -exec file {} \;) if echo "$output" | grep -q "Intel 80386";then echo "Arch of ${lib} is x86" >&2 echo "x86" @@ -262,7 +259,7 @@ lib_build_ncurses(){ CMD="CFLAGS=\"${GCC_OPTS}\" " CMD+="CXXFLAGS=\"${GXX_OPTS}\" " CMD+="./configure --host=$(get_host_triple) --disable-shared --enable-static" - if [ "$CURRENT_ARCH" != "x86" ] && [ "$CURRENT_ARCH" != "x86_64" ];then + if [ "$CURRENT_ARCH"!="x86" -a "$CURRENT_ARCH"!="x86_64" ];then CMD+=" --with-build-cc=/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc" fi eval "$CMD" diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index f26e9b3..47d47fa 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -14,57 +14,37 @@ build_gdb() { fetch "$GIT_BINUTILS_GDB" "${BUILD_DIRECTORY}/binutils-gdb" git cd "${BUILD_DIRECTORY}/binutils-gdb/" || { echo "Cannot cd to ${BUILD_DIRECTORY}/binutils-gdb/"; exit 1; } git clean -fdx - git checkout gdb-9.2-release + git checkout gdb-10.1-release CMD="CFLAGS=\"${GCC_OPTS}\" " CMD+="CXXFLAGS=\"${GXX_OPTS}\" " - CMD+="LDFLAGS=\"-static -pthread\" " - if [ "$CURRENT_ARCH" != "x86" ] && [ "$CURRENT_ARCH" != "x86_64" ];then + CMD+="LDFLAGS=\"-static\" " + if [ "$CURRENT_ARCH" != "x86_64" ];then CMD+="CC_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc\" " CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++\" " fi - CMD+="${BUILD_DIRECTORY}/binutils-gdb/configure --target=$(get_host_triple) --host=x86_64-unknown-linux-musl " - CMD+="--disable-shared --enable-static" + CMD+="${BUILD_DIRECTORY}/binutils-gdb/configure --build=x86_64-linux-musl --host=$(get_host_triple) " + CMD+="--disable-shared --enable-static --enable-gdbserver --disable-nls" - GDB_CMD="${CMD} --disable-interprocess-agent" - - cd "${BUILD_DIRECTORY}/binutils-gdb/" - mkdir build - cd build - eval "$GDB_CMD" - ls -la - - cd "${BUILD_DIRECTORY}/binutils-gdb/" - MAKE_PROG="${MAKE-make}" - MAKE="${MAKE_PROG} AR=true LINK=true" - export MAKE - ${MAKE} $* all-libiberty - ${MAKE} $* all-intl - ${MAKE} $* all-bfd - cd binutils - MAKE="${MAKE_PROG}" - export MAKE - ${MAKE} $* ar_DEPENDENCIES= ar_LDADD='../bfd/*.o ../libiberty/*.o `if test -f ../intl/gettext.o; then echo '../intl/*.o'; fi`' ar - ls -la - cp ar /usr/bin - - cd "${BUILD_DIRECTORY}/binutils-gdb/build" + mkdir -p "${BUILD_DIRECTORY}/gdb_build" + cd "${BUILD_DIRECTORY}/gdb_build/" + eval "$CMD" make -j4 - strip "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" + strip "${BUILD_DIRECTORY}/gdb_build/gdb/gdb" "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver" } main() { build_gdb - if [ ! -f "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" ] || \ - [ ! -f "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" ];then + if [ ! -f "${BUILD_DIRECTORY}/gdb_build/gdb/gdb" ] || \ + [ ! -f "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver" ];then echo "[-] Building GDB ${CURRENT_ARCH} failed!" exit 1 fi - GDB_VERSION=$(get_version "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb --version |head -n1 |awk '{print \$4}'") - GDBSERVER_VERSION=$(get_version "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver --version |head -n1 |awk '{print \$4}'") - cp "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" "${OUTPUT_DIRECTORY}/gdb${GDB_VERSION}" - cp "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" "${OUTPUT_DIRECTORY}/gdbserver${GDBSERVER_VERSION}" + GDB_VERSION=$(get_version "${BUILD_DIRECTORY}/gdb_build/gdb/gdb --version |head -n1 |awk '{print \$4}'") + GDBSERVER_VERSION=$(get_version "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver --version |head -n1 |awk '{print \$4}'") + cp "${BUILD_DIRECTORY}/gdb_build/gdb/gdb" "${OUTPUT_DIRECTORY}/gdb${GDB_VERSION}" + cp "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver" "${OUTPUT_DIRECTORY}/gdbserver${GDBSERVER_VERSION}" echo "[+] Finished building GDB ${CURRENT_ARCH}" echo ::set-output name=PACKAGED_NAME::"gdb${GDB_VERSION}" diff --git a/build/targets/build_nmap.sh b/build/targets/build_nmap.sh index 20bd7ee..564528f 100755 --- a/build/targets/build_nmap.sh +++ b/build/targets/build_nmap.sh @@ -36,9 +36,9 @@ build_nmap() { main() { lib_build_openssl build_nmap - if [ ! -f "${BUILD_DIRECTORY}/nmap/nmap" ] || \ - [ ! -f "${BUILD_DIRECTORY}/nmap/ncat/ncat" ] || \ - [ ! -f "${BUILD_DIRECTORY}/nmap/nping/nping" ];then + if [ ! -f "${BUILD_DIRECTORY}/nmap/nmap" -o \ + ! -f "${BUILD_DIRECTORY}/nmap/ncat/ncat" -o \ + ! -f "${BUILD_DIRECTORY}/nmap/nping/nping" ];then echo "[-] Building Nmap ${CURRENT_ARCH} failed!" exit 1 fi @@ -63,7 +63,7 @@ main() { fi cd "${BUILD_DIRECTORY}/nmap" make install - cp -r /usr/local/share/nmap/* "$NMAP_DIR" + cp -r /usr/local/share/nmap/* $NMAP_DIR echo "[+] Copied data to Nmap data dir" } diff --git a/build/targets/build_openssh.sh b/build/targets/build_openssh.sh index 14a2744..cb5c130 100755 --- a/build/targets/build_openssh.sh +++ b/build/targets/build_openssh.sh @@ -33,8 +33,8 @@ main() { lib_build_openssl lib_build_zlib build_openssh - if [ ! -f "${BUILD_DIRECTORY}/openssh-portable/ssh" ] || \ - [ ! -f "${BUILD_DIRECTORY}/openssh-portable/sshd" ];then + if [ ! -f "${BUILD_DIRECTORY}/openssh-portable/ssh" -o \ + ! -f "${BUILD_DIRECTORY}/openssh-portable/sshd" ];then echo "[-] Building OpenSSH ${CURRENT_ARCH} failed!" exit 1 fi @@ -43,7 +43,7 @@ main() { cp "${BUILD_DIRECTORY}/openssh-portable/sshd" "${OUTPUT_DIRECTORY}/sshd${OPENSSH_VERSION}" echo "[+] Finished building OpenSSH ${CURRENT_ARCH}" - OPENSSH_VERSION=$(echo "$OPENSSH_VERSION" | sed 's/-//') + OPENSSH_VERSION=$(echo $OPENSSH_VERSION | sed 's/-//') echo ::set-output name=PACKAGED_NAME::"${OPENSSH_VERSION}" echo ::set-output name=PACKAGED_NAME_PATH::"/output/*" } diff --git a/build/targets/build_strace.sh b/build/targets/build_strace.sh new file mode 100755 index 0000000..9b9c442 --- /dev/null +++ b/build/targets/build_strace.sh @@ -0,0 +1,43 @@ +#!/bin/bash +set -e +set -x +set -o pipefail +if [ "$#" -ne 1 ];then + echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" + echo "Example: ${0} x86_64" + exit 1 +fi +source $GITHUB_WORKSPACE/build/lib.sh +init_lib "$1" + +build_strace() { + fetch "https://github.com/strace/strace" "${BUILD_DIRECTORY}/strace" git + cd "${BUILD_DIRECTORY}/strace" + git clean -fdx + git checkout v5.7 + ./bootstrap + CMD="CFLAGS=\"${GCC_OPTS}\" " + CMD+="CXXFLAGS=\"${GXX_OPTS}\" " + CMD+="LDFLAGS=\"-static -pthread\" " + if [ "$CURRENT_ARCH" != "x86" ] && [ "$CURRENT_ARCH" != "x86_64" ];then + CMD+="CC_FOR_BUILD=\"/i686-linux-musl-cross/bin/i686-linux-musl-gcc\" " + CMD+="CPP_FOR_BUILD=\"/i686-linux-musl-cross/bin/i686-linux-musl-g++\" " + fi + CMD+="./configure --host=i486-linux-musl --target=$(get_host_triple)" + eval "$CMD" + make CFLAGS="-w" -j4 + strip strace +} + +main() { + build_strace + local version + version=$(get_version "${BUILD_DIRECTORY}/strace/strace --version 2>&1 | head -n1 | awk '{print \$4}'") + cp "${BUILD_DIRECTORY}/strace/strace" "${OUTPUT_DIRECTORY}/strace" + echo "[+] Finished building strace ${CURRENT_ARCH}" + + echo ::set-output name=PACKAGED_NAME::"strace${version}" + echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" +} + +main diff --git a/build/targets/build_tcpreplay.sh b/build/targets/build_tcpreplay.sh new file mode 100755 index 0000000..eb46fcf --- /dev/null +++ b/build/targets/build_tcpreplay.sh @@ -0,0 +1,57 @@ +#!/bin/bash +set -e +set -x +set -o pipefail +if [ "$#" -ne 1 ];then + echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" + echo "Example: ${0} x86_64" + exit 1 +fi +source $GITHUB_WORKSPACE/build/lib.sh +init_lib "$1" + +build_autogen(){ + fetch "http://ftp.gnu.org/gnu/autogen/rel5.16.2/autogen-5.16.2.tar.gz" "${BUILD_DIRECTORY}/autogen" http + cd "${BUILD_DIRECTORY}/autogen" + automake + CFLAGS="${GCC_OPTS}" \ + CXXFLAGS="${GXX_OPTS}" \ + CPPFLAGS="-static" \ + LDFLAGS="-static" \ + ./configure \ + --host="$(get_host_triple)" + make -j4 + make install +} + +build_tcpreplay() { + fetch "https://github.com/appneta/tcpreplay.git" "${BUILD_DIRECTORY}/tcpdump" git + cd "${BUILD_DIRECTORY}/tcpreplay" + git clean -fdx + git checkout v4.3.3 + export LIBPCAP_PATH="${BUILD_DIRECTORY}/libpcap" + ./autogen.sh + CFLAGS="${GCC_OPTS} -I${LIBPCAP_PATH} -L${LIBPCAP_PATH}" \ + CXXFLAGS="${GXX_OPTS}" \ + CPPFLAGS="-static" \ + LDFLAGS="-static" \ + ./configure \ + --host="$(get_host_triple)" + make -j4 + strip tcpreplay +} + +main() { + lib_build_libpcap + build_autogen + build_tcpreplay + local version + version=$(get_version "${BUILD_DIRECTORY}/tcpreplay/tcpreplay --version 2>&1 | head -n1 | awk '{print \$3}'") + cp "${BUILD_DIRECTORY}/tcpreplay/tcpreplay" "${OUTPUT_DIRECTORY}/tcpreplay" + echo "[+] Finished building tcpreplay ${CURRENT_ARCH}" + + echo ::set-output name=PACKAGED_NAME::"tcpreplay${version}" + echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" +} + +main diff --git a/patches/gdb/gdb-aarch64-header-sigcontext-fix.patch b/patches/gdb/gdb-aarch64-header-sigcontext-fix.patch new file mode 100644 index 0000000..c679ae3 --- /dev/null +++ b/patches/gdb/gdb-aarch64-header-sigcontext-fix.patch @@ -0,0 +1,18 @@ +--- /tmp/aarch64-linux-musl-cross/aarch64-linux-musl/include/asm/sigcontext.h ++++ /aarch64-linux-musl-cross/aarch64-linux-musl/include/asm/sigcontext.h +@@ -25,6 +25,7 @@ + * Signal context structure - contains all info to do with the state + * before the signal handler was invoked. + */ ++#if false + struct sigcontext { + __u64 fault_address; + /* AArch64 registers */ +@@ -127,6 +128,7 @@ + __u16 vl; + __u16 __reserved[3]; + }; ++#endif + + #endif /* !__ASSEMBLY__ */ + From 0835060b5d9927d056f580e2631cd75e3e406680 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 4 Nov 2020 12:43:56 +0100 Subject: [PATCH 29/95] Updated README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 207872b..5c0a6da 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ Compilation is done automatically with GitHub Actions. ## Tools -|[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| -|[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| -|[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|| -|[GDB](https://github.com/ernw/static-toolbox/actions?query=workflow%3AGDB)|| -|[tcpdump](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| +|[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| +|[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| +|[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|| +|[GDB & gdbserver](https://github.com/ernw/static-toolbox/actions?query=workflow%3AGDB)|| +|[tcpdump](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| From 068b92fb11989be64823b68a602a52a93098afd5 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 4 Nov 2020 12:44:39 +0100 Subject: [PATCH 30/95] Updated README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5c0a6da..04e0b0f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ Compilation is done automatically with GitHub Actions. ## Tools +| Tool | Status | +| ---- | ------ | |[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| |[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| |[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|| From 70287760e1b365ff053b3ee8122763505b693247 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Wed, 4 Nov 2020 12:53:05 +0100 Subject: [PATCH 31/95] Updated README.md --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 04e0b0f..2c0a061 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,14 @@ Compilation is done automatically with GitHub Actions. * Downloading of build artifacts in GitHub Ations currently requires a GitHub account * Blobs in build artifacts are zipped by the GitHub frontend by default, even zip files themselves! Build artifact zips may contain other zip files. -## Tools +## Building Status + +The following table shows the building status for the current toolset. The following architectures are currently supported: + +* x86 +* x86_64 +* ARMHF +* AARCH64 | Tool | Status | | ---- | ------ | From 127d8a9d754d84cbb900c9d12a239f583756807d Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <nschiess@ernw.de> Date: Fri, 16 Apr 2021 15:01:34 +0200 Subject: [PATCH 32/95] Updated musl.cc URLs --- .github/workflows/build-socat.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index 87a6740..c5224a7 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -68,7 +68,7 @@ jobs: run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" env: ARCH: x86_64-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + HOST: http://musl.cc/ TEMP: /tmp USER: 0 @@ -100,7 +100,7 @@ jobs: run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" env: ARCH: x86_64-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + HOST: http://musl.cc/ TEMP: /tmp USER: 0 From 7098615c1ab8dcccb330a0362915ebfec47b1de4 Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <nschiess@ernw.de> Date: Fri, 16 Apr 2021 15:32:41 +0200 Subject: [PATCH 33/95] Updated musl.cc URLs --- .github/workflows/build-gdb.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml index 6074e1b..19eb88b 100644 --- a/.github/workflows/build-gdb.yml +++ b/.github/workflows/build-gdb.yml @@ -18,7 +18,7 @@ jobs: run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" env: ARCH: x86_64-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + HOST: http://musl.cc/ TEMP: /tmp USER: 0 @@ -26,7 +26,7 @@ jobs: run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" env: ARCH: i686-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + HOST: http://musl.cc/ TEMP: /tmp USER: 0 @@ -80,7 +80,7 @@ jobs: run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" env: ARCH: x86_64-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + HOST: http://musl.cc/ TEMP: /tmp USER: 0 @@ -88,7 +88,7 @@ jobs: run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" env: ARCH: arm-linux-musleabihf - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + HOST: http://musl.cc/ TEMP: /tmp USER: 0 @@ -120,7 +120,7 @@ jobs: run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" env: ARCH: x86_64-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + HOST: http://musl.cc/ TEMP: /tmp USER: 0 @@ -128,7 +128,7 @@ jobs: run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" env: ARCH: aarch64-linux-musl - HOST: https://more.musl.cc/9.2.1/x86_64-linux-musl + HOST: http://musl.cc/ TEMP: /tmp USER: 0 From edcac69d3fb054842e9d39b9fee8b2e1ba029c07 Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <nschiess@ernw.de> Date: Fri, 16 Apr 2021 15:36:18 +0200 Subject: [PATCH 34/95] Added patch to alpine dependencies --- build/install_deps_alpine.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/install_deps_alpine.sh b/build/install_deps_alpine.sh index f76b2ec..3f916b0 100755 --- a/build/install_deps_alpine.sh +++ b/build/install_deps_alpine.sh @@ -25,4 +25,5 @@ apk add \ lttng-ust-dev \ curl \ rsync \ - util-linux \ No newline at end of file + util-linux \ + patch \ No newline at end of file From 17c9e910c8a70f192fe0ae1894d1510af4e7987d Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <nschiess@ernw.de> Date: Fri, 16 Apr 2021 16:03:16 +0200 Subject: [PATCH 35/95] Updated GDB build --- .github/workflows/build-gdb.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml index 19eb88b..44771b4 100644 --- a/.github/workflows/build-gdb.yml +++ b/.github/workflows/build-gdb.yml @@ -53,9 +53,26 @@ jobs: - name: Install dependencies run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + - name: Install build compiler + run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: http://musl.cc/ + TEMP: /tmp + USER: 0 + + - name: Install dependencies workaround + run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: http://musl.cc/ + TEMP: /tmp + USER: 0 + - name: Build GDB id: build_gdb run: | + export PATH="$PATH:/x86_64-linux-musl-cross/bin" $GITHUB_WORKSPACE/build/targets/build_gdb.sh x86_64 - name: Upload artifacts From d1e18ab8e252c6c4a5226a1e2c582c0ab3965e16 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 11:07:28 +0200 Subject: [PATCH 36/95] Added release job for Nmap --- .github/workflows/build-nmap.yml | 25 ++++++++++++++++++++++++- package/targets/nmap/package.sh | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index d2d92c7..8ce2628 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -121,4 +121,27 @@ jobs: uses: actions/upload-artifact@v2 with: name: ${{ steps.package_nmap.outputs.PACKAGED_ZIP }} - path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} \ No newline at end of file + path: ${{ steps.package_nmap.outputs.PACKAGED_ZIP_PATH }} + + create-release: + name: Create Nmap Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prepare Environment + run: mkdir /data + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + path: /data + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + files: /data/* + name: Nmap v${{ jobs.build-x86.outputs.PACKAGED_VERSION }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/package/targets/nmap/package.sh b/package/targets/nmap/package.sh index c2363a6..85ca112 100755 --- a/package/targets/nmap/package.sh +++ b/package/targets/nmap/package.sh @@ -61,3 +61,5 @@ zip -r -q "${output}/${ZIP}" . cp "${output}/${ZIP}" /packaged echo ::set-output name=PACKAGED_ZIP::${ZIP} echo ::set-output name=PACKAGED_ZIP_PATH::"/packaged/${ZIP}" + +echo ::set-output name=PACKAGED_VERSION::${version} \ No newline at end of file From a94e52ae86eccd2d3e0ed74b10606359287a17e8 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 11:11:48 +0200 Subject: [PATCH 37/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index 8ce2628..b8d3669 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -142,6 +142,6 @@ jobs: uses: softprops/action-gh-release@v1 with: files: /data/* - name: Nmap v${{ jobs.build-x86.outputs.PACKAGED_VERSION }} + name: Nmap v${{ needs.build-x86.outputs.PACKAGED_VERSION }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 31fc61d83f755335d4c239029b6e384bed49efe1 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 11:14:06 +0200 Subject: [PATCH 38/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index b8d3669..c74ef71 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -126,22 +126,23 @@ jobs: create-release: name: Create Nmap Release runs-on: ubuntu-latest + needs: [build-x86, build-x86_64, build-armhf, build-aarch64] steps: - name: Checkout uses: actions/checkout@v2 - name: Prepare Environment - run: mkdir /data + run: mkdir /releases - name: Download Artifacts uses: actions/download-artifact@v2 with: - path: /data + path: /releases - name: Create Release uses: softprops/action-gh-release@v1 with: - files: /data/* + files: /releases/* name: Nmap v${{ needs.build-x86.outputs.PACKAGED_VERSION }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From faa9a33e9df151e45f9ebbc9a8e60d4eff38da04 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 11:25:00 +0200 Subject: [PATCH 39/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index c74ef71..5670939 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -132,17 +132,20 @@ jobs: uses: actions/checkout@v2 - name: Prepare Environment - run: mkdir /releases + run: mkdir /tmp/releases - name: Download Artifacts uses: actions/download-artifact@v2 with: - path: /releases + path: /tmp/releases + + - name: List Artifacts + run: ls -la /tmp/releases - name: Create Release uses: softprops/action-gh-release@v1 with: - files: /releases/* + files: /tmp/releases/* name: Nmap v${{ needs.build-x86.outputs.PACKAGED_VERSION }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 47c0c238dd0d530679c039732c17bde8731f219c Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 11:41:07 +0200 Subject: [PATCH 40/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index 5670939..dd67ea1 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -142,6 +142,11 @@ jobs: - name: List Artifacts run: ls -la /tmp/releases + - name: Tag Release + run: | + git tag "nmap-v${{ needs.build-x86.outputs.PACKAGED_VERSION }}" + git push origin "nmap-v${{ needs.build-x86.outputs.PACKAGED_VERSION }}" + - name: Create Release uses: softprops/action-gh-release@v1 with: From f8ddcacf737bd2abb8c06b7ceaabcd24f70fa402 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 11:51:24 +0200 Subject: [PATCH 41/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index dd67ea1..fb735e3 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -144,13 +144,13 @@ jobs: - name: Tag Release run: | - git tag "nmap-v${{ needs.build-x86.outputs.PACKAGED_VERSION }}" - git push origin "nmap-v${{ needs.build-x86.outputs.PACKAGED_VERSION }}" + git tag "nmap-v${{ needs.build-x86.steps.package_nmap.outputs.PACKAGED_VERSION }}" + git push origin "nmap-v${{ needs.build-x86.steps.package_nmap.outputs.PACKAGED_VERSION }}" - name: Create Release uses: softprops/action-gh-release@v1 with: files: /tmp/releases/* - name: Nmap v${{ needs.build-x86.outputs.PACKAGED_VERSION }} + name: Nmap v${{ needs.build-x86.steps.package_nmap.outputs.PACKAGED_VERSION }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 5f8293095da535bf0269dd6d4f965cee9b05d1d0 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 11:55:27 +0200 Subject: [PATCH 42/95] Added building helper scripts --- build/01_init.sh | 4 ++++ build/02_install_build_compiler.sh | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 build/01_init.sh create mode 100755 build/02_install_build_compiler.sh diff --git a/build/01_init.sh b/build/01_init.sh new file mode 100755 index 0000000..bd62b59 --- /dev/null +++ b/build/01_init.sh @@ -0,0 +1,4 @@ +#!/bin/sh +p=$(dirname "$0") +apk update && apk add bash +"$p"/install_deps_alpine.sh \ No newline at end of file diff --git a/build/02_install_build_compiler.sh b/build/02_install_build_compiler.sh new file mode 100755 index 0000000..b606c55 --- /dev/null +++ b/build/02_install_build_compiler.sh @@ -0,0 +1,20 @@ +#!/bin/bash +if [ $# -ne 1 ];then + echo "Missing arch" + exit 1 +fi +ARCH="${1,,}" +case $ARCH in + x86|x86_64|i686|arm|armhf|aarch64) + ARCH="${ARCH}-linux-musl" + ;; + *) + echo "Invalid arch ${ARCH}" + exit 1 + ;; +esac +HOST=http://musl.cc +cd / +curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz +tar -xf ${ARCH}-cross.tgz +rm ${ARCH}-cross.tgz \ No newline at end of file From 7b20701593f1979a74b7dbdea5450729c56a4285 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 12:03:48 +0200 Subject: [PATCH 43/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index fb735e3..2670705 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -7,6 +7,8 @@ jobs: name: Build Nmap x86 runs-on: ubuntu-latest container: muslcc/x86_64:i686-linux-musl + outputs: + version: ${{ steps.package_nmap.outputs.PACKAGED_VERSION }} steps: - name: Checkout uses: actions/checkout@v2 @@ -144,13 +146,13 @@ jobs: - name: Tag Release run: | - git tag "nmap-v${{ needs.build-x86.steps.package_nmap.outputs.PACKAGED_VERSION }}" - git push origin "nmap-v${{ needs.build-x86.steps.package_nmap.outputs.PACKAGED_VERSION }}" + git tag "nmap-v${{ needs.build-x86.outputs.version }}" + git push origin "nmap-v${{ needs.build-x86.outputs.version }}" - name: Create Release uses: softprops/action-gh-release@v1 with: files: /tmp/releases/* - name: Nmap v${{ needs.build-x86.steps.package_nmap.outputs.PACKAGED_VERSION }} + name: Nmap v${{ needs.build-x86.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From ca570767b7cf3f8ab14f074c01fc82b2626a2584 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 12:16:26 +0200 Subject: [PATCH 44/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index 2670705..af71564 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -154,5 +154,6 @@ jobs: with: files: /tmp/releases/* name: Nmap v${{ needs.build-x86.outputs.version }} + tag: nmap-v${{ needs.build-x86.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 02b0d65e61a89fb9b485c22915aad0e7cba287dc Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 12:26:33 +0200 Subject: [PATCH 45/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index af71564..5d4845c 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -154,6 +154,6 @@ jobs: with: files: /tmp/releases/* name: Nmap v${{ needs.build-x86.outputs.version }} - tag: nmap-v${{ needs.build-x86.outputs.version }} + tag_name: nmap-v${{ needs.build-x86.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From c366f39a57853c75732124f1e84ccf2bea3527fa Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 12:33:30 +0200 Subject: [PATCH 46/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index 5d4845c..6bb1a22 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -154,6 +154,6 @@ jobs: with: files: /tmp/releases/* name: Nmap v${{ needs.build-x86.outputs.version }} - tag_name: nmap-v${{ needs.build-x86.outputs.version }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REF: nmap-v${{ needs.build-x86.outputs.version }} \ No newline at end of file From 5e8c9f2d08ec27fe72baa203669bd76f2164795f Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 13:08:49 +0200 Subject: [PATCH 47/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index 6bb1a22..7fd648e 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -150,10 +150,9 @@ jobs: git push origin "nmap-v${{ needs.build-x86.outputs.version }}" - name: Create Release - uses: softprops/action-gh-release@v1 + uses: ncipollo/release-action@v1 with: - files: /tmp/releases/* name: Nmap v${{ needs.build-x86.outputs.version }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_REF: nmap-v${{ needs.build-x86.outputs.version }} \ No newline at end of file + tag: nmap-v${{ needs.build-x86.outputs.version }} + artifacts: /tmp/releases/* + token: ${{ secrets.GITHUB_TOKEN }} From 7facf8d89eaba1d31d3daee86a2fdb54902162e5 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 13:23:30 +0200 Subject: [PATCH 48/95] Updated Nmap job --- .github/workflows/build-nmap.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index 7fd648e..9772c2b 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -142,7 +142,7 @@ jobs: path: /tmp/releases - name: List Artifacts - run: ls -la /tmp/releases + run: ls -laR /tmp/releases - name: Tag Release run: | @@ -154,5 +154,5 @@ jobs: with: name: Nmap v${{ needs.build-x86.outputs.version }} tag: nmap-v${{ needs.build-x86.outputs.version }} - artifacts: /tmp/releases/* + artifacts: "/tmp/releases/*/*" token: ${{ secrets.GITHUB_TOKEN }} From 885534ec824a98b40ca75711a3083e5c307de0a7 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 13:34:06 +0200 Subject: [PATCH 49/95] Updated GDB build script --- .github/workflows/build-gdb.yml | 57 ++++----------------------------- build/targets/build_gdb.sh | 12 ++++--- 2 files changed, 15 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml index 44771b4..d6cc2c5 100644 --- a/.github/workflows/build-gdb.yml +++ b/.github/workflows/build-gdb.yml @@ -15,20 +15,10 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 - name: Install dependencies workaround - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: i686-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh i686 - name: Build GDB id: build_gdb @@ -54,20 +44,7 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 - - - name: Install dependencies workaround - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 - name: Build GDB id: build_gdb @@ -94,20 +71,10 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 - name: Install dependencies workaround - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: arm-linux-musleabihf - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh arm - name: Build gdb id: build_gdb @@ -134,20 +101,10 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 - name: Install dependencies workaround - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: aarch64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh aarch64 - name: Patch headers run: | diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index 47d47fa..e8cb4bb 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -1,12 +1,16 @@ #!/bin/bash -set -e -set -o pipefail -set -x +if [ -z "$GITHUB_WORKSPACE" ];then + echo "GITHUB_WORKSPACE environemnt variable not set!" + exit 1 +fi if [ "$#" -ne 1 ];then echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" echo "Example: ${0} x86_64" exit 1 fi +set -e +set -o pipefail +set -x source $GITHUB_WORKSPACE/build/lib.sh init_lib $1 @@ -24,7 +28,7 @@ build_gdb() { CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++\" " fi CMD+="${BUILD_DIRECTORY}/binutils-gdb/configure --build=x86_64-linux-musl --host=$(get_host_triple) " - CMD+="--disable-shared --enable-static --enable-gdbserver --disable-nls" + CMD+="--disable-shared --enable-static --enable-gdbserver --disable-nls --disable-inprocess-agent" mkdir -p "${BUILD_DIRECTORY}/gdb_build" cd "${BUILD_DIRECTORY}/gdb_build/" From 782855bf2bff39b653742779764f94d31bba9542 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 13:39:33 +0200 Subject: [PATCH 50/95] Fixed path in GDB build --- .github/workflows/build-gdb.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml index d6cc2c5..a9af073 100644 --- a/.github/workflows/build-gdb.yml +++ b/.github/workflows/build-gdb.yml @@ -15,10 +15,10 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 + run: $GITHUB_WORKSPACE/build/02_install_build_compiler.sh x86_64 - name: Install dependencies workaround - run: $GITHUB_WORKSPACE/02_install_build_compiler.sh i686 + run: $GITHUB_WORKSPACE/build/02_install_build_compiler.sh i686 - name: Build GDB id: build_gdb @@ -44,7 +44,7 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 + run: $GITHUB_WORKSPACE/build/02_install_build_compiler.sh x86_64 - name: Build GDB id: build_gdb @@ -71,10 +71,10 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 + run: $GITHUB_WORKSPACE/build/02_install_build_compiler.sh x86_64 - name: Install dependencies workaround - run: $GITHUB_WORKSPACE/02_install_build_compiler.sh arm + run: $GITHUB_WORKSPACE/build/02_install_build_compiler.sh arm - name: Build gdb id: build_gdb @@ -101,10 +101,10 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 + run: $GITHUB_WORKSPACE/build/02_install_build_compiler.sh x86_64 - name: Install dependencies workaround - run: $GITHUB_WORKSPACE/02_install_build_compiler.sh aarch64 + run: $GITHUB_WORKSPACE/build/02_install_build_compiler.sh aarch64 - name: Patch headers run: | From 176cff87c7b5f033f9458be2239238e2ba51f6d0 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 13:40:47 +0200 Subject: [PATCH 51/95] Updated Nmap build script --- build/targets/build_nmap.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build/targets/build_nmap.sh b/build/targets/build_nmap.sh index 564528f..6e6cfa7 100755 --- a/build/targets/build_nmap.sh +++ b/build/targets/build_nmap.sh @@ -1,12 +1,16 @@ #!/bin/bash -set -e -set -x -set -o pipefail +if [ -z "$GITHUB_WORKSPACE" ];then + echo "GITHUB_WORKSPACE environemnt variable not set!" + exit 1 +fi if [ "$#" -ne 1 ];then echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" echo "Example: ${0} x86_64" exit 1 fi +set -e +set -o pipefail +set -x source $GITHUB_WORKSPACE/build/lib.sh init_lib $1 From 7e3ae1499c4a4733322d3d5ae86b4270d2707439 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 13:57:43 +0200 Subject: [PATCH 52/95] Updated socat workflow --- .github/workflows/build-socat.yml | 36 ++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index c5224a7..c54f758 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -6,6 +6,8 @@ jobs: name: Build socat x86 runs-on: ubuntu-latest container: muslcc/x86_64:i686-linux-musl + outputs: + version: ${{ steps.build_socat.outputs.PACKAGED_NAME }} steps: - name: Checkout uses: actions/checkout@v2 @@ -112,4 +114,36 @@ jobs: uses: actions/upload-artifact@v2 with: name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} - path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} \ No newline at end of file + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} + + create-release: + name: Create socat Release + runs-on: ubuntu-latest + needs: [build-x86, build-x86_64, build-armhf, build-aarch64] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prepare Environment + run: mkdir /tmp/releases + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + path: /tmp/releases + + - name: List Artifacts + run: ls -laR /tmp/releases + + - name: Tag Release + run: | + git tag "${{ needs.build-x86.outputs.version }}" + git push origin "${{ needs.build-x86.outputs.version }}" + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + name: ${{ needs.build-x86.outputs.version }} + tag: ${{ needs.build-x86.outputs.version }} + artifacts: "/tmp/releases/*/*" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 687716cb1ae904469fa5a4c7ca7ef549fc75e569 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 14:15:53 +0200 Subject: [PATCH 53/95] Updated socat workflow --- .github/workflows/build-socat.yml | 10 +++++----- build/targets/build_socat.sh | 12 +++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index c54f758..b8d7447 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest container: muslcc/x86_64:i686-linux-musl outputs: - version: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + version: ${{ steps.build_socat.outputs.PACKAGED_VERSION }} steps: - name: Checkout uses: actions/checkout@v2 @@ -137,13 +137,13 @@ jobs: - name: Tag Release run: | - git tag "${{ needs.build-x86.outputs.version }}" - git push origin "${{ needs.build-x86.outputs.version }}" + git tag "socat-v${{ needs.build-x86.outputs.version }}" + git push origin "socat-v${{ needs.build-x86.outputs.version }}" - name: Create Release uses: ncipollo/release-action@v1 with: - name: ${{ needs.build-x86.outputs.version }} - tag: ${{ needs.build-x86.outputs.version }} + name: socat-v{{ needs.build-x86.outputs.version }} + tag: socat-v${{ needs.build-x86.outputs.version }} artifacts: "/tmp/releases/*/*" token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/build/targets/build_socat.sh b/build/targets/build_socat.sh index f74fbd6..51b1f72 100755 --- a/build/targets/build_socat.sh +++ b/build/targets/build_socat.sh @@ -1,12 +1,16 @@ #!/bin/bash -set -e -set -x -set -o pipefail +if [ -z "$GITHUB_WORKSPACE" ];then + echo "GITHUB_WORKSPACE environemnt variable not set!" + exit 1 +fi if [ "$#" -ne 1 ];then echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" echo "Example: ${0} x86_64" exit 1 fi +set -e +set -o pipefail +set -x source $GITHUB_WORKSPACE/build/lib.sh init_lib "$1" @@ -33,11 +37,13 @@ main() { build_socat local version version=$(get_version "${BUILD_DIRECTORY}/socat/socat -V | grep 'socat version' | awk '{print \$3}'") + version_number=$(echo "$version" | cut -d"-" -f2) cp "${BUILD_DIRECTORY}/socat/socat" "${OUTPUT_DIRECTORY}/socat${version}" echo "[+] Finished building socat ${CURRENT_ARCH}" echo ::set-output name=PACKAGED_NAME::"socat${version}" echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" + echo ::set-output name=PACKAGED_VERSION::"${version_number}" } main From 3c7a3bbb7b48b656887d71ba38cf45790b22f2ad Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 14:20:54 +0200 Subject: [PATCH 54/95] Updated tcpdump workflow --- .github/workflows/build-tcpdump.yml | 34 +++++++++++++++++++++++++++++ build/targets/build_tcpdump.sh | 12 +++++++--- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-tcpdump.yml b/.github/workflows/build-tcpdump.yml index 1990ee9..b6a0b47 100644 --- a/.github/workflows/build-tcpdump.yml +++ b/.github/workflows/build-tcpdump.yml @@ -6,6 +6,8 @@ jobs: name: Build tcpdump x86 runs-on: ubuntu-latest container: muslcc/x86_64:i686-linux-musl + outputs: + version: ${{ steps.build_tcpdump.outputs.PACKAGED_VERSION }} steps: - name: Checkout uses: actions/checkout@v2 @@ -85,3 +87,35 @@ jobs: with: name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} + + create-release: + name: Create tcpdump Release + runs-on: ubuntu-latest + needs: [build-x86, build-x86_64, build-armhf, build-aarch64] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prepare Environment + run: mkdir /tmp/releases + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + path: /tmp/releases + + - name: List Artifacts + run: ls -laR /tmp/releases + + - name: Tag Release + run: | + git tag "tcpdump-v${{ needs.build-x86.outputs.version }}" + git push origin "tcpdump-v${{ needs.build-x86.outputs.version }}" + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + name: tcpdump-v{{ needs.build-x86.outputs.version }} + tag: tcpdump-v${{ needs.build-x86.outputs.version }} + artifacts: "/tmp/releases/*/*" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/build/targets/build_tcpdump.sh b/build/targets/build_tcpdump.sh index 730954f..66b1bf9 100755 --- a/build/targets/build_tcpdump.sh +++ b/build/targets/build_tcpdump.sh @@ -1,12 +1,16 @@ #!/bin/bash -set -e -set -x -set -o pipefail +if [ -z "$GITHUB_WORKSPACE" ];then + echo "GITHUB_WORKSPACE environemnt variable not set!" + exit 1 +fi if [ "$#" -ne 1 ];then echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" echo "Example: ${0} x86_64" exit 1 fi +set -e +set -o pipefail +set -x source $GITHUB_WORKSPACE/build/lib.sh init_lib "$1" @@ -31,11 +35,13 @@ main() { build_tcpdump local version version=$(get_version "${BUILD_DIRECTORY}/tcpdump/tcpdump --version 2>&1 | head -n1 | awk '{print \$3}'") + version_number=$(echo "$version" | cut -d"-" -f2) cp "${BUILD_DIRECTORY}/tcpdump/tcpdump" "${OUTPUT_DIRECTORY}/tcpdump" echo "[+] Finished building tcpdump ${CURRENT_ARCH}" echo ::set-output name=PACKAGED_NAME::"tcpdump${version}" echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" + echo ::set-output name=PACKAGED_VERSION::"${version_number}" } main From d5743fc0362ee96f4c23c1215a086c23d82f8395 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 14:22:06 +0200 Subject: [PATCH 55/95] Updated tcpdump workflow --- .github/workflows/build-tcpdump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-tcpdump.yml b/.github/workflows/build-tcpdump.yml index b6a0b47..1a60ed2 100644 --- a/.github/workflows/build-tcpdump.yml +++ b/.github/workflows/build-tcpdump.yml @@ -91,7 +91,7 @@ jobs: create-release: name: Create tcpdump Release runs-on: ubuntu-latest - needs: [build-x86, build-x86_64, build-armhf, build-aarch64] + needs: [build-x86, build-x86_64, build-armhf] steps: - name: Checkout uses: actions/checkout@v2 From 5c3ec0f2da56cf5747d1c231870d9616bf1fe5a5 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 14:25:36 +0200 Subject: [PATCH 56/95] Updated tcpdump workflow --- .github/workflows/build-tcpdump.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-tcpdump.yml b/.github/workflows/build-tcpdump.yml index 1a60ed2..b1eff60 100644 --- a/.github/workflows/build-tcpdump.yml +++ b/.github/workflows/build-tcpdump.yml @@ -67,7 +67,7 @@ jobs: name: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME }} path: ${{ steps.build_tcpdump.outputs.PACKAGED_NAME_PATH }} - build: + build-aarch64: name: Build tcpdump AARCH64 runs-on: ubuntu-latest container: muslcc/x86_64:aarch64-linux-musl @@ -91,7 +91,7 @@ jobs: create-release: name: Create tcpdump Release runs-on: ubuntu-latest - needs: [build-x86, build-x86_64, build-armhf] + needs: [build-x86, build-x86_64, build-armhf, build-aarch64] steps: - name: Checkout uses: actions/checkout@v2 @@ -115,7 +115,7 @@ jobs: - name: Create Release uses: ncipollo/release-action@v1 with: - name: tcpdump-v{{ needs.build-x86.outputs.version }} + name: tcpdump-v${{ needs.build-x86.outputs.version }} tag: tcpdump-v${{ needs.build-x86.outputs.version }} artifacts: "/tmp/releases/*/*" token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 62ad95dfa42b2a0554d070fb75029e04310da676 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 14:35:05 +0200 Subject: [PATCH 57/95] Fixed typo in socat workflow --- .github/workflows/build-socat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index b8d7447..ed5a657 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -143,7 +143,7 @@ jobs: - name: Create Release uses: ncipollo/release-action@v1 with: - name: socat-v{{ needs.build-x86.outputs.version }} + name: socat-v${{ needs.build-x86.outputs.version }} tag: socat-v${{ needs.build-x86.outputs.version }} artifacts: "/tmp/releases/*/*" token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 30721c6c11359d31fa20ce4cc5d73c680669f386 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 14:45:44 +0200 Subject: [PATCH 58/95] Updated socat workflow --- .github/workflows/build-socat.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index ed5a657..3ebccc9 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -136,12 +136,19 @@ jobs: run: ls -laR /tmp/releases - name: Tag Release + id: tag_release run: | - git tag "socat-v${{ needs.build-x86.outputs.version }}" - git push origin "socat-v${{ needs.build-x86.outputs.version }}" + if git tag "socat-v${{ needs.build-x86.outputs.version }}";then + git push origin "socat-v${{ needs.build-x86.outputs.version }}" + echo ::set-output name=NEW_RELEASE::"true" + else + echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + fi - name: Create Release uses: ncipollo/release-action@v1 + condition: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} with: name: socat-v${{ needs.build-x86.outputs.version }} tag: socat-v${{ needs.build-x86.outputs.version }} From eef54d6c31eb26fbad15213dd918c09fcbdc3e17 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 14:46:42 +0200 Subject: [PATCH 59/95] Updated socat workflow --- .github/workflows/build-socat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index 3ebccc9..9b2aade 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -148,7 +148,7 @@ jobs: - name: Create Release uses: ncipollo/release-action@v1 - condition: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} + if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} with: name: socat-v${{ needs.build-x86.outputs.version }} tag: socat-v${{ needs.build-x86.outputs.version }} From 959c42b35420b56446389ce50b9a0c813ca3da03 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 14:51:33 +0200 Subject: [PATCH 60/95] Added version to tcpdump binaries --- build/targets/build_tcpdump.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/targets/build_tcpdump.sh b/build/targets/build_tcpdump.sh index 66b1bf9..fdab747 100755 --- a/build/targets/build_tcpdump.sh +++ b/build/targets/build_tcpdump.sh @@ -36,7 +36,7 @@ main() { local version version=$(get_version "${BUILD_DIRECTORY}/tcpdump/tcpdump --version 2>&1 | head -n1 | awk '{print \$3}'") version_number=$(echo "$version" | cut -d"-" -f2) - cp "${BUILD_DIRECTORY}/tcpdump/tcpdump" "${OUTPUT_DIRECTORY}/tcpdump" + cp "${BUILD_DIRECTORY}/tcpdump/tcpdump" "${OUTPUT_DIRECTORY}/tcpdump${version}" echo "[+] Finished building tcpdump ${CURRENT_ARCH}" echo ::set-output name=PACKAGED_NAME::"tcpdump${version}" From 56fa020198910974caed54e65ce482255b692ef9 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 14:58:34 +0200 Subject: [PATCH 61/95] Fixed script in socat workflow --- .github/workflows/build-socat.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index 9b2aade..500a8b4 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -138,6 +138,7 @@ jobs: - name: Tag Release id: tag_release run: | + set +e if git tag "socat-v${{ needs.build-x86.outputs.version }}";then git push origin "socat-v${{ needs.build-x86.outputs.version }}" echo ::set-output name=NEW_RELEASE::"true" From 016b681c23cf033366e5ea346fe0d155b75d0b3f Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 15:07:04 +0200 Subject: [PATCH 62/95] Fixed script in socat workflow --- .github/workflows/build-socat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index 500a8b4..545eb3d 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -139,7 +139,7 @@ jobs: id: tag_release run: | set +e - if git tag "socat-v${{ needs.build-x86.outputs.version }}";then + if [ $(git tag "socat-v${{ needs.build-x86.outputs.version }}") ];then git push origin "socat-v${{ needs.build-x86.outputs.version }}" echo ::set-output name=NEW_RELEASE::"true" else From 75fdf2b4bcc5dbeb48037c97c0a8cf1624490320 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 15:14:31 +0200 Subject: [PATCH 63/95] Added tag check to Nmap workflow --- .github/workflows/build-nmap.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index 9772c2b..0c38912 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -146,11 +146,18 @@ jobs: - name: Tag Release run: | - git tag "nmap-v${{ needs.build-x86.outputs.version }}" - git push origin "nmap-v${{ needs.build-x86.outputs.version }}" + set +e + if [ $(git tag "nmap-v${{ needs.build-x86.outputs.version }}") ];then + git push origin "nmap-v${{ needs.build-x86.outputs.version }}" + echo ::set-output name=NEW_RELEASE::"true" + else + echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + fi - name: Create Release uses: ncipollo/release-action@v1 + if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} with: name: Nmap v${{ needs.build-x86.outputs.version }} tag: nmap-v${{ needs.build-x86.outputs.version }} From b613a7377c1cfede10c73eed19c1f17514f3e399 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 15:15:15 +0200 Subject: [PATCH 64/95] Added tag check to tcpdump workflow --- .github/workflows/build-tcpdump.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-tcpdump.yml b/.github/workflows/build-tcpdump.yml index b1eff60..5c6614e 100644 --- a/.github/workflows/build-tcpdump.yml +++ b/.github/workflows/build-tcpdump.yml @@ -109,11 +109,18 @@ jobs: - name: Tag Release run: | - git tag "tcpdump-v${{ needs.build-x86.outputs.version }}" - git push origin "tcpdump-v${{ needs.build-x86.outputs.version }}" + set +e + if [ $(git tag "tcpdump-v${{ needs.build-x86.outputs.version }}") ];then + git push origin "tcpdump-v${{ needs.build-x86.outputs.version }}" + echo ::set-output name=NEW_RELEASE::"true" + else + echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + fi - name: Create Release uses: ncipollo/release-action@v1 + if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} with: name: tcpdump-v${{ needs.build-x86.outputs.version }} tag: tcpdump-v${{ needs.build-x86.outputs.version }} From 0dc37eb3907db403266e204da8d147423e7df2cc Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 15:18:49 +0200 Subject: [PATCH 65/95] Updated GDB workflow --- .github/workflows/build-gdb.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml index a9af073..10e4f89 100644 --- a/.github/workflows/build-gdb.yml +++ b/.github/workflows/build-gdb.yml @@ -49,7 +49,6 @@ jobs: - name: Build GDB id: build_gdb run: | - export PATH="$PATH:/x86_64-linux-musl-cross/bin" $GITHUB_WORKSPACE/build/targets/build_gdb.sh x86_64 - name: Upload artifacts From 73ddc59fab7bcb080b553382cb9b1e91c4bf26ae Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 15:28:36 +0200 Subject: [PATCH 66/95] Updated openssh build script to v8.6p1 --- build/targets/build_openssh.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build/targets/build_openssh.sh b/build/targets/build_openssh.sh index cb5c130..33a6c1c 100755 --- a/build/targets/build_openssh.sh +++ b/build/targets/build_openssh.sh @@ -1,19 +1,23 @@ #!/bin/bash -set -e -set -x -set -o pipefail +if [ -z "$GITHUB_WORKSPACE" ];then + echo "GITHUB_WORKSPACE environemnt variable not set!" + exit 1 +fi if [ "$#" -ne 1 ];then echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" echo "Example: ${0} x86_64" exit 1 fi +set -e +set -o pipefail +set -x source $GITHUB_WORKSPACE/build/lib.sh init_lib $1 build_openssh() { fetch "https://github.com/openssh/openssh-portable.git" "${BUILD_DIRECTORY}/openssh-portable" git cd "${BUILD_DIRECTORY}/openssh-portable" - git checkout V_7_9 + git checkout V_8_6_P1 git clean -fdx autoreconf -i CC="gcc ${GCC_OPTS}" \ From d64ea4e08f01876cb9f228bb447a7d42be1fbf3b Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 15:37:29 +0200 Subject: [PATCH 67/95] Added release job for OpenSSH workflow --- .github/workflows/build-openssh.yml | 44 ++++++++++++++++++++++++++++- build/targets/build_openssh.sh | 2 ++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-openssh.yml b/.github/workflows/build-openssh.yml index 45403dd..4a120e8 100644 --- a/.github/workflows/build-openssh.yml +++ b/.github/workflows/build-openssh.yml @@ -6,6 +6,8 @@ jobs: name: Build OpenSSH x86 runs-on: ubuntu-latest container: muslcc/x86_64:i686-linux-musl + outputs: + version: ${{ steps.build_openssh.outputs.PACKAGED_VERSION }} steps: - name: Checkout uses: actions/checkout@v2 @@ -84,4 +86,44 @@ jobs: uses: actions/upload-artifact@v2 with: name: ${{ steps.build_openssh.outputs.PACKAGED_NAME }} - path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} \ No newline at end of file + path: ${{ steps.build_openssh.outputs.PACKAGED_NAME_PATH }} + + create-release: + name: Create OpenSSH Release + runs-on: ubuntu-latest + needs: [build-x86, build-x86_64, build-armhf, build-aarch64] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prepare Environment + run: mkdir /tmp/releases + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + path: /tmp/releases + + - name: List Artifacts + run: ls -laR /tmp/releases + + - name: Tag Release + id: tag_release + run: | + set +e + if [ $(git tag "openssh-v${{ needs.build-x86.outputs.version }}") ];then + git push origin "openssh-v${{ needs.build-x86.outputs.version }}" + echo ::set-output name=NEW_RELEASE::"true" + else + echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + fi + + - name: Create Release + uses: ncipollo/release-action@v1 + if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} + with: + name: openssh-v${{ needs.build-x86.outputs.version }} + tag: openssh-v${{ needs.build-x86.outputs.version }} + artifacts: "/tmp/releases/*/*" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/build/targets/build_openssh.sh b/build/targets/build_openssh.sh index 33a6c1c..15d5093 100755 --- a/build/targets/build_openssh.sh +++ b/build/targets/build_openssh.sh @@ -43,6 +43,7 @@ main() { exit 1 fi OPENSSH_VERSION=$(get_version "${BUILD_DIRECTORY}/openssh-portable/ssh -V 2>&1 | awk '{print \$1}' | sed 's/,//g'") + version_number=$(echo "$OPENSSH_VERSION" | cut -d"_" -f2) cp "${BUILD_DIRECTORY}/openssh-portable/ssh" "${OUTPUT_DIRECTORY}/ssh${OPENSSH_VERSION}" cp "${BUILD_DIRECTORY}/openssh-portable/sshd" "${OUTPUT_DIRECTORY}/sshd${OPENSSH_VERSION}" echo "[+] Finished building OpenSSH ${CURRENT_ARCH}" @@ -50,6 +51,7 @@ main() { OPENSSH_VERSION=$(echo $OPENSSH_VERSION | sed 's/-//') echo ::set-output name=PACKAGED_NAME::"${OPENSSH_VERSION}" echo ::set-output name=PACKAGED_NAME_PATH::"/output/*" + echo ::set-output name=PACKAGED_VERSION::"${version_number}" } main From e2a49be0b7f53399699dc1ec533a6fb1ec1f67b4 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 15:43:19 +0200 Subject: [PATCH 68/95] Updated 02_install_build_compiler.sh --- build/02_install_build_compiler.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/build/02_install_build_compiler.sh b/build/02_install_build_compiler.sh index b606c55..15cb8c3 100755 --- a/build/02_install_build_compiler.sh +++ b/build/02_install_build_compiler.sh @@ -5,13 +5,19 @@ if [ $# -ne 1 ];then fi ARCH="${1,,}" case $ARCH in - x86|x86_64|i686|arm|armhf|aarch64) - ARCH="${ARCH}-linux-musl" - ;; + x86_64|i686|aarch64) + ARCH="${ARCH}-linux-musl" + ;; + x86) + ARCH="i686-linux-musl" + ;; + arm) + ARCH="arm-linux-musleabihf" + ;; *) - echo "Invalid arch ${ARCH}" - exit 1 - ;; + echo "Invalid arch ${ARCH}" + exit 1 + ;; esac HOST=http://musl.cc cd / From 3e9cf83e71aa4531853b98329d70806a82309969 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 15:53:12 +0200 Subject: [PATCH 69/95] Fixed OpenSSH version tag --- build/targets/build_openssh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/targets/build_openssh.sh b/build/targets/build_openssh.sh index 15d5093..e9ba48e 100755 --- a/build/targets/build_openssh.sh +++ b/build/targets/build_openssh.sh @@ -43,7 +43,7 @@ main() { exit 1 fi OPENSSH_VERSION=$(get_version "${BUILD_DIRECTORY}/openssh-portable/ssh -V 2>&1 | awk '{print \$1}' | sed 's/,//g'") - version_number=$(echo "$OPENSSH_VERSION" | cut -d"_" -f2) + version_number=$(echo "$OPENSSH_VERSION" | cut -d"-" -f2 | cut -d"_" -f2) cp "${BUILD_DIRECTORY}/openssh-portable/ssh" "${OUTPUT_DIRECTORY}/ssh${OPENSSH_VERSION}" cp "${BUILD_DIRECTORY}/openssh-portable/sshd" "${OUTPUT_DIRECTORY}/sshd${OPENSSH_VERSION}" echo "[+] Finished building OpenSSH ${CURRENT_ARCH}" From 4dd18e112a62f54a8b3db1ecb13327d336c59495 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 16:03:23 +0200 Subject: [PATCH 70/95] Added release job for GDB --- .github/workflows/build-gdb.yml | 44 ++++++++++++++++++++++++++++++++- build/targets/build_gdb.sh | 2 ++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml index 10e4f89..81d1983 100644 --- a/.github/workflows/build-gdb.yml +++ b/.github/workflows/build-gdb.yml @@ -7,6 +7,8 @@ jobs: name: Build GDB & gdbserver x86 runs-on: ubuntu-latest container: muslcc/x86_64:i686-linux-musl + outputs: + version: ${{ steps.build_gdb.outputs.PACKAGED_VERSION }} steps: - name: Checkout uses: actions/checkout@v2 @@ -119,4 +121,44 @@ jobs: uses: actions/upload-artifact@v2 with: name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} - path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} \ No newline at end of file + path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} + + create-release: + name: Create GDB & gdbserver Release + runs-on: ubuntu-latest + needs: [build-x86, build-x86_64, build-armhf, build-aarch64] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prepare Environment + run: mkdir /tmp/releases + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + path: /tmp/releases + + - name: List Artifacts + run: ls -laR /tmp/releases + + - name: Tag Release + id: tag_release + run: | + set +e + if [ $(git tag "gdb-v${{ needs.build-x86.outputs.version }}") ];then + git push origin "gdb-v${{ needs.build-x86.outputs.version }}" + echo ::set-output name=NEW_RELEASE::"true" + else + echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + fi + + - name: Create Release + uses: ncipollo/release-action@v1 + if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} + with: + name: gdb-v${{ needs.build-x86.outputs.version }} + tag: gdb-v${{ needs.build-x86.outputs.version }} + artifacts: "/tmp/releases/*/*" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index e8cb4bb..916d74b 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -47,12 +47,14 @@ main() { fi GDB_VERSION=$(get_version "${BUILD_DIRECTORY}/gdb_build/gdb/gdb --version |head -n1 |awk '{print \$4}'") GDBSERVER_VERSION=$(get_version "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver --version |head -n1 |awk '{print \$4}'") + version_number=$(echo "$GDB_VERSION" | cut -d"-" -f2) cp "${BUILD_DIRECTORY}/gdb_build/gdb/gdb" "${OUTPUT_DIRECTORY}/gdb${GDB_VERSION}" cp "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver" "${OUTPUT_DIRECTORY}/gdbserver${GDBSERVER_VERSION}" echo "[+] Finished building GDB ${CURRENT_ARCH}" echo ::set-output name=PACKAGED_NAME::"gdb${GDB_VERSION}" echo ::set-output name=PACKAGED_NAME_PATH::"/output/*" + echo ::set-output name=PACKAGED_VERSION::"${version_number}" } main From 349f0d7f3e464457af70001f5c9417f661d042a1 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 16:06:40 +0200 Subject: [PATCH 71/95] Updated GDB workflow --- .github/workflows/build-gdb.yml | 68 ++++++++++++++++----------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml index 81d1983..15208e8 100644 --- a/.github/workflows/build-gdb.yml +++ b/.github/workflows/build-gdb.yml @@ -123,42 +123,42 @@ jobs: name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} - create-release: - name: Create GDB & gdbserver Release - runs-on: ubuntu-latest - needs: [build-x86, build-x86_64, build-armhf, build-aarch64] - steps: - - name: Checkout - uses: actions/checkout@v2 + create-release: + name: Create GDB & gdbserver Release + runs-on: ubuntu-latest + needs: [build-x86, build-x86_64, build-armhf, build-aarch64] + steps: + - name: Checkout + uses: actions/checkout@v2 - - name: Prepare Environment - run: mkdir /tmp/releases + - name: Prepare Environment + run: mkdir /tmp/releases - - name: Download Artifacts - uses: actions/download-artifact@v2 - with: - path: /tmp/releases + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + path: /tmp/releases - - name: List Artifacts - run: ls -laR /tmp/releases + - name: List Artifacts + run: ls -laR /tmp/releases - - name: Tag Release - id: tag_release - run: | - set +e - if [ $(git tag "gdb-v${{ needs.build-x86.outputs.version }}") ];then - git push origin "gdb-v${{ needs.build-x86.outputs.version }}" - echo ::set-output name=NEW_RELEASE::"true" - else - echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" - fi + - name: Tag Release + id: tag_release + run: | + set +e + if [ $(git tag "gdb-v${{ needs.build-x86.outputs.version }}") ];then + git push origin "gdb-v${{ needs.build-x86.outputs.version }}" + echo ::set-output name=NEW_RELEASE::"true" + else + echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + fi - - name: Create Release - uses: ncipollo/release-action@v1 - if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} - with: - name: gdb-v${{ needs.build-x86.outputs.version }} - tag: gdb-v${{ needs.build-x86.outputs.version }} - artifacts: "/tmp/releases/*/*" - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Create Release + uses: ncipollo/release-action@v1 + if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} + with: + name: gdb-v${{ needs.build-x86.outputs.version }} + tag: gdb-v${{ needs.build-x86.outputs.version }} + artifacts: "/tmp/releases/*/*" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From c0f10cbaa1744109a32b853f7916cad6d2d0bfd1 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 16:26:10 +0200 Subject: [PATCH 72/95] Updated OpenSSH tag check --- .github/workflows/build-openssh.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-openssh.yml b/.github/workflows/build-openssh.yml index 4a120e8..cea4e49 100644 --- a/.github/workflows/build-openssh.yml +++ b/.github/workflows/build-openssh.yml @@ -111,12 +111,13 @@ jobs: id: tag_release run: | set +e - if [ $(git tag "openssh-v${{ needs.build-x86.outputs.version }}") ];then + if git rev-list "openssh-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for openssh-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "openssh-v${{ needs.build-x86.outputs.version }}" git push origin "openssh-v${{ needs.build-x86.outputs.version }}" echo ::set-output name=NEW_RELEASE::"true" - else - echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" fi - name: Create Release From c9effeebc193ad265b5832fa58204be074c5a552 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 16:38:56 +0200 Subject: [PATCH 73/95] Updated tag checks --- .github/workflows/build-gdb.yml | 9 +++++---- .github/workflows/build-nmap.yml | 9 +++++---- .github/workflows/build-socat.yml | 9 +++++---- .github/workflows/build-tcpdump.yml | 9 +++++---- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml index 15208e8..710af0d 100644 --- a/.github/workflows/build-gdb.yml +++ b/.github/workflows/build-gdb.yml @@ -146,12 +146,13 @@ jobs: id: tag_release run: | set +e - if [ $(git tag "gdb-v${{ needs.build-x86.outputs.version }}") ];then + if git rev-list "gdb-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for gdb-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "gdb-v${{ needs.build-x86.outputs.version }}" git push origin "gdb-v${{ needs.build-x86.outputs.version }}" echo ::set-output name=NEW_RELEASE::"true" - else - echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" fi - name: Create Release diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index 0c38912..93e1188 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -147,12 +147,13 @@ jobs: - name: Tag Release run: | set +e - if [ $(git tag "nmap-v${{ needs.build-x86.outputs.version }}") ];then + if git rev-list "nmap-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for nmap-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "nmap-v${{ needs.build-x86.outputs.version }}" git push origin "nmap-v${{ needs.build-x86.outputs.version }}" echo ::set-output name=NEW_RELEASE::"true" - else - echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" fi - name: Create Release diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index 545eb3d..3c8a4fd 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -139,12 +139,13 @@ jobs: id: tag_release run: | set +e - if [ $(git tag "socat-v${{ needs.build-x86.outputs.version }}") ];then + if git rev-list "socat-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for socat-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "socat-v${{ needs.build-x86.outputs.version }}" git push origin "socat-v${{ needs.build-x86.outputs.version }}" echo ::set-output name=NEW_RELEASE::"true" - else - echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" fi - name: Create Release diff --git a/.github/workflows/build-tcpdump.yml b/.github/workflows/build-tcpdump.yml index 5c6614e..12f3a05 100644 --- a/.github/workflows/build-tcpdump.yml +++ b/.github/workflows/build-tcpdump.yml @@ -110,12 +110,13 @@ jobs: - name: Tag Release run: | set +e - if [ $(git tag "tcpdump-v${{ needs.build-x86.outputs.version }}") ];then + if git rev-list "tcpdump-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for tcpdump-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "tcpdump-v${{ needs.build-x86.outputs.version }}" git push origin "tcpdump-v${{ needs.build-x86.outputs.version }}" echo ::set-output name=NEW_RELEASE::"true" - else - echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" fi - name: Create Release From bfdc8f494ae8f7b65f011f802fc316f179b6b398 Mon Sep 17 00:00:00 2001 From: takeshix <takeshix@adversec.com> Date: Mon, 19 Apr 2021 18:14:46 +0200 Subject: [PATCH 74/95] Updated README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2c0a061..c9666c4 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,13 @@ This repository includes prebuild static binaries and build-recipes for various The Linux versions are compiled with the musl-cross toolchain and the openssl-pm-snapshot fork of OpenSSL in order to support a wide range of SSL/TLS features (Warning: some of them are insecure!). -Compilation is done automatically with GitHub Actions. - -## Current Limitations +Compilation is done automatically with GitHub Actions. The binaries are uploaded to the [release section](https://github.com/ernw/static-toolbox/releases). The artifacts are also available in the artifacts of each GitHub Action. However, there are some limitations: * Downloading of build artifacts in GitHub Ations currently requires a GitHub account * Blobs in build artifacts are zipped by the GitHub frontend by default, even zip files themselves! Build artifact zips may contain other zip files. +* Build artifacts will expire after some time. + +Therefore, it is recommended to download the binaries from the release section. ## Building Status From dc233d4f74afc6f2cc0a0277f0bbc8eb1ab0a7a3 Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <najsc@amazon.com> Date: Wed, 5 Oct 2022 11:22:07 +0200 Subject: [PATCH 75/95] Bumped OpenSSH to V_9_1_P1 --- build/targets/build_openssh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/targets/build_openssh.sh b/build/targets/build_openssh.sh index e9ba48e..f8cebee 100755 --- a/build/targets/build_openssh.sh +++ b/build/targets/build_openssh.sh @@ -17,7 +17,7 @@ init_lib $1 build_openssh() { fetch "https://github.com/openssh/openssh-portable.git" "${BUILD_DIRECTORY}/openssh-portable" git cd "${BUILD_DIRECTORY}/openssh-portable" - git checkout V_8_6_P1 + git checkout V_9_1_P1 git clean -fdx autoreconf -i CC="gcc ${GCC_OPTS}" \ From c613b77803463bd326dae2a658dbd4a420eb4d70 Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <najsc@amazon.com> Date: Wed, 5 Oct 2022 12:21:05 +0200 Subject: [PATCH 76/95] Bumped gdb to gdb-12.1-release --- build/targets/build_gdb.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index 916d74b..2d00027 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -18,8 +18,7 @@ build_gdb() { fetch "$GIT_BINUTILS_GDB" "${BUILD_DIRECTORY}/binutils-gdb" git cd "${BUILD_DIRECTORY}/binutils-gdb/" || { echo "Cannot cd to ${BUILD_DIRECTORY}/binutils-gdb/"; exit 1; } git clean -fdx - git checkout gdb-10.1-release - + git checkout gdb-12.1-release CMD="CFLAGS=\"${GCC_OPTS}\" " CMD+="CXXFLAGS=\"${GXX_OPTS}\" " CMD+="LDFLAGS=\"-static\" " From 1431466df094f89c4d15c44bf10d0310e5f325c3 Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <najsc@amazon.com> Date: Wed, 5 Oct 2022 12:42:20 +0200 Subject: [PATCH 77/95] Updated Nmap release creation --- .github/workflows/build-nmap.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index 93e1188..b9823ca 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -147,10 +147,12 @@ jobs: - name: Tag Release run: | set +e - if git rev-list "nmap-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + git fetch --quiet --prune --unshallow --tags + if [[ $(git tag -l | grep nmap-v${{ needs.build-x86.outputs.version }} | wc -l) -gt 0 ]]; then echo "Tag for nmap-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." echo ::set-output name=NEW_RELEASE::"false" else + echo "Tag for nmap-v${{ needs.build-x86.outputs.version }} missing. Starting release creation." git tag "nmap-v${{ needs.build-x86.outputs.version }}" git push origin "nmap-v${{ needs.build-x86.outputs.version }}" echo ::set-output name=NEW_RELEASE::"true" From ecf0f96df9ef12eec2e92b5379bcc1ccbc8840f5 Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <najsc@amazon.com> Date: Wed, 5 Oct 2022 12:43:36 +0200 Subject: [PATCH 78/95] Updated install build compiler script --- build/02_install_build_compiler.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/02_install_build_compiler.sh b/build/02_install_build_compiler.sh index 15cb8c3..7e6fd97 100755 --- a/build/02_install_build_compiler.sh +++ b/build/02_install_build_compiler.sh @@ -3,7 +3,7 @@ if [ $# -ne 1 ];then echo "Missing arch" exit 1 fi -ARCH="${1,,}" +ARCH="${1}" case $ARCH in x86_64|i686|aarch64) ARCH="${ARCH}-linux-musl" From 04a22777912d86df30ab730e6c482c8921b57088 Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <najsc@amazon.com> Date: Wed, 5 Oct 2022 12:49:27 +0200 Subject: [PATCH 79/95] Updated install build compiler script --- build/02_install_build_compiler.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/build/02_install_build_compiler.sh b/build/02_install_build_compiler.sh index 7e6fd97..bb70c9e 100755 --- a/build/02_install_build_compiler.sh +++ b/build/02_install_build_compiler.sh @@ -1,4 +1,10 @@ #!/bin/bash + +function die(){ + echo "$1" + exit 1 +} + if [ $# -ne 1 ];then echo "Missing arch" exit 1 @@ -20,7 +26,8 @@ case $ARCH in ;; esac HOST=http://musl.cc +echo "Fetching ${HOST}/${ARCH}-cross.tgz" cd / -curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz -tar -xf ${ARCH}-cross.tgz -rm ${ARCH}-cross.tgz \ No newline at end of file +curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz || die "Failed to download build compiler package" +tar -xf ${ARCH}-cross.tgz || die "Failed to extract build compiler package" +rm ${ARCH}-cross.tgz || die "Failed to remove build compiler package" \ No newline at end of file From 5d920d97ab5c80ab1dd93b9051f925d5f4bbf040 Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <najsc@amazon.com> Date: Wed, 5 Oct 2022 12:59:56 +0200 Subject: [PATCH 80/95] Updated Nmap release creation --- .github/workflows/build-nmap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index b9823ca..d79a2f9 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -147,7 +147,7 @@ jobs: - name: Tag Release run: | set +e - git fetch --quiet --prune --unshallow --tags + git fetch --quiet --prune --tags if [[ $(git tag -l | grep nmap-v${{ needs.build-x86.outputs.version }} | wc -l) -gt 0 ]]; then echo "Tag for nmap-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." echo ::set-output name=NEW_RELEASE::"false" From 676eeb8f454eeab8207bb25b53453b43a389b4c5 Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <najsc@amazon.com> Date: Wed, 5 Oct 2022 13:14:00 +0200 Subject: [PATCH 81/95] Updated Nmap release creation --- .github/workflows/build-nmap.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index d79a2f9..bd6832d 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -145,6 +145,7 @@ jobs: run: ls -laR /tmp/releases - name: Tag Release + id: tag_release run: | set +e git fetch --quiet --prune --tags From a1cd885edc002e6ff8ca8a5f6831a07ae1786aa6 Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <najsc@amazon.com> Date: Wed, 5 Oct 2022 16:35:44 +0200 Subject: [PATCH 82/95] Updated workflow links --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c9666c4..ba52d22 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ The following table shows the building status for the current toolset. The follo | Tool | Status | | ---- | ------ | -|[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| -|[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| -|[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|| -|[GDB & gdbserver](https://github.com/ernw/static-toolbox/actions?query=workflow%3AGDB)|| -|[tcpdump](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| +|[Nmap](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| +|[OpenSSH](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| +|[socat](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22socat%22)|| +|[GDB & gdbserver](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3AGDB)|| +|[tcpdump](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| From bd887fa3fcae79d12f1232716b4b002ac333ffbf Mon Sep 17 00:00:00 2001 From: Niklaus Schiess <najsc@amazon.com> Date: Wed, 5 Oct 2022 16:39:04 +0200 Subject: [PATCH 83/95] Updated workflow links --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ba52d22..fff326a 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ The following table shows the building status for the current toolset. The follo | Tool | Status | | ---- | ------ | -|[Nmap](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| -|[OpenSSH](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| -|[socat](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22socat%22)|| -|[GDB & gdbserver](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3AGDB)|| -|[tcpdump](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| +|[Nmap](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| +|[OpenSSH](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| +|[socat](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22socat%22)|| +|[GDB & gdbserver](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3AGDB)|| +|[tcpdump](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| From 9a8f7c9e1a64cbb1007a9d6f5d3aaff1c9618319 Mon Sep 17 00:00:00 2001 From: hnzlmnn-ernw <83819013+hnzlmnn-ernw@users.noreply.github.com> Date: Thu, 9 Mar 2023 15:43:14 +0100 Subject: [PATCH 84/95] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fff326a..c9666c4 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ The following table shows the building status for the current toolset. The follo | Tool | Status | | ---- | ------ | -|[Nmap](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| -|[OpenSSH](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| -|[socat](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22socat%22)|| -|[GDB & gdbserver](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3AGDB)|| -|[tcpdump](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| +|[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| +|[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| +|[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|| +|[GDB & gdbserver](https://github.com/ernw/static-toolbox/actions?query=workflow%3AGDB)|| +|[tcpdump](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| From b34b0980ef4f838f374bc85ed98f439166f59917 Mon Sep 17 00:00:00 2001 From: Dennis Heinze <ttdennis@users.noreply.github.com> Date: Tue, 16 May 2023 09:29:08 +0200 Subject: [PATCH 85/95] Start strace --- .github/workflows/build-strace.yml | 158 +++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 .github/workflows/build-strace.yml diff --git a/.github/workflows/build-strace.yml b/.github/workflows/build-strace.yml new file mode 100644 index 0000000..f9b19c8 --- /dev/null +++ b/.github/workflows/build-strace.yml @@ -0,0 +1,158 @@ +name: strace +on: + workflow_dispatch +jobs: + build-x86: + name: Build strace x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + outputs: + version: ${{ steps.build_strace.outputs.PACKAGED_VERSION }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Build strace + id: build_strace + run: $GITHUB_WORKSPACE/build/targets/build_strace.sh x86 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_strace.outputs.PACKAGED_NAME }} + path: ${{ steps.build_strace.outputs.PACKAGED_NAME_PATH }} + + build-x86_64: + name: Build strace x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Build strace + id: build_strace + run: $GITHUB_WORKSPACE/build/targets/build_strace.sh x86_64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_strace.outputs.PACKAGED_NAME }} + path: ${{ steps.build_strace.outputs.PACKAGED_NAME_PATH }} + + build-armhf: + name: Build strace ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:arm-linux-musleabihf + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: http://musl.cc/ + TEMP: /tmp + USER: 0 + + - name: Build strace + id: build_strace + run: $GITHUB_WORKSPACE/build/targets/build_strace.sh armhf + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_strace.outputs.PACKAGED_NAME }} + path: ${{ steps.build_strace.outputs.PACKAGED_NAME_PATH }} + + build-aarch64: + name: Build strace AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: http://musl.cc/ + TEMP: /tmp + USER: 0 + + - name: Build strace + id: build_strace + run: $GITHUB_WORKSPACE/build/targets/build_strace.sh aarch64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_strace.outputs.PACKAGED_NAME }} + path: ${{ steps.build_strace.outputs.PACKAGED_NAME_PATH }} + + create-release: + name: Create strace Release + runs-on: ubuntu-latest + needs: [build-x86, build-x86_64, build-armhf, build-aarch64] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prepare Environment + run: mkdir /tmp/releases + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + path: /tmp/releases + + - name: List Artifacts + run: ls -laR /tmp/releases + + - name: Tag Release + id: tag_release + run: | + set +e + if git rev-list "strace-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for strace-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "strace-v${{ needs.build-x86.outputs.version }}" + git push origin "strace-v${{ needs.build-x86.outputs.version }}" + echo ::set-output name=NEW_RELEASE::"true" + fi + + - name: Create Release + uses: ncipollo/release-action@v1 + if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} + with: + name: strace-v${{ needs.build-x86.outputs.version }} + tag: strace-v${{ needs.build-x86.outputs.version }} + artifacts: "/tmp/releases/*/*" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 735d28224efda0bc465cd9060dffab731364c315 Mon Sep 17 00:00:00 2001 From: Dennis Heinze <ttdennis@users.noreply.github.com> Date: Tue, 16 May 2023 09:51:29 +0200 Subject: [PATCH 86/95] Finish strace build --- .github/workflows/build-strace.yml | 12 +++++++++++- build/targets/build_strace.sh | 21 +++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-strace.yml b/.github/workflows/build-strace.yml index f9b19c8..4d1192e 100644 --- a/.github/workflows/build-strace.yml +++ b/.github/workflows/build-strace.yml @@ -1,6 +1,8 @@ name: strace on: - workflow_dispatch + push: + branches: + - strace jobs: build-x86: name: Build strace x86 @@ -18,6 +20,14 @@ jobs: - name: Install testing dependencies run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: http://musl.cc/ + TEMP: /tmp + USER: 0 + - name: Build strace id: build_strace run: $GITHUB_WORKSPACE/build/targets/build_strace.sh x86 diff --git a/build/targets/build_strace.sh b/build/targets/build_strace.sh index 9b9c442..16fe54d 100755 --- a/build/targets/build_strace.sh +++ b/build/targets/build_strace.sh @@ -10,34 +10,39 @@ fi source $GITHUB_WORKSPACE/build/lib.sh init_lib "$1" +VERSION="v6.3" + build_strace() { fetch "https://github.com/strace/strace" "${BUILD_DIRECTORY}/strace" git cd "${BUILD_DIRECTORY}/strace" git clean -fdx - git checkout v5.7 + git checkout "$VERSION" ./bootstrap CMD="CFLAGS=\"${GCC_OPTS}\" " CMD+="CXXFLAGS=\"${GXX_OPTS}\" " CMD+="LDFLAGS=\"-static -pthread\" " - if [ "$CURRENT_ARCH" != "x86" ] && [ "$CURRENT_ARCH" != "x86_64" ];then - CMD+="CC_FOR_BUILD=\"/i686-linux-musl-cross/bin/i686-linux-musl-gcc\" " - CMD+="CPP_FOR_BUILD=\"/i686-linux-musl-cross/bin/i686-linux-musl-g++\" " + if [ "$CURRENT_ARCH" != "x86_64" ];then + CMD+="CC_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc\" " + CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ -E\" " + CMD+="CXX_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ -E\" " fi - CMD+="./configure --host=i486-linux-musl --target=$(get_host_triple)" + CMD+="./configure --disable-mpers --host=$(get_host_triple)" eval "$CMD" make CFLAGS="-w" -j4 - strip strace + strip "${BUILD_DIRECTORY}/strace/src/strace" } main() { build_strace local version - version=$(get_version "${BUILD_DIRECTORY}/strace/strace --version 2>&1 | head -n1 | awk '{print \$4}'") - cp "${BUILD_DIRECTORY}/strace/strace" "${OUTPUT_DIRECTORY}/strace" + version=$(get_version "${BUILD_DIRECTORY}/strace/src/strace -V 2>&1 | head -n1 | awk '{print \$4}'") + version_number=$(echo "$version" | cut -d"-" -f2) + cp "${BUILD_DIRECTORY}/strace/src/strace" "${OUTPUT_DIRECTORY}/strace${version}" echo "[+] Finished building strace ${CURRENT_ARCH}" echo ::set-output name=PACKAGED_NAME::"strace${version}" echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" + echo ::set-output name=PACKAGED_VERSION::"${version_number}" } main From 20ee0f7d17e0849a80ade3fc2d6deaf2a1a1d987 Mon Sep 17 00:00:00 2001 From: Dennis Heinze <ttdennis@users.noreply.github.com> Date: Fri, 19 May 2023 11:38:41 +0200 Subject: [PATCH 87/95] Clean + workflow dispatch --- .github/workflows/build-strace.yml | 4 +--- build/targets/build_strace.sh | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-strace.yml b/.github/workflows/build-strace.yml index 4d1192e..df90b2f 100644 --- a/.github/workflows/build-strace.yml +++ b/.github/workflows/build-strace.yml @@ -1,8 +1,6 @@ name: strace on: - push: - branches: - - strace + workflow_dispatch jobs: build-x86: name: Build strace x86 diff --git a/build/targets/build_strace.sh b/build/targets/build_strace.sh index 16fe54d..5853c98 100755 --- a/build/targets/build_strace.sh +++ b/build/targets/build_strace.sh @@ -24,7 +24,7 @@ build_strace() { if [ "$CURRENT_ARCH" != "x86_64" ];then CMD+="CC_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc\" " CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ -E\" " - CMD+="CXX_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ -E\" " + CMD+="CXX_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++\" " fi CMD+="./configure --disable-mpers --host=$(get_host_triple)" eval "$CMD" From 98edf482f8536b3990ed25e951862d0c779c5158 Mon Sep 17 00:00:00 2001 From: Dennis Heinze <ttdennis@users.noreply.github.com> Date: Fri, 19 May 2023 12:14:58 +0200 Subject: [PATCH 88/95] Fix deprecated set-output --- .github/workflows/build-strace.yml | 4 ++-- build/targets/build_strace.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-strace.yml b/.github/workflows/build-strace.yml index df90b2f..c5a426a 100644 --- a/.github/workflows/build-strace.yml +++ b/.github/workflows/build-strace.yml @@ -149,11 +149,11 @@ jobs: set +e if git rev-list "strace-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then echo "Tag for strace-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" + echo "NEW_RELEASE=false" >> $GITHUB_OUTPUT else git tag "strace-v${{ needs.build-x86.outputs.version }}" git push origin "strace-v${{ needs.build-x86.outputs.version }}" - echo ::set-output name=NEW_RELEASE::"true" + echo "NEW_RELEASE=true" >> $GITHUB_OUTPUT fi - name: Create Release diff --git a/build/targets/build_strace.sh b/build/targets/build_strace.sh index 5853c98..b87db5c 100755 --- a/build/targets/build_strace.sh +++ b/build/targets/build_strace.sh @@ -40,9 +40,9 @@ main() { cp "${BUILD_DIRECTORY}/strace/src/strace" "${OUTPUT_DIRECTORY}/strace${version}" echo "[+] Finished building strace ${CURRENT_ARCH}" - echo ::set-output name=PACKAGED_NAME::"strace${version}" - echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" - echo ::set-output name=PACKAGED_VERSION::"${version_number}" + echo "PACKAGED_NAME=strace${version}" >> $GITHUB_OUTPUT + echo "PACKAGED_NAME_PATH=${OUTPUT_DIRECTORY}/*" >> $GITHUB_OUTPUT + echo "PACKAGED_VERSION=${version_number}" >> $GITHUB_OUTPUT } main From e2515272f813ad7a2cd71c2f896e42230aead9b1 Mon Sep 17 00:00:00 2001 From: Dennis Heinze <ttdennis@users.noreply.github.com> Date: Mon, 22 May 2023 08:44:33 +0200 Subject: [PATCH 89/95] Fix deprecated set-output --- .github/workflows/build-nmap.yml | 4 ++-- .github/workflows/build-openssh.yml | 4 ++-- .github/workflows/build-socat.yml | 4 ++-- .github/workflows/build-tcpdump.yml | 4 ++-- build/targets/build_gdb.sh | 6 +++--- build/targets/build_openssh.sh | 6 +++--- build/targets/build_socat.sh | 6 +++--- build/targets/build_strace.sh | 4 ++-- build/targets/build_tcpdump.sh | 6 +++--- build/targets/build_tcpreplay.sh | 4 ++-- package/targets/nmap/package.sh | 10 +++++----- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index bd6832d..33f0d3d 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -151,12 +151,12 @@ jobs: git fetch --quiet --prune --tags if [[ $(git tag -l | grep nmap-v${{ needs.build-x86.outputs.version }} | wc -l) -gt 0 ]]; then echo "Tag for nmap-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" + echo "NEW_RELEASE=false" >> $GITHUB_OUTPUT else echo "Tag for nmap-v${{ needs.build-x86.outputs.version }} missing. Starting release creation." git tag "nmap-v${{ needs.build-x86.outputs.version }}" git push origin "nmap-v${{ needs.build-x86.outputs.version }}" - echo ::set-output name=NEW_RELEASE::"true" + echo "NEW_RELEASE=true" >> $GITHUB_OUTPUT fi - name: Create Release diff --git a/.github/workflows/build-openssh.yml b/.github/workflows/build-openssh.yml index cea4e49..de32095 100644 --- a/.github/workflows/build-openssh.yml +++ b/.github/workflows/build-openssh.yml @@ -113,11 +113,11 @@ jobs: set +e if git rev-list "openssh-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then echo "Tag for openssh-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" + echo "NEW_RELEASE=false" >> $GITHUB_OUTPUT else git tag "openssh-v${{ needs.build-x86.outputs.version }}" git push origin "openssh-v${{ needs.build-x86.outputs.version }}" - echo ::set-output name=NEW_RELEASE::"true" + echo "NEW_RELEASE=true" >> $GITHUB_OUTPUT fi - name: Create Release diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index 3c8a4fd..feef419 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -141,11 +141,11 @@ jobs: set +e if git rev-list "socat-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then echo "Tag for socat-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" + echo "NEW_RELEASE=false" >> $GITHUB_OUTPUT else git tag "socat-v${{ needs.build-x86.outputs.version }}" git push origin "socat-v${{ needs.build-x86.outputs.version }}" - echo ::set-output name=NEW_RELEASE::"true" + echo "NEW_RELEASE=true" >> $GITHUB_OUTPUT fi - name: Create Release diff --git a/.github/workflows/build-tcpdump.yml b/.github/workflows/build-tcpdump.yml index 12f3a05..080857c 100644 --- a/.github/workflows/build-tcpdump.yml +++ b/.github/workflows/build-tcpdump.yml @@ -112,11 +112,11 @@ jobs: set +e if git rev-list "tcpdump-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then echo "Tag for tcpdump-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" + echo "NEW_RELEASE=false" >> $GITHUB_OUTPUT else git tag "tcpdump-v${{ needs.build-x86.outputs.version }}" git push origin "tcpdump-v${{ needs.build-x86.outputs.version }}" - echo ::set-output name=NEW_RELEASE::"true" + echo "NEW_RELEASE=true" >> $GITHUB_OUTPUT fi - name: Create Release diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index 2d00027..658b7e7 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -51,9 +51,9 @@ main() { cp "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver" "${OUTPUT_DIRECTORY}/gdbserver${GDBSERVER_VERSION}" echo "[+] Finished building GDB ${CURRENT_ARCH}" - echo ::set-output name=PACKAGED_NAME::"gdb${GDB_VERSION}" - echo ::set-output name=PACKAGED_NAME_PATH::"/output/*" - echo ::set-output name=PACKAGED_VERSION::"${version_number}" + echo "PACKAGED_NAME=gdb${GDB_VERSION}" >> $GITHUB_OUTPUT + echo "PACKAGED_NAME_PATH=/output/*" >> $GITHUB_OUTPUT + echo "PACKAGED_VERSION=${version_number}" >> $GITHUB_OUTPUT } main diff --git a/build/targets/build_openssh.sh b/build/targets/build_openssh.sh index f8cebee..37a4c0a 100755 --- a/build/targets/build_openssh.sh +++ b/build/targets/build_openssh.sh @@ -49,9 +49,9 @@ main() { echo "[+] Finished building OpenSSH ${CURRENT_ARCH}" OPENSSH_VERSION=$(echo $OPENSSH_VERSION | sed 's/-//') - echo ::set-output name=PACKAGED_NAME::"${OPENSSH_VERSION}" - echo ::set-output name=PACKAGED_NAME_PATH::"/output/*" - echo ::set-output name=PACKAGED_VERSION::"${version_number}" + echo "PACKAGED_NAME=${OPENSSH_VERSION} >> $GITHUB_OUTPUT" + echo "PACKAGED_NAME_PATH=/output/* >> $GITHUB_OUTPUT" + echo "PACKAGED_VERSION=${version_number} >> $GITHUB_OUTPUT" } main diff --git a/build/targets/build_socat.sh b/build/targets/build_socat.sh index 51b1f72..d09b841 100755 --- a/build/targets/build_socat.sh +++ b/build/targets/build_socat.sh @@ -41,9 +41,9 @@ main() { cp "${BUILD_DIRECTORY}/socat/socat" "${OUTPUT_DIRECTORY}/socat${version}" echo "[+] Finished building socat ${CURRENT_ARCH}" - echo ::set-output name=PACKAGED_NAME::"socat${version}" - echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" - echo ::set-output name=PACKAGED_VERSION::"${version_number}" + echo "PACKAGED_NAME=socat${version}" >> $GITHUB_OUTPUT + echo "PACKAGED_NAME_PATH=${OUTPUT_DIRECTORY}/*" >> $GITHUB_OUTPUT + echo "PACKAGED_VERSION=${version_number}" >> $GITHUB_OUTPUT } main diff --git a/build/targets/build_strace.sh b/build/targets/build_strace.sh index 9b9c442..39eb5a6 100755 --- a/build/targets/build_strace.sh +++ b/build/targets/build_strace.sh @@ -36,8 +36,8 @@ main() { cp "${BUILD_DIRECTORY}/strace/strace" "${OUTPUT_DIRECTORY}/strace" echo "[+] Finished building strace ${CURRENT_ARCH}" - echo ::set-output name=PACKAGED_NAME::"strace${version}" - echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" + echo "PACKAGED_NAME=strace${version}" >> $GITHUB_OUTPUT + echo "PACKAGED_NAME_PATH=${OUTPUT_DIRECTORY}/*" >> $GITHUB_OUTPUT } main diff --git a/build/targets/build_tcpdump.sh b/build/targets/build_tcpdump.sh index fdab747..3c6f8d6 100755 --- a/build/targets/build_tcpdump.sh +++ b/build/targets/build_tcpdump.sh @@ -39,9 +39,9 @@ main() { cp "${BUILD_DIRECTORY}/tcpdump/tcpdump" "${OUTPUT_DIRECTORY}/tcpdump${version}" echo "[+] Finished building tcpdump ${CURRENT_ARCH}" - echo ::set-output name=PACKAGED_NAME::"tcpdump${version}" - echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" - echo ::set-output name=PACKAGED_VERSION::"${version_number}" + echo "PACKAGED_NAME=tcpdump${version}" >> $GITHUB_OUTPUT + echo "PACKAGED_NAME_PATH=${OUTPUT_DIRECTORY}/*" >> $GITHUB_OUTPUT + echo "PACKAGED_VERSION=${version_number}" >> $GITHUB_OUTPUT } main diff --git a/build/targets/build_tcpreplay.sh b/build/targets/build_tcpreplay.sh index eb46fcf..ed326b1 100755 --- a/build/targets/build_tcpreplay.sh +++ b/build/targets/build_tcpreplay.sh @@ -50,8 +50,8 @@ main() { cp "${BUILD_DIRECTORY}/tcpreplay/tcpreplay" "${OUTPUT_DIRECTORY}/tcpreplay" echo "[+] Finished building tcpreplay ${CURRENT_ARCH}" - echo ::set-output name=PACKAGED_NAME::"tcpreplay${version}" - echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" + echo "PACKAGED_NAME=tcpreplay${version}" + echo "PACKAGED_NAME_PATH=${OUTPUT_DIRECTORY}/*" } main diff --git a/package/targets/nmap/package.sh b/package/targets/nmap/package.sh index 85ca112..51f2d05 100755 --- a/package/targets/nmap/package.sh +++ b/package/targets/nmap/package.sh @@ -53,13 +53,13 @@ cd "$tmp_dir" TARBALL="nmap-${version}-${arch}-portable.tar.gz" tar czf "${output}/${TARBALL}" -C "$tmp_dir" . cp "${output}/${TARBALL}" /packaged -echo ::set-output name=PACKAGED_TARBALL::${TARBALL} -echo ::set-output name=PACKAGED_TARBALL_PATH::"/packaged/${TARBALL}" +echo "PACKAGED_TARBALL=${TARBALL}" >> $GITHUB_OUTPUT +echo "PACKAGED_TARBALL_PATH=/packaged/${TARBALL}" >> $GITHUB_OUTPUT ZIP="nmap-${version}-${arch}-portable.zip" zip -r -q "${output}/${ZIP}" . cp "${output}/${ZIP}" /packaged -echo ::set-output name=PACKAGED_ZIP::${ZIP} -echo ::set-output name=PACKAGED_ZIP_PATH::"/packaged/${ZIP}" +echo "PACKAGED_ZIP=${ZIP}" >> $GITHUB_OUTPUT +echo "PACKAGED_ZIP_PATH=/packaged/${ZIP}" >> $GITHUB_OUTPUT -echo ::set-output name=PACKAGED_VERSION::${version} \ No newline at end of file +echo "PACKAGED_VERSION=${version}" >> $GITHUB_OUTPUT \ No newline at end of file From fd09b1375d688127908ab903ba17e37dded4fe72 Mon Sep 17 00:00:00 2001 From: Dennis Heinze <ttdennis@users.noreply.github.com> Date: Mon, 22 May 2023 14:04:57 +0200 Subject: [PATCH 90/95] Add strace badge to readme --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fff326a..1918cc8 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,11 @@ The following table shows the building status for the current toolset. The follo | Tool | Status | | ---- | ------ | -|[Nmap](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| -|[OpenSSH](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| -|[socat](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22socat%22)|| -|[GDB & gdbserver](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3AGDB)|| -|[tcpdump](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| +|[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)|| +|[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|| +|[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|| +|[GDB & gdbserver](https://github.com/ernw/static-toolbox/actions?query=workflow%3AGDB)|| +|[tcpdump](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|| +|[strace](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22strace%22)|| + From 44979a970308679f363a7e1a153851acee29a2fe Mon Sep 17 00:00:00 2001 From: Dennis Heinze <ttdennis@users.noreply.github.com> Date: Thu, 25 May 2023 08:21:08 +0200 Subject: [PATCH 91/95] Start ppc implementation --- .github/workflows/build-socat.yml | 70 ++++++++++++++++++++++++++++++- build/install_deps_alpine.sh | 2 + build/lib.sh | 22 ++++++++++ build/targets/build_socat.sh | 2 +- 4 files changed, 93 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index feef419..882a1a2 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -1,6 +1,8 @@ name: socat on: - workflow_dispatch + push: + branches: + - socat-ppc jobs: build-x86: name: Build socat x86 @@ -116,10 +118,74 @@ jobs: name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} + build-ppc32: + name: Build socat powerpc32 + runs-on: ubuntu-latest + container: muslcc/x86_64:powerpc-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: http://musl.cc/ + TEMP: /tmp + USER: 0 + + - name: Build socat + id: build_socat + run: $GITHUB_WORKSPACE/build/targets/build_socat.sh ppc32 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} + + build-ppc64: + name: Build socat powerpc64 + runs-on: ubuntu-latest + container: muslcc/x86_64:powerpc64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: http://musl.cc/ + TEMP: /tmp + USER: 0 + + - name: Build socat + id: build_socat + run: $GITHUB_WORKSPACE/build/targets/build_socat.sh ppc64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} + create-release: name: Create socat Release runs-on: ubuntu-latest - needs: [build-x86, build-x86_64, build-armhf, build-aarch64] + needs: [build-x86, build-x86_64, build-armhf, build-aarch64, build-ppc32, build-ppc64] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/build/install_deps_alpine.sh b/build/install_deps_alpine.sh index 3f916b0..15b52b7 100755 --- a/build/install_deps_alpine.sh +++ b/build/install_deps_alpine.sh @@ -13,6 +13,8 @@ apk add \ libtool \ qemu-arm \ qemu-aarch64 \ + qemu-ppc \ + qemu-ppc64 \ file \ texinfo \ zip \ diff --git a/build/lib.sh b/build/lib.sh index 8107faa..3d09984 100755 --- a/build/lib.sh +++ b/build/lib.sh @@ -47,6 +47,10 @@ get_host_triple(){ host="arm-linux-musleabihf" elif [ "$CURRENT_ARCH" == "aarch64" ];then host="aarch64-linux-musl" + elif [ "$CURRENT_ARCH" == "ppc32" ];then + host="powerpc-linux-musl" + elif [ "$CURRENT_ARCH" == "ppc64" ];then + host="powerpc64-linux-musl" fi echo $host } @@ -145,6 +149,20 @@ get_version(){ else echo "qemu-aarch64 not found, skipping AARCH64 version checks." >&2 fi + elif [ "$CURRENT_ARCH" == "ppc32" ];then + if which qemu-ppc 1>&2 2>/dev/null;then + cmd="qemu-ppc ${cmd}" + version+=$(eval "$cmd") + else + echo "qemu-ppc not found, skipping ppc32 version checks." >&2 + fi + elif [ "$CURRENT_ARCH" == "ppc64" ];then + if which qemu-ppc64 1>&2 2>/dev/null;then + cmd="qemu-ppc64 ${cmd}" + version+=$(eval "$cmd") + else + echo "qemu-ppc64 not found, skipping ppc64 version checks." >&2 + fi else version+=$(eval "$cmd") fi @@ -214,6 +232,10 @@ lib_build_openssl(){ openssl_arch="linux-x86_64" elif [ "${CURRENT_ARCH}" == "aarch64" ];then openssl_arch="linux-generic64" + elif [ "${CURRENT_ARCH}" == "ppc32" ];then + openssl_arch="linux-ppc" + elif [ "${CURRENT_ARCH}" == "ppc64" ];then + openssl_arch="linux-ppc" fi CFLAGS="${GCC_OPTS}" \ ./Configure \ diff --git a/build/targets/build_socat.sh b/build/targets/build_socat.sh index d09b841..5550a88 100755 --- a/build/targets/build_socat.sh +++ b/build/targets/build_socat.sh @@ -4,7 +4,7 @@ if [ -z "$GITHUB_WORKSPACE" ];then exit 1 fi if [ "$#" -ne 1 ];then - echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" + echo "Usage: ${0} [x86|x86_64|armhf|aarch64|ppc32|ppc64]" echo "Example: ${0} x86_64" exit 1 fi From b322d1b36c556e57df7a5f6933b55063ca7460db Mon Sep 17 00:00:00 2001 From: Dennis Heinze <ttdennis@users.noreply.github.com> Date: Fri, 26 May 2023 09:17:44 +0200 Subject: [PATCH 92/95] Socat ppc and ppc64 build --- .github/workflows/build-socat.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index 882a1a2..bee15b4 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -1,8 +1,6 @@ name: socat on: - push: - branches: - - socat-ppc + workflow_dispatch jobs: build-x86: name: Build socat x86 From 6ea45868db55f33969b5f227a0279edbb6f2428b Mon Sep 17 00:00:00 2001 From: Benjamin Collet <benjamin@collet.eu> Date: Tue, 17 Dec 2024 20:02:35 +0100 Subject: [PATCH 93/95] Migrate CI to forgejo --- {.github => .forgejo}/workflows/build-gdb.yml | 0 .../workflows/build-nmap.yml | 0 .../workflows/build-openssh.yml | 0 .../workflows/build-socat.yml | 42 +++++++++---------- .../workflows/build-strace.yml | 0 .../workflows/build-tcpdump.yml | 0 6 files changed, 21 insertions(+), 21 deletions(-) rename {.github => .forgejo}/workflows/build-gdb.yml (100%) rename {.github => .forgejo}/workflows/build-nmap.yml (100%) rename {.github => .forgejo}/workflows/build-openssh.yml (100%) rename {.github => .forgejo}/workflows/build-socat.yml (89%) rename {.github => .forgejo}/workflows/build-strace.yml (100%) rename {.github => .forgejo}/workflows/build-tcpdump.yml (100%) diff --git a/.github/workflows/build-gdb.yml b/.forgejo/workflows/build-gdb.yml similarity index 100% rename from .github/workflows/build-gdb.yml rename to .forgejo/workflows/build-gdb.yml diff --git a/.github/workflows/build-nmap.yml b/.forgejo/workflows/build-nmap.yml similarity index 100% rename from .github/workflows/build-nmap.yml rename to .forgejo/workflows/build-nmap.yml diff --git a/.github/workflows/build-openssh.yml b/.forgejo/workflows/build-openssh.yml similarity index 100% rename from .github/workflows/build-openssh.yml rename to .forgejo/workflows/build-openssh.yml diff --git a/.github/workflows/build-socat.yml b/.forgejo/workflows/build-socat.yml similarity index 89% rename from .github/workflows/build-socat.yml rename to .forgejo/workflows/build-socat.yml index bee15b4..b23beea 100644 --- a/.github/workflows/build-socat.yml +++ b/.forgejo/workflows/build-socat.yml @@ -4,13 +4,13 @@ on: jobs: build-x86: name: Build socat x86 - runs-on: ubuntu-latest + runs-on: docker container: muslcc/x86_64:i686-linux-musl outputs: version: ${{ steps.build_socat.outputs.PACKAGED_VERSION }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh @@ -23,18 +23,18 @@ jobs: run: $GITHUB_WORKSPACE/build/targets/build_socat.sh x86 - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: https://code.forgejo.org/forgejo/upload-artifact@v4 with: name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} build-x86_64: name: Build socat x86_64 - runs-on: ubuntu-latest + runs-on: docker container: muslcc/x86_64:x86_64-linux-musl steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh @@ -47,18 +47,18 @@ jobs: run: $GITHUB_WORKSPACE/build/targets/build_socat.sh x86_64 - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: https://code.forgejo.org/forgejo/upload-artifact@v4 with: name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} build-armhf: name: Build socat ARMHF - runs-on: ubuntu-latest + runs-on: docker container: muslcc/x86_64:arm-linux-musleabihf steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh @@ -79,18 +79,18 @@ jobs: run: $GITHUB_WORKSPACE/build/targets/build_socat.sh armhf - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: https://code.forgejo.org/forgejo/upload-artifact@v4 with: name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} build-aarch64: name: Build socat AARCH64 - runs-on: ubuntu-latest + runs-on: docker container: muslcc/x86_64:aarch64-linux-musl steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh @@ -111,18 +111,18 @@ jobs: run: $GITHUB_WORKSPACE/build/targets/build_socat.sh aarch64 - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: https://code.forgejo.org/forgejo/upload-artifact@v4 with: name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} build-ppc32: name: Build socat powerpc32 - runs-on: ubuntu-latest + runs-on: docker container: muslcc/x86_64:powerpc-linux-musl steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh @@ -143,18 +143,18 @@ jobs: run: $GITHUB_WORKSPACE/build/targets/build_socat.sh ppc32 - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: https://code.forgejo.org/forgejo/upload-artifact@v4 with: name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} build-ppc64: name: Build socat powerpc64 - runs-on: ubuntu-latest + runs-on: docker container: muslcc/x86_64:powerpc64-linux-musl steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh @@ -175,24 +175,24 @@ jobs: run: $GITHUB_WORKSPACE/build/targets/build_socat.sh ppc64 - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: https://code.forgejo.org/forgejo/upload-artifact@v4 with: name: ${{ steps.build_socat.outputs.PACKAGED_NAME }} path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }} create-release: name: Create socat Release - runs-on: ubuntu-latest + runs-on: docker needs: [build-x86, build-x86_64, build-armhf, build-aarch64, build-ppc32, build-ppc64] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Prepare Environment run: mkdir /tmp/releases - name: Download Artifacts - uses: actions/download-artifact@v2 + uses: https://code.forgejo.org/forgejo/download-artifact@v4 with: path: /tmp/releases diff --git a/.github/workflows/build-strace.yml b/.forgejo/workflows/build-strace.yml similarity index 100% rename from .github/workflows/build-strace.yml rename to .forgejo/workflows/build-strace.yml diff --git a/.github/workflows/build-tcpdump.yml b/.forgejo/workflows/build-tcpdump.yml similarity index 100% rename from .github/workflows/build-tcpdump.yml rename to .forgejo/workflows/build-tcpdump.yml From ff74c3de0148b660651cf4e61c7c5889e57315a5 Mon Sep 17 00:00:00 2001 From: Benjamin Collet <benjamin@collet.eu> Date: Tue, 17 Dec 2024 21:01:36 +0100 Subject: [PATCH 94/95] Fix --- .forgejo/workflows/build-socat.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/build-socat.yml b/.forgejo/workflows/build-socat.yml index b23beea..090760e 100644 --- a/.forgejo/workflows/build-socat.yml +++ b/.forgejo/workflows/build-socat.yml @@ -7,13 +7,16 @@ jobs: runs-on: docker container: muslcc/x86_64:i686-linux-musl outputs: - version: ${{ steps.build_socat.outputs.PACKAGED_VERSION }} + version: "${{ steps.build_socat.outputs.PACKAGED_VERSION }}" steps: + - name: Install dependencies + run: sudo apk update && sudo apk add bash nodejs git-lfs + - name: Checkout uses: actions/checkout@v4 - - name: Install dependencies - run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + - name: Install build dependencies + run: sudo bash build/install_deps_alpine.sh - name: Install testing dependencies run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl @@ -33,6 +36,15 @@ jobs: runs-on: docker container: muslcc/x86_64:x86_64-linux-musl steps: + - name: Install dependencies + run: sudo apk update && sudo apk add bash nodejs git-lfs + + - name: Checkout + uses: actions/checkout@v4 + + - name: Install build dependencies + run: sudo bash build/install_deps_alpine.sh + - name: Checkout uses: actions/checkout@v4 From 574763abbaf7721de322cbb7eb1a0cd2aecf687e Mon Sep 17 00:00:00 2001 From: Benjamin Collet <benjamin@collet.eu> Date: Tue, 17 Dec 2024 21:08:26 +0100 Subject: [PATCH 95/95] fix --- .forgejo/workflows/build-socat.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build-socat.yml b/.forgejo/workflows/build-socat.yml index 090760e..6113268 100644 --- a/.forgejo/workflows/build-socat.yml +++ b/.forgejo/workflows/build-socat.yml @@ -5,7 +5,8 @@ jobs: build-x86: name: Build socat x86 runs-on: docker - container: muslcc/x86_64:i686-linux-musl + container: + image: muslcc/x86_64:i686-linux-musl outputs: version: "${{ steps.build_socat.outputs.PACKAGED_VERSION }}" steps: