This is my write-up for TryHackMe's LazyAdmin Room
Enumeration
Using nmap, we see that SSH and HTTP ports are open.
This is just the default page. We need to dig deeper. For this, we use dirb.
Checking Searchsploit, we find a number of available exploits for SweetRice.
And looking at the contents, we find the admin password hash.
Exploitation
Using JohnTheRipper, we can crack the password.
So now we have admin credentials. We can logon to the site and use the vulnerability described in Cross-Site Request Forgery / PHP Code Execution (40700.html from the earlier Searchsploit query).
Using the above method, we can inject a php backdoor using the php-reverse-shell from pentestmonkey. We run netcat as listener on our attacker, and get shell!
Privilege Escalation
Running sudo -l, we see that the user can run the perl script backup.pl
Checking pentestmonkey's reverse shell cheat sheet we can modify copy.sh and have it call netcat instead.
Running backup.pl with sudo gives us a reverse shell!
No comments:
Post a Comment