
Starting Credentials
This is an assumed breach scenario. Use the credentials below:
Active Directory Layout
This lab consists of 3 machines (mimicking an OSCP set), consisting of 1 domain controller and 2 domain joined machines. Running an nmap scan across all of the given hosts, we can create the following table to give us an idea of what our attack surface looks like:Enumeration
With AD enumeration, I always like to start by using nxcspraywith the given credentials and see if we have any low hanging fruit access:
IPC$, NETLOGON, SYSVOL. So nothing interesting to pursue here.
Moving on to other types of enumeration, we can pull down other users with nxc to build a full users list:
Initial Foodhold: GenericWrite on Lion
Using the bloodhound data we just pulled down, we find that our usershannon has the following interaction on another domain user, lion :

Lion, which means we can compromise the Lion user via Targeted Kerberoast:First, we need to request a krb5tgs for the user lion using
targetedKerberoast.py

Then we can crack that hash with hashcat to retrieve Lion’s plaintext password:

Access as Lion on WS01
First, spraying our new creds against the hosts and WinRM, we find thatlion has shell access on WS01!


.accdb database file in our downloads folder!

download functionality:

Lateral Movement: Lion → Kanon via DB File
What is a .accdb file? An.accdb file is a standard database file created by Microsoft Access (version 2007 and newer, including Microsoft 365). For our sake, it basically is a DB that might contain sensitive information.
To read this type of file, we can use this github repo, which conveniently provides a python script to access .accdb files, even those that are password protected (which I presume this one might be).
We can confirm this by running the accdbpy.py tool trying to list tables from our extracted files:


Now, we can dump the Users table to find another set of credentials! This time for the user
kanon:

Access as Kanon on WS01
Spraying the creds we obtained from the.accdb database, we see that we get access to the same machine (WS01) via WinRM as kanon:


Privilege Escalation on WS01
Beyond files in the user’s directory, we can upload a privesc script, such asPrivescCheck.ps1 to see if we can pick up any other low hanging fruits on this machine.

ChangeConfig, Start, Stopon the wuauserv service. This means that we should be able to change the config a little bit to obtain a SYSTEM shell!
First, let’s generate our shell:


net user:



erika !

Access as Erika on FORENSICS01
Spraying these newfound creds, we find that we have WinRM access on the FORENSICS01 workstation!
erika has the SeDebugPrivilege privilege!

SeDebug bypasses standard Windows process memory-protection boundaries, granting us full access to open a handle and read the memory of protected system processes like lsass.exe , which holds the credentials we are so interested in!
So going off of that theory, we can put it into practice and extract the NTLM hash of the local administrator on the machine!

Access as Administrator on FORENSICS01
Using the hash we just found, we can perform pass-the-hash to gain WinRM access on the same FORENSICS01 machine. Performing the same enumeration as the other machine, we can usetree . /f to list out all the files in our Administrator folder:

notes.txtlike there are some iocs from previous attackers left behind:

Privilege Escalation to Domain Administrator
Thenotes.txt file above mentions that the ticket file (.kirbi) is for the domain admin! We can use this to forge our own ccache domain admin ticket on kali and login as the domain admin:
First, we need to convert the .kirbi file to a .ccache:
klist, we see that we are the Administrator@LAINOSCP.LOCAL as anticipated!


