Enumeration

Nmap

Initial Nmap scan revealed that SMTP, IMAP, POP3 SMTPs, HTTP and SMB ports are open.

00 - nmap

WEB Enumeration

I applied directory and vhost brute forcing which did not reveal any useful information.

Then while checking the website I found that there is a ‘download.php’ file which downloads any file that is given on file parameter. So this endpoint has file disclosure vulnerability.

I know that the website is using hMailServer, so I simply searched for hMailServer config file location and tried to access it which revealed MD5 Hash of the administrator.

01 - config file

Crack The Hash

Then using crackstation, I cracked the administrator hash.

02 - cracked

Exploitation

SMTP

Using administrator credentials, I tried to login SMTP server and it worked.

03 - test

04 - logged in

CVE-2024-21413

Now I know the target is windows and it is using mail server. So I simply searched for Windows Mailing Exploits and found an RCE exploit. It is a vulnerability occurs from improper input validation on file protocol.

So we need to craft a mail with malicious file URL and capture the NTLMv2 Hash with responder. Below are the names that are found form website. Instructions.pdf reveals mail format ‘maya@mailing.htb’. So using below names we can send each one of them a malicious mail.

05 - targets

06 - send

The maya was the one that opened the mail.

07 - hash

Crack The Hash

So simply cracked the maya’s hash.

08 - cracked

Got The User

Maya had permission to PSRemote so using ‘evil-winrm’, I got the user flag.

09 - user

Privilege Escalation

Libre Office

Libre office had vulnerable version running.

10 - libre version

So searching through internet reveals that this version can allow users to run commands with a maliciously crafted odt file. I created a file that runs nc64.exe and put it in ‘Important Documents’ folder, where maya had write permissions over SMB.

11 - malicious libre

12 - put it

Got The Administrator Shell

Then started netcat listener, after a while I got the administrator shell.

13 - admin shell

14 - root flag

Pwned

The machine was fully compromised.

15 - pwned


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