Post

TryHackMe: Dav

TryHackMe Room Link https://tryhackme.com/room/bsidesgtdav

Description

The Dav is a boot2root machine for FIT and bsides guatemala CTF

Gain a Flag

Enumeration

Nmap Scan

Nmap Scan

From the scan we see that only one open ports:

  • 80/tcp http

with an info of apache version 2.4.18

Main Page

from the index page, we see default Apache Page with no further info, then let’s do further enumeraion with Gobuster, using this command

1
gobuster dir -u MACHINE_IP -w /usr/share/dirb/wordlists/common.txt

from this scanning we found 6 directory, one of it is /webdav, if we go to the directory it will ask for credentials. Luckily i do some researching on Webdav vulnerability Webdav Vuln.

Default cred for webdav referring on the documentation is :-

User : wampp Pass : xampp

clue_1

when we login we found and open directory that only have 1 file named password.dav, that mean we on the right track.

What the User Flag ?

What we got so far :-

1
2
3
4
Username = wampp
Password = xampp

http server: Apache 2.4.18

from the info that we have, we can login to site using Cadaver.

P/S : Cadaver is CLI WebDav client for Unix

access_1

Cadaver is actually look-a-like SSH, not the same, but look-a-like, means we can upload, download, move and copy. By using put we can upload our reverse shell file

1
put reverse_shell.php

access_2wdaw

remember that /webdav directory ? the reverse_shell file is there, so now open a listener on Kali nc -lvnp 1234 then open the file on webdav directory, you’ll get your shell.

access_3

The flag is on /home/merlin

flag

What the root Flag ?

awda for the root flag, it is simple, first check the permission using sudo -l, noticed that no password on /bin/cat. So simple use this command

1
sudo /bin/cat /root/root.txt

then you’ll get the flag

root

Conclusion

This lab is simple Boot2Root, good for beginner to learn how to exploit from apache server from being normal user into root

Happy Hacking

This post is licensed under CC BY 4.0 by the author.