Creds >>

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

HackTheBox (aka TheSysRat)

Recon >>>

nmap >>

Looks normal …

dirsearch >>

Some interesting files login.php /admin/login.php and register.php .

So we can look on web site >>

Welcome us a login page >>

And we can register account >>

After login we can send our linkt of blog and redirect a pages >>

So let’s look on source code >>

I try put a basic page like “www.google.com” and look on source codes , response in burp suite. After long while I found a this >

In detail is this fragment interesting target=’_blank’ >>

Detail of this bug is here:

https://book.hacktricks.xyz/pentesting-web/reverse-tab-nabbing

Exploitation >>

I prepared two files and it was a mal.html >>

And copy of a admin/login.php to login.html >>

After that a started two python http.server on port 80 and 8000 (for better ilustration) and started Wireshark and tcpdump(not necesery).

After send link on webpage, traffic was generated and really good were POST requests was recieve >>

After that we can find in wireshark a login data, and after try we have access to ssh.

Finaly we have ssh connection to daniel user, but daniel don’t have a flag.

Flag is in adrian user and we don’t have access.


USER Flag >>>

After quick recon, we can find a script which is running every minute a adrian user >>

And detail of query.py file >>

This file we can modify, because we are too in administrators group!

So we can make a reverse shell to adrian user >>

After a minute we get a adrian shell >>

But we can upgrade this shell to full ssh connection… so we can gerate our ssh key pair >>

And add public key to /home/adrian/.ssh/authorized_keys >>

And now we have full ssh connection!

And of course USER Flag is done!


Root Path >>>

Root path is really easy, after first try to sudo -l we have this output >>

And look on GTFObins , we can get shell as root easy :

https://gtfobins.github.io/gtfobins/vim

So let’s do it >>

So ROOT Path is DONE! We have full access to machine!!

Enjoy and happy hacking !!

Leave a Reply

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