SpeedHacking on Youtube >>

CREDS >>

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

HackTheBox – https://app.hackthebox.com/profile/1298347


TryHackMe >>

https://tryhackme.com/r/room/mkingdom


Recon >>>

We can add mkingdom.thm to /etc/hosts

nmap >>

Nothing special, only HTTP port move on port 85. So let’s inspect >>

OK, let’s fuzz it >>

Nice new end point, let’s inspect>>

And JUMP >>

There we can found Concrete CMS 8.5.2, we can try to find any public exploits>

And there is RCE, but for me not work >

https://vulners.com/hackerone/H1:768322

So we can try any default creads to get access >

I found some examples and try admin:pas****d and works! 🙂

OK, so we can try get reverse shell, Concrete CMS is write in PHP. Maybe we can upload reverse shell >

Let’s go to Files and try to upload >

But file not allowed, so we can try change settings >>

Go to Settings > Allowed File Types and add php to accepted extension and save options.

After that we can upload our reveverse php shell!

OK let’s try >>

And we are in!

After little research we can found two user mario and toad. So let’s looking for some passwords >>

First options is looking for database connections Concrete CMS, lets try >>

And we can try to switch to toad user.

NOTE: This machine is not really stable, I recommend use nc mkfifo.

OK we are now toad user, but no user flag, no sudo, maybe some SUID found >>

Nothing useful, so we can try other options like linpeas and etc.

Finally we can found something in environment>>

PWD_token looks like base64, we can decode and we can get password to mario 🙂

So switch to mario user >>

AND WORK USER IS DONE !!


ROOT Path >>>

We can looking around, linpeas not found anything usefull, so we can try pspy64 >>

We can’t modify file /app/castle/application/counter.sh on server.

BUT… Remote file running from domain, great, maybe we can change domain to our own and get reverse shell as root user!

And confirm mario user can modify /etc/hosts so we can try it >>

First change domain record to our server >>

And second prepare counter.sh in this route /app/castle/application/counter.sh

Inside counter.sh we just create reverse shell >

And we can try, run python server on port 85>

Upload hosts to /etc/hosts and checked >

After while we could get other hit of counter.sh >

If everything was correct, we should get root reverse shell >

And we are DONE!

mKingdom was completely PWNed !!

Happy hacking!!

Leave a Reply

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