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

roadtools: add package #4366

Merged
merged 2 commits into from
Nov 23, 2024
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
4 changes: 4 additions & 0 deletions lists/to-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
roadlib
roadrecon
roadoidc
roadtx
123 changes: 123 additions & 0 deletions packages/roadtools/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=roadtools
_pkgbase=ROADtools
pkgname=('roadlib' 'roadrecon' 'roadoidc' 'roadtx')
pkgver=323.bbd706c
pkgrel=1
pkgdesc='Azure AD and O365 exploration framework'
arch=('any')
groups=('blackarch' 'blackarch-networking' 'blackarch-recon')
url='https://github.com/dirkjanm/ROADtools'
license=('MIT')
makedepends=('python-build' 'python-pip' 'git' 'npm')
source=("git+https://github.com/dirkjanm/$_pkgbase.git")
sha512sums=('SKIP')

pkgver() {
cd $_pkgbase

( 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)"
)
}

build() {
cd "$_pkgbase/roadlib"

python -m build --wheel --outdir="$startdir/dist"

cd "../roadrecon/frontend"

npm install
npm run build

cd ".."

python -m build --wheel --outdir="$startdir/dist"

cd "../roadtx"

python -m build --wheel --outdir="$startdir/dist"
}

package_roadlib() {
depends=('python' 'python-adal' 'python-sqlalchemy' 'python-pyjwt')

cd "$_pkgbase/roadlib"

pip install \
--verbose \
--disable-pip-version-check \
--no-warn-script-location \
--ignore-installed \
--no-compile \
--no-deps \
--root="$pkgdir" \
--prefix=/usr \
--no-index \
--find-links="file://$startdir/dist" \
$pkgname
}

package_roadoidc() {
depends=('python' 'roadlib' 'roadtx' 'python-flask' 'python-cryptography' 'python-requests' 'python-werkzeug')

cd "$_pkgbase/roadoidc"

install -dm 755 "$pkgdir/usr/bin"
install -Dm 644 requirements.txt "$pkgdir/usr/share/$pkgname/requirements.txt"

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

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

chmod a+x "$pkgdir/usr/bin/genconfig"
}

package_roadrecon() {
depends=('python' 'roadlib' 'python-flask' 'python-sqlalchemy'
'python-marshmallow' 'python-flask-sqlalchemy'
'python-flask-marshmallow' 'python-flask-cors'
'python-marshmallow-sqlalchemy' 'python-aiohttp')

pip install \
--verbose \
--disable-pip-version-check \
--no-warn-script-location \
--ignore-installed \
--no-compile \
--no-deps \
--root="$pkgdir" \
--prefix=/usr \
--no-index \
--find-links="file://$startdir/dist" \
$pkgname
}

package_roadtx() {
depends=('python' 'python-requests' 'python-selenium' 'python-selenium-wire' 'python-pyotp' 'python-pycryptodomex' 'python-blinker')

cd "$_pkgbase/roadtx"

pip install \
--verbose \
--disable-pip-version-check \
--no-warn-script-location \
--ignore-installed \
--no-compile \
--no-deps \
--root="$pkgdir" \
--prefix=/usr \
--no-index \
--find-links="file://$startdir/dist" \
$pkgname
}

Loading