SpeedHacking on Youtube >>


CREDS >>

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

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


TryHackMe >>

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


Recon >>>

nmap >>

Port 8000/TCP >>

On first look, we can see basic Python http.server, but there is something not correct with that, when we try to connect in the browser, there is not working, there is just message “Try a more basic connection!” >>

So let’s try NetCat to connect >>

In the first look nothing happened, but when we try something like print(“test”), output is displayed >

It is look that there is something like console or C2 client. We can try easy OSINT research >>

OSINT research >>

After typing nickname of creator and Pyrat name we can found this repro github page >>

https://github.com/josemlwdf/PyRAT

So we can look on code file pyrat.py and there are some interesting section >>

We can found that there are two command to get shell >

  • User shell type “shell”
  • Admin user shell type “admin”
  • And of course try to mask like http Simple Server 😀

For admin shell we need add password, there is any test string, probably we will need brute forcing this for get login >>

User Flag >>

So we can connect to machine and type “shell” after that we have shell like www-data user >

So we can look around, run linpeas.sh and we can found this >

  • Mail service SMTP on port 25 running >
  • Users with shell >
  • Interesting folder /opt/dev/.git
  • And some mails >

We can read mail >

So we can inspect git folder >>

First we try to look into config file >

And there is password to think user, let’s try to connect via SSH >>

And we are inside, so we can grab User Flag and this part is finished!


ROOT Path >>

How we found before for root access we need found password, it is simple see in this scripts >>

We have 3 attempts for try send password, but we can try create simple python script and repeatedly start connection, type admin first and after that check is is message “Password:” close connection and try again and for more we can make it multi-threads, script like this >>

https://github.com/TheSysRat/PyRAT–THM

So we can try run our script >>

And success, we found password, so let’s try to login >>

And we are DONE!

PyRat machine was PWNed !!

Happy hacking!!

Leave a Reply

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