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

netexec: release #3961

Merged
merged 2 commits into from
Oct 2, 2023
Merged
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
65 changes: 65 additions & 0 deletions packages/netexec/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=netexec
_pyver=3.11
pkgver=v1.0.0.r0.g72e42e9
pkgrel=1
groups=('blackarch' 'blackarch-scanner' 'blackarch-exploitation'
'blackarch-windows')
pkgdesc='A Windows / Active Directory environments pentest tool.'
arch=('any')
url='https://netexec.wiki/'
license=('BSD')
depends=('python' 'python-poetry')
makedepends=('git')
source=("$pkgname::git+https://github.com/Pennyw0rth/NetExec.git")
sha512sums=('SKIP')
install="$pkgname.install"

pkgver() {
cd $pkgname

git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
cd $pkgname

install -dm 755 "$pkgdir/usr/bin"
install -dm 755 "$pkgdir/usr/share/$pkgname"

install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

rm -rf LICENSE .github .git* .dockerignore Dockerfile Makefile *.nix

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

cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
poetry config cache-dir "/usr/share/$pkgname"
poetry env use /usr/share/$pkgname/virtualenvs/*/bin/python$_pyver \\
--directory /usr/share/netexec
poetry run --directory "/usr/share/$pkgname" $pkgname "\$@"
EOF

cat > "$pkgdir/usr/bin/nxc" << EOF
#!/bin/sh
poetry config cache-dir "/usr/share/$pkgname"
poetry env use /usr/share/$pkgname/virtualenvs/*/bin/python$_pyver \\
--directory /usr/share/netexec
poetry run --directory "/usr/share/$pkgname" nxc "\$@"
EOF

cat > "$pkgdir/usr/bin/nxcdb" << EOF
#!/bin/sh
poetry config cache-dir "/usr/share/$pkgname"
poetry env use /usr/share/$pkgname/virtualenvs/*/bin/python$_pyver \\
--directory /usr/share/netexec
poetry run --directory "/usr/share/$pkgname" nxcdb "\$@"
EOF

chmod +x "$pkgdir/usr/bin/$pkgname" "$pkgdir/usr/bin/nxc" \
"$pkgdir/usr/bin/nxcdb"
}

11 changes: 11 additions & 0 deletions packages/netexec/netexec.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
post_install() {
set -e
cd /usr/share/netexec
poetry config cache-dir /usr/share/netexec
poetry install --no-cache
}

post_upgrade() {
post_install "$@"
}