Enumeration

Nmap

Initial Nmap scan revealed HTTP, SMB, LDAP, Kerberos, MSSQL and WinRM Ports.

00 - nmap

RID Brute Forcing

I tried anonymous ldapsearch and SMB null session which did not reveal anything. Then I did vhost and directory enumeration for HTTP site and it also did not reveal anything.

Then after some search, I found that it is possible to brute force RIDs if the SMB Null session has read access to IPC$. So I did that and created a userList

01 - rid brute

Exploitation

Brute Force

Then using the userList, I created an password list that includes reverse and direct usernames.

Then using this credentials I applied a brute force attack for SMB. (At first I tried it with kerbrute which did not reveal anything useful)

02 - brute force

MSSQL Client

After finding the valid password I checked SMB Shares but non of the shares were usefull. So then I tried to login MSSQL with ‘mssqlclient.py’ using windows-auth option and got inside.

03 - mssql

I then tried xp_cmdshell which was blocked. Used xp_dirtree to capture hash with responder but it was a machine account so I could not do anything useful.

Then again using xp_dirtree I simply enumerated the files. I got access to the inetpub folder and enumerating it I found website backup zip file.

04 - backup?

Got The User

So simply downloaded it and checked all files including hidden files. One of them revealed the password for the user raven.

05 - got it

And using evil-winrm I got the user flag.

06 - user flag

Privilege Escalation

I then used bloodhound and winPEAS but could not find anything useful. Only useful information was network listening service certsrv.

So I thought maybe the machine is about AD certifications. I then ran certipy.

07 - certipy-ad

The machine was vulnerable to ESC7 vulnerability.

08 - ESC7

So by following the official wiki I was able to get administrator hash. And logged in using psexec.py

09 - got the admin

Pwned

The machine was pwned.

pwned


<
Previous Post
Access - Hack The Box
>
Next Post
Cicada - Hack The Box