HackTheBox-Resolute
Enumeration
Full nmap scan
- A - enable OS, version and script detection (-sV, -sC, -O)
- p- - test all ports
Due to a poorly configured rpc, we can use rpcclient to connect to the machine using a blank username
- U - username
We can then run “enumdomusers” to enumerate the users
Using ldapsearch I was able to enumerate users and grep for passwords
- h - host
- x - Simple Authentication
- b - base dn for search
We can then pipe that into grep
Ldapsearch can also be used to enumerate usernames
We can then pipe that into grep
Generate a file with that list of users
Use crackmapexec to test the accounts found in using rpcclient or ldapsearch with the password of “Welcome123!”
We get output
Initial Foothold
Now we have the assumed credentials of user “melanie” which we can use to authenticate to the server using winrm
We can use the credentials with the evil-winrm tool (https://github.com/Hackplayers/evil-winrm)
With this we get a shell!
And we can grab the user flag
Privilege Escalation 1
Enumerate the users on the box
We can also see what users have logged onto the machine
Viewing our group permissions we can see we don’t have any access to anything special
Looking for hidden files in the C: drive we can find a PSTranscripts folder
After going into a few more hidden folders we find a PowerShell Transcript file (PowerShell Transcript files record all the activities in the PowerShell console to a text file)
In this text file we find credentials for a “ryan” user
We can now login using evil-winrm with ryan
We don’t find a flag but we do find this note
Running whoami /all as ryan tells us that we’re apart of the DNSAdmins group
Searching about DNSAdmin, I found this privesc post - https://medium.com/techzap/dns-admin-privesc-in-active-directory-ad-windows-ecc7ed5a21a2
Constructing the msfvenom payload
We can then host this using impacket-smbserver
You can test the server by using net view
But you may get this error, as long as you see the incoming connection on your smbserver, it all works
Set up your netcat listener
Now the next few steps involve you to have quick hands as the settings are reset every minute, the easiest way I found was to have already typed all the commands and just use the arrow keys to go through your history to get through them quickly
Run the dnscmd (don’t be worried if you don’t see anything contact your smbserver, it’s not meant to until you restart dns)
Check that the dll has appeared in the registry
Stop and start dns
We should now see something connect to the smbserver and recieve a reverse shell on the listener
And we’ve got a shell!