Compare commits

..
50 Commits
Author SHA1 Message Date
quoije 7340e4cd54 proxmox: turnkey RDP exposure for the Kali seats
kali rdp writes one systemd unit per seat (3381..338N) forwarding to the
seat's 3389, and rdp-off removes them. The xrdp bake now pulls xorgxrdp,
uses LAB_HOST_IP for the temporary proxy instead of a hardcoded address,
and restores any pre-existing squid configuration afterwards. Docs use the
command instead of a manual socat loop and mention the PVE firewall.
2026-10-27 20:13:07 -04:00
quoije 2c46b78712 lab: move the DC flag to C:\flag and make the last step an admin takeover
The replication right is read-only, so root.txt now sits where only DC
administrators can read it (like user.txt on WS01). The backup share stays
readable by Sauvegarde-AD with a note, but no flag. The final step is DCSync
-> Administrator hash -> pass-the-hash -> create a Domain Admin -> read
C:\flag\root.txt; the golden ticket becomes the persistence variant.

doctor checks the new path and fails if the flag is still exposed on the
share. Walkthrough, student sheet, blue-team table and deck updated.
2026-10-27 00:18:44 -04:00
quoije e30a447662 docs: bonus persistence section for participants
Shows why the replication right alone cannot create an account (read-only),
then pass-the-hash with a dumped Administrator hash to add a Domain Admin,
plus the golden-ticket variant and the events the blue team would see.
2026-10-27 00:15:25 -04:00
quoije b134cd9737 docs: align the permission section with the lab flow
Collect, decode with bh_clues.py, confirm with daclread, then look at the
target's groups and exercise the right. The example uses the entry account
(a dead end) so the sheet teaches the output without handing over the path;
the walkthrough shows the real svc_backup output and the DCSync nuance.
Also corrected the pronouns for m.legault (Marie).
2026-10-26 23:49:22 -04:00
quoije ab96939b20 bh_clues: --help, lab notice and clearer errors
argparse usage with an example, a header line in the output stating it is a
Norbourg-lab tool, and explicit messages for a missing collection or an
unknown account. The tool ISOs describe the script next to the wordlist.
2026-10-26 23:21:52 -04:00
quoije 28cf7080ee tools: decode BloodHound JSON into exploitable edges
bloodhound-python only writes JSON for the GUI, so a terminal user sees a
successful collection and nothing else. bh_clues.py answers the question
that matters: for one account, its groups, SPNs, non-inherited ACEs and
local-admin/PSRemote edges — with GetChanges+GetChangesAll collapsed into
DCSync. Shipped in both tool ISOs and copied by the Kali setup; the student
sheet uses it after the collector.
2026-10-26 23:14:52 -04:00
quoije 3023525737 dc01: serve the site on http://norbourg.lab too
The domain name must keep resolving to the DC for AD, so redirect at the
HTTP layer: a netsh portproxy on the DC forwards port 80 to FS01, and a
firewall rule opens it. Both URLs now serve the archived site. doctor
checks the short URL and warns (not fails) when the forward is absent.
2026-10-26 22:43:51 -04:00
quoije a9e55469b3 docs: enumerate accounts over LDAP, not SAMR on SMB
nxc smb <machine> --users reads the local SAM: on a member server that is
empty, which reads like a failure. The hand-out now uses nxc ldap against
the DC and explains the difference; the walkthrough matches.
2026-10-26 22:13:12 -04:00
quoije 6bb7758709 proxmox: bake xrdp into the Kali template
KALI_XRDP=1 installs xrdp while the template is still a VM, so every clone
and every kali reset keeps it. The lab has no Internet, so the host runs a
temporary squid bound to 10.10.10.1 and restricted to the probe address
(10.10.10.249); it is stopped and disabled afterwards. A ~/.xsession is
written for kali so the xfce session starts under xrdp.

Docs cover exposing one RDP port per seat with socat (3381..3385).
2026-10-26 19:40:57 -04:00
quoije e08731bf37 proxmox: parse out-data in the Kali seat verification
Same field-name difference as the Windows path; the seats were configured
correctly but the check read an empty string and warned every time.
2026-10-26 18:55:37 -04:00
quoije b6dff5693c proxmox: read out-data from the guest agent JSON
PVE 8 returns out-data/err-data instead of out/err, so every backend_ps
call was parsed as an empty string: Test-Path guards said "missing" and
backend_wait never saw True. Accept both key names.
2026-10-26 18:13:18 -04:00
quoije 30dbefdb1b proxmox: tolerate NUL-padded agent output and avoid false stage guards
powershell.exe over the guest agent can return UTF-16LE, so Test-Path read
as T\0r\0u\0e and every 'grep true' failed. Strip NULs in _qga_unwrap,
and only treat an explicit False as proof that the role script is absent.
2026-10-26 17:58:06 -04:00
quoije f0f5ffc140 bootstrap: install the vioser driver for the running Windows build
The recursive search returned vioserial/2k12 first (alphabetical), and
pnputil rejects it on Server 2022 with -536870325. The agent MSI installed
fine (exit 0) but never had a channel. Pick the folder from the OS build
and fall back through the other amd64 builds until one succeeds.
2026-10-26 17:49:01 -04:00
quoije 37852b3f0b provision: fail fast when the role script is missing
A missing seed payload used to look like a hung stage: the scheduled task
exited immediately and backend_wait polled for an hour. Both backends now
check Test-Path on the role script before scheduling it.
2026-10-26 17:23:36 -04:00
quoije 06a9034214 proxmox: reboot once after the install so the guest agent can connect
The agent MSI was installed at first logon, before the virtio-serial port
existed. The service started without a channel and Proxmox kept reporting
"guest agent is not running", which blocked provisioning at backend_ready.

- backend_finalize now waits for the first-logon bootstrap to finish
  (stamp.txt over SMB, which does not need the agent), detaches the
  installer ISO, reboots the VM once and waits for the agent to answer.
- bootstrap logs the pnputil and msiexec exit codes, so bootstrap.log says
  exactly what happened if it still fails.
- check requires smbclient (site sync + finalize) and python3.
- instructor guide: snapshot doubles disk usage, plan ~60 GB.
2026-10-26 17:23:05 -04:00
quoije bcc370d70f bootstrap: find the virtio CD by content, not by volume label
Get-Volume only returns a label when the image carries one; when it did
not, the whole block was skipped and neither vioser nor the agent was
installed. Probe the drives for guest-agent/qemu-ga-x86_64.msi instead.
2026-10-26 13:01:10 -04:00
quoije 0189330117 bootstrap: install the VirtIO serial driver before the agent
qemu-ga-x86_64.msi installs the service but not vioserial. The service then
starts without a channel and Proxmox reports "guest agent is not running",
so provisioning never gets past backend_ready. Install vioser.inf from the
virtio CD first, then enable and start the service.
2026-10-26 12:40:10 -04:00
quoije 4dc27a4208 proxmox: fix the status table and the template lifecycle
Found on the first real deployment:

- status used the qemu implementation (pidfile + VNC display) and died with
  "qemu_pidfile: command not found". The Proxmox override shows VMID, state
  and role, plus the Kali seats once they exist.
- snapshot templated the working VM in place (id 1100) while reset cloned
  from base+100 (1200), so reset always failed and up could not start a
  template. snapshot now clones the VM into 1200 and templates the clone;
  reset and launch clone 1200 back into 1100.
- working clones are full copies: snapshot --update destroys and rebuilds
  the template, which would orphan a linked clone.
- vnc prints the noVNC URL instead of a localhost display that does not
  exist on Proxmox.

Checked against a stubbed qm: status table, snapshot, reset and
launch-without-a-VM all behave.
2026-10-26 12:29:47 -04:00
quoije 30d806c06c audit for the own-Kali deployment
- dc01-post: drop the vestigial Serveurs-Admins group. It only existed to be
  nested into the DC's administrators, which was removed; leaving it would
  suggest a privilege that no longer exists.
- prerequis: participants who bring their own Kali are told where to get
  norbourg.txt, and the address table no longer promises a provided VM.
- qemu check: assert the firewalld isolation zone and policy. They persist
  across reboots but nothing verified them, so a missing policy would go
  unnoticed until a VM reached the office LAN.
- up/reset: skip the directory wait when dc01 is not in the table.
- deck: no implication that a Kali VM is always provided.

Redeployed from scratch without Kali: build and provision completed in one
pass, doctor reports 0 warnings, and the documented path reproduces through
DCSync with no shortcut (C$ denied, decoy ACE absent).
2026-10-25 15:35:43 -04:00
quoije 59e2594c1e dc01: make the delegated ACL the only way out, and stabilise the state
Three shortcuts and one race made the lab either easier than documented or
non-deterministic:

- Serveurs-Admins was nested in BUILTIN\Administrators on the DC, so
  m.legault was a de-facto domain-controller admin (C$, NTDS.dit) and the
  whole ACL lesson could be skipped. It also made SDProp treat her as
  protected: an hour after provisioning, the intended GenericAll ACE was
  wiped. Removed the nesting; adminCount is explicitly reset.
- the t.smith decoy ACE gave a working path to Domain Admin until SDProp
  ran (up to an hour after a fresh build). The role now grants it and
  revokes it immediately, so the state is deterministic.
- the replication-rights grant stacked duplicate ACEs on every re-run; it
  now removes its own ACEs first.
- up/reset/save returned as soon as WinRM answered, while the directory
  was still starting; doctor right after could report a missing ACE and
  missing replication rights on a healthy lab. They now wait for
  Get-ADDomain on dc01.

doctor: a decoy ACE that is still present is now a failure, not a success.
The deck's wording matches the new behaviour.
2026-10-25 14:05:55 -04:00
quoije df5ce2d497 docs: first draft of the workshop deck (21 slides)
Intro, rules, topology, methodology, then the debriefing path and the
defensive angle. Text lives in build_slides.py so it can be regenerated;
the .pptx is the editable artifact.
2026-10-25 13:39:33 -04:00
quoije 0dbfcc7147 lifecycle: up/reset wait for every guest before returning
doctor run right after reset reported false failures because the VMs were
still booting. _start_lab now waits for WinRM on each guest (300 s) and
names the ones that did not answer.
2026-10-24 16:48:01 -04:00
quoije ca72e1aa2e windows: fix first-boot races and non-idempotent stages
A from-scratch rebuild surfaced three defects that only appear on a clean
deployment:

- dc01-post: `Set-ADObject -Identity <sAMAccountName>` raises
  ADIdentityNotFoundException even right after New-ADUser, so resolve the
  DN once and reuse it. The stage aborted before DNS, flags, DHCP and the
  audit policy, leaving a half-built domain.
- bootstrap ran the role script at first boot while `provision` also ran
  it. fs01 tried to join a domain that did not exist yet, and dc01 ran two
  promotions concurrently; the loser wrote "FAIL Stream was not readable".
  Roles are now only started by the harness, which orders them.
- fs01: the `.url` MIME existence test read the staticContent element
  (-Name '.') instead of its collection, so any re-run died on a duplicate
  entry. Test -Name 'collection'.

Every stage now takes a PID-based lock: a duplicate start exits instead of
racing the real one.

Validated on a fresh build: doctor 0 warnings, and the full path
(site -> SMB -> AS-REP -> Kerberoast -> WinRM -> ACL -> replication ->
DCSync) reproduces.
2026-10-24 16:38:37 -04:00
quoije 95d70fa5a4 docs: explain how to add seats beyond the default five 2026-10-24 14:57:59 -04:00
quoije ef6fe18333 proxmox: one turnkey Kali VM per participant
Deploy N attacker VMs alongside the domain lab and hand each colleague a
console URL, with nothing to install or configure on their side.

- import the Kali image once, keep it as a template, clone per seat
- deterministic MAC + DHCP reservation on DC01, so addresses are stable
- configure through the QEMU guest agent: hostname, wordlist from the
  tool ISO, sshd, then verify network and DNS
- add the `users` command: a PVEVMUser account scoped to one VM plus the
  noVNC URL and generated password
- check: 7z/pveum presence, address range, RAM budget for the clones
- destroy cleans up the clones and the template

The documented path no longer depends on bloodyAD: the password reset uses
impacket-changepasswd (already installed) and ACL inspection uses nxc's
daclread module, both verified against the live lab.
2026-10-24 14:57:38 -04:00
quoije dcb64ac65e Restructure the repository per session
session1/ now holds the whole live lab (content, platforms, docs, answer key,
README); session2/ keeps the design for the second workshop. The root README
indexes both and states that session2 modifies session1 rather than
duplicating it.

build-bundle.sh builds from session1 and still produces a flat archive, so
the documented paths inside a deployment (platforms/<p>/lab.sh) are
unchanged. .gitignore follows the move.
2026-10-24 14:22:39 -04:00
quoije 62d3c4282c Student guide and README: control of the domain, not Domain Admin
The graded path ends with replication rights and DCSync, not membership in
Domain Admins, so the stated objective was inaccurate. Also documents that
C$/ADMIN$ require local admin while hidden shares depend only on their own
ACL — which is how the server flag is reachable.
2026-10-24 14:20:52 -04:00
quoije a29a5ce4b9 Docs: final pass for the replication-rights design
blue-team: the reset target is m.legault; the ACL row explains that the same
ACE on t.smith is stripped hourly by SDProp; the DA-logon row becomes the
replication event (4662).

answer key: DCSync runs as m.legault, t.smith is listed as the protected
decoy, and two new pitfalls document why C$ refuses a plain account and why
WinRM on DC01 is authorization, not a closed port.

README: structure table gains session2/. No stale references remain
(AdminSDHolder, Serveurs-Admins, C:\flag).
2026-10-24 14:19:59 -04:00
quoije 4446bb6a0f Align the docs with the explicit-rights design
Answer key no longer claims two viable targets: SDProp has already reverted
the t.smith decoy by the time a student looks, so 'get writable' shows only
m.legault. Keeps t.smith as the documented trap instead.

Instructor runbook and the archive index now describe the replication-rights
story rather than the old BUILTIN\Administrators one.
2026-10-24 14:10:14 -04:00
quoije 122aeed6cb Escalate through explicit replication rights, not a protected group
The AdminSDHolder anchor worked but handed svc_backup GenericAll over every
protected object, including Domain Admins — a shortcut that undermined the
intended lesson.

New design, matching how backup products actually get AD access:
  svc_backup --GenericAll--> m.legault (plain user, never protected)
  m.legault in Sauvegarde-AD, which holds Replicating Directory Changes
  and ...All on the domain — the vendor requirement for AD-aware backups

Nothing on that path is a protected object, so SDProp has nothing to rewrite.
t.smith stays as the decoy whose ACE is reverted hourly.

The flag moves to C:\Sauvegarde, shared as Sauvegarde\$ readable by the
backup group: C\$ is admin-only, so a plain account could never fetch it.

web --sync now mirrors instead of merging (it used to leave deleted files
served forever) and clears the staging folder that smbclot only adds to.
Lore 2016/2021 rewritten around the replication requirement.
2026-10-24 14:06:21 -04:00
quoije 5e9be0a0b3 Anchor the delegation in AdminSDHolder; document the mechanism
BUILTIN\Administrators is itself a protected group, so adding
Serveurs-Admins to it made m.legault transitively protected too: SDProp
then wiped both ACEs and reset adminCount. doctor caught it.

The durable fix is the one that works in a real domain: the ACE lives in
AdminSDHolder, which SDProp copies onto protected objects every hour, so it
is re-applied rather than deleted. The adminCount workaround is gone.

Lore gains a 2021 note explaining exactly this, in the voice of the
instructor who hit it: the delegation kept vanishing, the vendor explained
AdminSDHolder, the right was moved there and stopped disappearing.
2026-10-24 13:49:08 -04:00
quoije 23f4e1f060 Fix the missing DHCP reservation; scaffold session 2
dc01-post.ps1 now creates the 10.10.10.101 reservation itself (it only
existed in the running lab), and doctor checks it.

session2/ holds the design for the second workshop: LSASS credential theft
with mimikatz, overpass-the-hash and pass-the-ticket, the scheduled-task
plant it needs, the detections to add alongside, and the open question to
prototype first. Nothing is implemented; the live lab is untouched.
2026-10-24 13:46:44 -04:00
quoije b9bc0eb079 Add 'save': the closing step for any change
save = snapshot --update + start, and falls back to a first-time snapshot
when no baseline exists yet. On the qemu platform it folds the working
overlays into the base images and brings the lab back up; on proxmox it
re-templates.

Documented as the rule it is: every deliberate change to the lab ends with
save, so reset always returns to the state you meant to freeze.
2026-10-24 02:13:18 -04:00
quoije 9ba0ca98ac Add the in-world archive trail that explains the lab
Six dated notes under _archives/ on the public share, one per artifact:
the 2003 backup deployment and its permanent password, INC-0142 (the
object-level delegation), the 2011 'the agent needs local admin' shortcut,
the 2016 'this is equivalent but looks better in an audit' note, and the
2019 copy of the procedure for t.smith.

Students find the reasons for the permissions instead of being told them;
the instructor gets a per-step debrief trail. Referenced from the student
guide, the runbook and the answer key.
2026-10-24 01:57:52 -04:00
quoije 8933c9a669 Replace the unrealistic ACL target with a realistic delegation
GenericAll over a Domain Admin cannot survive in a real domain: SDProp
rewrites protected objects from AdminSDHolder every hour. The previous
design only worked thanks to adminCount=0, which no IT team would ever set.

New design, matching what broad delegation actually looks like:
  svc_backup --GenericAll--> m.legault (plain user, ACE stable)
  m.legault in Serveurs-Admins, which is in BUILTIN\Administrators on DC01

t.smith stays as a decoy: the same edge exists but is reverted by SDProp,
which is itself a lesson.

Also repairs accounts that an interrupted first run left disabled (m.legault
was one), and doctor now checks the stable path, the account state and the
DC admin membership.
2026-10-24 01:46:25 -04:00
quoije 723586029f Fix the ACL being reverted by SDProp, and make doctor check the puzzle
t.smith is a Domain Admin, therefore a protected object: SDProp rewrites his
security descriptor every hour from AdminSDHolder and deletes any ACE not
present there. The GenericAll that the lab builds was silently removed by
that cycle, so 'bloodyad set password' started failing with the misleading
'oldpass not valid' error.

Clearing adminCount on the target takes it out of SDProp's scope while it
stays a Domain Admin. Applied in dc01-post.ps1 (guarded) and baked into the
baseline.

doctor now verifies the invariants that services do not reveal: the ACE,
adminCount, SPN, disabled pre-auth, minimum password age, root.txt, the
easter-egg TXT and the DHCP scope. This is exactly the drift that was
invisible before.
2026-10-24 01:36:33 -04:00
quoije 599cf23204 Student memo: complete the command set
Adds the four commands the lab needs that were missing from the cheat
sheet: the web entry (curl), reading a file from an admin share, the
bloodyad action that exercises a delegated right, and the final DCSync
secretsdump. Placeholders only, no target names.
2026-10-24 00:03:27 -04:00
quoije b13ec8da95 Persist the Kali setup in its base image
New 'kali snapshot' subcommand commits the working overlay into the base
image, the same way the Windows guests are frozen. After it, reset returns
to a Kali that already has: the wordlist under /opt/norbourg, bloodyAD,
sshd enabled at boot, and the dual resolver (DC first, slirp second).

Verified by booting from the committed base with no manual step: sshd
answers, 1716-line wordlist present, bloodyad on PATH, lab and public names
both resolving.

Docs: README and instructor checklist describe the new step.
2026-10-23 07:14:19 -04:00
quoije 6fb5c3b4ca Kali keeps the DC as resolver and still reaches the internet
The DC returns SERVFAIL for names outside its zones, so glibc falls through
to the next nameserver. Listing the slirp resolver second (10.0.2.3) gives
lab names from the DC, public names from the tunnel, and keeps apt working.
No dnsmasq or per-domain config needed.

Docs: instructor checklist and the participant note both describe the
two-resolver setup, and warn that the connection name is case-sensitive.
2026-10-23 00:59:17 -04:00
quoije 4ee3bba0c5 prerequis: hosts-file fallback is legitimate, with the right apex
The doc claimed a hosts file would break nxc and Kerberos lookups. It does
not: name-to-IP is all the tools need, and the lab works with IPs plus
-dc-ip. What actually matters is that the domain name points at the DC —
a hosts entry pointing norbourg.lab at FS01 silently sends tooling to the
wrong machine, which is exactly what happened during testing.

Documents both routes and the one rule that matters.
2026-10-23 00:50:24 -04:00
quoije b93ed45635 Docs: full accuracy pass across all five files
prerequis: tools list corrected (collector, not the BloodHound GUI), the
provided Kali VM path added (DHCP + DNS come free), address table completed
with the Kali reservation and the DHCP range.

blue-team: null sessions are refused in this lab, so the SMB row no longer
claims one; the GenericAll is planted at build time, so the detectable
signal is its use (4724), not an ACE creation (5136); added ready-to-run
Get-WinEvent queries with the field indices.

answers: nxc instead of netexec, domain flag on every call, bloodyad -H,
and the no-GUI shortcut documented.

README/instructeur: what the image actually ships, and how to add bloodyAD.
2026-10-23 00:48:12 -04:00
quoije 6818a57500 Student guide: rewrite the cheat sheet against the real toolset
- nxc/netexec with the domain flag, from Kali
- AS-REP and Kerberoast commands with the actual flags (-request, -format
  hashcat, -dc-ip, -outputfile)
- hashcat modes called out explicitly (18200 AS-REP, 13100 TGS)
- bloodyAD get writable as the no-BloodHound way to answer permission
  questions, since the GUI is not installed
- note that bloodhound-python -c all is required for ACL data
2026-10-23 00:46:20 -04:00
quoije 801cf7e851 Docs: qualify the remaining lab.sh paths
Troubleshooting table and the post-deployment checklist now say where each
command must run, and the stale 'step to come' note for the site is gone.
2026-10-23 00:32:08 -04:00
quoije 069e90cf8e Docs: post-deployment checklist and service notes
Instructor runbook now covers what we learned the hard way: snapshot before
use, the wordlist lives on the Kali tool CD, DNS needs the DC prioritised on
Kali's bridge NIC, and the lab deliberately answers ICMP and offers RDP (for
instructors only — Remote Desktop Users stays empty).
2026-10-23 00:31:49 -04:00
quoije 7787bd5f84 Close the gaps that a fresh redeploy would have shipped
- install the QEMU guest agent from virtio-win: Proxmox provisions over
  qm guest exec, so without it every provision would hang waiting for the
  agent. virtio-win is now attached as ide3 on the Proxmox platform.
- restore the .url MIME mapping in fs01.ps1: the earlier patch silently
  missed, so a rebuilt FS01 would answer 404.3 for the easter-egg shortcut.
- kali install now builds a small tool ISO carrying the wordlist, so a
  fresh Kali is usable without network access to the host.

Audited by extracting the bundle and re-rendering the seeds: no unrendered
tokens, and every live fix is present in the generated role scripts.
2026-10-23 00:30:40 -04:00
quoije b5981dbe08 Restore the lab wordlist lost in the platform split
The directory move into content/scripts silently failed and scripts/ was
removed, so the list vanished from the tree while surviving in history.
kali-setup.sh has been pointing at a missing file ever since.
2026-10-23 00:26:07 -04:00
quoije 703db36381 Fix RDP never being enabled
The discoverability-flyout tweak used New-Item -Force on a protected HKLM
key, which throws UnauthorizedAccessException. With ErrorActionPreference
Stop that aborted the bootstrap before the RDP block, so TermService stayed
stopped, fDenyTSConnections stayed 1 and no RDP firewall rule was enabled.
Anyone trying 3389 got a closed port.

Use New-ItemProperty in a try/catch, and make the RDP block defensive
(start the service, enable the rule group, log failures).
2026-10-22 22:40:00 -04:00
quoije 31dae55b1f Allow ICMP echo on lab guests
Windows drops echo by default, and 'ping the DC' is the first check anyone
runs; prerequis.md tells participants to do exactly that. Adds a scoped
ICMPv4-in rule in bootstrap.ps1 (lab only, all profiles).
2026-10-22 21:30:42 -04:00
quoije 0206eb6110 Docs: platform-qualified commands; destroy stops Kali 2026-10-22 21:26:55 -04:00
quoije 608b559e51 Proxmox hardening from a dry run and stub tests
- PVE has no win2k22 ostype; Server 2022 maps to win11
- drop --startup 0, which is not a valid order value
- after install, repoint the boot order at sata0 and detach the installer
  ISO, so a stray keypress cannot re-enter Setup
- ISO storage detection falls back to storage.cfg when pvesm has no
  --content flag
- router wg0 is now 10.10.10.250/32 with the lab NIC at .251/24: two /24s on
  one host made routing ambiguous
- nft rules use the router's own interface name (WG_LAB_IFACE), not vmbr10
2026-10-22 21:26:37 -04:00
369 changed files with 5508 additions and 1101 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
# secrets et réponses # secrets et réponses
answers/ session1/answers/
lab.conf.local lab.conf.local
# artefacts générés / volumineux # artefacts générés / volumineux
@@ -8,8 +8,8 @@ dist/
*.qcow2 *.qcow2
*.vmdk *.vmdk
*.ova *.ova
content/web/site/ session1/content/web/site/
content/seed/out/ session1/content/seed/out/
run/ run/
logs/ logs/
+28 -144
View File
@@ -1,158 +1,42 @@
# Laboratoire Norbourg — atelier d'introduction au pentest de domaine # Laboratoire Norbourg — ateliers
Laboratoire Active Directory isolé, déployé par script, pour initier des collègues au pentest de Deux séances, un dépôt. Chaque dossier de séance est autonome ; `session2` ne duplique rien, il
domaine. L'objectif : partir d'un accès anonyme et obtenir les droits de **Domain Admin**, comme modifie ce que `session1` fournit.
sur une plateforme de type Hack The Box.
> **État : fonctionnel.** Le parcours complet (site → SMB → Kerberoasting → WinRM → ACL → | Dossier | État | Contenu |
> Domain Admin) a été validé sur la plateforme `qemu`. La plateforme `proxmox` est écrite et
> vérifiée statiquement, mais n'a pas encore tourné sur un hôte Proxmox réel.
## Deux plateformes, un même contenu
| | `qemu` | `proxmox` |
|---|---|---| |---|---|---|
| Cible | n'importe quel Linux avec KVM | Proxmox VE 8.x | | [`session1/`](session1/README.md) | **fonctionnel, validé** | laboratoire AD complet : deux plateformes, documentation, solution |
| Commande | `./platforms/qemu/lab.sh` | `./platforms/proxmox/lab.sh` | | [`session2/`](session2/README.md) | **conception seulement** | vol de matériel d'authentification (LSASS, mimikatz) — rien n'est implémenté |
| Configuration | `platforms/qemu/lab.conf` | `platforms/proxmox/lab.conf` |
| Disques | qcow2 + `chattr +C` sur btrfs | stockage Proxmox (`local-lvm`, `local-zfs`…) |
| Réseau | pont `br-lab` créé par le script | pont `vmbr10` créé à la main dans l'interface |
| Réinitialisation | base + couche jetable (~2 s) | gabarit + clone |
| Accès participants | route vers `10.10.10.0/24` | VM routeur WireGuard |
Le contenu commun — scripts PowerShell, site archivé, documentation, solution — vit dans ## Session 1 — le laboratoire
`content/` et `docs/`. Les deux plateformes ne diffèrent que par la couche de virtualisation.
## Topologie Le contenu de référence : domaine `norbourg.lab`, site archivé de 2002, chemin d'élévation par
délégation ACL, deux plateformes (`qemu` et `proxmox`).
```
participant (Kali)
│ route 10.10.10.0/24 via 10.10.10.1 (ou tunnel WireGuard)
▼
hôte 10.10.10.1 / 10.10.10.230 pont isolé
├── DC01 10.10.10.10 contrôleur de domaine, DNS
├── FS01 10.10.10.20 serveur de fichiers, site 2002, partage Public
└── WS01 10.10.10.31 poste de travail
```
## Prérequis
- Hôte Linux avec KVM, 16 Go de RAM et ~80 Go libres, **ou** un hôte Proxmox VE 8.x.
- Un accès `sudo` une seule fois sur la plateforme `qemu` (pont et pare-feu).
- Une machine Kali sur le même réseau local, ou un tunnel WireGuard.
---
## Démarrage — plateforme `qemu` (Linux générique)
```bash ```bash
cd platforms/qemu cd session1/platforms/qemu
./lab.sh check # valide hôte, stockage, réseau, configuration ./lab.sh check
./lab.sh init # arborescence + chattr +C ./lab.sh doctor
sudo ./setup-network.sh # pont br-lab et isolation — seule étape root
./lab.sh isos # télécharge 5,6 Go d'images Windows
./lab.sh build # installe les 3 VM sans intervention (~20 min)
./lab.sh provision # domaine, comptes, ACL, drapeaux (~15 min)
./lab.sh web --sync # publie le site 2002 sur FS01
./lab.sh snapshot # fige l'état propre
``` ```
## Démarrage — plateforme `proxmox` Documentation, prérequis et solution : [`session1/docs/`](session1/docs/), solution complète dans
`session1/answers/` (non versionnée).
1. Remplir `platforms/proxmox/lab.conf` : stockages, pont, adresse de l'hôte. ## Session 2 — la suite
2. Créer le pont dans l'interface Proxmox : *Datacenter > nœud > Network > Create > Linux
Bridge*, nom `vmbr10`, **aucun port**, IPv4 `10.10.10.1/24`, pas de passerelle. Deuxième séance, même laboratoire, autre compétence : voler le matériel d'authentification d'un
3. Puis : administrateur dans LSASS, puis le réutiliser contre le contrôleur de domaine.
Rien n'est codé. Le dossier contient la conception : le plant nécessaire, la chaîne, les
détections à ajouter, les risques et l'ordre de travail.
## Archives de déploiement
Pour un hôte sans accès au serveur git, chaque plateforme de la session 1 se met en archive :
```bash ```bash
cd platforms/proxmox ./build-bundle.sh proxmox # ou qemu, ou sans argument pour les deux
./lab.sh check # refuse de continuer si la config ne correspond pas à l'hôte # produit dist/norbourg-<plateforme>.tar.gz
./lab.sh init
./lab.sh isos
./lab.sh build
./lab.sh provision
./lab.sh web --sync
./lab.sh snapshot # convertit les VM en gabarits
``` ```
Sans accès au serveur git sur l'hôte Proxmox, construisez une archive autonome : L'archive se décompresse à plat : `norbourg-qemu/platforms/qemu/lab.sh`.
```bash
./build-bundle.sh proxmox # produit dist/norbourg-proxmox.tar.gz
scp dist/norbourg-proxmox.tar.gz root@pve:/root/
```
## Machine d'attaque (Kali, optionnel)
La plateforme `qemu` peut installer l'image QEMU officielle de Kali, avec tous les outils de
l'atelier :
```bash
./lab.sh kali install # télécharge ~4 Go, extrait, prépare une couche jetable
./lab.sh kali up # démarre (VNC 127.0.0.1:5909, SSH 127.0.0.1:2222)
./lab.sh kali reset # repart de l'image propre
./lab.sh kali down
```
Identifiants par défaut : `kali` / `kali`. La VM a deux cartes : le pont du laboratoire
(adresse fournie par le DHCP de DC01) et un réseau utilisateur qui permet `apt` sans ouvrir de
passage vers le réseau du bureau.
## Commandes
| Commande | Effet |
|---|---|
| `check` | préflight ; refuse si le stockage ou la config sont inadaptés |
| `init` | arborescence, désactivation du CoW |
| `isos` | télécharge les images d'évaluation Microsoft |
| `seeds` | génère les fichiers de réponse et les ISO d'amorçage |
| `build` | disques + installation sans intervention |
| `provision [--role N]` | domaine, comptes, ACL, partage, drapeaux |
| `web [--sync]` | assemble le site et le pousse sur FS01 |
| `snapshot [--update]` | fige une base ; `--update` y intègre les changements |
| `up` / `down` | démarre (DC d'abord) / arrête |
| `reset` | repart de la base |
| `status` / `doctor` | tableau des VM / bilan de santé |
| `vnc <vm>` | console graphique (plateforme qemu) |
| `answers` | affiche la solution de l'instructeur |
| `peers` | configs WireGuard (plateforme proxmox) |
## Structure du dépôt
| Chemin | Rôle |
|---|---|
| `platforms/qemu/` | point d'entrée et configuration pour un Linux générique |
| `platforms/proxmox/` | point d'entrée et configuration pour Proxmox VE |
| `content/lib/` | commandes communes, préflight, orchestration |
| `content/windows/` | scripts PowerShell par machine |
| `content/seed/` | fichier de réponse et charge utile des ISO d'amorçage |
| `content/site-src/` | site Norbourg 2002 : miroir et images retouchées |
| `content/web/` | site assemblé et fichiers pièges |
| `content/scripts/` | assistants partagés (WinRM, préparation du site, liste de mots) |
| `docs/` | documentation de l'atelier, en français |
| `answers/` | solution complète — **ignoré par git** |
| `build-bundle.sh` | fabrique une archive autonome par plateforme |
## Isolation
Rien du laboratoire ne doit joindre le réseau de bureau ni Internet :
- le pont du laboratoire n'a aucun port vers l'extérieur ;
- seul le sens participant → laboratoire est autorisé, sur les ports nécessaires
(DNS, Kerberos, LDAP, SMB, WinRM, HTTP) ;
- le sens laboratoire → bureau est rejeté.
Sur `qemu`, c'est le pare-feu de l'hôte qui l'applique ; sur `proxmox`, le pont sans port suffit,
et le routeur WireGuard ne fait que router.
## Contenu archivé
`content/site-src/` contient une capture du site public de Norbourg tel qu'il existait en 2002,
provenant de la Wayback Machine. Il sert de décor au laboratoire et de point d'entrée pour les
participants. Usage strictement interne et pédagogique.
## Avertissement
Laboratoire jetable. Les images Windows sont des versions d'évaluation Microsoft (180 jours pour
Server, 90 jours pour Windows 11) : à reconstruire périodiquement, jamais à exposer, jamais en
production. Les vulnérabilités sont volontaires.
+3 -2
View File
@@ -13,6 +13,7 @@ set -euo pipefail
ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P) ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
TARGET=${1:-all} TARGET=${1:-all}
OUT=${2:-$ROOT/dist} OUT=${2:-$ROOT/dist}
SRC="$ROOT/session1"
info() { printf '[*] %s\n' "$*"; } info() { printf '[*] %s\n' "$*"; }
ok() { printf '[ok] %s\n' "$*"; } ok() { printf '[ok] %s\n' "$*"; }
@@ -22,14 +23,14 @@ build() {
local stage="$OUT/norbourg-$platform" local stage="$OUT/norbourg-$platform"
local archive="$OUT/norbourg-$platform.tar.gz" local archive="$OUT/norbourg-$platform.tar.gz"
[[ -d $ROOT/platforms/$platform ]] || { echo "no such platform: $platform" >&2; return 1; } [[ -d $SRC/platforms/$platform ]] || { echo "no such platform in session1: $platform" >&2; return 1; }
rm -rf "$stage" rm -rf "$stage"
mkdir -p "$stage" mkdir -p "$stage"
# Shared content + one platform + docs + answers. Generated and transient # Shared content + one platform + docs + answers. Generated and transient
# paths are excluded: they are rebuilt by the host's own commands. # paths are excluded: they are rebuilt by the host's own commands.
tar -C "$ROOT" -cf - \ tar -C "$SRC" -cf - \
--exclude='.git' \ --exclude='.git' \
--exclude='__pycache__' \ --exclude='__pycache__' \
--exclude='*.pyc' \ --exclude='*.pyc' \
-98
View File
@@ -1,98 +0,0 @@
# shellcheck shell=bash
# cmd_doctor — end-to-end health check of the running laboratory.
_d_ok() { ok "$*"; }
_d_warn() { warn "$*"; DOCTOR_WARNS=$(( DOCTOR_WARNS + 1 )); }
_d_fail() { fail "$*"; DOCTOR_FAILS=$(( DOCTOR_FAILS + 1 )); }
cmd_doctor() {
DOCTOR_FAILS=0
DOCTOR_WARNS=0
local i name ip
step "host"
if ip link show "$LAB_BRIDGE" >/dev/null 2>&1; then
_d_ok "bridge ${LAB_BRIDGE} present"
else
_d_fail "bridge ${LAB_BRIDGE} missing — run sudo ./platforms/qemu/setup-network.sh"
fi
step "machines"
for i in "${!VM_NAMES[@]}"; do
name=${VM_NAMES[$i]}
ip=${VM_IPS[$i]}
if ! backend_running "$name"; then
_d_fail "$name is not running — ./lab.sh up"
continue
fi
if tcp_open "$ip" 445; then
_d_ok "$(printf '%-6s %-14s smb up' "$name" "$ip")"
else
_d_warn "$(printf '%-6s %-14s smb not answering' "$name" "$ip")"
fi
if [[ $name == dc01 || $name == ws01 || $name == fs01 ]]; then
if tcp_open "$ip" 5985; then
_d_ok "$(printf '%-6s %-14s winrm up' "$name" "$ip")"
else
_d_warn "$(printf '%-6s %-14s winrm not answering' "$name" "$ip")"
fi
fi
done
step "domain"
if have_cmd dig; then
local www
www=$(dig +short +time=2 +tries=1 "@$LAB_DC_IP" www.norbourg.lab 2>/dev/null | head -1)
if [[ $www == 10.10.10.20 ]]; then
_d_ok "dns: www.norbourg.lab -> $www"
else
_d_fail "dns: www.norbourg.lab did not resolve via ${LAB_DC_IP} (got '${www:-nothing}')"
fi
local srv
srv=$(dig +short +time=2 +tries=1 "@$LAB_DC_IP" SRV _ldap._tcp.dc._msdcs.norbourg.lab 2>/dev/null | head -1)
if [[ -n $srv ]]; then
_d_ok "dns: ldap SRV record present"
else
_d_fail "dns: ldap SRV record missing — AD discovery would fail"
fi
else
_d_warn "dig not installed, DNS checks skipped"
fi
step "web"
local code
code=$(curl -s -o /dev/null -w '%{http_code}' --max-time 5 "http://10.10.10.20/" 2>/dev/null || true)
if [[ $code == 200 ]]; then
_d_ok "site answers on 10.10.10.20"
else
_d_fail "site not answering (${code:-timeout}) — ./lab.sh web --sync"
fi
code=$(curl -s -o /dev/null -w '%{http_code}' --max-time 5 "http://10.10.10.20/public/IT-inventaire.txt" 2>/dev/null || true)
if [[ $code == 200 ]]; then
_d_ok "entry point reachable: /public/IT-inventaire.txt"
else
_d_fail "entry point missing (${code:-timeout})"
fi
step "share"
if have_cmd smbclient; then
if smbclient //10.10.10.20/Public -U 'NORBOURG\helpdesk1%Welcome2024!' -c 'ls' 2>/dev/null | grep -q 'IT-inventaire'; then
_d_ok "Public share reachable with the leaked credential"
else
_d_warn "Public share not readable as helpdesk1 (domain channel or DNS?)"
fi
else
_d_warn "smbclient not installed, share check skipped"
fi
printf '\n'
if (( DOCTOR_FAILS )); then
fail "${DOCTOR_FAILS} problem(s), ${DOCTOR_WARNS} warning(s)"
return 1
fi
ok "laboratory healthy · ${DOCTOR_WARNS} warning(s)"
}
-70
View File
@@ -1,70 +0,0 @@
# Norbourg lab — first-boot bootstrap, runs once from the seed ISO.
# The unattend file creates the account and triggers this; everything that
# touches the network happens here because unattend TCPIP settings fail
# silently when the adapter name does not match.
$ErrorActionPreference = 'Stop'
$base = 'C:\norbourg'
New-Item -ItemType Directory -Force -Path $base | Out-Null
Start-Transcript -Path "$base\bootstrap.log" -Append | Out-Null
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
. (Join-Path $here 'config.ps1')
Write-Host "bootstrap: host=$($Config.Hostname) role=$($Config.Role) ip=$($Config.IP)"
# ------------------------------------------------------------------ network
$nic = Get-NetAdapter |
Where-Object { $_.Status -eq 'Up' -and $_.InterfaceDescription -notmatch 'Loopback' } |
Select-Object -First 1
if (-not $nic) {
Write-Host 'bootstrap: no up adapter, network step skipped'
} else {
Remove-NetIPAddress -InterfaceIndex $nic.ifIndex -Confirm:$false -ErrorAction SilentlyContinue
Remove-NetRoute -InterfaceIndex $nic.ifIndex -Confirm:$false -ErrorAction SilentlyContinue
New-NetIPAddress -InterfaceIndex $nic.ifIndex `
-IPAddress $Config.IP -PrefixLength $Config.Prefix `
-DefaultGateway $Config.Gateway | Out-Null
Set-DnsClientServerAddress -InterfaceIndex $nic.ifIndex -ServerAddresses $Config.DNS
Set-NetConnectionProfile -InterfaceIndex $nic.ifIndex -NetworkCategory Private -ErrorAction SilentlyContinue
# The IP change re-triggers the "make this PC discoverable" flyout.
New-Item -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Network' -Force | Out-Null
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Network' `
-Name NewNetworkWindowOff -Value 1 -Type DWord
Write-Host "bootstrap: $($nic.Name) -> $($Config.IP)/$($Config.Prefix)"
}
# ------------------------------------------------------------------ WinRM
# The host provisions over WinRM; no guest agent needed for that.
Enable-PSRemoting -SkipNetworkProfileCheck -Force | Out-Null
Set-NetFirewallRule -DisplayGroup 'Windows Remote Management' -Enabled True -Profile Any -ErrorAction SilentlyContinue
# SMB: the eval image leaves File and Printer Sharing disabled, which makes the
# workstation invisible to a normal SMB scan.
Enable-NetFirewallRule -DisplayGroup 'File and Printer Sharing' -ErrorAction SilentlyContinue
# RDP: useful for the instructor when a step misbehaves.
Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\Terminal Server' `
-Name fDenyTSConnections -Value 0
Enable-NetFirewallRule -DisplayGroup 'Remote Desktop' -ErrorAction SilentlyContinue
# ------------------------------------------------------------------ marker
"$env:COMPUTERNAME|$($Config.Role)|$($Config.IP)|$((Get-Date).ToString('s'))" |
Set-Content -Path "$base\stamp.txt" -Encoding ascii
# ------------------------------------------------------------------ role
$role = Join-Path $here "roles\$($Config.Role).ps1"
if (Test-Path $role) {
Write-Host "bootstrap: running role $($Config.Role)"
& $role
} else {
Write-Host "bootstrap: no role script for '$($Config.Role)' yet (phase 5)"
}
Write-Host 'bootstrap: done'
Stop-Transcript | Out-Null
-100
View File
@@ -1,100 +0,0 @@
# Guide du participant
## Le contexte
Norbourg Services Financiers a fermé ses portes en 2005. Le serveur de fichiers, lui, n'a jamais
été mis au rancart : il tourne encore, avec son site Web de 2002, dans un coin du réseau. La
direction veut savoir ce qu'un attaquant pourrait y faire avant de confier la migration à un
sous-traitant.
Vous êtes ce sous-traitant. Votre mandat tient en une phrase : **obtenir les droits de Domain
Admin**.
## Votre objectif
Deux drapeaux à rapporter :
| Drapeau | Où | Ce qu'il prouve |
|---|---|---|
| `user.txt` | sur un poste de travail | vous avez compromis une machine |
| `root.txt` | sur le contrôleur de domaine | vous contrôlez le domaine |
Un drapeau a le format `NORBOURG{...}`. Notez-le et gardez-le pour le débriefing.
## Règles d'engagement
- **Seulement `10.10.10.0/24`.** Ne touchez pas à `10.10.10.230` (l'hôte du laboratoire) ni à
quoi que ce soit sur `192.168.10.0/24`.
- **Pas de déni de service.** Pas de balayage agressif, pas de saturation, pas de `--flood`.
- **Pas de destruction.** Ne supprimez pas de comptes, ne réinitialisez pas de mots de passe dont
vous n'avez pas besoin, ne chiffrez rien.
- **Tout reste dans le laboratoire.** Aucune donnée ne sort du réseau.
- Si vous cassez quelque chose, dites-le : c'est un laboratoire, ça se répare, mais il faut le
savoir pour les autres.
## Méthodologie suggérée
1. **Reconnaissance** — quelles machines répondent, quels services écoutent.
2. **Énumération** — qu'est-ce que ces services racontent : partages, utilisateurs, pages Web.
3. **Point d'entrée** — trouver un premier identifiant valide.
4. **Élévation** — transformer un compte ordinaire en compte puissant.
5. **Déplacement latéral** — passer d'une machine à l'autre avec les droits obtenus.
6. **Compromission du domaine** — la cible finale.
Ne sautez pas d'étape. La plupart des impasses viennent d'une énumération bâclée, pas d'un
manque d'outil.
## Aide-mémoire
```bash
# découverte
nmap -sn 10.10.10.0/24
nmap -sV -p- 10.10.10.10
# SMB / AD
netexec smb 10.10.10.0/24
netexec smb 10.10.10.10 -u '<user>' -p '<pass>' --shares
netexec smb 10.10.10.10 -u '<user>' -p '<pass>' --users
# Kerberos
impacket-GetUserSPNs norbourg.lab/<user>:<pass> -dc-ip 10.10.10.10 -request
# cassage
hashcat -m 13100 hash.txt /opt/norbourg/wordlists/norbourg.txt
hashcat -m 18200 hash.txt /opt/norbourg/wordlists/norbourg.txt
# mouvement latéral
netexec winrm 10.10.10.31 -u '<user>' -p '<pass>'
evil-winrm -i 10.10.10.31 -u '<user>' -p '<pass>'
# cartographie du domaine
bloodhound-python -d norbourg.lab -u '<user>' -p '<pass>' -ns 10.10.10.10 -c all
```
Les mots de passe du laboratoire se cassent en quelques secondes avec
`/opt/norbourg/wordlists/norbourg.txt`. Inutile de lancer `rockyou.txt` complet : vous perdriez
vingt minutes pour rien.
## Rappel terminal
Si vous n'êtes pas à l'aise en ligne de commande :
| Commande | Effet |
|---|---|
| `ls` | lister le dossier courant |
| `cd <dossier>` | entrer dans un dossier |
| `cat <fichier>` | afficher un fichier |
| `grep mot fichier` | chercher un mot |
| `commande \| grep mot` | filtrer la sortie d'une commande |
| `commande > fichier` | écrire la sortie dans un fichier |
| `Ctrl-C` | interrompre |
| `man <commande>` | documentation |
Une commande qui « ne fait rien » affiche souvent son erreur sur la sortie d'erreur : lisez-la.
## Si vous êtes bloqué
- Relisez la sortie de vos commandes : les outils d'énumération disent souvent quoi faire ensuite.
- Vérifiez votre configuration réseau (voir `prerequis.md`) : un `NXDOMAIN` n'est pas un serveur
mort, c'est un DNS mal pointé.
- Demandez un indice à l'instructeur : il en existe trois niveaux, du plus vague au plus direct.
-206
View File
@@ -1,206 +0,0 @@
# Guide de l'instructeur
## Prérequis de l'hôte
| | |
|---|---|
| Système | Linux avec KVM, `qemu-system-x86_64` 10.x ou plus récent |
| Mémoire | 16 Go minimum, 32 Go confortable (3 VM × 4 Go) |
| Disque | ~80 Go libres pour trois VM de 36 Go en allocation fine |
| Réseau | une interface sur `192.168.10.0/24` pour joindre les participants |
| Accès | `sudo` une seule fois, pour `platforms/qemu/setup-network.sh` |
Les images Windows sont des versions d'évaluation Microsoft : 180 jours pour Server 2022,
90 jours pour Windows 11. Elles ne servent qu'au laboratoire.
## Deux plateformes
Les commandes ci-dessous s'écrivent `./lab.sh` ; préfixez-les par la plateforme visée :
```bash
./platforms/qemu/lab.sh ... # Linux générique avec KVM
./platforms/proxmox/lab.sh ... # hôte Proxmox VE
```
Chaque plateforme a son propre `lab.conf` dans son répertoire.
## Déploiement complet (qemu)
```bash
./lab.sh check # 10 s — valide hôte, stockage, réseau, config
./lab.sh init # 1 s — arborescence + chattr +C
./lab.sh isos # ~10 min — télécharge 5,6 Go
sudo ./setup-network.sh # 5 s — pont, pare-feu, ip_forward
./lab.sh build # ~20 min — 3 installations sans intervention
./lab.sh provision # ~15 min — domaine, comptes, ACL, drapeaux
./lab.sh status # état des VM
```
Après `provision`, le laboratoire est prêt : `dc01` est un contrôleur de domaine, `fs01` sert le
site et le partage `Public`, `ws01` est joint au domaine avec `user.txt` en place.
### Ce que fait chaque étape
| Commande | Détail |
|---|---|
| `check` | refuse de continuer si le stockage est en NTFS, en lecture seule après erreur, ou trop plein |
| `isos` | télécharge Server 2022 Eval et virtio-win dans `LAB_ISO_CACHE` |
| `build` | disques qcow2, ISO d'amorçage par VM, installation `Autounattend.xml`, attente de WinRM |
| `provision` | upload des scripts PowerShell par WinRM, exécution détachée, attente des marqueurs `.done` |
### Ordre imposé
`provision` traite `dc01` en premier : la promotion du domaine redémarre la machine, et les
autres VM ne peuvent joindre le domaine qu'après. Utilisez `--role dc01` pour ne rejouer qu'une
étape.
## Vérifications rapides
```bash
./lab.sh doctor # tout en un : pont, SMB/WinRM, DNS, site, partage
./lab.sh status # les 3 VM répondent sur 5985
nc -zv 10.10.10.10 389 # le DC expose LDAP
curl -s http://10.10.10.20/ | head -5 # le site 2002 est servi
nmap -Pn -p 445,5985 10.10.10.10-31 # surface d'attaque
```
`doctor` est le premier réflexe quand quelque chose cloche : il sépare un problème réseau d'un
problème de domaine.
Depuis une VM, l'isolation se vérifie ainsi (attendu : `False` partout sauf le pair interne) :
```powershell
Test-NetConnection 192.168.10.1 -Port 445
Test-NetConnection 1.1.1.1 -Port 443
Test-NetConnection 10.10.10.20 -Port 5985
```
## Déploiement sur Proxmox
Rien n'est automatisé côté hôte avant `check` : le script **vérifie** la configuration et refuse
de continuer si elle ne correspond pas à la machine.
1. **Remplir `platforms/proxmox/lab.conf`** :
| Clé | À mettre |
|---|---|
| `PVE_STORAGE_DISKS` | stockage des disques (`local-lvm`, `local-zfs`…) |
| `PVE_STORAGE_ISO` | stockage avec le contenu `iso` (`pvesm status -content iso`) |
| `PVE_ISO_DIR` | chemin réel derrière ce stockage (`/var/lib/vz/template/iso` par défaut) |
| `PVE_BRIDGE` | `vmbr10` |
| `LAB_HOST_IP` | adresse de l'hôte sur ce pont, `10.10.10.1` |
| `PVE_VMID_BASE` | premier identifiant de VM libre, `1100` |
2. **Créer le pont** dans l'interface : nom `vmbr10`, aucun port, `10.10.10.1/24`, pas de
passerelle. Le script ne touche jamais à `/etc/network/interfaces`.
3. **Lancer** :
```bash
cd platforms/proxmox
./lab.sh check # qm, stockages, pont, ISO, config
./lab.sh init
./lab.sh isos # télécharge dans PVE_ISO_DIR
./lab.sh build
./lab.sh provision
./lab.sh web --sync
./lab.sh snapshot # convertit les VM en gabarits (ids +100)
```
`reset` détruit la VM et la reclone depuis le gabarit : quelques secondes, pas de réinstallation.
### Sans accès au serveur git
Sur un hôte qui ne peut pas cloner le dépôt :
```bash
./build-bundle.sh proxmox # sur votre poste
scp dist/norbourg-proxmox.tar.gz root@pve:/root/
ssh root@pve 'tar xzf norbourg-proxmox.tar.gz && cd norbourg-proxmox/platforms/proxmox && ./lab.sh check'
```
L'archive contient le contenu commun, la plateforme, la documentation et la solution.
### Accès des participants : VM routeur WireGuard
C'est la seule étape manuelle restante. Sur l'hôte Proxmox, créez une petite VM (Alpine ou
Debian, 512 Mo) avec deux cartes : `vmbr0` (réseau du bureau) et `vmbr10` (laboratoire). Dans
cette VM, installez WireGuard et collez la configuration produite par :
```bash
./platforms/proxmox/lab.sh peers alice bob carol
# écrit une config par participant et le wg0.conf du routeur dans $WG_DIR
```
Chaque participant importe son fichier `.conf` : il obtient une adresse dans `10.10.10.0/24` et
n'a plus qu'à suivre `docs/prerequis.md` (sans l'étape de route, le tunnel la fournit).
## DHCP du laboratoire
DC01 sert aussi DHCP sur le segment du laboratoire (plage `10.10.10.100-200`, DNS et domaine
fournis, **aucune passerelle** : le laboratoire est isolé). Tout appareil branché sur le pont se
configure seul. Une réservation fixe `10.10.10.101` est créée pour la VM Kali.
Conséquence pratique : les participants qui amènent leur propre machine sur `192.168.10.0/24`
suivent toujours `docs/prerequis.md` (route + DNS), mais une machine branchée directement sur le
pont n'a rien à configurer.
## Réseau et isolation
L'hôte a une adresse sur `br-lab` (`10.10.10.230`) et une sur le réseau du bureau. Le pare-feu
n'autorise **que** le sens participant → laboratoire, sur les ports `53, 80, 88, 135, 139, 389,
443, 445, 464, 3268, 3389, 5985`. Le sens laboratoire → bureau est rejeté, de même que
laboratoire → hôte.
Conséquence pratique : une VM compromise ne peut pas atteindre votre réseau d'entreprise. C'est
volontaire et c'est la propriété la plus importante du montage.
`sudo ./platforms/qemu/setup-network.sh --verify` affiche l'état, `--remove` défait tout.
## Dépannage
| Symptôme | Piste |
|---|---|
| `build` reste muet plus de 30 min | `./lab.sh vnc dc01` pour voir l'écran ; journal QEMU dans `$LAB_ROOT/run/<vm>.log` |
| WinRM injoignable après installation | `./lab.sh vnc <vm>`, ouvrir une session, vérifier `C:\norbourg\bootstrap.log` |
| `provision` échoue sur `dc01` | lire `C:\norbourg\provision.log` et `C:\norbourg\roles\dc01.ps1.done` |
| Le domaine ne se joint pas | le DC doit être promu avant : `./lab.sh provision --role dc01` |
| `nslookup` en `NXDOMAIN` côté participant | le DNS du Kali ne pointe pas sur `10.10.10.10` |
| Site injoignable | `./lab.sh web` n'a pas encore été poussé sur FS01 (étape à venir) |
Journaux utiles sur une VM : `C:\norbourg\bootstrap.log`, `C:\norbourg\provision.log`,
`C:\norbourg\roles\<rôle>.log`.
## Déroulé suggéré de l'atelier
| Durée | Segment |
|---|---|
| 15 min | accueil, contexte, règles d'engagement |
| 15 min | rappel terminal et méthodologie |
| 75 min | travail en autonomie, indices à trois niveaux |
| 20 min | débriefing technique : le chemin complet |
| 15 min | volet défensif : quels journaux auraient vu quoi |
## Volet défensif
La politique d'audit avancée est activée sur `dc01` par `dc01-post.ps1`. Le débriefing s'appuie
sur `docs/blue-team.md` : chaque étape de l'attaque correspond à un événement précis
(`4769` pour Kerberoasting, `4768` pour AS-REP, `4624` type 3 pour le mouvement latéral,
`4738` pour la réinitialisation de mot de passe, `4662` pour DCSync).
## Remise à zéro
Une fois le laboratoire validé, figez l'état propre :
```bash
./lab.sh snapshot # arrête les VM et fige une base (~2 min)
./lab.sh snapshot --update # intègre les changements courants à la base
./lab.sh up # ou ./lab.sh reset pour repartir de la base
```
Ensuite, `./lab.sh reset` arrête les VM, jette les disques de travail et les recrée depuis la
base : environ deux minutes, sans réinstallation. C'est la commande à utiliser entre deux
groupes ou après une manipulation destructive.
Les disques sont organisés en deux couches : `images/base/<vm>-base.qcow2` (jamais modifié) et
`images/overlays/<vm>.qcow2` (jetable).
-94
View File
@@ -1,94 +0,0 @@
# Prérequis — participants
À faire **avant** l'atelier. Comptez quinze minutes, dont la majeure partie consiste à
attendre que votre machine virtuelle démarre.
## Ce qu'il vous faut
- Une machine Kali Linux, en VM ou sur votre poste, branchée sur le même réseau que l'hôte du
laboratoire (`192.168.10.0/24`).
- Les droits `sudo` dans ce Kali.
- Rien d'autre : l'image fournie contient déjà tous les outils de l'atelier
(`netexec`, Impacket, BloodHound, hashcat, rockyou).
> Le laboratoire est isolé : une fois connecté, la résolution de noms vers Internet cesse de
> fonctionner. C'est normal et voulu. La section 5 explique comment revenir en arrière.
## 1. Route vers le laboratoire
```bash
sudo ip route add 10.10.10.0/24 via 192.168.10.230
```
Pour que la route survive à un redémarrage, utilisez plutôt NetworkManager :
```bash
sudo nmcli con mod "<votre-connexion>" +ipv4.routes "10.10.10.0/24 192.168.10.230"
sudo nmcli con up "<votre-connexion>"
```
Remplacez `<votre-connexion>` par le nom affiché par `nmcli con show` (souvent `Wired
connection 1` ou `eth0`).
## 2. DNS vers le contrôleur de domaine
```bash
sudo nmcli con mod "<votre-connexion>" ipv4.dns 10.10.10.10 ipv4.ignore-auto-dns yes
sudo nmcli con up "<votre-connexion>"
```
**Pourquoi le DNS et non `/etc/hosts` ?** Active Directory se découvre par des
enregistrements `SRV` (`_ldap._tcp.dc._msdcs.norbourg.lab`). Un fichier `hosts` ne fournit que
des noms de machines : la découverte du domaine, `netexec smb norbourg.lab` et les requêtes
Kerberos par nom échoueront. Le fichier `hosts` est un pis-aller, pas une solution.
## 3. Vérification
Les quatre commandes doivent répondre :
```bash
ping -c 2 10.10.10.10
nslookup www.norbourg.lab
nslookup -type=SRV _ldap._tcp.dc._msdcs.norbourg.lab
nmap -Pn -p 88,389,445 10.10.10.10
```
Résultats attendus :
| Commande | Attendu |
|---|---|
| `ping` | réponses de `10.10.10.10` |
| `nslookup www` | `10.10.10.20` |
| `nslookup -type=SRV` | un enregistrement pointant vers `dc01.norbourg.lab` |
| `nmap` | ports `88`, `389` et `445` ouverts |
## 4. Si quelque chose ne répond pas
| Symptôme | Cause probable | Correctif |
|---|---|---|
| `ping` sans réponse | route absente | refaire l'étape 1 |
| `ping` OK, `nslookup` en `NXDOMAIN` | DNS encore chez le routeur du bureau | refaire l'étape 2 |
| `nslookup` OK, `nmap` en `filtered` | pare-feu de l'hôte | aviser l'instructeur |
| `ping` OK mais tout le reste échoue | vous êtes sur le Wi-Fi invité, pas sur le réseau du labo | changer de réseau |
## 5. Revenir en arrière
Après l'atelier, pour retrouver Internet :
```bash
sudo ip route del 10.10.10.0/24 via 192.168.10.230
sudo nmcli con mod "<votre-connexion>" ipv4.ignore-auto-dns no ipv4.dns ""
sudo nmcli con up "<votre-connexion>"
```
## Adresses du laboratoire
| Machine | Adresse | Rôle |
|---|---|---|
| Passerelle | `10.10.10.230` | hôte du laboratoire, ne pas attaquer |
| `dc01` | `10.10.10.10` | contrôleur de domaine, DNS |
| `fs01` | `10.10.10.20` | serveur de fichiers, site archivé |
| `ws01` | `10.10.10.31` | poste de travail |
Les adresses `10.10.10.1` à `10.10.10.9` et `10.10.10.200` et plus ne font pas partie du
laboratoire.
-361
View File
@@ -1,361 +0,0 @@
# shellcheck shell=bash
# Proxmox VE backend.
#
# Hardware model mirrors the QEMU platform: q35 + SATA + e1000, so the same
# unattended file and the same role scripts work unchanged. Provisioning talks
# to the QEMU guest agent (`qm guest exec`), so the Proxmox host needs no
# Python packages beyond its own.
# ------------------------------------------------------------------ helpers
pve_vmid() {
local i
i=$(vm_index "$1") || return 1
printf '%s' $(( PVE_VMID_BASE + i ))
}
pve_template_vmid() {
local i
i=$(vm_index "$1") || return 1
printf '%s' $(( PVE_VMID_BASE + 100 + i ))
}
pve_exists() { qm status "$1" >/dev/null 2>&1; }
pve_is_template() { qm config "$1" 2>/dev/null | grep -qx 'template: 1'; }
pve_running() { qm status "$1" 2>/dev/null | grep -q 'status: running'; }
pve_ip() { local i; i=$(vm_index "$1"); printf '%s' "${VM_IPS[$i]}"; }
# ------------------------------------------------------------------ preflight
backend_check() {
if ! command -v qm >/dev/null 2>&1; then
_c_fail "qm not found — this script must run on a Proxmox VE host"
return
fi
_c_ok "qm present ($(pveversion 2>/dev/null | cut -d/ -f1-2))"
command -v pvesm >/dev/null 2>&1 && _c_ok "pvesm present" || _c_fail "pvesm missing"
# storages
local iso_content
if pvesm status 2>/dev/null | awk 'NR>1{print $1}' | grep -qx "$PVE_STORAGE_DISKS"; then
_c_ok "disk storage ${PVE_STORAGE_DISKS} present"
else
_c_fail "disk storage ${PVE_STORAGE_DISKS} not found (run pvesm status)"
fi
iso_content=$(pvesm status -content iso 2>/dev/null | awk 'NR>1{print $1}' | tr '\n' ' ')
if [[ " $iso_content " == *" ${PVE_STORAGE_ISO} "* ]]; then
_c_ok "iso storage ${PVE_STORAGE_ISO} present"
else
_c_fail "storage ${PVE_STORAGE_ISO} has no iso content (available: ${iso_content:-none})"
fi
if [[ -d $PVE_ISO_DIR && -w $PVE_ISO_DIR ]]; then
_c_ok "iso directory ${PVE_ISO_DIR} writable"
else
_c_fail "iso directory ${PVE_ISO_DIR} missing or not writable"
fi
# isolated bridge
if [[ -d /sys/class/net/$PVE_BRIDGE ]]; then
if ip -4 -o addr show dev "$PVE_BRIDGE" 2>/dev/null | grep -q "inet ${LAB_HOST_IP}/"; then
_c_ok "bridge ${PVE_BRIDGE} has ${LAB_HOST_IP}"
else
_c_fail "bridge ${PVE_BRIDGE} exists but does not carry ${LAB_HOST_IP}"
fi
else
_c_fail "bridge ${PVE_BRIDGE} missing — create it in the GUI (see lab.conf)"
fi
# guest agent is what provisioning talks to; it cannot be probed before boot
_c_ok "provisioning over qm guest exec (agent installed by bootstrap)"
[[ -f $WINDOWS_ISO ]] && _c_ok "Windows ISO present" \
|| _c_warn "Windows ISO missing: run ./lab.sh isos"
if command -v genisoimage >/dev/null 2>&1 || command -v xorriso >/dev/null 2>&1; then
_c_ok "ISO tooling present"
else
_c_fail "genisoimage or xorriso required to build seed ISOs"
fi
}
# ------------------------------------------------------------------ lifecycle
backend_running() {
local vmid
vmid=$(pve_vmid "$1") || return 1
pve_running "$vmid"
}
backend_create_disk() {
local name=$1 dry=${2:-0}
local i vmid ram disk vcpu seed win mac
i=$(vm_index "$name") || die "unknown vm: $name"
vmid=$(pve_vmid "$name")
ram=${VM_RAM[$i]}; disk=${VM_DISK[$i]}; vcpu=${VM_VCPU[$i]}
seed="$SEED_DIR/${name}-seed.iso"
win=$WINDOWS_ISO
mac=$(qemu_mac_for "${VM_IPS[$i]}")
if pve_exists "$vmid"; then
ok "$(printf '%-6s vm %s already exists' "$name" "$vmid")"
return 0
fi
[[ -f $seed ]] || (( dry )) || die "missing seed ISO for $name (run ./lab.sh seeds)"
[[ -f $win ]] || (( dry )) || die "missing Windows ISO: $win (run ./lab.sh isos)"
local args=(
"$vmid"
--name "norbourg-$name"
--memory "$ram" --cores "$vcpu" --sockets 1
--machine "$PVE_MACHINE" --bios "$PVE_BIOS" --ostype "$PVE_OSTYPE" --cpu "$PVE_CPU"
--net0 "${PVE_NET_MODEL},bridge=${PVE_BRIDGE},macaddr=${mac}"
--sata0 "${PVE_STORAGE_DISKS}:${disk}"
--ide2 "${PVE_STORAGE_ISO}:iso/$(basename "$win"),media=cdrom"
--ide0 "${PVE_STORAGE_ISO}:iso/$(basename "$seed"),media=cdrom"
--boot "order=ide2;ide0"
--onboot 0 --startup 0
)
(( PVE_AGENT )) && args+=( --agent enabled=1 )
if (( dry )); then
info " + qm create ${args[*]}"
return 0
fi
qm create "${args[@]}" || { fail "qm create failed for $name"; return 1; }
ok "$(printf '%-6s vm %s created (%sG on %s)' "$name" "$vmid" "$disk" "$PVE_STORAGE_DISKS")"
}
backend_launch() {
local name=$1 mode=${2:-run} dry=${3:-0}
local vmid
vmid=$(pve_vmid "$name")
if (( dry )); then
info " + qm start $vmid"
return 0
fi
pve_running "$vmid" && { info " $name already running"; return 0; }
qm start "$vmid" >/dev/null || { fail "qm start failed for $name"; return 1; }
ok "$(printf '%-6s started (vm %s)' "$name" "$vmid")"
}
backend_stop() {
local name=$1 vmid
vmid=$(pve_vmid "$name")
pve_running "$vmid" || { info " $name already stopped"; return 0; }
qm shutdown "$vmid" --timeout 90 >/dev/null 2>&1 || true
if pve_running "$vmid"; then
warn "$name did not shut down cleanly, forcing stop"
qm stop "$vmid" >/dev/null 2>&1 || true
sleep 2
fi
ok "$name stopped"
}
backend_snapshot() {
local name=$1 vmid tpl
vmid=$(pve_vmid "$name")
tpl=$(pve_template_vmid "$name")
pve_running "$vmid" && { fail "$name is still running"; return 1; }
if pve_exists "$tpl"; then
ok "$(printf '%-6s template %s already exists' "$name" "$tpl")"
return 0
fi
pve_exists "$vmid" || { fail "$name has no VM to freeze"; return 1; }
qm template "$vmid" >/dev/null || { fail "qm template failed for $name"; return 1; }
ok "$(printf '%-6s frozen as template %s' "$name" "$tpl")"
}
backend_reset() {
local name=$1 vmid tpl
vmid=$(pve_vmid "$name")
tpl=$(pve_template_vmid "$name")
pve_running "$vmid" && backend_stop "$name" >/dev/null 2>&1 || true
pve_exists "$tpl" || { fail "$name has no template — run ./lab.sh snapshot first"; return 1; }
pve_exists "$vmid" && qm destroy "$vmid" --purge 1 >/dev/null 2>&1
qm clone "$tpl" "$vmid" --name "norbourg-$name" >/dev/null \
|| { fail "qm clone failed for $name"; return 1; }
ok "$(printf '%-6s reverted from template %s' "$name" "$tpl")"
}
backend_destroy() {
local name=$1 vmid tpl
vmid=$(pve_vmid "$name")
tpl=$(pve_template_vmid "$name")
pve_running "$vmid" && backend_stop "$name" >/dev/null 2>&1 || true
if pve_exists "$vmid"; then
qm destroy "$vmid" --purge 1 >/dev/null 2>&1 || true
fi
if pve_exists "$tpl"; then
qm destroy "$tpl" --purge 1 >/dev/null 2>&1 || true
fi
ok "$name removed"
}
# ------------------------------------------------------------------ transport
# qm guest exec returns JSON; unwrap it without adding Python dependencies.
_qga() {
local name=$1; shift
local vmid
vmid=$(pve_vmid "$name")
qm guest exec "$vmid" --timeout "${QGA_TIMEOUT:-180}" -- "$@"
}
_qga_unwrap() {
python3 - "$1" <<'PY'
import json, sys
try:
data = json.loads(sys.argv[1])
except Exception:
print("could not parse guest agent output", file=sys.stderr)
sys.exit(2)
sys.stdout.write(data.get("out", ""))
if data.get("err", "").strip():
sys.stderr.write(data["err"])
sys.exit(int(data.get("exitcode", 0)))
PY
}
backend_ps() {
local name=$1 script=$2 json
json=$(_qga "$name" powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "$script" 2>/dev/null) \
|| return 2
_qga_unwrap "$json"
}
backend_ready() {
local name=$1 timeout=${2:-300}
local deadline=$(( SECONDS + timeout )) vmid
vmid=$(pve_vmid "$name")
while (( SECONDS < deadline )); do
pve_running "$vmid" || { sleep 10; continue; }
if _qga "$name" cmd.exe /c exit >/dev/null 2>&1; then
return 0
fi
sleep 10
done
fail "$name: guest agent not answering (is qemu-ga installed? see C:\\norbourg\\bootstrap.log)"
return 1
}
backend_start() {
local name=$1 remote=$2
backend_ps "$name" "
Remove-Item -Force -ErrorAction SilentlyContinue '${remote}.done'
schtasks.exe /End /TN NorbourgStage 2>\$null | Out-Null
schtasks.exe /Delete /TN NorbourgStage /F 2>\$null | Out-Null
\$tr = 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"${remote}\"'
schtasks.exe /Create /TN NorbourgStage /F /SC ONCE /ST 00:00 /RU SYSTEM /RL HIGHEST /TR \$tr | Out-Null
schtasks.exe /Run /TN NorbourgStage | Out-Null
"
}
backend_wait() {
local name=$1 remote=$2 timeout=${3:-1800}
local deadline=$(( SECONDS + timeout )) out
while (( SECONDS < deadline )); do
out=$(backend_ps "$name" "Test-Path '${remote}.done'" 2>/dev/null | tr -d '\r\n ')
if [[ $out == True ]]; then
backend_ps "$name" "Get-Content -Raw '${remote}.done'" 2>/dev/null | sed '/^$/d'
return 0
fi
sleep 10
done
return 3
}
# ------------------------------------------------------------------ peers
# Generate one WireGuard config per participant, plus the router's wg0.conf.
cmd_peers() {
local names=("$@")
(( ${#names[@]} )) || die "usage: ./lab.sh peers <name> [name...]"
have_cmd wg || die "wireguard-tools is required (apt install wireguard-tools)"
mkdir -p "$WG_DIR"
chmod 700 "$WG_DIR"
if [[ ! -f $WG_DIR/server.key ]]; then
( umask 077; wg genkey > "$WG_DIR/server.key" )
wg pubkey < "$WG_DIR/server.key" > "$WG_DIR/server.pub"
ok "server key generated"
fi
local endpoint=${WG_ENDPOINT:-}
if [[ -z $endpoint ]]; then
local iface ip
iface=$(ip route show default 2>/dev/null | awk '/default/{print $5; exit}')
ip=$(ip -4 -o addr show dev "${iface:-vmbr0}" 2>/dev/null | awk '{print $4}' | cut -d/ -f1 | head -1)
endpoint="${ip:-<LAN-IP>}:${WG_PORT}"
else
endpoint="${endpoint}:${WG_PORT}"
fi
local i name addr priv pub psk peer_conf router_peers=""
for i in "${!names[@]}"; do
name=${names[$i]}
addr="10.10.10.$(( 101 + i ))/32"
( umask 077; wg genkey > "$WG_DIR/${name}.key" )
wg pubkey < "$WG_DIR/${name}.key" > "$WG_DIR/${name}.pub"
( umask 077; wg genpsk > "$WG_DIR/${name}.psk" )
priv=$(<"$WG_DIR/${name}.key")
pub=$(<"$WG_DIR/${name}.pub")
psk=$(<"$WG_DIR/${name}.psk")
cat > "$WG_DIR/${name}.conf" <<CONF
[Interface]
PrivateKey = ${priv}
Address = ${addr}
DNS = ${LAB_DC_IP}
[Peer]
PublicKey = $(<"$WG_DIR/server.pub")
PresharedKey = ${psk}
Endpoint = ${endpoint}
AllowedIPs = ${LAB_SUBNET}
PersistentKeepalive = 25
CONF
chmod 600 "$WG_DIR/${name}.conf"
router_peers+="
[Peer]
# ${name}
PublicKey = ${pub}
PresharedKey = ${psk}
AllowedIPs = ${addr}"
ok "$(printf '%-10s %-16s %s' "$name" "${addr%/32}" "$WG_DIR/${name}.conf")"
done
cat > "$WG_DIR/wg0.conf" <<CONF
# Router VM — paste into /etc/wireguard/wg0.conf and: systemctl enable --now wg-quick@wg0
[Interface]
Address = 10.10.10.250/24
ListenPort = ${WG_PORT}
PrivateKey = $(<"$WG_DIR/server.key")
# Participants reach the DC first; the lab subnet is routed over vmbr10.
PostUp = sysctl -w net.ipv4.ip_forward=1
PostUp = nft add rule ip filter forward iifname "wg0" oifname "vmbr10" accept
PostUp = nft add rule ip filter forward iifname "vmbr10" oifname "wg0" ct state established,related accept
${router_peers}
CONF
chmod 600 "$WG_DIR/wg0.conf"
printf '\n'
ok "peer configs in ${WG_DIR}"
info " router config: ${WG_DIR}/wg0.conf (address 10.10.10.250 on the lab bridge)"
}
+243
View File
@@ -0,0 +1,243 @@
# Laboratoire Norbourg — atelier d'introduction au pentest de domaine
Laboratoire Active Directory isolé, déployé par script, pour initier des collègues au pentest de
domaine. L'objectif : partir d'un accès anonyme et **prendre le contrôle du domaine**, comme
sur une plateforme de type Hack The Box.
> **État : fonctionnel.** Le parcours complet (site → SMB → Kerberoasting → WinRM → ACL →
> droits de réplication, puis DCSync) a été validé sur la plateforme `qemu`. La plateforme
> `proxmox` est écrite et vérifiée statiquement, mais n'a pas encore tourné sur un hôte Proxmox
> réel — y compris le déploiement des Kali par l'agent invité, testé hors Proxmox seulement.
## Deux plateformes, un même contenu
| | `qemu` | `proxmox` |
|---|---|---|
| Cible | n'importe quel Linux avec KVM | Proxmox VE 8.x |
| Commande | `./platforms/qemu/lab.sh` | `./platforms/proxmox/lab.sh` |
| Configuration | `platforms/qemu/lab.conf` | `platforms/proxmox/lab.conf` |
| Disques | qcow2 + `chattr +C` sur btrfs | stockage Proxmox (`local-lvm`, `local-zfs`…) |
| Réseau | pont `br-lab` créé par le script | pont `vmbr10` créé à la main dans l'interface |
| Réinitialisation | base + couche jetable (~2 s) | gabarit + clone |
| Accès participants | route vers `10.10.10.0/24` | console web Proxmox, une Kali par personne |
Le contenu commun — scripts PowerShell, site archivé, documentation, solution — vit dans
`content/` et `docs/`. Les deux plateformes ne diffèrent que par la couche de virtualisation.
## Topologie
```
participant (Kali)
│ route 10.10.10.0/24 via 10.10.10.1 (ou tunnel WireGuard)
▼
hôte 10.10.10.1 / 10.10.10.230 pont isolé
├── DC01 10.10.10.10 contrôleur de domaine, DNS
├── FS01 10.10.10.20 serveur de fichiers, site 2002, partage Public
└── WS01 10.10.10.31 poste de travail
```
## Prérequis
- Hôte Linux avec KVM, 16 Go de RAM et ~80 Go libres, **ou** un hôte Proxmox VE 8.x.
- Un accès `sudo` une seule fois sur la plateforme `qemu` (pont et pare-feu).
- Une machine Kali sur le même réseau local, ou un tunnel WireGuard.
---
## Démarrage — plateforme `qemu` (Linux générique)
```bash
cd platforms/qemu
./lab.sh check # valide hôte, stockage, réseau, configuration
./lab.sh init # arborescence + chattr +C
sudo ./setup-network.sh # pont br-lab et isolation — seule étape root
./lab.sh isos # télécharge 5,6 Go d'images Windows
./lab.sh build # installe les 3 VM sans intervention (~20 min)
./lab.sh provision # domaine, comptes, ACL, drapeaux (~15 min)
./lab.sh web --sync # publie le site 2002 sur FS01
./lab.sh save # fige l'état dans la base et redémarre
```
## Démarrage — plateforme `proxmox`
1. Remplir `platforms/proxmox/lab.conf` : stockages, pont, adresse de l'hôte.
2. Créer le pont dans l'interface Proxmox : *Datacenter > nœud > Network > Create > Linux
Bridge*, nom `vmbr10`, **aucun port**, IPv4 `10.10.10.1/24`, pas de passerelle.
3. Puis :
```bash
cd platforms/proxmox
./lab.sh check # refuse de continuer si la config ne correspond pas à l'hôte
./lab.sh init
./lab.sh isos
./lab.sh build
./lab.sh provision
./lab.sh web --sync
./lab.sh snapshot # convertit les VM en gabarits
./lab.sh up # redémarre le laboratoire depuis les gabarits
./lab.sh kali install # une Kali par participant (5 par défaut)
./lab.sh users alice bob carol # comptes Proxmox + URL de console
```
Les participants n'ont rien à installer : chacun ouvre son URL de console dans un navigateur,
se connecte avec le compte Proxmox imprimé, et arrive sur un bureau Kali déjà configuré (DNS du
laboratoire, liste de mots, outils). Voir « Participants » plus bas.
Sans accès au serveur git sur l'hôte Proxmox, construisez une archive autonome :
```bash
./build-bundle.sh proxmox # produit dist/norbourg-proxmox.tar.gz
scp dist/norbourg-proxmox.tar.gz root@pve:/root/
```
## Machine d'attaque (Kali)
L'image QEMU officielle de Kali contient déjà `nxc`, Impacket, `evil-winrm`, `hashcat` et
`bloodhound-python`. Le parcours ne demande rien d'autre : `bloodyAD` est un confort, pas une
dépendance.
### Plateforme `qemu`
```bash
./lab.sh kali install # télécharge ~4 Go, extrait, prépare une couche jetable
./lab.sh kali up # démarre (VNC 127.0.0.1:5909, SSH 127.0.0.1:2222)
./lab.sh kali snapshot # fige l'état courant (outils, liste de mots, DNS) dans la base
./lab.sh kali reset # repart de la base figée
./lab.sh kali down
```
Identifiants par défaut : `kali` / `kali`. La VM a deux cartes : le pont du laboratoire
(adresse fournie par le DHCP de DC01) et un réseau utilisateur qui permet `apt` sans ouvrir de
passage vers le réseau du bureau.
Un petit ISO « outils » est monté dans la VM : il contient `norbourg.txt`, la liste de mots de
l'atelier. À récupérer une fois au premier démarrage, puis à figer avec `./lab.sh kali snapshot`
pour que `reset` la conserve :
```bash
sudo mkdir -p /opt/norbourg/wordlists
sudo mount /dev/sr0 /mnt && sudo cp /mnt/norbourg.txt /opt/norbourg/wordlists/
sudo cp /mnt/bh_clues.py /opt/norbourg/ && sudo chmod +x /opt/norbourg/bh_clues.py
```
Pour ajouter des outils qui ne sont pas dans l'image (Internet requis, donc avant de basculer le
DNS sur le DC) : `content/scripts/kali-setup.sh`.
### Plateforme `proxmox`
Aucune manipulation dans la VM : `kali install` importe l'image une fois, en fait un gabarit,
puis crée et configure chaque clone par l'agent invité — adresse fixe réservée sur DC01, nom,
liste de mots copiée depuis l'ISO d'outils.
```bash
./lab.sh kali install # KALI_COUNT clones (5 par défaut)
./lab.sh kali status
./lab.sh kali up | down
./lab.sh kali configure # rejoue la configuration si un clone a échoué
./lab.sh kali reset # détruit et recrée les clones
```
Les Kali n'ont **pas** Internet : c'est volontaire, le pont n'a aucun port vers l'extérieur.
Tout ce que demande l'atelier est déjà dans l'image, et la liste de mots arrive par l'ISO
d'outils.
`KALI_XRDP=1` (par défaut) installe `xrdp` dans le gabarit pour ceux qui veulent un bureau
graphique via un client RDP. `./lab.sh kali rdp` expose un port par siège (3381, 3382…).
## Participants
Chaque personne reçoit un compte Proxmox limité à sa propre VM :
```bash
./lab.sh users alice bob carol dave erin
```
La commande crée `alice@pve`, etc., accorde le rôle `PVEVMUser` sur la VM correspondante et
imprime le mot de passe ainsi que l'URL de console :
```
USER PASSWORD KALI CONSOLE URL
alice Xk3... vm 1301 https://pve:8006/?console=kvm&novnc=1&vmid=1301&node=pve&resize=scale
```
L'URL ouvre directement la console noVNC de la Kali. Identifiants dans la VM : `kali` / `kali`.
Aucun VPN, aucune route à ajouter, aucun outil à installer sur le poste du participant.
Pour plus de cinq personnes, ajustez `KALI_COUNT` dans `platforms/proxmox/lab.conf`, relancez
`./lab.sh kali install`, puis `./lab.sh users` avec la liste complète : les sièges sont attribués
dans l'ordre (`alice` → vm 1301, `bob` → vm 1302, …).
Dimensionnement : `KALI_COUNT × KALI_RAM` s'ajoute aux 12 Go du laboratoire. Avec les valeurs par
défaut (5 × 3 Go), comptez environ 30 Go de RAM sur l'hôte ; `./lab.sh check` compare la somme à
la mémoire de l'hôte et prévient avant le build.
## Commandes
| Commande | Effet |
|---|---|
| `check` | préflight ; refuse si le stockage ou la config sont inadaptés |
| `init` | arborescence, désactivation du CoW |
| `isos` | télécharge les images d'évaluation Microsoft |
| `seeds` | génère les fichiers de réponse et les ISO d'amorçage |
| `build` | disques + installation sans intervention |
| `provision [--role N]` | domaine, comptes, ACL, partage, drapeaux |
| `web [--sync]` | assemble le site et le pousse sur FS01 |
| `save` | **la commande de clôture** : fige l'état courant dans la base, puis démarre |
| `snapshot [--update]` | fige une base ; `--update` y intègre les changements, sans redémarrer |
| `up` / `down` | démarre (DC d'abord) / arrête |
| `reset` | repart de la base |
| `status` / `doctor` | tableau des VM / bilan de santé |
| `vnc <vm>` | console graphique (plateforme qemu) |
| `kali` | installe et pilote les VM d'attaque (voir plus haut) |
| `users <noms>` | comptes Proxmox + URL de console, une Kali par personne (proxmox) |
| `answers` | affiche la solution de l'instructeur |
| `peers` | configs WireGuard (plateforme proxmox) |
## Structure du dépôt
| Chemin | Rôle |
|---|---|
| `platforms/qemu/` | point d'entrée et configuration pour un Linux générique |
| `platforms/proxmox/` | point d'entrée et configuration pour Proxmox VE |
| `content/lib/` | commandes communes, préflight, orchestration |
| `content/windows/` | scripts PowerShell par machine |
| `content/seed/` | fichier de réponse et charge utile des ISO d'amorçage |
| `content/site-src/` | site Norbourg 2002 : miroir et images retouchées |
| `content/web/` | site assemblé et fichiers pièges |
| `content/scripts/` | assistants partagés (WinRM, préparation du site, liste de mots) |
| `docs/` | documentation de l'atelier, en français |
| `docs/slides/` | présentation d'introduction et de débriefing (`.pptx` + script de génération) |
| `answers/` | solution complète — **ignoré par git** |
| `build-bundle.sh` | fabrique une archive autonome par plateforme |
## Isolation
Rien du laboratoire ne doit joindre le réseau de bureau ni Internet :
- le pont du laboratoire n'a aucun port vers l'extérieur ;
- seul le sens participant → laboratoire est autorisé, sur les ports nécessaires
(DNS, Kerberos, LDAP, SMB, WinRM, HTTP) ;
- le sens laboratoire → bureau est rejeté.
Sur `qemu`, c'est le pare-feu de l'hôte qui l'applique ; sur `proxmox`, le pont sans port suffit,
et le routeur WireGuard ne fait que router.
## Contenu archivé
`content/site-src/` contient une capture du site public de Norbourg tel qu'il existait en 2002,
provenant de la Wayback Machine. Il sert de décor au laboratoire et de point d'entrée pour les
participants. Usage strictement interne et pédagogique.
## Session 2
Le dossier [`session2/`](../session2/README.md) contient la conception d'une deuxième séance : vol de
matériel d'authentification dans LSASS (mimikatz, overpass-the-hash, pass-the-ticket). **Rien
n'y est implémenté** — c'est un plan, pas du code. Le laboratoire décrit ci-dessus reste la
version de référence.
## Avertissement
Laboratoire jetable. Les images Windows sont des versions d'évaluation Microsoft (180 jours pour
Server, 90 jours pour Windows 11) : à reconstruire périodiquement, jamais à exposer, jamais en
production. Les vulnérabilités sont volontaires.
@@ -83,6 +83,14 @@ _wait_for_boot() {
printf '\n' printf '\n'
ok "all VMs installed and reachable" ok "all VMs installed and reachable"
if declare -F backend_finalize >/dev/null; then
step "finalize"
for name in "${VM_NAMES[@]}"; do
backend_finalize "$name" || warn "$name: finalize step failed"
done
fi
info " next: ./lab.sh status" info " next: ./lab.sh status"
} }
@@ -108,6 +116,41 @@ _start_lab() {
backend_launch "$name" run || { fail "$name did not start"; return 1; } backend_launch "$name" run || { fail "$name did not start"; return 1; }
fi fi
done done
# Return only once every guest answers: running `doctor` the instant `up`
# printed its last line used to report false failures during boot.
step "wait for the guests"
local notready=0
for name in "${VM_NAMES[@]}"; do
if backend_ready "$name" 300; then
ok "$(printf '%-6s ready' "$name")"
else
warn "$name did not answer in time"
notready=1
fi
done
if (( notready )); then
warn "skipping the directory check: not every guest answered"
return 1
fi
# WinRM answers before the directory does. A doctor run right after up saw
# "stable path missing" and "replication rights missing" on a healthy lab
# because the DC was still starting AD.
if ! vm_index dc01 >/dev/null 2>&1; then
return 0
fi
step "wait for the domain"
local deadline=$(( SECONDS + 240 ))
while (( SECONDS < deadline )); do
if backend_ps dc01 'Import-Module ActiveDirectory; (Get-ADDomain).DNSRoot' >/dev/null 2>&1; then
ok "directory services answer"
return 0
fi
sleep 5
done
warn "the domain did not answer in time — check with ./lab.sh doctor"
return 1
} }
cmd_up() { cmd_up() {
+172
View File
@@ -0,0 +1,172 @@
# shellcheck shell=bash
# cmd_doctor — end-to-end health check of the running laboratory.
_d_ok() { ok "$*"; }
_d_warn() { warn "$*"; DOCTOR_WARNS=$(( DOCTOR_WARNS + 1 )); }
_d_fail() { fail "$*"; DOCTOR_FAILS=$(( DOCTOR_FAILS + 1 )); }
cmd_doctor() {
DOCTOR_FAILS=0
DOCTOR_WARNS=0
local i name ip
step "host"
if ip link show "$LAB_BRIDGE" >/dev/null 2>&1; then
_d_ok "bridge ${LAB_BRIDGE} present"
else
_d_fail "bridge ${LAB_BRIDGE} missing — run sudo ./platforms/qemu/setup-network.sh"
fi
step "machines"
for i in "${!VM_NAMES[@]}"; do
name=${VM_NAMES[$i]}
ip=${VM_IPS[$i]}
if ! backend_running "$name"; then
_d_fail "$name is not running — ./lab.sh up"
continue
fi
if tcp_open "$ip" 445; then
_d_ok "$(printf '%-6s %-14s smb up' "$name" "$ip")"
else
_d_warn "$(printf '%-6s %-14s smb not answering' "$name" "$ip")"
fi
if [[ $name == dc01 || $name == ws01 || $name == fs01 ]]; then
if tcp_open "$ip" 5985; then
_d_ok "$(printf '%-6s %-14s winrm up' "$name" "$ip")"
else
_d_warn "$(printf '%-6s %-14s winrm not answering' "$name" "$ip")"
fi
fi
done
step "domain"
if have_cmd dig; then
local www
www=$(dig +short +time=2 +tries=1 "@$LAB_DC_IP" www.norbourg.lab 2>/dev/null | head -1)
if [[ $www == 10.10.10.20 ]]; then
_d_ok "dns: www.norbourg.lab -> $www"
else
_d_fail "dns: www.norbourg.lab did not resolve via ${LAB_DC_IP} (got '${www:-nothing}')"
fi
local srv
srv=$(dig +short +time=2 +tries=1 "@$LAB_DC_IP" SRV _ldap._tcp.dc._msdcs.norbourg.lab 2>/dev/null | head -1)
if [[ -n $srv ]]; then
_d_ok "dns: ldap SRV record present"
else
_d_fail "dns: ldap SRV record missing — AD discovery would fail"
fi
else
_d_warn "dig not installed, DNS checks skipped"
fi
step "lab state"
_lab_state
step "web"
local code
code=$(curl -s -o /dev/null -w '%{http_code}' --max-time 5 "http://10.10.10.20/" 2>/dev/null || true)
if [[ $code == 200 ]]; then
_d_ok "site answers on 10.10.10.20"
else
_d_fail "site not answering (${code:-timeout}) — ./lab.sh web --sync"
fi
code=$(curl -s -o /dev/null -w '%{http_code}' --max-time 5 "http://10.10.10.10/" 2>/dev/null || true)
if [[ $code == 200 ]]; then
_d_ok "site answers on the domain name (http://norbourg.lab)"
else
_d_warn "http://norbourg.lab does not answer (${code:-timeout}) — re-run provision --role dc01"
fi
code=$(curl -s -o /dev/null -w '%{http_code}' --max-time 5 "http://10.10.10.20/public/IT-inventaire.txt" 2>/dev/null || true)
if [[ $code == 200 ]]; then
_d_ok "entry point reachable: /public/IT-inventaire.txt"
else
_d_fail "entry point missing (${code:-timeout})"
fi
step "share"
if have_cmd smbclient; then
if smbclient //10.10.10.20/Public -U 'NORBOURG\helpdesk1%Welcome2024!' -c 'ls' 2>/dev/null | grep -q 'IT-inventaire'; then
_d_ok "Public share reachable with the leaked credential"
else
_d_warn "Public share not readable as helpdesk1 (domain channel or DNS?)"
fi
else
_d_warn "smbclient not installed, share check skipped"
fi
printf '\n'
if (( DOCTOR_FAILS )); then
fail "${DOCTOR_FAILS} problem(s), ${DOCTOR_WARNS} warning(s)"
return 1
fi
ok "laboratory healthy · ${DOCTOR_WARNS} warning(s)"
}
# The puzzle has invariants that services do not reveal: a delegated right, an
# SPN, disabled pre-authentication, a password policy, replication rights.
# SDProp quietly reverts ACEs on protected objects, so the target must stay
# outside protected groups — worth checking every time.
_lab_state() {
local out key value
out=$(backend_ps dc01 '
Import-Module ActiveDirectory,DnsServer
$dom = Get-ADDomain
$base = $dom.DistinguishedName
$acl = Get-Acl ("AD:\" + (Get-ADUser t.smith).DistinguishedName)
"ace=" + @($acl.Access | Where-Object { $_.IdentityReference.Value -like "*svc_backup*" }).Count
$plainAcl = Get-Acl ("AD:\" + (Get-ADUser m.legault).DistinguishedName)
"ace_plain=" + @($plainAcl.Access | Where-Object { $_.IdentityReference.Value -like "*svc_backup*" }).Count
"plain_enabled=" + (Get-ADUser m.legault).Enabled
"mcount=" + (Get-ADUser m.legault -Properties adminCount).adminCount
"repl=" + @((dsacls.exe $base | Select-String "Sauvegarde-AD")).Count
"share=" + ((Get-SmbShare -Name "Sauvegarde$" -ErrorAction SilentlyContinue) -ne $null)
"root=" + (Test-Path C:\flag\root.txt)
"oldflag=" + (Test-Path C:\Sauvegarde\root.txt)
"spn=" + @((Get-ADUser svc_backup -Properties ServicePrincipalNames).ServicePrincipalNames).Count
"preauth=" + (Get-ADUser j.contractor -Properties DoesNotRequirePreAuth).DoesNotRequirePreAuth
"minage=" + (Get-ADDefaultDomainPasswordPolicy).MinPasswordAge.TotalHours
"txt=" + ((Get-DnsServerResourceRecord -ZoneName norbourg.lab -Name yourlove -EA SilentlyContinue) -ne $null)
"dhcp=" + ((Get-DhcpServerv4Scope -EA SilentlyContinue) -ne $null)
"kali_res=" + @((Get-DhcpServerv4Reservation -ScopeId 10.10.10.0 -EA SilentlyContinue) | Where-Object { $_.IPAddress -eq "10.10.10.101" }).Count
' 2>/dev/null) || { _d_warn "cannot query DC01 for lab state"; return; }
while IFS='=' read -r key value; do
value=${value//$'\r'/}
case $key in
ace) if [[ $value -ge 1 ]]; then _d_fail "decoy ACE still on t.smith — a Domain Admin shortcut until SDProp runs"
else _d_ok "decoy ACE absent on t.smith (protected object, as designed)"; fi ;;
ace_plain) if [[ $value -ge 1 ]]; then _d_ok "stable path: svc_backup has an ACE on m.legault"
else _d_fail "stable path missing (ACE on m.legault)"; fi ;;
plain_enabled) if [[ $value == True ]]; then _d_ok "m.legault account enabled"
else _d_fail "m.legault is disabled — the path is dead"; fi ;;
mcount) if [[ -z $value || $value == 0 ]]; then _d_ok "m.legault outside protected groups"
else _d_fail "adminCount=$value: m.legault is protected, SDProp will wipe the ACE"; fi ;;
repl) if [[ $value -ge 2 ]]; then _d_ok "Sauvegarde-AD holds replication rights (DCSync)"
else _d_fail "replication rights missing on Sauvegarde-AD"; fi ;;
share) if [[ $value == True ]]; then _d_ok "backup share present (Sauvegarde$)"
else _d_fail "Sauvegarde\$ share missing"; fi ;;
root) if [[ $value == True ]]; then _d_ok "root.txt in C:\flag (administrators only)"
else _d_fail "root.txt missing from C:\flag"; fi ;;
oldflag) if [[ $value == True ]]; then _d_fail "root.txt still readable on the backup share"
else _d_ok "flag not exposed on the backup share"; fi ;;
spn) if [[ $value -ge 1 ]]; then _d_ok "service account: SPN present"
else _d_fail "svc_backup has no SPN"; fi ;;
preauth) if [[ $value == True ]]; then _d_ok "pre-auth disabled on j.contractor"
else _d_fail "j.contractor still requires pre-auth"; fi ;;
minage) if [[ $value == 0 ]]; then _d_ok "minimum password age: 0"
else _d_fail "minimum password age is $value h"; fi ;;
txt) if [[ $value == True ]]; then _d_ok "easter egg TXT record"
else _d_warn "yourlove TXT record missing"; fi ;;
dhcp) if [[ $value == True ]]; then _d_ok "DHCP scope present"
else _d_fail "DHCP scope missing"; fi ;;
kali_res) if [[ $value -ge 1 ]]; then _d_ok "DHCP reservation 10.10.10.101"
else _d_fail "Kali reservation missing"; fi ;;
esac
done <<< "$out"
}
@@ -12,6 +12,43 @@ _kali_pid() { printf '%s/run/kali.pid' "$LAB_ROOT"; }
_kali_log() { printf '%s/run/kali.log' "$LAB_ROOT"; } _kali_log() { printf '%s/run/kali.log' "$LAB_ROOT"; }
_kali_installed() { [[ -f $(_kali_base) ]]; } _kali_installed() { [[ -f $(_kali_base) ]]; }
_kali_tools_iso() { printf '%s/seeds/kali-tools.iso' "$LAB_ROOT"; }
# The stock Kali image ships without the lab wordlist. A small ISO carries it
# into the guest, so a fresh redeploy is reproducible without network access.
_kali_build_tools() {
local iso dir
iso=$(_kali_tools_iso)
dir=$(mktemp -d)
mkdir -p "$(dirname "$iso")"
cp "$CONTENT_DIR/scripts/wordlists/norbourg.txt" "$dir/"
cp "$CONTENT_DIR/scripts/bh_clues.py" "$dir/"
cat > "$dir/README.txt" <<'EOF'
Outils de l'atelier Norbourg
============================
norbourg.txt : liste de mots ciblee (1716 entrees), dimensionnee pour que le
cassage prenne quelques secondes.
bh_clues.py : lit les JSON de bloodhound-python et imprime les droits
exploitables d'un compte (outil concu pour ce laboratoire).
Installation dans Kali :
sudo mkdir -p /opt/norbourg/wordlists
sudo cp /media/cdrom/norbourg.txt /opt/norbourg/wordlists/
sudo chmod 644 /opt/norbourg/wordlists/norbourg.txt
sudo cp /media/cdrom/bh_clues.py /opt/norbourg/
sudo chmod +x /opt/norbourg/bh_clues.py
EOF
if have_cmd genisoimage; then
genisoimage -quiet -volid NORBOURG_TOOLS -J -R -o "$iso" "$dir"
else
xorriso -as mkisofs -quiet -V NORBOURG_TOOLS -J -R -o "$iso" "$dir"
fi
rm -rf "$dir"
ok "tool ISO: $iso"
}
_kali_ensure_overlay() { _kali_ensure_overlay() {
local base overlay local base overlay
@@ -30,8 +67,9 @@ cmd_kali() {
up) _kali_up ;; up) _kali_up ;;
down) _kali_down ;; down) _kali_down ;;
reset) _kali_reset ;; reset) _kali_reset ;;
snapshot) _kali_snapshot ;;
status) _kali_status ;; status) _kali_status ;;
*) info "usage: ./lab.sh kali install|up|down|reset|status"; return 2 ;; *) info "usage: ./lab.sh kali install|up|down|reset|snapshot|status"; return 2 ;;
esac esac
} }
@@ -70,6 +108,7 @@ _kali_install() {
fi fi
ok "base image: $(du -h "$base" | cut -f1) (${KALI_DISK_GB:-40}G nominal)" ok "base image: $(du -h "$base" | cut -f1) (${KALI_DISK_GB:-40}G nominal)"
_kali_ensure_overlay _kali_ensure_overlay
_kali_build_tools
printf '\n' printf '\n'
ok "Kali installed — ./lab.sh kali up" ok "Kali installed — ./lab.sh kali up"
@@ -91,9 +130,15 @@ _kali_up() {
vnc=${KALI_VNC_DISPLAY:-9} vnc=${KALI_VNC_DISPLAY:-9}
mkdir -p "$LAB_ROOT/run" mkdir -p "$LAB_ROOT/run"
[[ -f $(_kali_tools_iso) ]] || _kali_build_tools
# net0: the lab bridge (DHCP from DC01). net1: user networking so apt works # net0: the lab bridge (DHCP from DC01). net1: user networking so apt works
# without punching a hole through the lab isolation policy. # without punching a hole through the lab isolation policy.
local cd_args=()
if [[ -f $(_kali_tools_iso) ]]; then
cd_args=( -drive "if=none,id=cd1,media=cdrom,file=$(_kali_tools_iso)" -device "ide-cd,drive=cd1,bus=ide.1" )
fi
nohup qemu-system-x86_64 \ nohup qemu-system-x86_64 \
-name norbourg-kali \ -name norbourg-kali \
-machine q35,accel=kvm -cpu host \ -machine q35,accel=kvm -cpu host \
@@ -107,6 +152,7 @@ _kali_up() {
-netdev "user,id=net1,hostfwd=tcp:127.0.0.1:${KALI_SSH_PORT:-2222}-:22" \ -netdev "user,id=net1,hostfwd=tcp:127.0.0.1:${KALI_SSH_PORT:-2222}-:22" \
-device "e1000,netdev=net1" \ -device "e1000,netdev=net1" \
-monitor "unix:$LAB_ROOT/run/kali.monitor,server,nowait" \ -monitor "unix:$LAB_ROOT/run/kali.monitor,server,nowait" \
"${cd_args[@]}" \
-display none -vnc "127.0.0.1:$vnc" \ -display none -vnc "127.0.0.1:$vnc" \
>>"$(_kali_log)" 2>&1 & >>"$(_kali_log)" 2>&1 &
printf '%s\n' "$!" > "$(_kali_pid)" printf '%s\n' "$!" > "$(_kali_pid)"
@@ -115,6 +161,7 @@ _kali_up() {
if kill -0 "$(<"$(_kali_pid)")" 2>/dev/null; then if kill -0 "$(<"$(_kali_pid)")" 2>/dev/null; then
ok "Kali started · vnc 127.0.0.1:$(( 5900 + vnc )) · ssh 127.0.0.1:${KALI_SSH_PORT:-2222}" ok "Kali started · vnc 127.0.0.1:$(( 5900 + vnc )) · ssh 127.0.0.1:${KALI_SSH_PORT:-2222}"
info " login kali/kali · bridge address via DHCP (${KALI_IP:-10.10.10.101} reserved)" info " login kali/kali · bridge address via DHCP (${KALI_IP:-10.10.10.101} reserved)"
info " wordlist on the tool CD: mount /dev/sr0 /mnt && cp /mnt/norbourg.txt /opt/norbourg/wordlists/"
else else
fail "Kali failed to start — see $(_kali_log)" fail "Kali failed to start — see $(_kali_log)"
return 1 return 1
@@ -136,6 +183,27 @@ _kali_down() {
ok "Kali stopped" ok "Kali stopped"
} }
# Fold the current overlay into the base image: wordlist, DNS, packages and
# any tooling you installed survive a reset from then on.
_kali_snapshot() {
local overlay
_kali_installed || die "Kali is not installed"
overlay=$(_kali_disk)
_kali_down >/dev/null 2>&1 || true
if [[ ! -f $overlay ]]; then
ok "nothing to commit — no working overlay"
return 0
fi
step "commit the overlay into ${KALI_NAME:-kali}'s base image"
qemu-img commit -q "$overlay" || die "qemu-img commit failed"
rm -f "$overlay"
_kali_ensure_overlay
ok "baseline updated: ./lab.sh kali reset now returns to this state"
}
_kali_reset() { _kali_reset() {
local overlay local overlay
_kali_installed || die "Kali is not installed" _kali_installed || die "Kali is not installed"
@@ -20,6 +20,17 @@ cmd_destroy() {
backend_destroy "$name" || warn "could not fully remove $name" backend_destroy "$name" || warn "could not fully remove $name"
done done
# Kali lives outside the VMS table; stop it but keep its 16 GB base image.
if declare -F _kali_installed >/dev/null && _kali_installed; then
_kali_down >/dev/null 2>&1 || true
info "kali stopped; base image kept ($(du -h "$(_kali_base)" | cut -f1))"
fi
# Platforms that manage extra VMs (participant Kali clones) clean up here.
if declare -F platform_destroy_extra >/dev/null; then
platform_destroy_extra
fi
step "generated artifacts" step "generated artifacts"
rm -rf "$LAB_ROOT/seeds" "$LAB_ROOT/run" "$LAB_ROOT/provision" rm -rf "$LAB_ROOT/seeds" "$LAB_ROOT/run" "$LAB_ROOT/provision"
ok "seed ISOs, runtime state and provisioning scratch removed" ok "seed ISOs, runtime state and provisioning scratch removed"
@@ -34,3 +45,6 @@ cmd_peers() { planned peers; }
# Overridden by the qemu platform, which ships the Kali image helper. # Overridden by the qemu platform, which ships the Kali image helper.
cmd_kali() { planned kali; } cmd_kali() { planned kali; }
# Participant accounts are a Proxmox concern (console access per VM).
cmd_users() { planned users; }
@@ -53,3 +53,28 @@ cmd_reset() {
printf '\n' printf '\n'
ok "laboratory reset — previous state discarded" ok "laboratory reset — previous state discarded"
} }
# The closing step of every change: freeze the current state into the
# baseline, then bring the lab back up. Falls back to a first-time snapshot
# when no baseline exists yet.
cmd_save() {
local name need_full=0
if declare -F backend_has_baseline >/dev/null; then
for name in "${VM_NAMES[@]}"; do
backend_has_baseline "$name" || need_full=1
done
else
need_full=1
fi
if (( need_full )); then
cmd_snapshot
else
cmd_snapshot --update
fi
step "start"
_start_lab
}
@@ -51,6 +51,11 @@ _web_sync() {
tcp_open "$ip" 445 || die "fs01 SMB is not reachable — is it provisioned?" tcp_open "$ip" 445 || die "fs01 SMB is not reachable — is it provisioned?"
have_cmd smbclient || die "smbclient is required to push the site" have_cmd smbclient || die "smbclient is required to push the site"
# Clear the staging folder first: smbclient only adds, so an old file would
# otherwise come back on every sync.
backend_ready fs01 120 >/dev/null 2>&1 || true
backend_ps fs01 "Remove-Item -Recurse -Force -ErrorAction SilentlyContinue 'C:\\norbourg\\site'" >/dev/null 2>&1 || true
# Bulk copy goes over SMB: WinRM caps the command line at ~8 KB. # Bulk copy goes over SMB: WinRM caps the command line at ~8 KB.
smbclient "//$ip/C\$" -W "$NETBIOS" \ smbclient "//$ip/C\$" -W "$NETBIOS" \
-U "$LAB_USER%$LAB_ADMIN_PASSWORD" \ -U "$LAB_USER%$LAB_ADMIN_PASSWORD" \
@@ -58,7 +63,15 @@ _web_sync() {
>/dev/null 2>&1 || true >/dev/null 2>&1 || true
backend_ready fs01 300 || die "fs01 did not answer" backend_ready fs01 300 || die "fs01 did not answer"
backend_ps fs01 "Copy-Item -Path 'C:\\norbourg\\site\\*' -Destination 'C:\\inetpub\\wwwroot' -Recurse -Force; Test-Path 'C:\\inetpub\\wwwroot\\index.html'" \ # Mirror, not merge: remove everything except the web.config that fs01.ps1
# places in public/, otherwise files deleted from the repo keep being served.
backend_ps fs01 "
Get-ChildItem 'C:\inetpub\wwwroot' -Force | Where-Object { \$_.Name -ne 'public' } |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
Get-ChildItem 'C:\inetpub\wwwroot\public' -Force | Where-Object { \$_.Name -ne 'web.config' } |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
Copy-Item -Path 'C:\norbourg\site\*' -Destination 'C:\inetpub\wwwroot' -Recurse -Force
Test-Path 'C:\inetpub\wwwroot\index.html'" \
| grep -qi true || die "copy failed on fs01" | grep -qi true || die "copy failed on fs01"
ok "site published to C:\\inetpub\\wwwroot" ok "site published to C:\\inetpub\\wwwroot"
@@ -26,17 +26,21 @@ Commands:
provision run the role stages (--role NAME for a single VM) provision run the role stages (--role NAME for a single VM)
web assemble the site; --sync publishes it to FS01 web assemble the site; --sync publishes it to FS01
snapshot freeze a clean baseline snapshot freeze a clean baseline
save snapshot --update then start (the closing step)
reset revert to the baseline and start reset revert to the baseline and start
up, down start / stop the VMs up, down start / stop the VMs
status VM table status VM table
vnc open a console on a VM vnc open a console on a VM
doctor end-to-end health check doctor end-to-end health check
kali install / start / stop the optional Kali attacker VM kali install / start / stop the attacker VM(s)
answers print the instructor walkthrough answers print the instructor walkthrough
destroy remove the VMs and generated artifacts destroy remove the VMs and generated artifacts
EOF EOF
case $PLATFORM in case $PLATFORM in
proxmox) printf ' peers generate WireGuard configs for participants\n' ;; proxmox)
printf ' users create a Proxmox account + console URL per participant\n'
printf ' peers generate WireGuard configs for participants\n'
;;
esac esac
} }
@@ -95,9 +99,11 @@ case $cmd in
vnc) cmd_vnc "$@" ;; vnc) cmd_vnc "$@" ;;
provision) cmd_provision "$@" ;; provision) cmd_provision "$@" ;;
snapshot) cmd_snapshot "$@" ;; snapshot) cmd_snapshot "$@" ;;
save) cmd_save "$@" ;;
reset) cmd_reset "$@" ;; reset) cmd_reset "$@" ;;
doctor) cmd_doctor "$@" ;; doctor) cmd_doctor "$@" ;;
kali) cmd_kali "$@" ;; kali) cmd_kali "$@" ;;
users) cmd_users "$@" ;;
answers) cmd_answers "$@" ;; answers) cmd_answers "$@" ;;
destroy) cmd_destroy "$@" ;; destroy) cmd_destroy "$@" ;;
peers) cmd_peers "$@" ;; peers) cmd_peers "$@" ;;
+181
View File
@@ -0,0 +1,181 @@
#!/usr/bin/env python3
"""bh_clues.py — BloodHound JSON reader for the Norbourg workshop lab.
bloodhound-python writes JSON for the BloodHound GUI, so a terminal user
sees a successful collection and nothing else. This script answers the
question a participant actually has: for one account, what can it touch?
It prints:
* the account's SPNs and groups (including nested groups),
* non-inherited ACEs held by the account or one of its groups,
* local AdminTo / PSRemote / CanRDP / CanDCOM edges,
and collapses GetChanges + GetChangesAll into a single DCSync line.
Written for the Norbourg lab (norbourg.lab). It only reads the JSON files
produced by the collector; it never talks to the network.
Typical use:
bloodhound-python -d norbourg.lab -u svc_backup -p 'Backup2023!' \
-ns 10.10.10.10 -c All
python3 bh_clues.py svc_backup
"""
from __future__ import annotations
import argparse
import glob
import json
import os
import sys
INTERESTING = {
"GenericAll", "GenericWrite", "WriteDacl", "WriteOwner", "Owns",
"ForceChangePassword", "AddMember", "AddSelf", "AllExtendedRights",
"DCSync", "AddKeyCredentialLink", "ReadLAPSPassword",
"GetChanges", "GetChangesAll", "GetChangesInFilteredSet",
}
LOCAL = (("LocalAdmins", "AdminTo"), ("PSRemoteUsers", "PSRemote"),
("RemoteDesktopUsers", "CanRDP"), ("DcomUsers", "CanDCOM"))
def load(directory: str, suffix: str) -> list[dict]:
files = sorted(glob.glob(os.path.join(directory, f"*_{suffix}.json")))
if not files:
return []
with open(files[-1], encoding="utf-8") as fh:
return json.load(fh).get("data", [])
def short(obj: dict) -> str:
props = obj.get("Properties", {})
name = (props.get("name") or "").split("@")[0]
sam = props.get("samaccountname")
return f"{name} ({sam})" if sam else name
def parse_args(argv: list[str]) -> argparse.Namespace:
parser = argparse.ArgumentParser(
prog="bh_clues.py",
description=(
"Print the BloodHound edges of one account from the collector's JSON. "
"Built for the Norbourg workshop lab (norbourg.lab); it reads files only, "
"no network access."
),
epilog=(
"examples:\n"
" bloodhound-python -d norbourg.lab -u svc_backup -p 'Backup2023!' "
"-ns 10.10.10.10 -c All\n"
" python3 bh_clues.py svc_backup\n"
" python3 bh_clues.py svc_backup /tmp/collection\n"
),
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument(
"account",
help="sAMAccountName to inspect (for example svc_backup or m.legault)",
)
parser.add_argument(
"directory",
nargs="?",
default=".",
help="directory holding the *_users.json files (default: current directory)",
)
return parser.parse_args(argv)
def main(argv: list[str] | None = None) -> int:
args = parse_args(sys.argv[1:] if argv is None else argv)
who = args.account.lower()
directory = args.directory
users = load(directory, "users")
groups = load(directory, "groups")
computers = load(directory, "computers")
extra = load(directory, "domains") + load(directory, "ous") + load(directory, "containers")
if not users:
print(
f"no *_users.json in {directory!r} — run bloodhound-python there first",
file=sys.stderr,
)
return 1
target = next(
(u for u in users
if (u.get("Properties", {}).get("samaccountname") or "").lower() == who
or (u.get("Properties", {}).get("name") or "").split("@")[0].lower() == who),
None,
)
if not target:
print(
f"account not found in this collection: {args.account}\n"
"check the spelling, or collect again with -c All",
file=sys.stderr,
)
return 1
sid = target["ObjectIdentifier"]
principals = {sid}
changed = True
while changed:
changed = False
for group in groups:
gid = group["ObjectIdentifier"]
if gid in principals:
continue
members = group.get("Members") or []
if any(m.get("ObjectIdentifier") in principals for m in members):
principals.add(gid)
changed = True
print("\n# bh_clues.py — Norbourg lab (norbourg.lab)")
print(f"# collection: {directory}")
print(f"\n{short(target)}")
for spn in target.get("Properties", {}).get("serviceprincipalnames") or []:
print(f" SPN {spn}")
for group in groups:
if group["ObjectIdentifier"] in principals and group["ObjectIdentifier"] != sid:
print(f" MemberOf {short(group)}")
rows: list[tuple[str, str]] = []
for obj in users + groups + computers + extra:
for ace in obj.get("Aces") or []:
if ace.get("IsInherited"):
continue
if ace.get("PrincipalSID") not in principals:
continue
right = ace.get("RightName")
if right not in INTERESTING:
continue
rows.append((right, short(obj)))
# The GUI shows a single DCSync edge; the JSON carries the two rights.
for target_name in {t for r, t in rows if r in ("GetChanges", "GetChangesAll")}:
rights = {r for r, t in rows if t == target_name and r in ("GetChanges", "GetChangesAll")}
if {"GetChanges", "GetChangesAll"} <= rights:
rows = [(r, t) for r, t in rows
if not (t == target_name and r in ("GetChanges", "GetChangesAll"))]
rows.append(("DCSync", target_name))
found = len(rows)
for right, name in sorted(rows):
print(f" {right:<18} -> {name}")
for computer in computers:
for key, label in LOCAL:
results = (computer.get(key) or {}).get("Results") or []
if any(r.get("ObjectIdentifier") in principals for r in results):
print(f" {label:<18} -> {short(computer)}")
found += 1
if not found:
print(" (no exploitable edge — this account is a dead end)")
print()
return 0
if __name__ == "__main__":
raise SystemExit(main())
File diff suppressed because it is too large Load Diff
+146
View File
@@ -0,0 +1,146 @@
# Norbourg lab — first-boot bootstrap, runs once from the seed ISO.
# The unattend file creates the account and triggers this; everything that
# touches the network happens here because unattend TCPIP settings fail
# silently when the adapter name does not match.
$ErrorActionPreference = 'Stop'
$base = 'C:\norbourg'
New-Item -ItemType Directory -Force -Path $base | Out-Null
Start-Transcript -Path "$base\bootstrap.log" -Append | Out-Null
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
. (Join-Path $here 'config.ps1')
Write-Host "bootstrap: host=$($Config.Hostname) role=$($Config.Role) ip=$($Config.IP)"
# ------------------------------------------------------------------ network
$nic = Get-NetAdapter |
Where-Object { $_.Status -eq 'Up' -and $_.InterfaceDescription -notmatch 'Loopback' } |
Select-Object -First 1
if (-not $nic) {
Write-Host 'bootstrap: no up adapter, network step skipped'
} else {
Remove-NetIPAddress -InterfaceIndex $nic.ifIndex -Confirm:$false -ErrorAction SilentlyContinue
Remove-NetRoute -InterfaceIndex $nic.ifIndex -Confirm:$false -ErrorAction SilentlyContinue
New-NetIPAddress -InterfaceIndex $nic.ifIndex `
-IPAddress $Config.IP -PrefixLength $Config.Prefix `
-DefaultGateway $Config.Gateway | Out-Null
Set-DnsClientServerAddress -InterfaceIndex $nic.ifIndex -ServerAddresses $Config.DNS
Set-NetConnectionProfile -InterfaceIndex $nic.ifIndex -NetworkCategory Private -ErrorAction SilentlyContinue
# Cosmetic: silence the "make this PC discoverable" flyout that the IP
# change re-triggers. New-Item -Force throws on this protected key, and a
# Stop preference would abort the whole bootstrap — so it must not throw.
try {
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Network' `
-Name NewNetworkWindowOff -Value 1 -PropertyType DWord -Force -ErrorAction Stop | Out-Null
} catch {
Write-Host "bootstrap: flyout tweak skipped ($($_.Exception.Message))"
}
Write-Host "bootstrap: $($nic.Name) -> $($Config.IP)/$($Config.Prefix)"
}
# ------------------------------------------------------------------ WinRM
# The host provisions over WinRM; no guest agent needed for that.
Enable-PSRemoting -SkipNetworkProfileCheck -Force | Out-Null
Set-NetFirewallRule -DisplayGroup 'Windows Remote Management' -Enabled True -Profile Any -ErrorAction SilentlyContinue
# SMB: the eval image leaves File and Printer Sharing disabled, which makes the
# workstation invisible to a normal SMB scan.
Enable-NetFirewallRule -DisplayGroup 'File and Printer Sharing' -ErrorAction SilentlyContinue
# ICMP echo: Windows drops it by default, and "ping the DC" is the first thing
# anyone does. A lab where ping fails looks broken even when it is not.
if (-not (Get-NetFirewallRule -DisplayName 'Norbourg ICMPv4' -ErrorAction SilentlyContinue)) {
New-NetFirewallRule -DisplayName 'Norbourg ICMPv4' -Protocol ICMPv4 -IcmpType 8 `
-Direction Inbound -Action Allow -Profile Any | Out-Null
}
# QEMU guest agent. Proxmox provisions over `qm guest exec`, which needs it.
# virtio-win is attached as a CD on that platform; on qemu it is absent and
# this block does nothing.
try {
# Find the virtio CD by its content, not by volume label: the label is
# not reliable across images and an empty one silently skipped the whole
# block (no driver, no agent, no provisioning).
$virtioRoot = $null
foreach ($drv in (Get-PSDrive -PSProvider FileSystem -ErrorAction SilentlyContinue)) {
if (Test-Path "$($drv.Root)guest-agent\qemu-ga-x86_64.msi") {
$virtioRoot = $drv.Root
break
}
}
if ($virtioRoot) {
# The agent MSI does not install the VirtIO serial driver. Without it
# the service starts but never connects to the channel, and Proxmox
# shows "guest agent is not running", which blocks provisioning.
# Pick the driver for this Windows build first (2k12 first in the
# directory made pnputil reject it on Server 2022), then fall back to
# the other amd64 builds until one reports success.
$build = [Environment]::OSVersion.Version.Build
$pref = '2k12'
if ($build -ge 26100) { $pref = '2k25' } elseif ($build -ge 20348) { $pref = '2k22' } elseif ($build -ge 17763) { $pref = '2k19' } elseif ($build -ge 14393) { $pref = '2k16' }
$candidates = @($pref, '2k25', '2k22', 'w11', '2k19', '2k16', '2k12') |
Select-Object -Unique
$driverOk = $false
foreach ($v in $candidates) {
$inf = Join-Path $virtioRoot "vioserial\$v\amd64\vioser.inf"
if (-not (Test-Path $inf)) { continue }
$null = pnputil.exe /add-driver $inf /install
Write-Host "bootstrap: vioser $v exit=$LASTEXITCODE"
if ($LASTEXITCODE -eq 0) { $driverOk = $true; break }
}
if (-not $driverOk) {
Write-Host 'bootstrap: no vioser driver could be installed'
}
$msi = "$($virtioRoot)guest-agent\qemu-ga-x86_64.msi"
if (Test-Path $msi) {
$proc = Start-Process msiexec.exe -ArgumentList "/i `"$msi`" /qn /norestart" -Wait -PassThru
Write-Host "bootstrap: qemu-ga msi exit=$($proc.ExitCode)"
Set-Service -Name QEMU-GA -StartupType Automatic -ErrorAction SilentlyContinue
Start-Service -Name QEMU-GA -ErrorAction SilentlyContinue
Write-Host 'bootstrap: qemu guest agent installed'
} else {
Write-Host 'bootstrap: virtio-win mounted but qemu-ga msi not found'
}
}
} catch {
Write-Host "bootstrap: guest agent step skipped ($($_.Exception.Message))"
}
# RDP: useful for the instructor when a step misbehaves. This only opens the
# listener; who may log on is still governed by Remote Desktop Users.
try {
Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\Terminal Server' `
-Name fDenyTSConnections -Value 0 -ErrorAction Stop
Set-Service -Name TermService -StartupType Automatic -ErrorAction SilentlyContinue
Start-Service -Name TermService -ErrorAction SilentlyContinue
Enable-NetFirewallRule -DisplayGroup 'Remote Desktop' -ErrorAction SilentlyContinue
Write-Host 'bootstrap: RDP enabled'
} catch {
Write-Host "bootstrap: RDP setup failed ($($_.Exception.Message))"
}
# ------------------------------------------------------------------ marker
"$env:COMPUTERNAME|$($Config.Role)|$($Config.IP)|$((Get-Date).ToString('s'))" |
Set-Content -Path "$base\stamp.txt" -Encoding ascii
# ------------------------------------------------------------------ role
# The role stages are driven by the host (`./lab.sh provision`), which orders
# them: the DC must be promoted before a member tries to join. Running them
# here as well made every guest race the harness — fs01 joined before the
# domain existed, and dc01 ran two promotions at once.
$role = Join-Path $here "roles\$($Config.Role).ps1"
if (Test-Path $role) {
Write-Host "bootstrap: role $($Config.Role) staged, waiting for ./lab.sh provision"
} else {
Write-Host "bootstrap: no role script for '$($Config.Role)' yet (phase 5)"
}
Write-Host 'bootstrap: done'
Stop-Transcript | Out-Null

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 848 B

Before

Width:  |  Height:  |  Size: 457 B

After

Width:  |  Height:  |  Size: 457 B

Before

Width:  |  Height:  |  Size: 48 B

After

Width:  |  Height:  |  Size: 48 B

Before

Width:  |  Height:  |  Size: 551 B

After

Width:  |  Height:  |  Size: 551 B

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 496 B

Before

Width:  |  Height:  |  Size: 172 B

After

Width:  |  Height:  |  Size: 172 B

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 151 B

Before

Width:  |  Height:  |  Size: 439 B

After

Width:  |  Height:  |  Size: 439 B

Before

Width:  |  Height:  |  Size: 352 B

After

Width:  |  Height:  |  Size: 352 B

Before

Width:  |  Height:  |  Size: 51 B

After

Width:  |  Height:  |  Size: 51 B

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 51 B

After

Width:  |  Height:  |  Size: 51 B

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Before

Width:  |  Height:  |  Size: 538 B

After

Width:  |  Height:  |  Size: 538 B

Before

Width:  |  Height:  |  Size: 724 B

After

Width:  |  Height:  |  Size: 724 B

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Before

Width:  |  Height:  |  Size: 814 B

After

Width:  |  Height:  |  Size: 814 B

Before

Width:  |  Height:  |  Size: 859 B

After

Width:  |  Height:  |  Size: 859 B

Before

Width:  |  Height:  |  Size: 51 B

After

Width:  |  Height:  |  Size: 51 B

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 743 B

After

Width:  |  Height:  |  Size: 743 B

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 372 B

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 51 B

After

Width:  |  Height:  |  Size: 51 B

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Some files were not shown because too many files have changed in this diff Show More