Press

Nmap Scan

$ nmap -sC -sV -p- --min-rate 10000 -Pn -oN nmap 192.168.158.29    
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-06-12 13:28 +08
Nmap scan report for 192.168.158.29
Host is up (0.011s latency).
Not shown: 65531 closed tcp ports (conn-refused)
PORT      STATE    SERVICE VERSION
22/tcp    open     ssh     OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0)
| ssh-hostkey: 
|   3072 c9:c3:da:15:28:3b:f1:f8:9a:36:df:4d:36:6b:a7:44 (RSA)
|   256 26:03:2b:f6:da:90:1d:1b:ec:8d:8f:8d:1e:7e:3d:6b (ECDSA)
|_  256 fb:43:b2:b0:19:2f:d3:f6:bc:aa:60:67:ab:c1:af:37 (ED25519)
80/tcp    open     http    Apache httpd 2.4.56 ((Debian))
|_http-server-header: Apache/2.4.56 (Debian)
|_http-title: Lugx Gaming Shop HTML5 Template
8089/tcp  open     http    Apache httpd 2.4.56 ((Debian))
|_http-title: FlatPress
|_http-generator: FlatPress fp-1.2.1
|_http-server-header: Apache/2.4.56 (Debian)
58583/tcp filtered unknown
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 18.29 seconds

Initial Access

Port 8089

There is a flatpress blog running on port 8089.

There is also a login page located in the website.

From here we will try the usual username and password combination and managed to login using admin:password.

File upload bypass to RCE

After some searching online, we can see that this website might have this vulnerability.

First, we will test if the payload works.

This is the payload:

We will also save the file as shell.php.

Next, we will the upload the file.

We can see that the file is uploaded successfully.

After visiting the website, we will see this which means that the exploit works.

We will then modify the content of shell.php to this:

Then we reupload the file and visit the site to trigger the reverse shell.

After a while, we will get back a reverse shell.

Privilege Escalation

Upgrading shell

Use Upgrading Shells

Linpeas

From the linpeas result, we can see that www-data is able to run apt-get as root.

Sudo -l

After some googling, we can see this command is able to do privilege escalation to root.

We will just follow what they do there to get root shell.

Last updated