Skip to main content

Settings

Color Mode

Theme Skin

Background

Appearance preferences are saved in this browser only.

Environment

Current Environment Production

Built with JEKYLL_ENV=production. Changes require deployment.

Quick Links

Theme & Build

Jekyll v3.10.0
Last BuildNov 24, 17:25

Page Location

Page Info

Layout default
Collection wargames
Path _wargames/natas/natas23.md
URL /wargames/natas/natas23/
Date 2026-04-07

Natas Level 23

Natas Level 23 — a password check mixes string search with a numeric comparison; learn how PHP's loose typing can be satisfied in surprising ways.

Table of Contents

Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.

Username: natas23
URL:      http://natas23.natas.labs.overthewire.org

Study guide

Level map: sign in as natas23 and find the password for natas24.

What this level teaches

How comparing text and numbers together in a dynamically typed language creates logic holes.

Key ideas

  • Type juggling. In older PHP, comparing a string with a number converts one into the other, often in surprising ways.
  • Two conditions at once. The code requires a string to contain a specific word and to compare as a number against a threshold.
  • Satisfying both. An input can start with digits and contain the required word.
  • Read the source. The two checks are written explicitly.

How to approach it

  1. Read the conditions and look up how PHP converts strings to numbers.
  2. Construct one input that satisfies both.

How developers prevent it

Use strict comparison (===), validate types explicitly and keep password logic out of hand-written conditions.