This is my write-up for Cascade box, which was a windows box. I had some difficulties with this since I am not that good with windows but I learned new things. Let’s dive into it.
First of all I scan for available ports using the following nmap command.
I get the following result:
We have few services which are relatable to active directory such as kerberos, ldap, smb. First I will use enum4linux to get possible username and group, which information accessible from ldap.
I have a list of usernames and a list of groups. I will try with each one of these username to do a null authentication on smb port 445. But that was not the case. At this point I install and open a gui tool called jxplorer. With this tool I can inspect ldap easily. I enter the host ip and then try to find juicy info on users attributes.
User r.thompson has a attribute named CascadeLegacyPwd, and I can tell it is base64 because I see a =. I get the password for that user.
Let’s use smbclient with the username and password we have, to test if we can login to smb …..
I try to access Audit$ but I don’t have permission to do, and then I try Data:
I was able to get these files from the share.
The file ArkAdRecycleBin.log contains logs from a program called Ark Ad recycle bin.
If you look closely you can see 2 objects get deleted. And the command is running as user ArkSvc. Maybe we can restore these objects?
The file dcdiag.log has inside:
Which as the header says is something related to Server diagnosis. But there was nothing I could take as good info from this file.
The other file Meeting_Notes_June_2018.html:
From this file I get the following info:
A new server is going live on Wednesday.
They will be using a temporary account, which will be deleted at the end of the 2018. Username is TempAdmin and the password is the same as the normal admin.
If you look at the ArkAdRecycleBin file we can see user TempAdmin get deleted and the date is 8/12/2018 which is the day after wednesday. We keep this in our mind.
The last file we see it VNC Install.reg:
This is extracted from a registry as the file extension says. Also there is Password which is in hex. I try and search more in depth for this and find out a tool which may decode the password for me. I used this tool vncpasswd.
And get the password sT333ve2 . At this point I nmap again to check if winrm is open.
I first try with user s.smith(name taken from enum4linux output) as this user was also seen in the Meeting_Notes_June_2018.html file.
I am logged in as s.smith now and I can read the user.txt file also. After poking around the box I can’t seem to find much. So I go back, and try to see if I can access the smb share with the credentials of the new user…
I can access audit which contains a .exe with a dll which seems to be linked to it A DB folder and some others .ddl files. Inside DB there is a file named Audit.db.
I open the file with SQlite database browser. I find inside the Ldap Table a base64 string. I try to decode it bu nothing. This seems to belong to a user named ArkSvc. This user maybe is related to ArkAdRecycleBin as seen on the log.
By looking into the RunAudit.bat I see there is something related to the executable file.
Maybe the password is encrypted by using the exe file we saw earlier. I am going to use AvaloniaILSpy you can also use dotPeek if you feel like switching to a windows box. I open the executable file and try to find the main function. Because this is the function every program starts. In the main program I find some juicy staff.
There is some decryption proccess happening on password = Crypto.DecryptString(encryptedString, "c4scadek3y654321"); I also found a string there. Now I am going to load the dll file to see if I found something there also, as the Crypto.DecryptString may be reffering to the dll. I find the decryption Function inside the dll
There is also a IV key and the decryption algorithm which seems to be AES in CBC mode.
I now have the following extracted:
Encrypted password: BQO5l5Kj9MdErXx6Q6AGOw==
IV : 1tdyjCbY1Ix49842
Key: c4scadek3y654321
By using this website, I get the decrypted password in base64 encoding.
I now login as the user ArkSvc and password w3lc0meFr31nd with evil-winrm. Now as the file ArkAdRecycleBin.log shows I will try to restore the deleted accounts, because these are on recyclebin right???…
I see the deleted objects:
But trying to restore it does not gives me the rights to do it.
After a little bit, I try and see if I can see the properties of this object, which may throw us the password as the r.thompson user did.
Indeed it did throw us the password:
I now use again evil-winrm but this time as user Administrator(Because as seen in the file Meeting_Notes_June_2018.html the TempAdmin has the same password as the admin).
I can obtain root.txt now.
Extra
Trying to log in as TempAdmin does not do something as this users is deleted. I restore the object with the command Get-ADObject -Filter {SamAccountName -eq 'TempAdmin'} -IncludeDeletedObjects | Restore-ADObject as user administrator and then try to login but I can’t do it. By viewing the in which Groups TempAdmin the user is not inside Remote Management user. By adding the user at that group I can login also as TempAdmin