Skip to main content

Enumeration

Run Nmap Scan

View Website

Untitled

Directory Bruteforcing (Run Gobuster)

Update Hostname

Exploitation

SNMP Emumeration

Outputting available sub-tree MIBs

Above is the summarized output of the snmpwalk. -v 1 stands for the snmp version its going to use. -c public is the community string it is using.public is the default community string (password) We found the credential: "-u daniel -p HotelBabylon23"

Exploit - Login to SSH

Privilege Escalation

Daniel to Matt

Apache Site Configuration

Here pandora console website is hosted in localhost port 80. To get into the website, we need to port forward port 80.

Port Forwarding using SSH

-L <port in our side>:<target hosted host>:<target hosted port>

Viewing Pandora FMS

Untitled The website is using version 7.0NG.742

Searching for Pandora FMS Exploit

Pandora FMS 742: Critical Code Vulnerabilities Explained
Using SQLMAP for SQL Injection
SQL Injection is possible using time-based blind, error-based and boolean-based blind. Let’s enumerate the database
Here first is pandora and second is information_schema. Let’s check pandora database first Enumerating Pandora Database Tables
The table tsessions_php looks interesting. It looks like the database is storing the user session. Stealing Session
Let’s overwrite with matt’s session (g0kteepqaj1oep6u7msp0u38kv) to the cookie value. Untitled Then refresh the website. You will be inside the management console.

Inside the Pandora FMS Management Console

Untitled

Searching for vulnerabilities (CVE-2020-5844)

Here I found a RCE vulnerability that requires authentication.

Extracting PHPSESSIONID

Untitled Goto developer menu (F12), then go to storage, and find the cookies tab to extract the PHPSESSIONID.

Generating a Webshell URL through the exploit

Using the URL http://127.0.0.1:9000/pandora_console/images/unicord.php?cmd=whoami , we can change the command whoami to a reverse shell code to send the reverse shell to our attacker pc.

Listen to Reverse Shell and Exploit

Online - Reverse Shell Generator
Here is the link that tiggers the reverse shell through URL-Encoded python reverse shell

Matt to Root

Enumerate SUIDs

Looking for interesting files, pandora_backup is quite interesting.

Executing Pandora_backup

It’s failing due to low privilege [at | GTFOBins](https://gtfobins.github.io/gtfobins/at/#shell)

Searching for interesting strings inside pandora_backup

Based on the strings inside the pandora_backup program, the code tar -cvf /root/.backup/pandora-backup.tar.gz /var/www/pandora/pandora_console/* compressing the files inside /var/www/pandora/pandora_console/. However, we can see that the program tar is not specified in absolute path, hence it can be abused through PATH manipulation.

Naming Python Reverse Shell as tar

Online - Reverse Shell Generator

Download Reverse Shell named tar and Modify PATH

Listen to Reverse Shell and Exploit

Reference