Creds >>

TryHackMe – https://tryhackme.com/p/TheSysRat

HackTheBox (aka TheSysRat)

Discovery:

namp >>>

Webapp discovery >>

First look basic, let’s brute discovery

What is in /app/ folder?

So CMS Pluck 4.7.13, good hint :-), is it exploitable? Yes! But we need some creds.

OK, let’s discovery more depth… We need find login page:

O.K we have login page >>>

Try to guess, I yes it is easy, password is in Top 10 worst password in 2022. 😉

O.K. we can upload reshell by exploit …

Great!


Lucien flag >>>

After some basic researches like linpeas, SUID and etc, we can find interesting file in /opt/ folder

And there is password to ssh connection 🙂

OK.

lucien –>> death

Let’s look on traverse to death user. After short ivestigation we can find interisting things in history lucien:

OK we have mysql connection, so what is in sudo -l?

We know script getDreams.py to run as user death, but for now is script unreadable. But there is othre hint :

And what make script getDreams.py? Some hint is in /opt/ folder >>

Here is probably ssh cred to death, we need to get this file with password.

So we can use MYSQL for run our own command be cause there is run a command in console,m here is te interesting part:

So, we can get command into a mysql query, let’s try with whoami>>>

And it works !!

OK, so we can modify to cat getDreams.py fle >>

death >>> morpheus

In past I found one process in cron service using pspy64, script run every minute >>

2023/11/20 07:59:01 CMD: UID=1002  PID=1837   | /usr/bin/python3.8 /home/morpheus/restore.py 

Let’s look on script >>

So investigate python and library shutil.py

And YES shutil.py is writeable to user death, we can modify to reverse shell:

Wait a minute and BANG >>>

We PWNed Dreaming machine!!

Happy Hacking !!

Leave a Reply

Your email address will not be published. Required fields are marked *