Home > CTF Writeups > THM > LazyAdmin

LazyAdmin

LazyAdmin


Challenges Difficulty: Easy
Category: Privilege Escalation


Initial Access

As usual we will start with with nmap to scan the machine
image.png
There is 2 open ports 22, 80 so let’s open this webpage
image.png
ok it’s an apache server but we want to fuzz this ip to find more interesting pages
image.png
great there is a directory called content
image.png
going deeper in this directory we found several interesting pages
image.png
the /as one is a login page but we don’t have credentials yet ;)
alt text
now this is an interesting one as we can find a working creds from this backup
alt text
image.png
and we got a user called manager with admin role and a hash for his password
image.png
and we got the password
image.png
browsing this site we can find a Media Center tab with a file upload
alt text
just upload a reverse shell and you will get a shell but remember to change the .php to .php5 or any other extension
image.png

Privilege Escalation

Great we got initial access with a www-data now we need to escalate to root
checking our permissions we saw that there is a file that we can run as sudo
image.png
and we also has write permission to this file so overwrite it with another shell and run as sudo and you will get a root shell
image.png