platforms/qemu and platforms/proxmox each have their own lab.sh and lab.conf; content/ holds everything shared (roles, seed, site, helpers). The dispatcher, preflight and command implementations are common and take platform differences from the backend. Proxmox backend: qm create with q35/SATA/e1000, ISOs and seed ISOs in an ISO storage, provisioning over qm guest exec (no Python packages needed on the host), template + clone for reset, and peers/ to emit WireGuard configs. The role scripts now ride on the seed ISO, so provisioning transfers nothing. build-bundle.sh produces a self-contained tarball per platform, for hosts that cannot reach the git server. Both configs are generic: no absolute path from this machine remains.
53 lines
1.6 KiB
Bash
Executable File
53 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# kali-setup.sh — prepare a participant's Kali for the workshop.
|
|
#
|
|
# ./scripts/kali-setup.sh
|
|
#
|
|
# Installs the toolset used in the lab and copies the targeted wordlist to
|
|
# /opt/norbourg/wordlists/. Safe to run twice.
|
|
set -euo pipefail
|
|
|
|
HERE=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
|
|
WORDLIST="$HERE/wordlists/norbourg.txt"
|
|
|
|
info() { printf '[*] %s\n' "$*"; }
|
|
ok() { printf '[ok] %s\n' "$*"; }
|
|
warn() { printf '[!] %s\n' "$*" >&2; }
|
|
|
|
if [[ $EUID -eq 0 ]]; then
|
|
SUDO=""
|
|
else
|
|
SUDO="sudo"
|
|
fi
|
|
|
|
info "installing packages (this takes a few minutes)"
|
|
$SUDO apt-get update -qq || warn "apt-get update failed, continuing"
|
|
$SUDO DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends \
|
|
netexec impacket-scripts bloodyad evil-winrm bloodhound.py \
|
|
hashcat seclists smbclient dnsutils python3-pip \
|
|
|| warn "some packages failed to install, see the list below"
|
|
|
|
info "installing the lab wordlist"
|
|
$SUDO mkdir -p /opt/norbourg/wordlists
|
|
$SUDO cp "$WORDLIST" /opt/norbourg/wordlists/norbourg.txt
|
|
$SUDO chmod 0644 /opt/norbourg/wordlists/norbourg.txt
|
|
|
|
info "checking the toolset"
|
|
check() {
|
|
if command -v "$1" >/dev/null 2>&1; then
|
|
ok "$1"
|
|
else
|
|
warn "$1 missing"
|
|
fi
|
|
}
|
|
for tool in nxc netexec evil-winrm hashcat smbclient dig; do
|
|
check "$tool"
|
|
done
|
|
command -v impacket-GetUserSPNs >/dev/null 2>&1 && ok "impacket-GetUserSPNs" \
|
|
|| warn "impacket scripts missing (impacket-scripts)"
|
|
command -v bloodhound-python >/dev/null 2>&1 && ok "bloodhound-python" \
|
|
|| warn "bloodhound-python missing"
|
|
|
|
printf '\n'
|
|
ok "done. Lab access is configured separately: see docs/prerequis.md"
|