From ce0da7abfbd181474897c93c6d24e48826c6f4ad Mon Sep 17 00:00:00 2001 From: Antonio Date: Mon, 21 Oct 2024 14:02:56 +0200 Subject: [PATCH] Update PKGBUILD --- packages/empire/PKGBUILD | 15 ++++--------- packages/empire/empire.install | 39 ++++++--------------------------- packages/python-md2pdf/PKGBUILD | 5 ++--- 3 files changed, 13 insertions(+), 46 deletions(-) diff --git a/packages/empire/PKGBUILD b/packages/empire/PKGBUILD index eaa835a9261..4e285e09612 100644 --- a/packages/empire/PKGBUILD +++ b/packages/empire/PKGBUILD @@ -6,8 +6,8 @@ pkgver=v5.11.5.r0.gee6526b pkgrel=1 epoch=3 pkgdesc='A PowerShell and Python post-exploitation agent.' -groups=('blackarch' 'blackarch-automation') arch=('any') +groups=('blackarch' 'blackarch-automation') url='https://github.com/BC-SECURITY/Empire' license=('BSD') depends=('python' 'python-urllib3' 'python-requests' 'python-iptools' 'tk' @@ -40,15 +40,13 @@ depends=('python' 'python-urllib3' 'python-requests' 'python-iptools' 'tk' 'python-websockets' 'python-werkzeug' 'python-zipp' 'websockify' 'python-zope-interface' 'mariadb' 'uvicorn') makedepends=('git') -install='empire.install' +install="empire.install" source=("$pkgname::git+https://github.com/BC-SECURITY/Empire.git" 'https://files.pythonhosted.org/packages/35/d3/d6a9610f19d943e198df502ae660c6b5acf84cc3bc421a2aa3c0fb6b21d1/pyOpenSSL-22.0.0.tar.gz' - 'setup_database.py.patch' - 'empire.install') + 'setup_database.py.patch') sha512sums=('SKIP' '3d7695f27b7909eb82f05527ab7551fe90a85a70f20ea980293b59672a62f9b015966180407fa0786e94b01ad1d1acfaa7d40426bb63410efd24a144e559e2f0' - '9ffc3dc5d6a1dfd5b71cd22a0878a0231958938cb939e5fda5467c301fb4837ff96a299c2cbf2b2cc232fd8dd340c9086130e1067870c8c4272d7cc05e3954b4' - '22eae94614fa5fee5effb9c03160b307d1d43f0dbd4a68011cdc66c2437119c94e80f3efa98fa92b9fb061a12b960f6d0598c9f9420714ad3c16c18f54ce88e6') + '9ffc3dc5d6a1dfd5b71cd22a0878a0231958938cb939e5fda5467c301fb4837ff96a299c2cbf2b2cc232fd8dd340c9086130e1067870c8c4272d7cc05e3954b4') pkgver() { cd $pkgname @@ -64,11 +62,6 @@ pkgver() { prepare() { cd $pkgname - # Prevent invoking git submodule update on install directory since no git dir - sed -i "s/auto_update: true/auto_update: false/g" ./empire/server/config.yaml - # Prevent invoking git clone on install directory due to permission denied - sed -i '/starkiller:/,/enabled:/s/enabled: true/enabled: false/' ./empire/server/config.yaml - # need by empire cp -r "$srcdir/pyOpenSSL-22.0.0/src/OpenSSL" OpenSSL diff --git a/packages/empire/empire.install b/packages/empire/empire.install index 0ee64f73a9f..2875c5c4483 100644 --- a/packages/empire/empire.install +++ b/packages/empire/empire.install @@ -1,34 +1,9 @@ #!/bin/sh -post_install() { - set -e - echo " -=================================================================== - POWERSHELL EMPIRE DATABASE INITIALIZATION -=================================================================== -" -# Find the PIDs of processes using port 3306, and remove duplicates -pids=$(sudo ss -tulnp | grep ':3306' | awk '{print $7}' | cut -d',' -f2 | cut -d'=' -f2 | sort -u) - -# Check if any PIDs were found -if [ -n "$pids" ]; then - echo "Found processes using port 3306: $pids" - for pid in $pids; do - echo "Killing process with PID $pid..." - sudo kill -9 "$pid" - echo "Process $pid has been killed." - done -fi -echo "Initializing MariaDB..." -sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql -echo "Enabling mariadb systemctl service..." -sudo systemctl enable --now mariadb -echo "Creating empire_user..." -sudo mariadb -u root -e "CREATE USER IF NOT EXISTS 'empire_user'@'localhost' IDENTIFIED BY 'empire_password';" || true -sudo mariadb -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'empire_user'@'localhost' WITH GRANT OPTION;" || true -sudo mariadb -u root -e "FLUSH PRIVILEGES;" || true -} - -post_upgrade() { - post_install "$@" -} +post_remove() { + # Check if the directory exists to avoid errors if it doesn't + if [[ -d /usr/share/empire ]]; then + rm -rf /usr/share/empire + echo "Removed /usr/share/empire" + fi +} \ No newline at end of file diff --git a/packages/python-md2pdf/PKGBUILD b/packages/python-md2pdf/PKGBUILD index efab3838aff..daf6ae52b2b 100644 --- a/packages/python-md2pdf/PKGBUILD +++ b/packages/python-md2pdf/PKGBUILD @@ -10,16 +10,15 @@ arch=('any') url='https://pypi.org/project/md2pdf' license=('MIT') depends=('python' 'python-weasyprint' 'python-docopt' 'python-markdown2') -makedepends=('python-setuptools') +makedepends=('python-setuptools' 'python-pip') options=(!emptydirs) source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz") sha512sums=('6e86dabb235f35e572b08cf5fcec02b9e2afce70f63ce40e53b4222782a6245df00b75af0b17c6000651dddda66d4bb03a9a8b5350d82d9967aa36ec6af9d8bd') prepare() { cd "$_pkgname-$pkgver" - + sed -i 's/find_packages()/find_packages(exclude=["tests*"])/g' setup.py - cat setup.py } build() {