HTB - Mailing

Machine Description

Mailing is an easy Windows machine that runs hMailServer and hosts a website vulnerable to Path Traversal. This vulnerability can be exploited to access the hMailServer configuration file, revealing the Administrator password hash. Cracking this hash provides the Administrator password for the email account. We leverage CVE-2024-21413 in the Windows Mail application on the remote host to capture the NTLM hash for user maya. We can then crack this hash to obtain the password and log in as user maya via WinRM. For privilege escalation, we exploit CVE-2023-2255 in LibreOffice.

Enumeration


Scope

IP Address 10.10.11.14

Nmap Scan

  • From Machine name, I can guess there is mailing services running on that machine, So I'll scan known mailing ports first

HTTP Enumeration

I tried subdomain enumeration but no results

http://mailing.htb

Possible Username

I hover on Download Instructions Button and It seems like LFI

I opened burp and intercept the request, change the file name to include:\Windows\System32\drivers\etc\hosts and I get a hit

I also try to includedownload.php to see the function of that file and I found the folder path we are in C:\wwwroot\instructions\

RPC & SMB Enumeration

SMTP & IMAP & POP3

  • Got an email address ruy@mailing.htb

  • Get installation path after install the server locally and the setting file name from docs ..\..\..\Program+Files+(x86)\hMailServer\bin\hMailServer.ini

Fire up hashcat and hashid to identify the attacke mode

I managed to crack one hash but not the other

So, here we have credentials for SMTP server administrator:homenetworkingxxxxxxxxxxr. I'll fire up thunderbird and connect to the server

SUCCESS :)

I get a hint for a vulnerability that enable my to get users hashes, here is the link:

Try sending emails to the three usernames (ruy, maya, ..etc) found and one of them would work

Shell as Maya

User flag e5e110f97bdfbee7f1xxxxxxxxxxxxxx


Shell as localadmin

Looking at installed program there is an odd one.

Root flag: 499f2a971e0cb91baab16e344692dc9a

Last updated