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/natas26.md
URL /wargames/natas/natas26/
Date 2026-04-07

Natas Level 26

Natas Level 26 — a cookie contains serialised PHP data the server later unserialises; learn how object injection can write files on the server.

Table of Contents

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

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

Study guide

Level map: sign in as natas26 and find the password for natas27.

What this level teaches

PHP object injection through unsafe deserialisation.

Key ideas

  • Serialisation. PHP converts objects to strings and back; the conversion can call special “magic” methods such as a destructor.
  • User-controlled objects. If the server unserialises a cookie, the client chooses which class is created and with what values.
  • Gadgets. An existing class in the application (here, a logger) does something dangerous when its destructor runs.
  • Read the source. Every class definition you need is visible.

How to approach it

  1. Study how the drawing feature stores state in the cookie.
  2. Find a class whose methods perform file operations with data it holds.
  3. Build a serialised object of that class, encode it as the cookie expects, and send it.

How developers prevent it

Never unserialise untrusted data. Use a data-only format such as JSON and validate it.