From dd16fd34468f306369ccf30d524093e86baf2a0b Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 9 Nov 2024 19:57:21 +0100 Subject: [PATCH 1/5] platypus: add package Close https://github.com/BlackArch/blackarch/issues/3107 --- packages/platypus/PKGBUILD | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 packages/platypus/PKGBUILD diff --git a/packages/platypus/PKGBUILD b/packages/platypus/PKGBUILD new file mode 100644 index 00000000000..dc90d48282f --- /dev/null +++ b/packages/platypus/PKGBUILD @@ -0,0 +1,72 @@ +# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). +# See COPYING for license details. + +pkgname=platypus +_pkgname=Platypus +pkgver=v1.5.1.r134.g2c1f71b +pkgrel=1 +pkgdesc='A modern multiple reverse shell sessions manager written in go.' +arch=('x86_64' 'aarch64') +groups=('blackarch' 'blackarch-backdoor') +url='https://github.com/WangYihang/Platypus ' +license=('LGPL3') +depends=('axel' 'unarchiver' 'upx') +makedepends=('git' 'go' 'yarn' 'go-bindata' 'python' 'nodejs') +source=("git+https://github.com/WangYihang/$_pkgname.git") +sha512sums=('SKIP') + +pkgver() { + cd $_pkgname + + ( set -o pipefail + git describe --long --tags --abbrev=7 2>/dev/null | + sed 's/\([^-]*-g\)/r\1/;s/-/./g' || + printf "%s.%s" "$(git rev-list --count HEAD)" \ + "$(git rev-parse --short=7 HEAD)" + ) +} + +build() { + cd $_pkgname + + cd web/frontend && yarn && yarn build && cd ../../ + cd web/ttyd && yarn && yarn build && cd ../../ + go-bindata -pkg resource -o ./internal/utils/resource/resource.go ./internal/runtime/... ./web/ttyd/dist/... ./web/frontend/build/... + + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + GOPATH="$srcdir" go mod download + GOPATH="$srcdir" go build \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -ldflags "-s -w" \ + -o $pkgname-admin cmd/$pkgname-admin/main.go + GOPATH="$srcdir" go build \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -ldflags "-s -w" \ + -o $pkgname-agent cmd/$pkgname-agent/main.go + GOPATH="$srcdir" go build \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -ldflags "-s -w" \ + -o $pkgname-server cmd/$pkgname-server/main.go +} + +package() { + cd $_pkgname + + install -Dm 755 $pkgname-admin "$pkgdir/usr/bin/$pkgname-admin" + install -Dm 755 $pkgname-agent "$pkgdir/usr/bin/$pkgname-agent" + install -Dm 755 $pkgname-server "$pkgdir/usr/bin/$pkgname-server" + install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md +} + From e3220652fa811973bcedbaacc8b9f43ff6d02d36 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 9 Nov 2024 19:57:59 +0100 Subject: [PATCH 2/5] Update to-release --- lists/to-release | 1 + 1 file changed, 1 insertion(+) diff --git a/lists/to-release b/lists/to-release index e69de29bb2d..f093bd49146 100644 --- a/lists/to-release +++ b/lists/to-release @@ -0,0 +1 @@ +platypus From 63204ba9815d8b43e525c01be3103cb38e033c9e Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 9 Nov 2024 22:21:08 +0100 Subject: [PATCH 3/5] Update to-release --- lists/to-release | 1 + 1 file changed, 1 insertion(+) diff --git a/lists/to-release b/lists/to-release index f093bd49146..a1b49565799 100644 --- a/lists/to-release +++ b/lists/to-release @@ -1 +1,2 @@ platypus +go-bindata From 1f18df5f5c7ad0a7ece130baf0a3abffb30cf6e0 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 9 Nov 2024 22:22:47 +0100 Subject: [PATCH 4/5] go-bindata: add package --- packages/go-bindata/PKGBUILD | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/go-bindata/PKGBUILD diff --git a/packages/go-bindata/PKGBUILD b/packages/go-bindata/PKGBUILD new file mode 100644 index 00000000000..b91f3291d27 --- /dev/null +++ b/packages/go-bindata/PKGBUILD @@ -0,0 +1,39 @@ +# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). +# See COPYING for license details. + +pkgname=go-bindata +pkgver=4.0.2 +pkgrel=1 +pkgdesc='A small utility which generates Go code from any file.' +arch=('x86_64') +url='https://github.com/kevinburke/go-bindata' +license=('custom:CC0') +depends=('glibc') +makedepends=('go') +source=("$url/archive/refs/tags/v$pkgver.tar.gz") +sha512sums=('4d92510d967bcac7e05eb5fd6e7bb6aa3d90550ac1c72adf56bdfbdd5e9f59703b65d24ec21f9b9f5d1033748b1f911830b177b845405008e6f5c41ab64282b9') + +prepare(){ + cd "$pkgname-$pkgver" + + mkdir -p build/ +} + +build() { + cd "$pkgname-$pkgver" + + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + go build -o build ./$pkgname +} + +package() { + cd "$pkgname-$pkgver" + + install -Dm755 "build/$pkgname" "$pkgdir/usr/bin/$pkgname" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + From 06331364795c79cff23455fbccd9fd118472d9bf Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 9 Nov 2024 22:25:54 +0100 Subject: [PATCH 5/5] Update PKGBUILD --- packages/platypus/PKGBUILD | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/platypus/PKGBUILD b/packages/platypus/PKGBUILD index dc90d48282f..6343ba33d6e 100644 --- a/packages/platypus/PKGBUILD +++ b/packages/platypus/PKGBUILD @@ -8,7 +8,7 @@ pkgrel=1 pkgdesc='A modern multiple reverse shell sessions manager written in go.' arch=('x86_64' 'aarch64') groups=('blackarch' 'blackarch-backdoor') -url='https://github.com/WangYihang/Platypus ' +url='https://github.com/WangYihang/Platypus' license=('LGPL3') depends=('axel' 'unarchiver' 'upx') makedepends=('git' 'go' 'yarn' 'go-bindata' 'python' 'nodejs') @@ -64,9 +64,9 @@ build() { package() { cd $_pkgname - install -Dm 755 $pkgname-admin "$pkgdir/usr/bin/$pkgname-admin" - install -Dm 755 $pkgname-agent "$pkgdir/usr/bin/$pkgname-agent" - install -Dm 755 $pkgname-server "$pkgdir/usr/bin/$pkgname-server" + install -Dm 755 "$pkgname-admin" "$pkgdir/usr/bin/$pkgname-admin" + install -Dm 755 "$pkgname-agent" "$pkgdir/usr/bin/$pkgname-agent" + install -Dm 755 "$pkgname-server" "$pkgdir/usr/bin/$pkgname-server" install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md }