Page cover

Road (File Upload, Mongo, Library)

Firstly, we need to enumerate using nmap.

$ nmap -A 10.10.128.233 | tee nmap.log
Starting Nmap 7.80 ( https://nmap.org ) at 2022-01-24 14:44 +0630
Nmap scan report for 10.10.128.233
Host is up (0.22s latency).
Not shown: 998 closed ports
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Sky Couriers
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 58.36 seconds

SSH and HTTP ports are open. Let's check HTTP port. In http://10.10.128.233/v2/admin/login.htmlarrow-up-right, we will see login form. We must register and login with this credential. And then you will see Dashboard. You need to reset password at http://10.10.128.233/v2/ResetUser.phparrow-up-right.

With this credential admin@sky.thm:user1, we can login to the admin dashboard.

In http://10.10.128.233/v2/profile.phparrow-up-right, we can upload a profile image. Let's try to upload PHP reverse shell.

We can see this javascript source code. We can ball back our uploaded profile image image at this url

Now, we get revershell.

We find user flag at /home/webdeveloper/user.txt.

With ss command, we will notice a new open port at local. Port 27017 is Default MongoDB Port.

Let' connect mongo DB and enumerate some credentials.

We see webdeveloper credential. Let's connect ssh with this credential.

Check privileges on this host, we will see LD_ PRELOAD.

Build C code and get root privileges from this source https://www.hackingarticles.in/linux-privilege-escalation-using-ld_preload/arrow-up-right

Let's compile to generate shared library file.

Finally, we get root shell on this host and root.txt.

Last updated