> For the complete documentation index, see [llms.txt](https://thamizhiniyancs.gitbook.io/writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thamizhiniyancs.gitbook.io/writeups/overthewire/natas/level-6-level-7.md).

# Level 6 - Level 7

```
Username: natas7
Password: jmxSiH3SP6Sonf8dv66ng8v1cIEdjXWr
URL:      http://natas7.natas.labs.overthewire.org
```

This the page had two links, Home and About

<figure><img src="https://1858660820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrGZ5yoqZSj85T6vq2w3c%2Fuploads%2FuhD6DEMkwMRRmDCOx0uS%2Fimage.png?alt=media&amp;token=d7fa2bb9-5a76-4dc1-9d0e-907447adc100" alt=""><figcaption></figcaption></figure>

On checking these links found nothing.

<div><figure><img src="https://1858660820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrGZ5yoqZSj85T6vq2w3c%2Fuploads%2Fw97u5j0y9tCT7jvLHVsG%2Fimage.png?alt=media&amp;token=4924f7bc-c848-4e03-95cf-21d53e222241" alt=""><figcaption><p>Home Page</p></figcaption></figure> <figure><img src="https://1858660820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrGZ5yoqZSj85T6vq2w3c%2Fuploads%2FldrTOWdjquVs53tNtG14%2Fimage.png?alt=media&amp;token=dd3e09f5-46a2-468b-ae82-a1328787afa2" alt=""><figcaption><p>About Page</p></figcaption></figure></div>

But both of the above mentioned pages were fetched using the URL Query Parameter `page`.

And on the index page <http://natas7.natas.labs.overthewire.org/>, there was a hint in the source code of the page, which stated that the password for webuser `natas8` is in `/etc/natas_webpass/natas8`.

<figure><img src="https://1858660820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrGZ5yoqZSj85T6vq2w3c%2Fuploads%2FStTdrRGZpNCXKZlFDbjJ%2Fimage.png?alt=media&amp;token=e65ed367-7626-4c7a-a0af-b95ba1b4c687" alt=""><figcaption></figcaption></figure>

The URL parameter and the hint triggered me about the [LFI](https://owasp.org/www-project-web-security-testing-guide/v42/4-Web_Application_Security_Testing/07-Input_Validation_Testing/11.1-Testing_for_Local_File_Inclusion) vulnerability. On testing whether the paramter is vulnerable to LFI by entering the password file location `/etc/natas_webpass/natas8` to the `page` URL parameter \[ <http://natas7.natas.labs.overthewire.org/index.php?page=/etc/natas_webpass/natas8> ], resulted with the contents of the password file.

<figure><img src="https://1858660820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrGZ5yoqZSj85T6vq2w3c%2Fuploads%2FmeIMeR8JYL6MFXhvfeJU%2Fimage.png?alt=media&amp;token=9cd8775d-cd8a-4ad2-9f5d-c9294be4448f" alt=""><figcaption></figcaption></figure>
