Fusion Corp
AS-REP Roasting - Authenticated LDAP Domain Dump - SeBackupPrivilege and SeRestorePrivilege abuse
Scanning
Starting off with the nmap scan
Initial Foothold - 1
Finding Usernames
Let's try some AS-REP roasting attacks using impacket-GetNPUsers module
Viewing the output file
Let's now crack it via hashcat
We are then able to utilize the credentials against port 5985 with Evil-WinRM
Initial Foothold - 2
As port 80 was open I used “dirb” command to see if there was some useful folder. So I found “backup” folder in which there was a file named “employees.ods”
I downloaded and open it. It contains a users table
Now we can utilize the AS-REP roasting attack and move forward !
Lateral Move - 1
Viewing the jmurphy user's comment reveals us the password of the respective user
Lateral Move - 2
After obtaining the lparker's credentials we can perform an authenticated LDAP Domain dump which in return gives us the data in .json files
Got many files including one interesting file (domain_users.html) which contains users SAM Name and in one user (jmurphy) there was his password !
Privilege Escalation - 1
Querying out whoami /priv
returns us
As we can see we have SeBackupPrivilege
enabled ! - So how do we abuse it ?
This privilege grants us the ability to create backups of files on the system - A high value file would be the ntds.dit file which is a database of hashes for domain objects / users
As the ntds.dit file is in constant use we will be unable to create a backup using normal methods as the system will lock the file
Instead we can create a Distributed Shell File (DSH) - This file will contain the appropriate commands for us to run the diskshadow.exe
utility against the C: drive and ultimately the ntds.dit file
Create a
viper.dsh
file on the attacker's machine with the following contents
Once completed use the command unix2dos
to convert the file to DOS format
Then on the target system create a directory called 'temp' in c:\temp
- After this upload the viper.dsh
file
From here we need to extract the SYSTEM hive which will be required for extracting the hashes
Download the files on your attacker's machine now
Now use the secretsdump to extract the hashes !
We can now evil-winrm or psexec into the box as Administrator :)
Privilege Escalation - 2
Running whoami /privs I saw that jmurphy has SeBackupPrivilege and SeRestorePrivilege enabled
Copy the .dlls onto the victim's machine and import them
We can now abuse it and get the Administrator's flag but not the shell !
Last updated