Writeups OverTheWireNatasWebHTTP HeadersReferer

Natas 4 Writeup - OverTheWire

Writeup for Natas level 4 from OverTheWire: spoofing the Referer header.

Contents

Wargame: Natas

Level: 4

Category: Web Security

Description

The page checks the Referer HTTP header and only grants access if the request came from http://natas5.natas.labs.overthewire.org/. Setting the header manually spoofs the origin.

Overview

Solution

headers = {"Referer": "http://natas5.natas.labs.overthewire.org/"}
response = requests.get(url, auth=("natas4", current_password), headers=headers)
result = re.search(r"The password for natas5 is (.*)", response.text).group(1).strip()

Password

Z0NsrtIkJoKALBCLi5eqFfcRN82Au2oD

← Back to Blog