CREDS >>

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

HackTheBox (aka TheSysRat)

Discovery >

nmap >

We can try looking for subdomains, but nothing there. So we can inspect web page on port 8080 >>

8080 / TCP – Website >>

I tried some basic creds to login, inspect source code and SQL injection, but no luck there, maybe rabbit hole is not here.

What is interested is port 5000 >

5000 / TCP – Docker Registry (API: 2.0) >>

There we can leak some information >

There is something running in Docker >

We can dump it … by this tool >

https://github.com/Syzik/DockerRegistryGrabber

Also we can unpack and looking for something spice >

And we can found app.js inside one of pack >

And inside is a hint DB cred are set in environment.

So we can try to dump environment information >

And success, so we can find a DB creds >

First Task is DONE !! Let’s continue for USER Flag >>


USER Flag >>>

Now we can login to MySQL and try to looking for a user creds >

And success, so can we crack it? Let’s try >>

https://crackstation.net

And yeap, all passwords are cracked!

So we can try to connect to user account or to SSH? Let’s try >

And we have success to claire-r user SSH is running >

And user flag is DONE!


ROOT Path >>>

We can try to inspect by linpeas.sh or similar but no much luck.

So let’s look on website after login >

And there is some input, so we can try to look again in our dump file app.js from docker container >

eval() function. Nice, so can we escape into docker container? Let’s try >>

Payload >>

And YES we can, and we are root there!!

We can look around, and there is one directory looks interesting >

And in claire-r SSH we can found this folder too >

And some file is there, so what we can try :-D, maybe SUID bash?

In Docker container >

And in real machine >

And it works!

And we are ROOT !!

Machine was completely PWNed!!

Happy Hacking 😉 . See you next time!

Leave a Reply

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