HTB - Cicada

Enumeration


Nmap Scan


DNS Enumeration

Zone transfer failed

RPC Enumeration

SMB Enumeration

I then used spider_plus module from nxc to crawl the shares and list all the files inside. I found Notice from HR.txt that could be interesting.

Using smbclient from impacket, I connected to the share and downloaded all the files inside by mget * command

Initial Access


After reading the file, I got a password that can be sprayed to domain users. Then, I enumerated the domain users by bruting rid (Relative Identifier) technique

With the list of usernames, I could attempt the password I got against each one

The password only worked for michael.wrightson. I did my next move by firing up ldapdomaindump for quick users and groups mapping

Lateral Movement


Domain Users info

  • From the users' info page, I got the following:

    • emily.oscars => Member of (Remote Management Users, Backup Operators)

    • david.orelious => password:'aRt$Lp#7t*VQ!3'

With the password of david user, I will check share access again and it has READ access on most of the shares.

Using spider_plus again, I found Backup_script.ps1

Download the file to examine it

From the file below, It's a backup script file used to backup SMB files using emily credentials

As we saw previously, emily is a member of Remote Management User, So she can access the box using winRM

User Flag: 1933e43bb4bcd65536axxxxxxxxxxxxxxxxx

Privilege Escalation


Emily is a member of privileged group Backup Operator, So she can backup files from the DC. In our case, the most interesting files are NTDS, SYSTEM, SAM registry hives

  • NTDS: The database of the domain controller containing all objects' credentials

  • SYSTEM: Registry key that contains decryption key

  • SAM: The database of local system accounts

The principal of this attack is simple as we abuse Backup privileges to create shadow copy of specific file (NTDS.DIT in our case) and extract the domain secrets from it

I created a .vss file containing instruction for diskshadow utility to backup NTDS

Then execute the tool with the following command

If you face error when running diskshadow, try to run unix2doscommand to convert the file to windows formatting

Copy the ntds.dit to working directory and download it using evil-winrm

Backup SYSTEM registry hive

After downloading the two files, I used secretsdump.py to extract administrator's hash

Access the DC and get the root flag

Root flag: b53cd8bd68d39d7eb1xxxxxxxxxxxxxx

Shortcut


I can read the root flag with backup privileges using robocopy :)

Last updated