πŸͺŸOpacity

License

The following post by anthonyjsaab is licensed under CC BY 4.0arrow-up-right

0 - Introduction

Link to room: https://tryhackme.com/r/room/opacityarrow-up-right

Machine version: Opacity2

This writeup walks you through a room on TryHackMe created by tryhackmearrow-up-right and mindsfleearrow-up-right

1 - Scanning

1a - Ports

1ai - Discovery

β”Œβ”€β”€(kaliγ‰Ώkali)-[~]
└─$ sudo nmap -sS -T5 -p- 10.10.148.146
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-04-26 17:56 EEST
Nmap scan report for 10.10.148.146
Host is up (0.12s latency).
Not shown: 65531 closed tcp ports (reset)
PORT    STATE SERVICE
22/tcp  open  ssh
80/tcp  open  http
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds

Nmap done: 1 IP address (1 host up) scanned in 253.34 seconds

1aii - OS Fingerprinting, Service and Version Detection

1b - Directory busting

2 - Website - /cloud/

2a - Probing

It seems this web app allows anonymous visitors to upload images to the server, and give out a link to access that image. The image is maybe erased after 5 minutes. Let us try it out.

http://TARGET_MACHINE_IP/cloud/
Submitting a link. This is a link to an image accessible via a Python HTTP server on Kali
After submitting the link by clicking on upload
Final result. We can see the image I submitted and its link on the server.
Using the link that was generated by the server

This is perfect for a webshell.

2b - Sending the payload

Using revshells.com to get a PHP webshell payload

We are going to host the webshell source code on Kali and upload it to the server

There is a filter preventing us from uploading the webshell code
The filter can be bypassed by adding a fragment: #jpg
The file was successfully uploaded to the server

2c - Foothold

Using the generated link, we access the webshell

For convenience, we will execute this reverse shell payload inside the webshell:

We got our reverse shell! We now have a foothold in the target machine

3 - Horizontal privilege escalation

3a - Finding and exfiltrating a Keepass database

3b - Cracking the database's password

This guide helped me greatly: https://github.com/patecm/cracking_keepassarrow-up-right

Hooray! We got access to the database, and thus to sysadmin's password on the target machine

3c - Getting our first flag

4 - PrivEsc

4a - Setting SUID bit to /usr/bin/find

4b - Voila! Final flag

Last updated