OverTheWire Natas Level 9 Walkthrough
Today we're going to be doing a walkthrough of level 9 of the Natas CTF wargame hosted at:
http://natas9.natas.labs.overthewire.org
To access this page, we will need to authenticate into it by providing the current level of the Natas CTF game as the username (natas9), and the password obtained from the previous level as the password.
Once we have authenticated into the page, we see this:
An interesting looking web app. Let's take a look at the sourcecode link.
http://natas9.natas.labs.overthewire.org/index-source.html
From the source, we see that the app is taking user input string and passing it to the system running the server as a grep command, comparing the string to entries in a text file (dictionary.txt).
This kind of code allows the user to perform a Local File Inclusion attack by passing the web app a malformed string. For example, if we pass the web app this string
; ls #
The semicolon in the string will end the previous command and the hash symbol at the end of the line will cancel the first command that comes after our ls command. The result of sending the request to the web app is this:
This confirms that we have a Local File Inclusion vulnerability through the web app. More specifically, if we can access local files on the web app host system, we can access the password for the next level. In fact, we know where the passwords are on the local system because we are given this information on the overthewire.org Natas homepage.
https://overthewire.org/wargames/natas/
So from the Natas9 webpage, we will input the following string to gain access to the Natas10 password.
; cat /etc/natas_webpass/natas10 #
Summary
The Natas9 web app included a Local File Inclusion vulnerability which allowed us to gain access to the next level's password by sending the web app a malformed string.
Finish
Comments
Post a Comment