I'm trying to create a CTF for a project. One of my goals is to set up an Apache web server that allows directory traversal so people attempting my CTF can traverse to my root directory and access a folder containing an encrypted file. I want them to be able to download this file so they can unencrypt it on their machine. However, I don't even know where to start with allowing directory traversal. I've never really used Apache web server before and everything I find online is about preventing directory traversal.
I'm using Apache2 on an Ubuntu 12.04 VM.
I got a good enough workaround going.
First, I changed
DocumentRootin/etc/apache2/sites-available/defaultto"/"so that the server could access everything in/and created anindex.htmlfile in/so that the Apache server would know what to render. Inside ofindex.htmlis justWhich render the actual index to display. I did this to make it more obvious that some kind of directory traversal would be done. By doing this, the path that is displayed to visitors is
http://192.168.xx.xx/home/user/server/index.html.Then, I added a wildcard directory:
so that the users could enter any folder within the root directory. Now, when anyone visits
192.168.xx.xxthey are routed to192.168.xx.xx/home/user/server/index.htmland if they enter anything else, say192.168.xx.xx/etc/passwdthe file will be displayed to them.I know this isn't true directory traversal, but it is solution enough for this project.