Writing THM excersise solvings here and my thoughts on how to solve them
https://tryhackme.com/room/lazyadmin
Running nmap
shows me that there are 2 ports open so I go visit the http site
In the HTTP I found apache2 ubuntu default page, so I decided to run gobuster to find other directories.
Running gobuster on /content/
I found a login page on /as/
I decided to go check exploit database for sweetrice and found multiple exploits
Reading the first one backup disclosure
After trying multiple urls I got http://10.10.80.159/content/inc/mysql_backup/
working and found a sql file
Viewing the file I found 42f749ade7f9e195bf475f37a44cafcb
and using hash identifier identified it as MD5 hash
Running a hashcat on it I got it cracked with rockyou.txt, now I just need the login. Which is in the same sql file as password manager
After looking around for a while I found that I could upload a file in the Media Center
so I decided to send a php-reverse-shell.php there
First I couldn’t send the .php file so I used a previously used trick so I renamed it to .php5
As I have done before I ran python -c 'import pty; pty.spawn("/bin/bash")'
to give me more access to commands
After going to /home/itguy/
I found the user flag, now I need root access.
Doing sudo -l
I saw I can run /usr/bin/perl /home/itguy/backup.pl
without password
Looking at the file I could run I noticed it ran another file copy.sh
which had a reverse shell, so I changed the reverse shell to my ip so I could get root access.
After running the file I got the access and now I was root, after that I found the root flag
This was an intresting one, I got to use previously known knowledge and had to also learn new ones like the SweetRice
exploit. Also good training for reverse shelling.