CREDS >>

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

HackTheBox (aka TheSysRat)

Discovery >

nmap >

We can see port 80 is open Doodle Drive :-D, let’s check >

We can also check subdomains, but no luck…

80 / TCP > WEB >>>

First add record to /etc/hosts >

After that we can look on website >

First who we can found are name of team >

Good to know for a bruteforcing attacks and etc.

We can also register and login to system >

So let’s try >

After login we can upload your file >

I tried many techniques like LFI, SQLi, XSS etc. but no luck…

But one thing looks interesting, when we open our file, there is a number of file >

Maybe it is for all users, can we fuzz it? Let’s try >

I try only some numbers like 200 and use Burp Suite – Intruder for it >

After we get a request, we can sign fuzzing part and add a payload >

And there is a result some numbers may be possible to read >

So let’s try >

And there is any kind of protection, so we can try fuzz an endpoint, maybe we can break this protection >

And some endpoint found, we can try >

And success we can read a message >

So we can try to connect to SSH >

And we are in but no User Flag yet…

USER Flag >>>

Recon of users >

After quick recon, we don find many possibilities to change user , but we can found some backup in folder /var/www/backups >

There is one db.sqlite3 and some backups archived and protected by password. So we can look on non archived database >

And we can found some creds >

We can try to crack it and one is success >

But it is not working at all.

Port 3000 / TCP >>

We can found on port 3000 Gitea running on localhost >

So we can forwarting and try to login >

ssh -L 3000:127.0.0.1:3000 martin@drive.htb

And working so we can try to login be martin creds >

No success at first, but in db sqlite we can found other user name >

And it works >

After recon we can found db_backup.sh file >

And there is password to backups scripts >

So we can try to get data from 7z archives >

there is crackable hash to tom >

So we can change to account to Tom >

And User Flag is DONE !


ROOT Path >>>

In home directory is SUID binary file

We can test it >

We need some creds.. hmm we can try to reversed ? >>

Ghidra >>

First we wil found a strings, maybe some thing interesting is there >

And success, we can also confirm be login function >

So we can try to run an app >

There no much to get some privileges escalation, we need to go deeper >

In Ghidra we can found this >

We can try to load a poison extension , but there are some limitation >

There is only 40 chars to accept and some filtration of charts like . / are there … but we will break it >>

Prepare >>

And compile in home directory of tom user >

Check >

Exploitation >>

We can try use trick by char() 🙂

Our exploitation is >

That mean >

Let’s try >

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 *