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.
This commit is contained in:
@@ -126,7 +126,8 @@ $plainAcl = Get-Acl ("AD:\" + (Get-ADUser m.legault).DistinguishedName)
|
||||
"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:\Sauvegarde\root.txt)
|
||||
"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
|
||||
@@ -148,10 +149,12 @@ $plainAcl = Get-Acl ("AD:\" + (Get-ADUser m.legault).DistinguishedName)
|
||||
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 with the flag"
|
||||
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 reachable through the backup share"
|
||||
else _d_fail "root.txt 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"
|
||||
|
||||
Reference in New Issue
Block a user