summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksandr Knyshuk2023-07-31 22:47:07 +0300
committerOleksandr Knyshuk2023-07-31 22:47:07 +0300
commit8b9fe1fbdd35b402a21291ee2576ffa1aba7dc92 (patch)
tree443b6b16b55fceb425ae0fe8fccb5e6d8c3ba710
downloadaur-havoc-c2-git.tar.gz
initial commit
Signed-off-by: Oleksandr Knyshuk <kigen745@gmail.com>
-rw-r--r--.SRCINFO36
-rw-r--r--PKGBUILD48
-rw-r--r--havoc-c2-git.install9
-rw-r--r--havoc_runner.sh17
4 files changed, 110 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..359782bb9898
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,36 @@
+pkgbase = havoc-c2-git
+ pkgdesc = Modern and malleable post-exploitation command and control framework
+ pkgver = r619.f163210
+ pkgrel = 1
+ url = https://havocframework.com/
+ install = havoc-c2-git.install
+ arch = x86_64
+ license = GPL3
+ makedepends = git
+ makedepends = base-devel
+ makedepends = cmake
+ depends = openssl
+ depends = qt5-base
+ depends = qt5-websockets
+ depends = python3
+ depends = fontconfig
+ depends = gtest
+ depends = spdlog
+ depends = boost
+ depends = boost-libs
+ depends = ncurses
+ depends = gdbm
+ depends = readline
+ depends = libffi
+ depends = sqlite
+ depends = bzip2
+ depends = nasm
+ depends = mingw-w64-gcc
+ depends = go
+ depends = mesa
+ depends = glu
+ optdepends = qt5-wayland: wayland support
+ source = git+https://github.com/HavocFramework/Havoc.git#branch=dev
+ sha256sums = SKIP
+
+pkgname = havoc-c2-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e92511aa9483
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Oleksandr Knyshuk <kigen745 at gmail dot com>
+
+_pkgname=Havoc
+pkgname=havoc-c2-git
+pkgver=r619.f163210
+pkgrel=1
+pkgdesc="Modern and malleable post-exploitation command and control framework"
+arch=('x86_64')
+url="https://havocframework.com/"
+license=('GPL3')
+depends=('openssl' 'qt5-base' 'qt5-websockets' 'python3' 'fontconfig' 'gtest'
+ 'spdlog' 'boost' 'boost-libs' 'ncurses' 'gdbm' 'readline' 'libffi'
+ 'sqlite' 'bzip2' 'nasm' 'mingw-w64-gcc' 'go' 'mesa' 'glu')
+makedepends=('git' 'base-devel' 'cmake')
+optdepends=('qt5-wayland: wayland support')
+source=('git+https://github.com/HavocFramework/Havoc.git#branch=dev')
+install='havoc-c2-git.install'
+sha256sums=('SKIP')
+
+pkgver() {
+ cd $_pkgname
+ ( set -o pipefail
+ git describe --long --abbrev=7 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
+ )
+}
+
+prepare() {
+ cd "$_pkgname/client"
+ if [ -d "Modules" ]; then echo "Modules installed"; else git clone https://github.com/HavocFramework/Modules; fi
+ cd ../teamserver
+ go mod download golang.org/x/sys
+ go mod download github.com/ugorji/go
+}
+
+build() {
+ cd $_pkgname
+ sed -i '/sudo/d' makefile && sed -i '/apt/d' teamserver/Install.sh
+ make all
+}
+
+package() {
+ install -d "$pkgdir"/{opt,usr/bin,usr/share/licenses}
+ cp -r $_pkgname "$pkgdir"/opt/
+ rm -rf "$pkgdir"/opt/"$_pkgname"/assets
+ install -Dm755 ../havoc_runner.sh "${pkgdir}"/usr/bin/havoc
+ install -Dm644 "$_pkgname"/LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
+}
diff --git a/havoc-c2-git.install b/havoc-c2-git.install
new file mode 100644
index 000000000000..bc7c97c43427
--- /dev/null
+++ b/havoc-c2-git.install
@@ -0,0 +1,9 @@
+post_install() {
+ echo '################################################################################'
+ echo ' execute "sudo setcap 'cap_net_bind_service=+ep' /opt/Havoc/havoc" to run the '
+ echo ' server as a regular user. also, you may want to chown /opt/Havoc recursively, '
+ echo ' as for now havoc has to be launched from /opt/Havoc only: I mitigate this by '
+ echo ' placing a script in /usr/bin that uses pushd & popd just to launch the binary '
+ echo ' it is a hacky workaroud, but it works until 5pider fixes mainstream '
+ echo '################################################################################'
+} \ No newline at end of file
diff --git a/havoc_runner.sh b/havoc_runner.sh
new file mode 100644
index 000000000000..6a2dd435808a
--- /dev/null
+++ b/havoc_runner.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+# check if the havoc binary exists in the specified directory
+if [[ -x /opt/Havoc/havoc ]]; then
+ # save the current directory to return later
+ original_dir=$(pwd)
+
+ # change directory to /opt/Havoc and execute havoc binary with all the arguments
+ pushd /opt/Havoc > /dev/null
+ ./havoc "$@"
+
+ # return to the original directory
+ popd > /dev/null
+else
+ echo "havoc binary not found in /opt/Havoc"
+ exit 1
+fi