Skip to content

Commit

Permalink
Update PKGBUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
D3vil0p3r committed Nov 12, 2024
1 parent 387115d commit 92a0496
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 47 deletions.
17 changes: 5 additions & 12 deletions packages/empire/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# See COPYING for license details.

pkgname=empire
pkgver=v5.11.5.r0.gee6526b
pkgver=v5.11.7.r0.g8f41087
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'
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
39 changes: 7 additions & 32 deletions packages/empire/empire.install
Original file line number Diff line number Diff line change
@@ -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
}
5 changes: 2 additions & 3 deletions packages/python-md2pdf/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 92a0496

Please sign in to comment.