Sitemap
eXpl017

eXpl017

LazyAdmin TryHackMe

4 min readSep 7, 2024

Lets try solving the LazyAdmin room today, and learn along the way.
You can find the room here.

Scanning the target:

Press enter or click to view image in full size

Checked the website, its source-code and robots.txt but didnt find anything. So lets do some directory busting:

Press enter or click to view image in full size
The scan was big, including major directories here which i think are imp

Lets check these directories out:

Press enter or click to view image in full size
/content
Press enter or click to view image in full size
/content/as : need creds for this
/content/images : checked all images but didnt see anything useful
/content/attachment : maybe the uploaded files can be seen here?
/content/inc

Going through the files in /content/inc i found some interesting things, lets have a look at them:

downloading cache.db for later checking
htaccess file
seems like SweetRice version being used for the site
mysql backup downloaded for checking later
Press enter or click to view image in full size
Press enter or click to view image in full size

cache.db doesnt seem to have anything for us, but the other db does. I have omitted some text out from the mysql backup file, as the important part is the lengthy part in the second image above.

"admin\\";s:7:\\"manager\\";s:6:\\"passwd\\";s:32:\\"42f749ade7f9e195bf475f37a44cafcb\\"

This part clearly gives us admin user and password, but the password seems to be hashed, lets throw it on google:

Press enter or click to view image in full size
Its an MD5 hash and the password is Password123

We can now try this on /content/as:

Press enter or click to view image in full size
and we are in…

My first instinct was to look for file upload feature so i can check /content/attachment for the uploaded file and get a reverse shell maybe:

Press enter or click to view image in full size

IMPORTANT: I found the place to upload a file, but when i uploaded my php reverse shell, i couldn’t see the file being uploaded. BUT notice how there is a checkbox for extract zip archive? So i simply zipped my shell.php file and uploaded with, while checking the box. Then you can see the file, now just click to open it and you will get a connection back.

Press enter or click to view image in full size

Now lets get the user flag:

Press enter or click to view image in full size

EZ…

Get eXpl017’s stories in your inbox

Join Medium for free to get updates from this writer.

Lets move on the root flag:

Press enter or click to view image in full size

Lets keep in mind the mysql creds, but i dont see a way to use it as of now (NOTE: i did try ssh to the machine using those creds but it failed). Now, we got sudo permission to run the backup.pl file, but what is in it? It is just a perl script which runs another file, a shell script. So lets have a look at that and its permissions.

Press enter or click to view image in full size

I didnt know what that means, so i googled. Turns out, it is a reverse shell. But does it matter?We have write permissions on it, and with the previous sudo, we can do some devious stuff. But lets just spawn a root shell for now…

Press enter or click to view image in full size

Aaaand here we have it. The root flag! EZ

Thank you!

--

--