Skip to content

Give the lab domain users and deliberate weaknesses, one tag at a time #449

Open
0 of 6 issues completed

Description

@Gerrrt

ADR-0029
did the architecture: six guests, the tiering, the namespace and clock
separation, and an explicit list of shipped defaults that must not be
hardened. What it has no position on is the contents of the domain.

A domain with no users teaches nothing. Kerberoasting needs an account with
an SPN and a crackable password. BloodHound needs a graph with edges in it.
ADR-0029 names ramuh's SPN and titan as the relay target and stops there —
correctly, because that is architecture and this is content.

What to add

A user generator producing a realistic population from name lists —
configurable count, randomised group membership, output written to a file the
playbooks and any later analysis can both read.

Then the weaknesses, each behind its own tag so they can be enabled and disabled
independently:

  • kerberoast — ADR-0029 already provisions the target
  • asreproast — pre-auth disabled on an account
  • dcsync — replication rights on a non-DA principal
  • ucd — unconstrained delegation
  • cd — constrained delegation
  • rbcd — resource-based constrained delegation

Why the tags matter more than the vulnerabilities

Individually switchable is what makes a purple-team loop possible: enable
one, watch what Wazuh (#266),
Velociraptor (#267) and Zeek
(#437) actually see, then
disable it and confirm the signal goes away.

That last half is the part that teaches, and it is impossible with an
all-or-nothing lab.

It also makes the negative test available, which is the one worth insisting on:
run the collector with the tags off and confirm the path to Domain Admin is
not there
. A lab that is always exploitable proves nothing about the tags.

Order of work

Snapshot every guest first. Run setup, record the starter credentials it prints,
then add weaknesses one at a time rather than all at once — the observation
is the deliverable, not the compromise.

What it waits on

#414 and
#448.

Purchases this needs

None.

Activity

  1. added
    labstacks/lab on alexander (VLAN 30)
    on Sep 19, 2026
  2. Gerrrt commented on Oct 2, 2026

    @Gerrrt
    OwnerAuthor

    2026-10-02: one user already exists, and it's §6's. To break the wait between this issue and #414, AD\authgen was made by hand. It's in CN=Users, a member of Domain Users only, and its password is kept nowhere. It runs build-the-lab-domain.md §6's authentication generator: a Lab-AuthGenerator task on carbuncle and siren, every 15 minutes, against \\titan\Public.

    When the population lands, fold authgen into it (move it to whatever OU this issue settles on) rather than deleting it. If its password is reset, the task on both endpoints has to be registered again. The endpoints also needed SeBatchLogonRight granted to it explicitly (§6 says how). When the task moves into the playbook, that grant has to go with it. Recorded in #813.

    🤖 Generated with Claude Code

  3. Gerrrt commented on Oct 3, 2026

    @Gerrrt
    OwnerAuthor

    2026-10-03: the population is on the domain, applied from phoenix, and a second run changes nothing.

    Merged in #832 (ADR-0078):

    • --tags population:
      • 41 accounts from the committed population.yaml: 40 drawn by scripts/gen_population.py --count 40 --seed 449, plus authgen;
      • six department OUs under OU=People;
      • a global group per department, plus three cross-cutting groups, under OU=Groups.
    • --tags authgen: runbook §6's generator on carbuncle and siren. authgen moved from CN=Users into OU=IT, as said above.
    • Passwords: none in git. Each is derived on phoenix from LAB_POPULATION_SEED and the account name, and population-credentials.yml prints them on demand.

    Applied twice.

    Run Code Result
    First ec62481, before review Created the population and adopted the task, then a second apply changed=0 on all six, and verify.yml passed
    Rerun 00e23e4, identical under ansible/ to main's b136208 First apply: 2 changes per endpoint, the stored password and the first credential fingerprint. Second apply: changed=0 on all six. The generator, started on both endpoints, returned 0. verify.yml passed on all six.

    verify.yml now also checks that:

    • OU=People holds exactly population.yaml;
    • every population group exists;
    • the generator's principal is AD\authgen, compared by SID;
    • its last run succeeded.

    Still open here:

    • the rest of runbook §5: the tiers, the SPN account, the Tier 0 GPO and the shares;
    • the deliberate weaknesses, each its own tag on top of this population.

    Nothing in the population is given a weakness.

    🤖 Generated with Claude Code

  4. 8 remaining items

  5. Gerrrt commented on Oct 8, 2026

    @Gerrrt
    OwnerAuthor

    Deliberate-weakness loop run — 2026-10-08 (config/posture mode)

    Ran the enable → observe → disable loop against the rebuilt live domain (ad.matrix.elysium, DC bahamut 10.0.30.50), one weakness at a time with non-overlapping windows. Final verify.yml --limit dc_primary is green at 04:06:20Z — all six absent, nothing left enabled.

    Mode: config/posture only, no live attack tooling. There is no analyst host (Kali 902 is unbuilt, blocked on ifrit #790; phoenix has no impacket), so the attack events (4769-RC4, non-DA replication, S4U) were never generated. What's reported below is the configuration-change telemetry each role produced, read from wazuh-alerts-* on odin. Enable/verify/disable ran as locke on phoenix; the SOC reads were done by the Sysmon/Pktmon session.

    Per weakness

    # weakness enabled (UTC) verify present SOC — what the config change produced gap
    1 kerberoast (svc-sql, SPN MSSQLSvc/ramuh:1433) 03:46:58 ✓ ✓ 4720/4722/4738 account create+enable (rules 60109/60110). The SPN appears in no event. SPN needs 5136 (Audit DS Changes), which is off
    2 asreproast (svc-backup, pre-auth off) 03:52:00 ✓ ✓ the no-preauth bit is logged: 4738, UAC → %%2096 / 0x10000 USER_DONT_REQUIRE_PREAUTH fires only under generic rule 60110 (level 8, same as a password reset); nothing keys on %%2096
    3 cd (svc-web → CIFS/titan, Kerberos-only) 03:54:47 ✓ ✓ allowedToDelegateTo=CIFS/titan IS logged in the 4738 (not a gap). The HTTP/web SPN is not. no rule keys on allowedToDelegateTo; SPN is the same 5136 gap
    4 dcsync (svc-sync + 2 replication ACEs on the domain head) 03:57:04 ✓ ✓ account 4720/4738 only. The ACE grant on the domain head is completely silent — 0 events 4662/5136/4670 in the window, and none ever. biggest gap (see below)
    5 ucd (TRUSTED_FOR_DELEGATION on the real RAMUH) 04:00:05 ✓ ✓ SOC read outstanding — observer session ended. Expect 4742 (computer account changed), never yet seen → likely a gap. pending read
    6 rbcd (RBCD attribute on the real TITAN, trusts svc-rbcd) 04:03:38 (applied) ✗ see note SOC read outstanding — observer gone. see rbcd note

    All six disabled and confirmed absent (ucd cleared 04:03:03Z, rbcd 04:06:20Z). ucd/rbcd ran the attribute write from the DC, so the RAMUH/TITAN hosts were never touched directly.

    Headline detection gaps

    1. DCSync is invisible. Granting the two replication rights on the domain head logs nothing. To make it visible: (a) enable Audit Directory Service Changes on the DCs + a SACL on the domain head; (b) that lets rule 60229 fire on the nTSecurityDescriptor change; (c) add a local rule matching the replication GUIDs {1131f6aa-…} / {1131f6ad-…} in 5136/4662. 4662 currently has no rule at all in 0580-win-security_rules.xml.
    2. Kerberoastable SPN creation is invisible (needs 5136; same for cd's HTTP SPN).
    3. AS-REP no-preauth and constrained-delegation grants are logged but not alerted — both land only under generic rule 60110. Suggested local child rules: one on UAC %%2096, one on allowedToDelegateTo being non-empty.
    4. Ansible itself looks like an attacker: every enable tripped Sysmon 92057 (base64 PowerShell), 92213 (executable in a malware-typical folder), 92103 (LDAP from PowerShell). Worth accounting for when reading these windows.

    The technique→Wazuh-rule mapping these validate against is #266; graph-level "no path to DA" is the BloodHound collector (#451).

    Two follow-ups left

    • ucd + rbcd SOC reads are outstanding — the observer session ended after dcsync. Windows are timestamped (ucd 04:00:00–04:02:00Z, rbcd 04:03:30–04:06:30Z) and Wazuh retains the alerts, so they can be read retroactively on odin.
    • rbcd verify bug. Its enable applies correctly — the disable then cleared a real titan trust (changed=2), so the RBCD attribute was set — but verify.yml -e weakness_rbcd_state=present false-negatives its rbcd matches its toggle assertion, uniquely among the six. Likely the rbcd present-check reading titan's msDS-AllowedToActOnBehalfOfOtherIdentity via the DC under --limit dc_primary. Worth a fix in verify.yml's rbcd assertion.

    🤖 Generated with Claude Code

  6. Gerrrt commented on Oct 8, 2026

    @Gerrrt
    OwnerAuthor

    SOC reads for ucd + rbcd — table now complete

    The two windows left outstanding above have been read from wazuh-alerts-* on odin (read-only, by the Sysmon/Pktmon session). Full per-weakness result:

    # weakness what the SOC saw verdict
    1 kerberoast account create/enable (4720/4722/4738); SPN absent from every event partial — SPN invisible (needs 5136)
    2 asreproast no-preauth %%2096 present in 4738 (rule 60110, level 8) logged, generic rule only
    3 cd allowedToDelegateTo=CIFS/titan present in 4738 (60110, level 8); HTTP SPN absent logged, generic rule only
    4 dcsync completely silent — no 4662/5136/4670, ever invisible
    5 ucd 4742 (rule 60121, level 5) on RAMUH$, UAC %%2093 "Trusted For Delegation – Enabled" (and %%2061 on disable) visible, generic rule only
    6 rbcd svc-rbcd create (4720/4722/4738); 4742 ×2 "TITAN$ changed" (60121) but no changed-field populated — the msDS-AllowedToActOnBehalfOfOtherIdentity value and the trusted principal are invisible; 0×5136/4662 partial — "something changed", not what

    Correction to my earlier note: 4742 is audited (I'd guessed it wasn't). So ucd is visible and rbcd's computer-object change is visible; what's missing for rbcd is the attribute content, which — like dcsync's ACE — needs Directory Service Changes auditing (5136).

    Net: nothing singles out the weaponizable bit for any of the six — each lands under a generic account/computer-change rule (level 5–8) or nothing at all. The three things that make these attacks (an SPN, a replication-rights ACE, an RBCD descriptor) are each either unlogged (5136 off) or unmatched by any rule.

    The remediation (enable DS Changes auditing on the DCs + local Wazuh rules keyed on %%2093/%%2096/allowedToDelegateTo/the replication GUIDs/the RBCD descriptor, then re-run the enable→disable cycles to prove each alerts) is being taken up as its own issue by the Sysmon/Pktmon session. The per-primitive config/posture loop itself is complete; all six revert cleanly and a plain verify.yml is green.

    🤖 Generated with Claude Code

  7. added a commit that references this issue on Oct 8, 2026
  8. Gerrrt commented on Oct 8, 2026

    @Gerrrt
    OwnerAuthor

    Prove-it re-run after #1077 — all six now detected ✅

    Re-ran the full enable → disable loop against main @ cbc3516 (#1081/#1077 live: DS-Changes auditing + the member-server audit-policy fix + local Wazuh rules 100100–100110 on odin). The Sysmon/Pktmon session read every window from wazuh-alerts-* on odin and closed #1077 with the proof (issuecomment-6060570093). Each weakness now raises a dedicated, high-signal alert where the first (config-only) pass saw a gap or only a generic rule:

    # weakness first pass (pre-#1077) after #1077 rule / time (UTC)
    1 kerberoast account logged, SPN invisible SPN detected "…Kerberoastable" (lvl 10) 100103 @ 05:24:40
    2 asreproast %%2096 only under generic 60110 detected "AS-REP roastable" (lvl 10) 100100 @ 13:00:58
    3 cd allowedToDelegateTo only under generic 60110 detected 100102 @ 13:02:40
    4 dcsync completely silent detected on the grant (and again on removal) 100105 @ 13:04:21 (+13:05:01)
    5 ucd 4742 only under generic 60121 detected 100101 @ 13:05:49
    6 rbcd 4742 "changed" only, attribute invisible detected 100104 @ 13:07:21

    Also: rule 100103 additionally flagged the SPNs on svc-web and svc-rbcd. The biggest original gap — DCSync's replication-ACE grant being entirely unlogged — is now covered end to end (DS-Changes auditing on + a rule on the replication GUIDs).

    All six reverted; final plain verify.yml --limit dc_primary is green (all absent) at 13:08:38Z.

    Separately, the rbcd verify false-negative filed as #1075 is fixed by #1078 (read titan's RBCD trust by SID from its security descriptor) — confirmed in this run: rbcd's verify.yml -e weakness_rbcd_state=present passed cleanly (it had failed on the first pass).

    That closes the detection side of the loop in config/posture mode. The remaining open item is unchanged: a true technique→detection pass (firing the actual attacks, not just configuring the weakness) still needs an analyst host on VLAN 30, which doesn't exist yet (Kali template 902 is blocked on ifrit, #790).

    🤖 Generated with Claude Code

  9. Gerrrt commented on Nov 12, 2026

    @Gerrrt
    OwnerAuthor

    Split into one exercise per weakness role, each a sub-issue in the exercises milestone:

    Every role exists and the loop ran config-only on 2026-10-08. What is left is to use each one and record it in docs/exercises/. This issue closes when all six are recorded, and the exercises milestone closes with it.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new capability or a changelabstacks/lab on alexander (VLAN 30)

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions