Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empire: fix issues #4307

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lists/to-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
empire
python-md2pdf
python-obfuscator
40 changes: 28 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=3458.8f41087f
pkgver=v5.11.7.r0.g8f41087
pkgrel=1
epoch=2
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 All @@ -28,18 +28,19 @@ depends=('python' 'python-urllib3' 'python-requests' 'python-iptools' 'tk'
'python-constantly' 'python-ecdsa' 'python-fastapi' 'python-greenlet'
'python-h11' 'python-hyperlink' 'python-idna' 'python-iniconfig'
'python-importlib-metadata' 'python-incremental' 'python-isort'
'python-itsdangerous' 'python-markupsafe' 'python-mypy_extensions'
'python-numpy' 'python-packaging' 'python-passlib' 'python-pathspec'
'python-platformdirs' 'python-pluggy' 'python-ply' 'python-pyasn1'
'python-pyasn1-modules' 'python-pycparser' 'python-pycryptodome'
'python-pygame' 'python-engineio' 'python-python-multipart'
'python-itsdangerous' 'python-markupsafe' 'python-md2pdf' 'python-mypy_extensions'
'python-numpy' 'python-obfuscator' 'python-packaging' 'python-passlib'
'python-pathspec' 'python-platformdirs' 'python-pluggy' 'python-ply'
'python-pyasyncore' 'python-pyasn1' 'python-pyasn1-modules' 'python-pycparser'
'python-pycryptodome' 'python-pygame' 'python-engineio' 'python-python-multipart'
'python-pyvnc' 'python-rsa' 'python-ruff' 'python-secretsocks'
'python-service-identity' 'python-sniffio' 'python-starlette'
'python-stone' 'python-toml' 'python-tomli' 'python-twisted'
'python-service-identity' 'python-sniffio' 'python-starlette' 'python-stix2'
'python-stone' 'python-tabulate' 'python-toml' 'python-tomli' 'python-twisted'
'python-typing_extensions' 'python-wcwidth' 'python-websocket-client'
'python-websockets' 'python-werkzeug' 'python-zipp' 'websockify'
'python-zope-interface' 'uvicorn')
'python-zope-interface' 'mariadb' 'uvicorn')
makedepends=('git')
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')
Expand All @@ -50,14 +51,21 @@ sha512sums=('SKIP'
pkgver() {
cd $pkgname

echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
( 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)"
)
}

prepare() {
cd $pkgname

# need by empire
cp -r "$srcdir/pyOpenSSL-22.0.0/src/OpenSSL" OpenSSL

git submodule update --init --recursive
}

package() {
Expand All @@ -73,6 +81,14 @@ package() {

cp -a * "$pkgdir/usr/share/$pkgname/"

cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python empire.py "\$@"
EOF

chmod +x "$pkgdir/usr/bin/$pkgname"

cat > "$pkgdir/usr/bin/$pkgname-server" << EOF
#!/bin/sh
cd /usr/share/$pkgname
Expand Down
9 changes: 9 additions & 0 deletions packages/empire/empire.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

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
}
35 changes: 35 additions & 0 deletions packages/python-md2pdf/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-md2pdf
_pkgname=${pkgname#python-}
pkgver=1.0.1
pkgrel=1
pkgdesc='Python-based Markdown to PDF converter.'
arch=('any')
url='https://pypi.org/project/md2pdf'
license=('MIT')
depends=('python' 'python-weasyprint' 'python-docopt' 'python-markdown2')
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
}

build() {
cd "$_pkgname-$pkgver"

python setup.py build
}

package() {
cd "$_pkgname-$pkgver"

python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

29 changes: 29 additions & 0 deletions packages/python-obfuscator/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-obfuscator
_pkgname=${pkgname//-/_}
pkgver=0.0.2
pkgrel=1
pkgdesc='Python-based obfuscator.'
arch=('any')
url='https://github.com/davidteather/python-obfuscator'
license=('MIT')
depends=('python' 'python-regex')
makedepends=('python-setuptools')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('fb709bd3817444f3ab8a087b0db5e592285e738f96521974d69af833919b0531a0f3f63b3bae78fccff1928af7cedd768b7c2117d895fd5dab13553c8008e714')

build() {
cd "$_pkgname-$pkgver"

python setup.py build
}

package() {
cd "$_pkgname-$pkgver"

python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

Loading