Creds >>

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

HackTheBox (aka TheSysRat)

Discovery >>>

As is note first add domain vulnnet.thm to your /etc/hosts

nmap >>

Looks like normal web server.

Dirsearch >>

Subdomain search >>

We can found subdomain http://broadcast.vulnnet.thm , so we can look on it . Don’t forget add it to /etc/hosts 😉

NOTE: subdomain we can find too in /js/index__7ed54732.js for decode we can use https://beautifier.io/ 😉

Inspect web pages >>

http://vulnnet.thm >>

Nothing special, login and sing in not work. I tried some SQL injection but no luck.

http://broadcast.vulnnet.thm >>

And there we can see a login page, I tried a sqlmap but no luck.

So we can try a LFIfinder to find a possible LFI vuln.

And results >>

So let’s try http://vulnnet.thm/index.php?referer= in Burp Suite >

And works!

NOTE: referer query we can find to manually in /js/index__d8338055.js 😉

After some tries we can find something juicy in /etc/apache2/.htpasswd

So we can try to crack it by john >

So let’s try to login broadcast subdomain >>

And we are in >

After quick research we can find a possibilities to upload a shell >>

https://exploit-notes.hdks.org/exploit/web/clipbucket-pentesting

I used reverse shell from PentestMonkey php rev shell and try to upload >

And success, we can find a file on server >

Reverse shell >>

Run listener and try to run >

After enumeration we can find a one file in backups which looks interesting>>

So let’s download and try to use >

After decompress we can find a id_rsa file to user server-management, but we need crack a passphrase…

After that we can login as user server-management

User flag is DONE!


ROOT Path >>>

When we enumerate first time by linpeas we should found a cron job

So we can inspect this job >>

And we can find “tar czf” know as TAR Wildcard Injection PrivEsc

Exploitation >>

After a minute we have SUID /tmp/bash >>

And easy run /tmp/bash -p to escal priv.

If you want a reverse shell with full access you can make little change in cmd.sh for example nc mkfifo>>

And after minute we get a shell>>

So machine was completely PWNed!!

So happy hacking 😉 !

Leave a Reply

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