HackTheBox - Querier
Last updated
Was this helpful?
Last updated
Was this helpful?
No webserver running on this machine, so we can proceed with SMB Server. I will use smbmap and smbclient to enumerate samba shares.
Let's get all the content from the Reports share as we have READ ACCESS
to it.
If you will run binwalk on the xlsm
file, you will find vbaProject.bin file which will probably contain Macros.
We can use olevba
from oletools which can be installed by entering the following command.
And we get SQL Server password having username as reporting and password as PcwTWTHRwryjc$c6
Now let's setup a Responder on tun0 interface and listen for incoming NTLM Hash. Other way can be to use smbserver from impacket to intercept the Hash. I will be using impacket's smbserver.
Crack the password using hashcat. Now we can login into the SQL Server with the user mssql-svc
Quick introduction to the PowerUp.ps1 script.
We need to add Invoke-AllChecks
at the end of the script for it to execute.
I tried UsoSvc to get administrator privileges, it did create a account named john having admin privileges, but it's not working.
Now that we have password for administrator, we can use psexec.py or even do it manually using powershell. I will be using powershell for my practice.
To connect to SQL Server, we need mssqlclient.py
from module.
Now we can't run enable_xp_cmdshell
due to insufficient privileges. Taken from .
Get the Powershell reverse shell from 's github repository and modify it according to your needs. We need to add a command at the end of script for it to get executed as soon as we request it via HTTP Server.
We can try to search for Groups.xml file which contains Group Policy encrypted password. Read more about .
We can decrypt this password using gpp-decrypt
script which is available on .