Files
pentest.intro/scripts/kali-setup.sh
T
quoije d34981d279 Add doctor health check and Kali setup script
doctor verifies bridge, per-VM SMB/WinRM, DNS SRV records, the site and the
leaked credential in one pass — the instructor's first move when something
looks wrong.

Start order now boots dc01 first and waits for WinRM: a member that wins the
race loses its machine-account channel (NO_LOGON_SERVERS on every logon).
2026-10-21 20:13:18 -04:00

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"