lab.sh kali install|up|down|reset|status extracts the official Kali QEMU image once, keeps it as a read-only base with a throwaway overlay, and boots two NICs: the lab bridge (for the exercise) and user networking (so apt works without opening the isolation policy). DC01 now serves DHCP on 10.10.10.100-200 with DNS and domain options but no router: devices on the bridge configure themselves while the lab stays isolated. A reservation pins 10.10.10.101 to the Kali MAC. Also fixed backend_stop, which still called the pre-refactor WinRM helper and fell back to killing the VMs.
21 lines
665 B
Bash
Executable File
21 lines
665 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# lab.sh — Norbourg lab on a generic Linux host (QEMU/KVM).
|
|
set -euo pipefail
|
|
|
|
LAB_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd -P)
|
|
ROOT_DIR=$(cd -- "$LAB_DIR/../.." && pwd -P)
|
|
CONTENT_DIR="$ROOT_DIR/content"
|
|
PLATFORM=qemu
|
|
export LAB_DIR ROOT_DIR CONTENT_DIR PLATFORM
|
|
|
|
source "$CONTENT_DIR/lib/common.sh"
|
|
for _lib in check cmd_init cmd_isos cmd_seeds cmd_build cmd_provision cmd_web \
|
|
cmd_snapshot cmd_doctor cmd_misc cmd_kali; do
|
|
# shellcheck disable=SC1090
|
|
source "$CONTENT_DIR/lib/${_lib}.sh"
|
|
done
|
|
unset _lib
|
|
|
|
# shellcheck source=../../content/lib/dispatch.sh
|
|
source "$CONTENT_DIR/lib/dispatch.sh"
|