Creds >>

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

HackTheBox (aka TheSysRat)


Discovery >>>

nmap >>

Nothing special, just SMTP server running.

dirsearch >>

Nothing scpecial.

Website discovery >>

Looks normal, source code or links nothing special.

But in CTF notes is link and there is first hint >>

hakanbey user twitter (X) account

And there are some interesting things >

So it looks that we can try to phishing hakabey user! Let’s try it…

Prepare to application payload, we know this is a Linux machine, so we can try bash reverse shell to payload him.

And try to send him an e-mail with payload>>

And yes, we get a shell and first user_flag1

required password for the chat app >>>

After getting shell we can find a app chat_with_kral4

I try to look on app for strings, ghidra and etc. but nothing to find. After while I found a pcap log file in /var/log and yes there is a pass…

OK password to app we have, can we get a pass to ssh connection?

the password of hakanbey user >>

And yes after login do chat app simple conversation get to us pass to ssh connection hakabey user >>

OK, we have full SSH connection with password >>


second user flag >>>

ok, quick research and sudo -l get me a answer…

Really?? O.K. log as kral4 user >>

And second user flag >>


web user flag >>>

we can find a flag, but is permitted to web user.

but in SUID app we can find a app to able read a write ro web user. Great!

OK, use as describe on GTFObins >>

https://gtfobins.github.io/gtfobins/dd

AND root flag, or full access? >>>

After long time a find a mail message from root >>

So if I read correctly, when we copy nano to our home folder and do something bad with index.html. we will get SUID nano app as root to fix it!

Let’s try it >>

For writing to index.html we can use dd app with SUID web user >>

And after a few second, YES we have it!

So we can read a root flag >>

simple follow a GTFObins insctruction >>

https://gtfobins.github.io/gtfobins/nano

But I want be a full access as root >>

we can try to Limited SUID (followed GTFObins) but with not luck >>

And after switch user we are a ROOT!!!

And this is end

We PWDed this machine completely!!

Happy Hacking !!

Leave a Reply

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