Enumeration

Nmap

Initial Nmap scan revealed SMB, LDAP, Kerberos and WinRM ports open, which indicates target is Domain Controller.

00 - nmap

User Enumeration

A user was given to us initially, so using given credentials I applied rid brute forcing and created a user list.

01 - userList

Trying AS-REP Roasting

Using the user list, I tried ASREP Roasting which did not reveal anything.

01 - userList asrep try

Trying Kerberoasting

Then tried kerberoasting attack and got a ticket for the management_svc user, but it was not crackable.

02 - SPN

Did an LDAP search and checked description fields, which also did not reveal anything useful.

03 - ldapsearch try

BloodHound

Then ran bloodhound and found a way to get a shell.

04 - bloodhound python

05 - path to admin

Exploitation

WriteOwner

Current user judith had WriteOwner permissions over Management group. So simply following the steps, I added judith to Management group.

06 - 0 writeowned

06 - 1 writeowned

06 - 2 writeowned

06 - 3 verify

GenericWrite (Shadow Credentials)

Management group had generic write over management_svc. So we could either do targeted kerberoasting (which I tried at the beginning and could not crack the ticket) or we can apply Shadow Credentials attack.

So I followed steps to apply shadow credentials attack.

07 - 0 shadowcreds

07 - 1 shadowcreds

07 - 2 shadowcreds

Got The User

08 - userFlag

Privilege Escalation

GenericAll

management_svc user had generic all permissions over CA_OPERATOR.

09 - generic all

So I could force change CA_OPERATOR’s password.

10 - set password

ADCS - ESC9

Using CA_OPERATOR, I enumerated for vulnerable certificate templates, and found a template that is vulnerable to ESC9.

11 - certipy 0

11 - certipy 1

So the scenario was simple, management_svc user had generic all permissions over CA_OPERATOR and CA_OPERATOR has vulnerable certificate template.

I can exploit ESC9 by updating CA_OPERATOR’s upn to Administrator using management_svc credentials. I followed this steps to do that and get the Administrator hash.

Got The Shell

Then I got the administrator shell using psexec.

12 - root

Pwned

The machine was fully compromised.

pwned


<
Previous Post
Administrator - Hack The Box
>
Next Post
Phantom - Hack The Box