FunboxEasy OffSec Walkthrough

4 Min Read

FunboxEasy OffSec Walkthrough: Boot2Root Easy going, but with this FunboxEasy you have to spend a bit more time. Much more, if you stuck in good traps. But most of the traps have hints, that they are traps.

Difficulty:

Easy

Goal:

Read flag inside /root

Victim IP: 192.168.220.111
Attacker IP (Kali Linux): 
192.168.45.165

Reconnaissance

nmap scan

Frist run command nmap 192.168.220.111 to view the open ports. Which reveals two ports 22 adn 80. Then run
nmap -sC -sV -p 22,80 192.168.220.111

-sC for default scripts,-sV for version enumeration and -p to specify the ports.

Looking at the result we can see
port 22 ssh
port 80 http

web server

Visiting the ip, you can see simple apache default page.

got dir

Then running gobuster reveals hidden directory,
/store /admin and /secret

book store

At /store , we can see online CSE bookstore.
If you do simple search for CSE bookstore we can see it is vulnerable to Unauthenticated Remote Code Execution exploit

OffSec’s Exploit Database Archive

Online Book Store 1.0 – Unauthenticated Remote Code Execution.. webapps exploit for PHP platform

www.exploit-db.com

I will not be using this exploit. I will do manual process.

admin

In the CSE backstore login page, I tried to enter some default credentials
and luckly admin:admin woked

website

After successful login, we are greeted with section to add new book and we have option to edit added books.

shell upload

When clicking on edit option, we are greeted with this section. If you look closely, we have option to upload files.
With this option, our next step would be to upload a reverse shell and get ourself a shell.

So lets prepare a reverse shell.

I will be using php reverse shell from pentestmonkey

GitHub – pentestmonkey/php-reverse-shell

Contribute to pentestmonkey/php-reverse-shell

Download the php script.

shell

Make sure to change the $ip to your attacker’s machine’s ip. Changing $port is optional, we will need this later.

After changes are done, save and upload this reverse shell.

We have successfully uploaded the reverse shell, now we need to find the location where it is stored.

gobuster

To find the location, I again ran gobuster and found some interesting directories.
Among which /bootstrap is what we need.

files
uploads

Under /bootstrap/img we can see our reverse shell stored.

Before running the reverse shell, we need to make sure netcat listner is ready.

netcat

To make netcat listener ready, use command
nc -lnvp 443 use same port you used in the reverse shell file.

Now we are ready, simply click the reverse shell from /bootstrap/img

nc listner

And we have shell as www-data

password file

Under /home we can see one user tony under /home/tony
we have jackpot password.txt

ssh: yxcvbnmYYY
gym/admin: asdfghjklXXX
/store: admin@admin.com admin

we now have ssh password, lets try to login.

tony login

And we are successfully logged in as user tony.

Our next step to get root access.

sudo exploit

Running command sudo -l we can see some interesting things.
User tony can above command as root.

Which we can use to get a root shell.

GTFOBins

GTFOBins is a curated list of Unix binaries that can be used to bypass local security restrictions in misconfigured…

Lets use GTFOBins

gtfobins

From the result of sudo -l I searched for each entries, and we have some interesting thing for binary pkexec
We can use pkexec to drop elevated privilges.

sudo -l

Running sudo pkexec /bin/sh
We have root shell.

root flag

And we can read the flag proof.txt

7ad87c789be895d7bde85d9216c16e8e

Also Read | Dawn offsec Walkthrough

Share This Article