Certified

Writeup for Certified lab on HackTheBox

Enumeration

  • nmap scan:
    d0375fbead9f7c04447d7967aa84d51e3edd6a17.png
  • Let’s start by using the credentials provided by the challenge
    b8d0c8426f6d23000cde91ba371d34534b3995e2.png
  • BloodHound extract :
    dbb011a9a44ac94c48d3527c553b290f8f37b8f3.png

Road to user flag

  • In BloodHound we can see that judith has WriteOwner permissions against the Management group
    a0a981940de8471af9c77071f5991baa8e17fc31.png
  • To abuse this ACL, we first need to set ourself as owner of the Management group:
    7e38e142a755c06ca4f7f3e8550c99ac649c86a9.png
  • Then we can give us FullControl over this group:
    b542aba4586b918d8ed2a753ca3bc206eb5f214a.png
  • And now we can add ourself to the Management group:
    22c9cfe0a09c3fe2e74f528fe81696bc7d9f2957.png
  • This group has GenericWrite over management_svc:
    bc3ba43fc338f8bc10219fb76bb728c2a0388862.png
  • We can abuse this by using shadow credentials:
    9d5e2b4a80c77549f4cb87416dc5f2e21ca54fb9.png
  • Then we can get the user flag:
    d9e9dbb9d609c42c34cf0bc5eac6612b722f25b9.png
  • management_svc has a GenericAll over ca_operator:
    11a76fc62887531e1b78b422c4377f731997708e.png
  • To abuse it we can just change the password of ca_operator:
    7895ce1e02734a1007d6ac6cb91849c0ea0f421d.png

ESC9 abuse

  • CA Operator probably has some permissions in ADCS, so we enumerate them with the following command:
1
certipy find -u '[email protected]' -p Jawad2Bagnolet -vulnerable -stdout

3bd8c574734c6ec07966bc3c20c3f060ae93bfc4.png

  • According to THR, these are the requirements to perform ESC9:

    • StrongCertificateBindingEnforcement not set to 2 (default: 1) or CertificateMappingMethods contains UPN flag (0x4)
    • The template contains the CT_FLAG_NO_SECURITY_EXTENSION flag in the msPKI-Enrollment-Flag value
    • The template specifies client authentication
    • GenericWrite right against any account A to compromise any account B
  • We start by changing ca_operator’s UPN to the user we want to compromise: Administrator
    713c79c55ae9e846638d4d1caf92b2d8228f5f72.png

  • Now we can request a certificate for Administrator
    cc43ae286861042ed2ec62e0ee7aa1595c97592d.png

  • Before authenticating with the certificate, we reset ca_operator’s UPN:
    abc208f06c9a7334102777b29099c6df9b35f664.png

  • And now we can use UnPAC the hash to get the NT hash of Administrator:
    1c6d1b061a8ff0ddebe894595468fbb02fee1449.png

Last updated on Apr 20, 2025 00:00 UTC